03-13-2009, 08:46 PM
Continuing with the presentation of the battle formulas here are the basic calculations for physical attacks:
Here, the result will depend linearly on the attack value of the used weapon, and on one parameter of the user: the strenght for close combat weapons, and the dexterity for ranged weapons.
Code:
# Calculate basic damage
if MNK_STATIONARY_WEAPONS.include?(attacker.weapon_id)
power = attacker.atk * attacker.dex
else
power = attacker.atk * attacker.str
end
power *= ATTACK_DAMAGE_RANGE_CORRECTION
defense = self.pdef
power = [power - defence, 0].max
Here, the result will depend linearly on the attack value of the used weapon, and on one parameter of the user: the strenght for close combat weapons, and the dexterity for ranged weapons.