# defence
if defence <= 0:
defence = 0
defenceM = 0
defenceW = 0
defenceActPar = 0
defenceActParM = 0
defenceAct = 0
defenceActM = 0
defAtk = 0
defAtkM = 0
end
if defenceV <= 0:
defenceV = 0
defenceMV = 0
defenceWV = 0
defenceActParV = 0
defenceActParMV = 0
defenceActV = 0
defenceActMV = 0
defAtkV = 0
defAtkMV = 0
end
if defenceAct > 0:
defence += defenceActPar
defenceAct -= 1
defActParK = defenceActPar/100
manna -= defActParK
'Regeneration consumes Protection <> units manna.'
end
if defenceActM > 0:
defenceM += defenceActParM
defenceActM -= 1
defActParKM = defenceActParM/100
manna -= defActParKM
'Regeneration consumes magical protection <> units of manna.'
end
if defenceActV > 0:
defenceV += defenceActParV
defenceActV -= 1
mannaV -= (defenceActParV / 100)
end
if defenceActMV > 0:
defenceMV += defenceActParMV
defenceActMV -= 1
mannaV -= (defenceActParMV / 100)
end
if defAtk > 0:
defAtk -= 1
'Your defense is attacking the enemy.'
gs 'atakB', 'atak'
end
if defAtkV > 0:
defAtkV -= 1
'Protection of the enemy attacks you.'
gs 'atakB1', 'atak'
end
if defAtkM > 0:
defAtkM -= 1
if defenceMV <= 0 and unmaterialV = 0:
defDamM = rand(defenceActParM/2, defenceActParM)
mannaV -= defDamM
defence += defDamM
'Your defense absorbed <> mana from an enemy, this manna went to strengthen your defenses.'
end
if defenceMV > 0:
defenceMV += defenceActParM
'Your defense caused <> points of damage protection from damage enemy mana.'
end
if unmaterialV > 0:'Your defense is trying to absorb the manna but it does not work, the enemy is not material.'
end
if defAtkMV > 0:
defAtkMV -= 1
if defenceM <= 0 and unmaterial = 0:
defDamMV = rand(defenceActParMV/2, defenceActParMV)
manna -= defDamMV
defenceV += defDamMV
'Protection of the enemy swallow <> manna from you and this manna went to strengthen the defense.'
end
if defenceM > 0:
defenceM += defenceActParMV
'Protection against your magic damage inflicted damage <> units.'
end
if unmaterial > 0:'Protection of the enemy is trying to absorb your manna but it does not work.'
end
--- defence ---------------------------------