# atakB
if $ARGS[0] = 'atak':
cla
!расчет попадания уворота
set poSp = speed * 20 / 100
set uvAg = agilV * 20 / 100
set poBox = react * 20 / 100
set uvBox = reactV * 20 / 100
set popad = rand(react - poBox, react + poBox) + rand(speed - poSp, speed + poSp) + bonusSh
set uvorot = rand(reactV - uvBox, reactV + uvBox) + rand(agilV - uvAg, agilV + uvAg)
set uvorKoef = uvorot * 50 / 100
set popKoef = popad * 50 / 100
if popad > uvorot:
if popad >= uvorot + uvorKoef:
!крит, очень точное попадание
'critical hits'
gs 'atakB', 'uronKrit'
end
if popad < uvorot + uvorKoef:
!нормальное попадание
!атаковал противник
'Contact'
gs 'atakB', 'uron'
end
end
if popad <= uvorot:'is washed'
end
if $ARGS[0] = 'uronKrit':
cla
set damDef = defence/100
set damKoef = damDef * 20/100
set damage = rand(damDef + damKoef, damDef + damKoef * 2)
gs 'atakB', 'damage'
end
if $ARGS[0] = 'uron':
cla
set damDef = defence / 100
set damKoef = damDef * 20 / 100
set 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:set damageV -= dospehDefV & set dospehEn -= 1
if damage < 0:set damage = 0
set healthV -= damage
!set manna -= damageM
if eleSh > 0:
set stunV = rand(eleSh, eleSh * 3)
'<<$nameV>> paralyzed <> rounds'
end
'You have caused damage <> units'
!'caused damage your manna <> units'
if zerkaloV > 0:
set zerkaloV -= 1
set defence -= damage
'<<$nameV>> reflected the damage and your defense has received <> points of damage'
end
!xgt 'fight', 'sta'
end
if defenceV > 0 and klonV <= 0 and unmaterialV <= 0:
!set damSum = damage + damageM
!set defence -= damSum
set defenceV -= damage
'caused damage to your defense <> Protection of the enemy units'
!xgt 'fight', 'sta'
end
if klonV > 0 and unmaterialV <= 0:
set klonV -= 1
'Destroyed enemy clone'
!xgt 'fight', 'sta'
end
if unmaterialV > 0:
set unmaterialV -= 1
'Blow your protection passed through the body of the opponent. Opponents do not materials'
!xgt 'fight', 'sta'
end
if barierV > 0:
!барьер именитета для урона
if barierV >= damage:
'<<$nameV>> easily withstood kick your protection'
!xgt 'fight', 'sta'
end
if barierV < damage:
!set manna -= damageM
!set health -= damage
set healthV -= damage
if eleSh > 0:
set stunV = rand(eleSh, eleSh * 3)
'<<$nameV>> paralyzed <> rounds'
end
'caused damage to your defense <> units'
!'caused damage your manna <> units'
if zerkaloV > 0:
set zerkaloV -= 1
set defence -= damage
'Enemy reflected damage and your defense received <> points of damage'
end
end
!xgt 'fight', 'sta'
end
end
--- atakB ---------------------------------