03-11-2009, 07:48 PM
I'm working on new battle formulas.
Here is what I have at the moment for skills with power>0.
I'm gonna get rid of the distinction between skills and techniques, because it has been confusing for users and because you can easily reproduce them with the new formulas.
I'm interested in comments and ideas.
Here is what I have at the moment for skills with power>0.
Code:
# A base value of damage is calculated from the skill's power
# Optionally the skill's power can be used as an exponent
attack = (skill.is_exp_damage())?Math.exp(skill.power/10.0):skill.power
# This multiplier is based on the caster's parameters and the F modifiers of the skill
stats_multiplier =
user.str * skill.str_f / 100 +
user.dex * skill.dex_f / 100 +
user.agi * skill.agi_f / 100 +
user.int * skill.int_f / 100 +
user.atk * skill.atk_f / 100
# The modifier is used only if not zero
# If the modifier is zero the damage will not depend in any way on the caster's stats
attack *= stats_multiplier unless stats_multiplier == 0
# Element tagging can be used to increase the skill's power
attack *= 10 if skill.is_damage_x_10()
# This is configurable and lets you adjust the range of damages
attack *= 0.1
# mdef_f and pdef_f indicate what percentage of the skill's power can be neutralized
# with mdef and pdef
defense = [attack * skill.mdef_f / 100, self.mdef].min +
[attack * skill.pdef_f / 100, self.pdef].min
# The standard element correction
attack *= elements_correct(skill.element_set)
attack /= 100
# The final result
power = [attack - defense, 0].max
I'm gonna get rid of the distinction between skills and techniques, because it has been confusing for users and because you can easily reproduce them with the new formulas.
I'm interested in comments and ideas.