#local vars
attackpoints= RAND*attack
defensepoints= RAND*other_defend
damage = attackpoints - defensepoints
strengthratio = defensepoints/attackpoints

if (damage < 1) damage = 1 endif

# health hit on attackee
other_health = other_health - 1.2*damage

#energy drain on attacker
energy = energy - 5 * strengthratio

if (energy < 0) energy = 0 endif

if (energy < 0.1) health = health - 5