# atak
if $ARGS[0] = 'player':
	cla
	!!!!!!!
	set tip = 0
	!!!!!!!
	set strenA = stren
	set speedA = speed
	set agilA = agil
	set vitalA = vital
	!!skills
	set boxingA = boxing
	!!parameters
	set healthA = health
	set BonusA = BonusAtak
	!!!!!!!!!
	set strenD = strenV
	set speedD = speedV
	set agilD = agilV
	set vitalD = vitalV
	!!skills
	set boxingD = boxingV
	!!parameters
	set healthD = healthV
	set initBonusA = initBonus
	set initBonus = 0
	set initBonusV = 0
	set BonusD = BonusDefV

	if stunV <= 0:xgt 'atak', 'popad'

	if stunV > 0:
		'<b><font color="green"><<$nameV>> can not move a critical hit</font></b>'
		xgt 'atak', 'uronKrit'
	end
end

if $ARGS[0] = 'enemy':
	cla
	!!!!!!!
	set tip = 1
	!!!!!!!
	set strenA = strenV
	set speedA = speedV
	set agilA = agilV
	set vitalA = vitalV
	!!skills
	set boxingA = boxingV
	!!parameters
	set healthA = healthV
	set BonusA = BonusAtakV
	!!!!!!!!!!!!!!
	set strenD = stren
	set speedD = speed
	set agilD = agil
	set vitalD = vital
	!!skills
	set boxingD = boxing
	!!parameters
	set healthD = health
	set BonusD = BonusDef
	set initBonusA = initBonusV
	set initBonus = 0
	set initBonusV = 0

	if stun <= 0:xgt 'atak', 'popad'

	if stun > 0:
		'<b><font color="red">You can not move a critical hit</font></b>'
		xgt 'atak', 'uronKritV'
	end
end

if $ARGS[0] = 'popad':
	cla
	!!payment hit dodge
	set poSp = speedA * 20/100
	set uvAg = agilD * 20/100
	set poBox = boxingA * 20/100
	set uvBox = boxingD * 20/100
	set popad = rand(boxingA - poBox, boxingA + poBox) + rand(speedA - poSp, speedA + poSp) + BonusA + initBonusA
	set uvorot = rand(boxingD - uvBox, boxingD + uvBox) + rand(agilD - uvAg, agilD + uvAg) + BonusD
	set uvorKoef = uvorot * 50/100
	set popKoef = popad * 50/100

	if popad > uvorot:
		if popad >= uvorot + uvorKoef:
			!!Crete, very direct hit
			if tip = 0:
				!!attack players
				'<b><font color="green">critical hits</font></b>'
				xgt 'atak', 'uronKrit'
			end

			if tip = 1:
				!!attack the enemy
				'<b><font color="red">critical hits</font></b>'
				xgt 'atak', 'uronKritV'
			end
		end

		if popad < uvorot+uvorKoef:
			!!normal hit
			if tip = 0:
				!!attack players
				'<b><font color="green">Contact</font></b>'
				xgt 'atak', 'uron'
			end

			if tip = 1:
				!!attack the enemy
				'<b><font color="red">Contact</font></b>'
				xgt 'atak', 'uronV'
			end
		end
	end

	if popad <= uvorot:
		if popad + popKoef <= uvorot:
			!!critical blunder
			if tip = 0:
				!!attack players
				'<b><font color="red">CRITICAL SLIP</font></b>'
				xgt 'atak', 'uronKritV'
			end

			if tip = 1:
				!!attack the enemy
				'<b><font color="green">CRITICAL SLIP</font></b>'
				xgt 'atak', 'uronKrit'
			end
		end

		if popad + popKoef > uvorot:
			!!bloomer
			if tip = 0:
				!!attack players
				'<b><font color="red">is washed</font></b>'
				xgt 'fight', 'sta'
			end

			if tip = 1:
				!!attack the enemy
				'<b><font color="green">is washed</font></b>'
				xgt 'fight', 'sta'
			end
		end
	end
end


if $ARGS[0] = 'uronKrit':
	cla
	set damage = rand(stren, stren * 2) + weapbonus + magweapbonus

	if knife > 0:
		set knibon = knife + 1
		set knife = 0
		set damage = damage * knibon
		set knibon = 0
		'<b><font color="green">your opponent flies throwing knife</font></b>'
	end

	if defenceV <= 0 and klonV <= 0 and unmaterialV <= 0 and barierV <= 0:
		if dospehV > 0:set damage -= dospehDefV & set dospehEnV -= 1
		if damage < 0:set damage = 0

		set healthV -= damage

		if weaponTipe = 1:set bloodV += rand(weapon / 4, weapon / 2)
		if weaponTipe = 2:set stun += rand(1, 2)
		if weaponTipe = 3:set bloodV += rand(weapon / 4, weapon / 2)

		if stunner > 0:
			set stunner = 0
			set stunV = rand(3, 6)
			'<b><font color="green">You are paralyzed the enemy <<stunV>> moves.</font></b>'
		end

		'<b><font color="green">Apply Done <<damage>> units</font></b>'

		if zerkaloV > 0:
			set zerkaloV -= 1
			set health -= damage
			'<b><font color="red"><<$nameV>> reflected the damage and you got <<damage>> points of damage</font></b>'
		end

		xgt 'fight', 'sta'
	end

	if defenceV > 0 and klonV <= 0 and unmaterialV <= 0:
		set defenceV -= damage
		'<b><font color="green">Protection of the enemy harmed <<damage>> units</font></b>'
		xgt 'fight', 'sta'
	end

	if klonV > 0 and unmaterialV <= 0:
		set klonV -= 1
		'<b><font color="green">Destroyed clone enemy, he still had <<KlonV>> clones</font></b>'
		xgt 'fight', 'sta'
	end

	if unmaterialV > 0:
		set unmaterialV -= 1
		'<b><font color="red">Your shot went straight through the opponent´s body. <<$nameV>> is not material</font></b>'
		xgt 'fight', 'sta'
	end

	if barierV > 0:
		!!imeniteta barrier for damage
		if barierV >= damage:
			'<b><font color="red"><<$nameV>> easily withstood your butt</font></b>'
			xgt 'fight', 'sta'
		end

		if barierV < damage:
			set healthV -= damage

			if weaponTipe = 1:set bloodV += rand(weapon / 4, weapon / 2)
			if weaponTipe = 2:set stun += rand(1, 2)
			if weaponTipe = 3:set bloodV += rand(weapon / 4, weapon / 2)

			if stunner > 0:
				set stunV = rand(3, 6)
				'<b><font color="green">You are paralyzed the enemy <<stunV>> moves.</font></b>'
			end

			'<b><font color="green">Apply Done <<damage>> units</font></b>'

			if zerkaloV > 0:
				set zerkaloV -= 1
				set health -= damage
				'<b><font color="red"><<$nameV>> reflected the damage and you got <<damage>> points of damage</font></b>'
			end
		end

		xgt 'fight', 'sta'
	end
end

if $ARGS[0] = 'uron':
	cla
	set stKo = stren * 20 / 100
	set damage = rand(stren - stKo, stren + stKo) + weapbonus + magweapbonus

	if knife > 0:
		set knibon = knife + 1
		set knife = 0
		set damage = damage * knibon
		set knibon = 0
		'<b><font color="green">your opponent flies throwing knife</font></b>'
	end

	if defenceV <= 0 and klonV <= 0 and unmaterialV <= 0 and barierV <= 0:
		if dospehV > 0:set damage -= dospehDefV & set dospehEnV -= 1
		if damage < 0:set damage = 0

		set healthV -= damage

		if stunner > 0:
			set stunner = 0
			set stunV = rand(1, 3)
			'<b><font color="green">You are paralyzed the enemy <<stunV>> moves.</font></b>'
		end

		'<b><font color="green">Apply Done <<damage>> units</font></b>'

		if zerkaloV > 0:
			set zerkaloV -= 1
			set health -= damage
			'<b><font color="red"><<$nameV>> reflected the damage and you got <<damage>> points of damage</font></b>'
		end

		xgt 'fight', 'sta'
	end

	if defenceV > 0 and klonV <= 0 and unmaterialV <= 0:
		set defenceV -= damage
		'<b><font color="green">Protection of the enemy harmed <<damage>> units</font></b>'
		xgt 'fight', 'sta'
	end

	if klonV > 0 and unmaterialV <= 0:
		set klonV -= 1
		'<b><font color="green">Destroyed clone enemy, he still had <<KlonV>> clones</font></b>'
		xgt 'fight', 'sta'
	end

	if unmaterialV > 0:
		set unmaterialV -= 1
		'<b><font color="red">Your shot went straight through the opponent´s body. <<$nameV>> is not material</font></b>'
		xgt 'fight', 'sta'
	end

	if barierV > 0:
		!!imeniteta barrier for damage
		if barierV >= damage:
			'<b><font color="red"><<$nameV>> easily withstood your butt</font></b>'
			xgt 'fight', 'sta'
		end

		if barierV < damage:
			set healthV -= damage
			if stunner > 0:
				set stunV = rand(1, 3)
				'<b><font color="green">You are paralyzed the enemy <<stunV>> moves.</font></b>'
			end

			'<b><font color="green">Apply Done <<damage>> units</font></b>'

			if zerkaloV > 0:
				set zerkaloV -= 1
				set health -= damage
				'<b><font color="red"><<$nameV>> reflected the damage and you got <<damage>> points of damage</font></b>'
			end
		end

		xgt 'fight', 'sta'
	end
end

if $ARGS[0] = 'uronKritV':
	cla
	set damage = rand(strenV, strenV * 2) + weapbonusV + magweapbonusV

	if knifeV > 0:
		set knibonV = knifeV + 1
		set knifeV = 0
		set damage = damage * knibonV
		set knibonV = 0
		'<b><font color="red">you throwing knife flies</font></b>'
	end

	if defence <= 0 and klon <= 0 and unmaterial <= 0 and barier <= 0:
		if dospeh > 0:set damage -= dospehDef & set dospehEn -= 1
		if damage < 0:set damage = 0

		set health -= damage

		if weaponTipeV = 1:set blood += rand(weaponV / 4, weaponV / 2)
		if weaponTipeV = 2:set stunV += rand(1, 2)
		if weaponTipeV = 3:set blood += rand(weaponV / 4, weaponV / 2)

		if stunnerV > 0:
			set stunnerV = 0
			set stun = rand(3, 6)
			'<b><font color="red"><<$nameV>> paralyzed you to <<stun>> moves.</font></b>'
		end

		'<b><font color="red">You harmed <<damage>> units</font></b>'

		if zerkalo > 0:
			set zerkalo -= 1
			set healthV -= damage
			'<b><font color="green">You are repelled damage and <<$nameV>> to give <<damage>> points of damage</font></b>'
		end

		xgt 'fight', 'sta'
	end

	if defence > 0 and klon <= 0 and unmaterial <= 0:
		set defence -= damage
		'<b><font color="red">Protection of your harmed <<damage>> units</font></b>'
		xgt 'fight', 'sta'
	end

	if klon > 0 and unmaterial <= 0:
		set klon -= 1
		'<b><font color="red">destroy your clone, you have more <<Klon>> clones</font></b>'
		xgt 'fight', 'sta'
	end

	if unmaterial > 0:
		set unmaterial -= 1
		'<b><font color="green">Strike the enemy flew right through your body. YOU is not material</font></b>'
		xgt 'fight', 'sta'
	end

	if barier > 0:
		!!imeniteta barrier for damage
		if barier >= damage:
			'<b><font color="green">You can easily withstood the impact of the opponent</font></b>'
			xgt 'fight', 'sta'
		end

		if barier < damage:
			set health -= damage

			if weaponTipeV = 1:set blood += rand(weaponV / 4, weaponV / 2)
			if weaponTipeV = 2:set stunV += rand(1, 2)
			if weaponTipeV = 3:set blood += rand(weaponV / 4, weaponV / 2)

			if stunnerV > 0:
				set stun = rand(3, 6)
				'<b><font color="red"><<$nameV>> paralyzed you to <<stun>> moves.</font></b>'
			end

			'<b><font color="red">You harmed <<damage>> units</font></b>'

			if zerkalo > 0:
				set zerkalo -= 1
				set healthV -= damage
				'<b><font color="green">You are repelled damage and <<$nameV>> to give <<damage>> points of damage</font></b>'
			end
		end

		xgt 'fight', 'sta'
	end
end

if $ARGS[0] = 'uronV':
	cla
	set stKo = strenV * 20/100
	set damage = rand(strenV - stKo, strenV + stKo) + weapbonusV + magweapbonusV

	if knifeV > 0:
		set knibonV = knifeV + 1
		set knifeV = 0
		set damage = damage * knibonV
		set knibonV = 0
		'<b><font color="red">you throwing knife flies</font></b>'
	end

	if defence <= 0 and klon <= 0 and unmaterial <= 0 and barier <= 0:
		if dospeh > 0:set damage -= dospehDef & set dospehEn -= 1
		if damage < 0:set damage = 0

		set health -= damage

		if stunnerV > 0:
			set stunnerV = 0
			set stun = rand(3, 6)
			'<b><font color="red"><<$nameV>> paralyzed you to <<stun>> moves.</font></b>'
		end

		'<b><font color="red">You harmed <<damage>> units</font></b>'

		if zerkalo > 0:
			set zerkalo -= 1
			set healthV -= damage
			'<b><font color="green">You are repelled damage and <<$nameV>> to give <<damage>> points of damage</font></b>'
		end

		xgt 'fight', 'sta'
	end

	if defence > 0 and klon <= 0 and unmaterial <= 0:
		set defence -= damage
		'<b><font color="red">Protection of your harmed <<damage>> units</font></b>'
		xgt 'fight', 'sta'
	end

	if klon > 0 and unmaterial <= 0:
		set klon -= 1
		'<b><font color="red">destroy your clone, you have more <<Klon>> clones</font></b>'
		xgt 'fight', 'sta'
	end

	if unmaterial > 0:
		set unmaterial -= 1
		'<b><font color="green">Strike the enemy flew right through your body. YOU is not material</font></b>'
		xgt 'fight', 'sta'
	end

	if barier > 0:
		!!imeniteta barrier for damage
		if barier >= damage:
			'<b><font color="green">You can easily withstood the impact of the opponent</font></b>'
			xgt 'fight', 'sta'
		end

		if barier < damage:
			set health -= damage

			if stunnerV > 0:
				set stun = rand(3, 6)
				'<b><font color="red"><<$nameV>> paralyzed you to <<stun>> moves.</font></b>'
			end

			'<b><font color="red">You harmed <<damage>> units</font></b>'

			if zerkalo > 0:
				set zerkalo -= 1
				set healthV -= damage
				'<b><font color="green">You are repelled damage and <<$nameV>> to give <<damage>> points of damage</font></b>'
			end
		end

		xgt 'fight', 'sta'
	end
end

--- atak ---------------------------------
