# atakA1
if $ARGS[0] = 'atak':
	cla
	!!payment hit dodge
	poSp = speedV * 20 / 100
	uvAg = agil * 20 / 100
	poBox = reactV * 20 / 100
	uvBox = react * 20 / 100
	popad = rand(reactV - poBox, reactV + poBox) + rand(speedV - poSp, speedV + poSp) + bonusShV
	uvorot = rand(react - uvBox, react + uvBox) + rand(agil - uvAg, agil + uvAg)
	uvorKoef = uvorot * 50 / 100
	popKoef = popad * 50 / 100

	if popad > uvorot:
		if popad >= uvorot + uvorKoef:
			!!Crete, very direct hit
			'<b><font color="red">critical hits</font></b>'
			xgt 'atakA1', 'uronKrit'
		else
			!!normal hit
			!!attack the enemy
			'<b><font color="red">Contact</font></b>'
			xgt 'atakA1', 'uron'
		end
	else
		'<b><font color="green">is washed</font></b>'
		xgt 'fight', 'sta'
	end
end

if $ARGS[0] = 'uronKrit':
	cla
	damKoef = damTipV * 20 / 100
	damage = rand(damTipV + damKoef, damTipV + damKoef * 2)

	if damTipMV > 0:
		damKoefM = damTipMV * 20 / 100
		damageM = rand(damTipMV + damKoefM, damTipMV + damKoefM * 2)
	end

	xgt 'atakA1', 'damage'
end

if $ARGS[0] = 'uron':
	cla
	damKoef = damTipV * 20 / 100
	damage = rand(damTipV - damKoef, damTipV + damKoef)

	if damTipMV > 0:
		damKoefM = damTipMV * 20 / 100
		damageM = rand(damTipMV - damKoefM, damTipMV + damKoefM)
	end

	xgt 'atakA1', 'damage'
end

if $ARGS[0] = 'damage':
	cla

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

		health -= damage

		if hidanAtk = 1:
			hidanAtk = 0
			zerkaloV += 50
			bloodV += 50
			'<b><font color="red"><<$nameV>> drink your blood.</font></b>'
		end

		if damTipMV > 0:
			manna -= damageM
			manna += damageM
			'<b><font color="red"><<$nameV>> absorbed <<damageM>> units of manna you.</font></b>'
		end

		if poisonAV = 1:
			poisonV = 50
			'<b><font color="red"><<$nameV>> have poisoned the needles hit.</font></b>'
		end

		!!manna -= damageM
		if eleShV > 0:
			stun = rand(eleShV, eleShV * 3)
			'<b><font color="red">You are paralyzed <<stunV>> rounds</font></b>'
		end

		'<b><font color="red"><<$nameV>> damage caused you <<damage>> units</font></b>'
		!!'<b><font color="red">caused damage your manna <<damageM>> units</font></b>'

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

		xgt 'fight', 'sta'
	end

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

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

	if unmaterial > 0:
		unmaterial -= 1
		'<b><font color="green">Strike the enemy passed through you. 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'
		else
			!!manna -= damageM
			!!health -= damage
			health -= damage

			if damTipM > 0:
				manna -= damageM
				mannaV += damageM
				'<b><font color="green">you have ingested <<damageM>> units of manna from the enemy.</font></b>'
			end

			if eleShV > 0:
				stun = rand(eleShV, eleShV * 3)
				'<b><font color="green"><<$nameV>> paralyzed <<stunV>> rounds</font></b>'
			end

			if poisonAV = 1:
				poisonV = 50
				'<b><font color="red"><<$nameV>> have poisoned the needles hit.</font></b>'
			end

			'<b><font color="red">you have caused damage <<damage>> units</font></b>'
			!!'<b><font color="red">caused damage your manna <<damageM>> units</font></b>'

			if zerkalo > 0:
				zerkalo -= 1
				healthV -= damage
				'<b><font color="green">You are repelled enemy damage and received <<damage>> points of damage</font></b>'
			end
		end

		xgt 'fight', 'sta'
	end
end

if $ARGS[0] = 'atakW':
	cla
	!!payment hit dodge
	poSp = speedV * 20 / 100
	uvAg = agil * 20 / 100
	poBox = reactV * 20 / 100
	uvBox = react * 20 / 100
	popad = rand(reactV - poBox, reactV + poBox) + rand(speedV - poSp, speedV + poSp)
	uvorot = rand(react - uvBox, react + uvBox) + rand(agil - uvAg, agil + uvAg)
	uvorKoef = uvorot * 50 / 100
	popKoef = popad * 50 / 100

	if popad > uvorot:
		if popad >= uvorot + uvorKoef:
			!!Crete, very direct hit
			'<b><font color="red">critical hits</font></b>'
			xgt 'atakA1', 'uronKritW'
		else
			!!normal hit
			'<b><font color="red">Contact</font></b>'
			xgt 'atakA1', 'uronW'
		end
	else
		'<b><font color="green">is washed</font></b>'
		xgt 'fight', 'sta'
	end
end

if $ARGS[0] = 'uronKritW':
	cla
	damKoef = damTipV * 20 / 100
	damage = rand(damTipV + damKoef, damTipV + damKoef * 2)
	damKoefM = damTipMV * 20 / 100
	damageM = rand(damTipMV + damKoefM, damTipMV + damKoefM * 2)
	xgt 'atakA1', 'damageW'
end

if $ARGS[0] = 'uronW':
	cla
	damKoef = damTipV * 20 / 100
	damage = rand(damTipV - damKoef, damTipV + damKoef)
	damKoefM = damTipMV * 20 / 100
	damageM = rand(damTipMV - damKoefM, damTipMV + damKoefM)
	xgt 'atakA1', 'damageW'
end

if $ARGS[0] = 'damageW':
	cla

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

		health -= damage
		manna -= damageM
		'<b><font color="green">You are harmed <<damage>> units</font></b>'
		'<b><font color="green">You have caused damage to the enemy manna <<damageM>> units</font></b>'

		if zerkalo > 0:
			zerkalo -= 1
			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 defence > 0 and klon <= 0 and unmaterial <= 0:
		damSum = damage + damageM
		defence -= damSum
		!!defenceV -= damage
		'<b><font color="green">You have caused damage <<damSum>> Protection of the enemy units</font></b>'
		xgt 'fight', 'sta'
	end

	if klon > 0 and unmaterial <= 0:
		klon -= 1
		'<b><font color="green">Destroyed enemy clone</font></b>'
		xgt 'fight', 'sta'
	end

	if unmaterial > 0:
		unmaterial -= 1
		'<b><font color="red">Your shot went through the opponent''s body. Opponents do not materials</font></b>'
		xgt 'fight', 'sta'
	end

	if barier > 0:
		!!imeniteta barrier for damage
		if barier >= damage:
			'<b><font color="red"><<$nameV>> easily withstood your butt</font></b>'
			xgt 'fight', 'sta'
		else
			manna -= damageM
			health -= damage
			!!healthV -= damage
			'<b><font color="green">You have caused damage <<damage>> units</font></b>'
			'<b><font color="green">You have caused damage to the enemy manna <<damageM>> units</font></b>'

			if zerkalo > 0:
				zerkalo -= 1
				healthV -= damage
				'<b><font color="red">Enemy reflected damage and you got <<damage>> points of damage</font></b>'
			end
		end

		xgt 'fight', 'sta'
	end
end

--- atakA1 ---------------------------------
