# atakM

if $ARGS[0] = 'atakVmanna':
	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 'atakM', 'uronKritV'
		else
			!!normal hit
			!!attack the enemy
			'<b><font color="red">Contact</font></b>'
			xgt 'atakM', 'uronV'
		end
	else
		'<b><font color="green">is washed</font></b>'
		xgt 'fight', 'sta'
	end
end

if $ARGS[0] = 'uronKritV':
	cla
	damage = rand(1000, 2000)
	damageM = rand(1000, 2000)

	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="red">caused damage your health <<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>> to give <<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
		'<b><font color="red">Protection of your harmed <<damSum>> units</font></b>'
		xgt 'fight', 'sta'
	end

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

	if unmaterial > 0:
		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'
		else
			manna -= damageM
			health -= damage
			'<b><font color="red">You harmed <<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>> to give <<damage>> points of damage</font></b>'
			end
		end

		xgt 'fight', 'sta'
	end
end

if $ARGS[0] = 'uronV':
	cla
	damage = rand(500, 1000)
	damageM = rand(500, 1000)

	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="red">caused damage your health <<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>> to give <<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
		'<b><font color="red">Protection of your harmed <<damSum>> units</font></b>'
		xgt 'fight', 'sta'
	end

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

	if unmaterial > 0:
		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'
		else
			manna -= damageM
			health -= damage
			'<b><font color="red">You harmed <<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>> to give <<damage>> points of damage</font></b>'
			end
		end

		xgt 'fight', 'sta'
	end
end

--- atakM ---------------------------------
