# enemy
!Calculation of the enemy`s attack

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

	!in this block is selected on the basis of the variable program enemy attacks
	if program = 0:xgt 'enemy', 'fighter'
	if program = 1:	xgt 'enemy', 'fighter2'
	if program = 2:xgt 'enemy', 'fighter3'
	if program = 3:xgt 'enemy', 'fighter4'
	if program = 4:xgt 'enemy', 'fighter5'

	if program = 5:xgt 'enemy', 'kisame'
	if program = 6:xgt 'enemy', 'tobi'
	if program = 7:xgt 'enemy', 'gedomazo'
	if program = 8:xgt 'enemy', 'gun'
	if program = 9:xgt 'enemy', 'sasori'
	if program = 10:xgt 'enemy', 'konan'
	if program = 11:xgt 'enemy', 'hidan'
end

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

	if zerkaloV > 0:set barierV = 0
	if zerkaloV <= 0:set barierV = 5500
	if healthV < vitalV * 10 + strenV * 5:set healthV = vitalV * 10 + strenV * 5

	if zerkaloV > 0:
		set healthV = vitalV * 10 + strenV * 5
		set mannaV = intelV * magikV + magikV * 100 + vitalV * 10
		set willpowerV = willV * 10
		set health -= 400
		set manna -= 500
		'<b><font color="red"><<$nameV>> yells "RITUAL BEGINS!" and stands in a circle inscribed in blood on the ground.</font></b>'
		'<b><font color="red">He stabs himself and you feel like the pain pierces the body.</font></b>'
		xgt 'fight', 'sta'
		exit
	end

	if zerkaloV <= 0 and defence > 0:
		set damTipV = 5000
		set bonusShV = 100
		set hidanAtk = 1
		'<b><font color="red"><<$nameV>> yells "Your existence offends DZHASHINA MY GOD!" and throws you in his scythe trehlezviynuyu driving it by a line.</font></b>'

		if klon > 0:set klon = klon / 2 & '<b><font color="red"><<$nameV>> yells "Mraz I slaughter YOU LIKE A PIG!"</font></b>'

		xgt 'atakA1', 'atak'
		exit
	end

	if zerkaloV <= 0 and defence <= 0:
		set damTipV = 300
		set bonusShV = 100
		set hidanAtk = 1
		'<b><font color="red"><<$nameV>> yells "You will die a blasphemer!" and throws you in his scythe trehlezviynuyu driving it by a line.</font></b>'

		if klon > 0:set klon = 0 & '<b><font color="red">Your clones turned into steam from the blow spit. <<$nameV>> yells "I IMMORTAL Ravager! And YOU SHIT!"</font></b>'
		if tuman > 0:set tuman = 0 & '<b><font color="red"><<$nameV>> yells "You´re pathetic in their vain attempts SPRYATATSYA FROM ME!"</font></b>'

		xgt 'atakA1', 'atak'
		exit
	end
end

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

	if round < 6:
		set mannaV -= 10
		set damTipV = 500
		'<b><font color="red"><<$nameV>> adds signs hands and you are flying sheets of paper.</font></b>'

		if klon > 0:set klon = 0 & '<b><font color="red">Your clones turned into steam from hitting the paper.</font></b>'

		xgt 'atakA1', 'atak'
		exit
	end

	if round >= 6:
		if unmaterialV > 5 and defence > 0:
			set mannaV -= 250
			set damTipV = 15000
			set bonusShV = 100
			'<b><font color="red"><<$nameV>> takes to the air on the white wings and pulled out from her wings paper falls on you in a flood of flying with terrible speed paper swords.</font></b>'

			if klon > 0:set klon = 0 & '<b><font color="red">Your clones turned into steam from hitting the paper.</font></b>'

			xgt 'atakA1', 'atak'
			exit
		end

		if unmaterialV > 5 and defence <= 0:
			set mannaV -= 20
			set damTipV = 450
			'<b><font color="red"><<$nameV>> creates a paper boomerangs that fly in your direction.</font></b>'
			xgt 'atakA1', 'atak'
			exit
		end

		if defenceV <= 0 and unmaterialV <= 5:
			set mannaV -= 250
			set defenceV += 3000
			set defenceMV += 3000
			set defenceWV += 3000
			'<b><font color="red">Conan shoots up to its paper wings like an angel. Around it starts spinning paper creating her protection.</font></b>'
			xgt 'fight', 'sta'
			exit
		end

		if unmaterialV <= 2 and konanD < 3:
			set mannaV -= 150
			set konanD += 1
			'<b><font color="red">Conan stops meditating in the air.</font></b>'
			xgt 'fight', 'sta'
			exit
		end

		if konanD >= 3:
			set mannaV -= 250
			set konanD = 0
			set unmaterialV = 20
			'<b><font color="red">Conan crumbles in the air for thousands of sheets of paper.</font></b>'
			xgt 'fight', 'sta'
			exit
		end
	end
end

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

	if SasoriBody > 1:set damTipV = 1000
	if SasoriBody = 1:set damTipV = 2000

	set poisonAV = 1
	set defenceV += 10
	set defenceMV += 20
	set defenceWV += 50
	set mannaV -= 10

	if SasoriBody = 1 and defence > 0:
		set defSasori = defence * 20 / 100
		set defence -= defSasori
		'<b><font color="red">of rain falls on top of steel needles greatly weaken your defenses.</font></b>'
	end

	'<b><font color="red"><<$nameV>> shoots at you the whole cloud of poisonous spines.</font></b>'

	if klon > 0:set klon = 0 & '<b><font color="red">Your clones turned into steam from the blow needle.</font></b>'

	xgt 'atakA1', 'atak'
end

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

	if klon <= 0 and tuman <= 0:
		set magweapbonusV = 5000
		'<b><font color="red"><<$nameV>> with a furious roar of effort on you for its huge stone fist.</font></b>'
		xgt 'atak', 'enemy'
		exit
	end

	if klon > 0 or tuman > 0:
		set klon = 0
		set tuman = 0
		set mannaV -= 500
		'<b><font color="red"><<$nameV>> makes a terrible roar and air shock wave sweeps over the battlefield.</font></b>'
		xgt 'fight', 'sta'
		exit
	end
end

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

	!программа атаки Тоби
	if unmaterialV <= 0 and IzanagiV = 0 and GedoMazo = 0:
		*clr
		'<b><font color="red"><<$nameV>> fingers to his lips and said quietly, "KUCHIE SAINT BUT JITSU."</font></b>'
		'<b><font color="red">you will see Huge stone statue of a demon, and you rushed to the attack.</font></b>'
		set GedoMazo = 1
		set $nameV = 'Gedo Mazo'
		!Статы
		set strenV = 1000
		set speedV = 100
		set agilV = 90
		set reactV = 100
		set vitalV = 5000
		set intelV = 50
		set willV = 50
		!Навыки
		set magikV = 1
		set boxingV = 100
		set shootV = 100
		!Параметры
		set healthV = vitalV * 10 + strenV * 5
		set mannaV = intelV * magikV + magikV * 100 + vitalV * 10
		set willpowerV = willV * 10
		set BonusAtakV = 0
		set BonusDefV = 0
		!программа действий
		set barierV = 1500
		set program = 7
		xgt 'fight', 'start'
		exit
	end

	if unmaterialV <= 2 and IzanagiV = 0 and GedoMazo > 0 and TobiStena = 0:
		set mannaV -= 500
		set TobiStena = 1
		set defenceV += 25000
		'<b><font color="red"><<$nameV>> makes Arcanum and reinforcing the skin blackens his body and creating protection of 25, 000 units.</font></b>'
		set barierV = 2000
		xgt 'fight', 'sta'
		exit
	end

	if unmaterialV <= 2 and IzanagiV = 0 and GedoMazo > 0 and TobiStena = 1:
		set mannaV += 6000
		set TobiStena = 2
		'<b><font color="red"><<$nameV>> makes the magic sign and you feel like it´s magical energy increases sharply.</font></b>'
		xgt 'fight', 'sta'
		exit
	end

	if stun > 0:
		set magweapbonusV = 2000
		'<b><font color="red"><<$nameV>> triumphantly said, "Now you´re dead."</font></b>'
		'<b><font color="red">He grabs you by the throat and lifts his hand in the air.</font></b>'
		'<b><font color="red">His fingers like steel and they squeeze your throat with terrible force.</font></b>'
		xgt 'atak', 'enemy'
		exit
	end

	if defence >= 5000:
		set defence = 0
		set defenceM = 0
		set defenceActPar = 0
		set defenceActParM = 0
		set defenceAct = 0
		set defenceActM = 0
		set defAtk = 0
		set mannaV -= 100
		set stunV = 1
		'<b><font color="red"><<$nameV>> close your eyes and you saw of him as a tear ran down a drop of blood.</font></b>'
		'<b><font color="red">He opened his eyes become completely red with black veins and said Amaterasu</font></b>'
		'<b><font color="red">In your face rushed black devouring flames destroy your lightning protection.</font></b>'
		xgt 'fight', 'sta'
		exit
	end

	if tuman > 0:
		set tumanV += tuman
		set tuman = 0
		'<b><font color="red"><<$nameV>> adds the magic signs your hands and mist coming under his control enveloping the review of you.</font></b>'
		'<b><font color="red">He will attack you.</font></b>'
		xgt 'atak', 'enemy'
		exit
	end

	if unmaterialV > 0 and klon <= 0:
		set stunnerV = 1
		set mannaV -= 20
		set magweapbonusV = 800
		'<b><font color="red"><<$nameV>> attacks you gathered the manna in the hand.</font></b>'
		xgt 'atak', 'enemy'
		exit
	end

	if unmaterialV > 0 and klon > 0:
		set klon = 0
		set stunV = 1
		'<b><font color="red"><<$nameV>> adds signs hands and all your clones just turn into steam.</font></b>'
		xgt 'atak', 'enemy'
		exit
	end

	if unmaterialV <= 0 and tobizanagi < 2:
		set mannaV -= 250
		set tobizanagi += 1
		!set unmaterialV = 10
		'<b><font color="red"><<$nameV>> adds the characters by hand.</font></b>'
		xgt 'fight', 'sta'
		exit
	end

	if unmaterialV <= 0 and tobizanagi = 2:
		set mannaV -= 250
		set tobizanagi = 0
		set unmaterialV = 20
		set stunV = 1
		'<b><font color="red"><<$nameV>> folds his hands and marks around his eyes twisted vortex.</font></b>'
		xgt 'fight', 'sta'
		exit
	end
end

if $ARGS[0] = 'kisame':
	cla
	!программа атаки Кисаме

	if defenceV <= 0 and kisamePro = 0:
		set kisamePro = 1
		set mannaV -= 150
		set defenceV += 1500
		set defenceMV += 1500
		set defenceWV += 1500
		set defenceActParV = 500
		set defenceActParMV = 500
		set defenceActV = 10
		set defenceActMV = 10
		'<b><font color="red"><<$nameV>> adds the marks around his hands and formed water sphere protecting it from damage.</font></b>'
		xgt 'fight', 'sta'
		exit
	end

	if defenceV <= 1000 and kisamePro > 0:
		set mannaV -= 500
		set defenceV += 5000
		set defenceMV += 5000
		set defenceWV += 5000
		set defenceActParV = 500
		set defenceActParMV = 500
		set defenceActV = 10
		set defenceActMV = 10
		set defAtkMV = 10
		'<b><font color="red"><<$nameV>> adds the marks and the space around the hands begins pogruzhatsya water.</font></b>'

		if klon > 0:set klon = 0 & '<b><font color="red">Your clones turned into steam from hitting the water.</font></b>'

		xgt 'fight', 'sta'
		exit
	end

	if defenceV > 1000:
		set kisamerand= rand(0, 3)

		if kisamerand= 0:
			set klonV += 3
			'<b><font color="red"><<$nameV>> adds the characters by hand.</font></b>'
			xgt 'fight', 'sta'
			exit
		end

		if kisamerand> 0:
			set mannaV -= 250
			set damTipV = 1500
			set damTipMV = 2500
			set bonusShV = 50
			'<b><font color="red"><<$nameV>> adds the characters in the hands and fly sharks have created from the water.</font></b>'

			if klon > 0:set klon = 0 & '<b><font color="red">Your clones turned into steam from hitting the water.</font></b>'

			xgt 'atakA1', 'atak'
			exit
		end
	end

	'<b><font color="red"><<$nameV>> attacks.</font></b>'
	xgt 'enemy', 'fighter'
end

if $ARGS[0] = 'gun':
	cla
	!непосредственно программа атаки
	!gs 'atak'
	set damTipV = 1500
	'<b><font color="red"><<$nameV>> shoots at you.</font></b>'
	xgt 'atakA1', 'atak'
end

if $ARGS[0] = 'fighter':
	cla
	!непосредственно программа атаки
	!gs 'atak'
	xgt 'atak', 'enemy'
end

if $ARGS[0] = 'fighter2':
	cla
	!непосредственно программа атаки
	set deystrand = rand(0, 1)

	if deystrand = 0:xgt 'atak', 'enemy'

	if deystrand = 1:
		set knifeV = rand(1, 3)
		'<b><font color="red"><<$nameV>> have a throws <<knifeV>> the blades</font></b>'
		xgt 'atak', 'enemy'
	end
end

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

	!непосредственно программа атаки
	if tuman = 0 and tumanV < 5 and mannaV > 10:
		set mannaV -= 10
		set tumanV += 10
		'<b><font color="red"><<$nameV>> produces a fog on the battlefield.</font></b>'
		xgt 'fight', 'sta'
		exit
	end

	set deystrand = rand(0, 1)

	if deystrand = 0:xgt 'atak', 'enemy'

	if deystrand = 1:
		set knifeV = rand(1, 3)
		'<b><font color="red"><<$nameV>> have a throws <<knifeV>> the blades</font></b>'
		xgt 'atak', 'enemy'
	end
end

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

	!непосредственно программа атаки
	if tuman = 0 and tumanV < 5 and mannaV > 10:
		set mannaV -= 10
		set tumanV += 10
		'<b><font color="red"><<$nameV>> produces a fog on the battlefield.</font></b>'
		xgt 'fight', 'sta'
		exit
	end

	if klonV < 1 and mannaV > 15:
		set mannaV -= 15
		set klonV += 1
		'<b><font color="green">is washed</font></b>'
		xgt 'fight', 'sta'
		exit
	end

	set deystrand = rand(0, 1)

	if deystrand = 0:xgt 'atak', 'enemy'

	if deystrand = 1:
		set knifeV = rand(1, 3)
		'<b><font color="red"><<$nameV>> have a throws <<knifeV>> the blades</font></b>'
		xgt 'atak', 'enemy'
	end
end

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

	!непосредственно программа атаки
	if tuman = 0 and tumanV < 5 and mannaV > 10:
		set mannaV -= 10
		set tumanV += 10
		'<b><font color="red"><<$nameV>> produces a fog on the battlefield.</font></b>'
		xgt 'fight', 'sta'
		exit
	end

	if klonV < 1 and mannaV > 15:
		set mannaV -= 15
		set klonV += 1
		'<b><font color="green">is washed</font></b>'
		xgt 'fight', 'sta'
		exit
	end

	if stun < 1 and manna > 20:
		set stunnerV = 1
		set mannaV -= 20
		'<b><font color="red"><<$nameV>> attacks you Gouge.</font></b>'
		xgt 'atak', 'enemy'
	end

	set deystrand = rand(0, 1)

	if deystrand = 0:xgt 'atak', 'enemy'

	if deystrand = 1:
		set knifeV = rand(1, 3)
		'<b><font color="red"><<$nameV>> have a throws <<knifeV>> the blades</font></b>'
		xgt 'atak', 'enemy'
	end
end

--- enemy ---------------------------------

