Is there a way to have a damage formula calculate the element resistance before subtracting the defense?
I tried getting it to work 2 different ways.
Attempt 1: Edit Game_Battler and set normal attack's damage formula to just a.atk
def make_damage_value(user, item)
value = item.damage.eval(user, self, $game_variables) #Returns a.atk for normal attack
value = apply_critical(value) if @result.critical
value = apply_variance(value, item.damage.variance)
value *= item_element_rate(user, item)
value -= self.def if item.physical? #No effect
value -= self.mdf if item.magical? #No effect
value *= pdr if item.physical?
value *= mdr if item.magical?
value *= rec if item.damage.recover?
value = apply_guard(value)
@result.make_damage(value.to_i, item)
end
Results in unmitigated attack damage no matter what for a normal physical attack
Attempt 2: I also tried this as the damage formula (unmodified Game_Battler)
(a.atk * b.elements_max_rate(a.element_set)) - b.def
but that returns NULL as the [Pierce] damage for a.atk = 73, b.def = 79, when b's elemental vulnerability for [Pierce] is 125%. (Damage I want is 12.25 from 73*1.25-79)