# fight
if $ARGS[0]='start':
cla
inFight=1
fcolor=rgb(0,0,0)
bcolor=rgb(255,255,255)
LCOLOR = rgb(106,90,205)

gs'defence'

gs'statBat'


if SasoriBody > 2 and healthV <= 0 or SasoriBody > 2 and mannaV <= 0 or SasoriBody > 2 and willpowerV <= 0:
set SasoriBody = SasoriBody - 1
gs'priziv','sasori'
'<B><font color=red>Doll scattered the parts and immediately entered into battle other doll Sasori.</font></B>'
'<B><font color=red>You`ve heard the sonorous voice Sasori "I have a lot of dolls, you can not win."</font></B>'
end
if SasoriBody = 2 and healthV <= 0 or SasoriBody = 2 and mannaV <= 0 or SasoriBody = 2 and willpowerV <= 0:
set SasoriBody = SasoriBody - 1
gs'priziv','sasori1'
'<B><font color=red>Last Doll crumbled into pieces and joined in the battle itself Sasori.</font></B>'
end
if stunV > 0 and SasoriBody > 1:
set stunV = 0
'<B><font color=red>Doll began to move again.</font></B>'
end
if stunV > 0 and SasoriBody = 1:
set stunV = 0
'<B><font color=red>Sasori is moving again.</font></B>'
end

if GedoMazo = 1 and healthV <= 0 or GedoMazo = 1 and mannaV <= 0 or GedoMazo = 1 and willpowerV <= 0:
set GedoMazo = 2
set barierV = 0
'<B><font color=green><<$nameV>> fell to the ground turning into ashes</font></B>'
gs'priziv','tobi'
'<B><font color=green><<$nameV>> attacked you</font></B>'
end 

if health <= 0 and heart = 0 and izanagi = 0:
'<B><font color=red>you lost</font></B>'
xgt'ender','loss'
exit
end 

if healthV <= 0 and heartV = 0 and izanagiV = 0:
'<B><font color=green><<$nameV>> lost</font></B>'
xgt'ender','win'
exit
end 
if manna <= 0 and heart = 0 and izanagi = 0:
'<B><font color=red>you lost</font></B>'
xgt'ender','loss'
exit
end 
if mannaV <= 0 and heartV = 0 and izanagiV = 0:
'<B><font color=green><<$nameV>> lost</font></B>'
xgt'ender','win'
exit
end 
if willpower <= 0 and heart = 0 and izanagi = 0:
'<B><font color=red>you lost</font></B>'
xgt'ender','loss'
exit
end 
if willpowerV <= 0 and heartV = 0 and izanagiV = 0:
'<B><font color=green><<$nameV>> lost</font></B>'
xgt'ender','win'
exit
end
if izanagiV > 0 and healthV <= 0 or izanagiV > 0 and mannaV <= 0 or izanagiV > 0 and willpowerV <= 0:
set izanagiV = izanagiV - 1
'<B><font color=red><<$nameV>> simply disappeared</font></B>'
set healthV = vitalV*10 + strenV*5
set mannaV = intelV*magikV + magikV*100 + vitalV*10
set willpowerV = willV*10
set stunV = 0
     if program = 6 and izanagiOnce = 0:set izanagiOnce = 1&set unmaterialV = 40&set tobizanagi = 0
'<B><font color=red><<$nameV>> appeared in front of you is completely healthy. He folded his arms and magic sign said Izanagi - perfect illusion.</font></B>'
'<B><font color=red>One of his eyes closed forever, paying for this spell.</font></B>'
end
if heartV > 0 and healthV <= 0 or heartV > 0 and mannaV <= 0 or heartV > 0 and willpowerV <= 0:
set heartV = heartV - 1
'<B><font color=red><<$nameV>> staggered and his heart burst</font></B>'
set healthV = vitalV*10 + strenV*5
set mannaV = intelV*magikV + magikV*100 + vitalV*10
set willpowerV = willV*10
set stunV = 0
'<B><font color=red><<$nameV>> stood up and rushed into the fray. He has run another heart.</font></B>'
end
if izanagi > 0 and health <= 0 or izanagi > 0 and manna <= 0 or izanagi > 0 and willpower <= 0:
set izanagi = izanagi - 1
'<B><font color=green>you disappeared</font></B>'
set health = vital*10 + stren*5
set willpower = intel*5 + will*5
set manna = (intel*magik) + magik*100 + vital*10 + rikudo
set stun = 0
set zerkaloV = 0
set poisonV = 0
set bloodV = 0
'<B><font color=green>And then he appeared before the enemy completely healthy.</font></B>'
end
if heart > 0 and health <= 0 or heart > 0 and manna <= 0 or heart > 0 and willpower <= 0:
set heart = heart - 1
set zerkaloV = 0
set poisonV = 0
set bloodV = 0
'<B><font color=green>Your heart has not sustained and burst.</font></B>'
set health = vital*10 + stren*5
set willpower = intel*5 + will*5
set manna = (intel*magik) + magik*100 + vital*10 + rikudo
set stun = 0
'<B><font color=green>You are not dead, you start another heart.</font></B>'
end

gs'before'
'<B>==========================================================</B>'
'<B>========================(ROUND <<round>>)===========================</B>'
'<B>==========================================================</B>'
'<B><<$nameV>></B> life <B><font color=red><<healthV>></font></B>, manna <B><font color=blue><<mannaV>></font></B>, willpower <B><font color=green><<willpowerV>></font></B>'
if defenceV > 0:'<B><font color=red>protection <<defenceV>> units</font></B>'
if defenceMV > 0:'<B><font color=red>protection of manna <<defenceMV>> units</font></B>'
if defenceWV > 0:'<B><font color=red>protection will <<defenceWV>> units</font></B>'
'Your life <B><font color=red><<health>></font></B>, manna <B><font color=blue><<manna>></font></B>, willpower <B><font color=green><<willpower>></font></B>'
if defence > 0:'<B><font color=green>protection <<defence>> units</font></B>'
if defenceM > 0:'<B><font color=green>Protection from impacts on the manna <<defenceM>> units</font></B>'
if defenceW > 0:'<B><font color=green>Protection from the will <<defenceW>> units</font></B>'
if defenceAct > 0:'<B><font color=green><<defenceAct>> moves regeneration protection</font></B>'
if defenceActM > 0:'<B><font color=green><<defenceActM>> stroke recovery protection from the effects of manna</font></B>'
if unmaterial > 0:'<B><font color=green>left <<unmaterial>> moves are not material.</font></B>'
'<B>==========================================================</B>'
gs'init'

     if hod = 0:
     !player attacks
     '<font color=green>You can attack</font>'
     if gun>0:
         !Boomstick
		 if bulletIn>0:
		 '<<bulletIn>> charged bullets in the gun'
			 act 'Pistol shot':
			 cla
			 bulletIn-=1
			 gunpower=150
			 buu=1
			 gunpricel=1
			 Gcrime+=1
			 gt'strelba'
			 end
			 
         end
         if bulletIn<=0:
         
             if bullet=0:
             'Ammunition for the gun ran out.'
             end
             if bullet>0:
             '<<bullet>> ammunition for pistols'
                 act 'charge':
                 cla
                     if bullet<7:
                     bulletIn=bullet
                     bullet=0
                     'You loaded all the remaining rounds in the gun.'
                     end
                     if bullet>=7:
                     bullet-=7
                     bulletIn=7
                     'you loaded 7NIL rounds in the gun.'
                     end
                     act 'further': gt'fight','sta'
			     end
             end
         end
         
     end
     if Mgun>0:
              !Boomstick
		 if mbulletIn>0:
		 '<<mbulletIn>> Charged cartridges in the machine'
			 act 'From single machine':
			 cla
			 mbulletIn-=1
			 buu=1
			 gunpower=300
			 gunpricel=2
			 Gcrime+=1
			 gt'strelba'
			 end
			 
			 if mbulletIn>=3:
				 act 'A short burst of machine':
				 cla
				 mbulletIn-=3
				 buu=3
				 gunpower=300
				 gunpricel=1
				 Gcrime+=buu
				 gt'strelba'
				 end
			 end
			 
			 if mbulletIn>=3:
				 act 'Long line of machine':
				 cla
				 buu=mbulletIn
				 mbulletIn=0
				 gunpower=300
				 gunpricel=0
				 Gcrime+=buu
				 gt'strelba'
				 end
			 end
         end
         if mbulletIn<=0:
         
             if mbullet=0:
             'Cartridges for machine run out.'
             end
             if mbullet>0:
             '<<mbullet>> ammunition for the machine'
                 act 'charge':
                 cla
                     if mbullet<7:
                     mbulletIn=mbullet
                     mbullet=0
                     'You loaded all the remaining cartridges in the machine.'
                     end
                     if mbullet>=30:
                     mbullet-=30
                     mbulletIn=30
                     'you loaded 30 cartridges in the machine.'
                     end
                     act 'further': gt'fight','sta'
			     end
             end
         end
     end
     if tragun>0:
         !travmatik
         if tbulletIn>0:
		 'travmatik charged'
			 act 'Pistol shot':
			 cla
			 tbulletIn-=1
			 gunpower=50
			 buu=1
			 gunpricel=0
			 gt'strelba'
			 end
			 
         end
         if tbulletIn<=0:
         
             if tbullet=0:
             'Cartridges for travmatika ended.'
             end
             if tbullet>0:
             '<<tbullet>> cartridges for travmatika'
                 act 'charge':
                 cla
                     if tbullet>=1:
                     tbullet-=1
                     tbulletIn=1
                     'You loaded a cartridge in travmatik.'
                     end
                     act 'further': gt'fight','sta'
			     end
             end
         end
     end
     act 'physical Attack':xgt'boxing'
         if magik > 0:
         act 'magical Attack':gt'magik'
         end
         
     end
     if hod = 1:
     !enemy attacks
     '<font color=red><<$nameV>> attacks</font>'
     act 'further':xgt'enemy','start'
     end
end


if $ARGS[0]='sta':
cla
set damTip = 0
set damTipM = 0
set damTipV = 0
set damTipMV = 0
set magweapbonus = 0
set magweapbonusV = 0
set bonusSh = 0
set bonusShV = 0
set eleSh = 0
set eleShV = 0
set poisonAV = 0
set hidanAtk = 0
'<B>==========================================================</B>'
'<B><<$nameV>></B> life <B><font color=red><<healthV>></font></B>, manna <B><font color=blue><<mannaV>></font></B>, willpower <B><font color=green><<willpowerV>></font></B>'
if defenceV > 0:'<B><font color=red>protection <<defenceV>> units</font></B>'
if defenceMV > 0:'<B><font color=red>protection of manna <<defenceMV>> units</font></B>'
if defenceWV > 0:'<B><font color=red>protection will <<defenceWV>> units</font></B>'
'Your life <B><font color=red><<health>></font></B>, manna <B><font color=blue><<manna>></font></B>, willpower <B><font color=green><<willpower>></font></B>'
if defence > 0:'<B><font color=green>protection <<defence>> units</font></B>'
if defenceM > 0:'<B><font color=green>Protection from impacts on the manna <<defenceM>> units</font></B>'
if defenceW > 0:'<B><font color=green>Protection from the will <<defenceW>> units</font></B>'
if defenceAct > 0:'<B><font color=green><<defenceAct>> moves regeneration protection</font></B>'
if defenceActM > 0:'<B><font color=green><<defenceActM>> stroke recovery protection from the effects of manna</font></B>'
'<B>==========================================================</B>'
act 'further':gt'fight','start'
end



--- fight ---------------------------------

