# atakB
if $ARGS[0] = 'atak':
cla
!payment hit dodge
poSp = speed*20/100
uvAg = agilV*20/100
poBox = pcs_react*20/100
uvBox = reactV*20/100
popad = RAND(pcs_react-poBox,pcs_react+poBox) + RAND(speed-poSp,speed+poSp) + bonusSh
uvorot = RAND(reactV-uvBox,reactV+uvBox) + RAND(agilV-uvAg,agilV+uvAg)
uvorKoef = uvorot*50/100
popKoef = popad*50/100
if popad > uvorot:
if popad >= uvorot+uvorKoef:
!Crete, very direct hit
'Critical hits'
gs'atakB','uronKrit'
elseif popad < uvorot+uvorKoef:
!Normal hit
!He attacks the enemy
'EYE'
gs'atakB','uron'
end
elseif popad <= uvorot:
'LOST'
end
end
if $ARGS[0] = 'uronKrit':
cla
damDef = defence/100
damKoef = damDef*20/100
damage = RAND(damDef+damKoef,damDef+damKoef*2)
gs'atakB','damage'
end
if $ARGS[0] = 'uron':
cla
damDef = defence/100
damKoef = damDef*20/100
damage = RAND(damDef-damKoef,damDef+damKoef)
gs'atakB','damage'
end
if $ARGS[0] = 'damage':
cla
if defenceV <= 0 and klonV <= 0 and unmaterialV <= 0 and barierV <= 0:
if dospehV > 0:damageV = damageV - dospehDefV & dospehEn = dospehEn - 1
if damage < 0:damage = 0
healthV = healthV - damage
!pcs_manna = pcs_manna - damageM
if eleSh > 0:
stunV = RAND(eleSh,eleSh*3)
'<<$boydesc>> paralyzed <> Rounds'
end
'You have caused damage <> units'
!'Your manna harmed <> units'
if zerkaloV > 0:
zerkaloV = zerkaloV - 1
defence = defence - damage
'<<$boydesc>> It reflected the damage and your defense received <> points of damage'
end
!xgt'fight','sta'
end
if defenceV > 0 and klonV <= 0 and unmaterialV <= 0:
!damSum = damage + damageM
!defence = defence - damSum
defenceV = defenceV - damage
'Your defense caused damage <> Protection of enemy units'
!xgt'fight','sta'
end
if klonV > 0 and unmaterialV <= 0:
klonV = klonV - 1
'Destroyed enemy clone'
!xgt'fight','sta'
end
if unmaterialV > 0:
unmaterialV = unmaterialV - 1
'Blow your protection passed through the body of the enemy. Opponents do not materials'
!xgt'fight','sta'
end
if barierV > 0:
!imeniteta barrier for damage
if barierV >= damage:
'<<$boydesc>> easily weathered blow your protection'
!xgt'fight','sta'
elseif barierV < damage:
!pcs_manna = pcs_manna - damageM
!pcs_health = pcs_health - damage
healthV = healthV - damage
if eleSh > 0:
stunV = RAND(eleSh,eleSh*3)
'<<$boydesc>> paralyzed <> Rounds'
end
'Your defense caused damage <> units'
!'Your manna harmed <> units'
if zerkaloV > 0:
zerkaloV = zerkaloV - 1
defence = defence - damage
'Opponent reflected damage and your defense received <> points of damage'
end
end
!xgt'fight','sta'
end
end
--- atakB ---------------------------------