Main Menu
  • Welcome to The RPG Maker Resource Kit.

[VXA] A.Attack*Element Resistance - B.Def

Started by noian, November 03, 2012, 11:14:14 PM

0 Members and 1 Guest are viewing this topic.

noian

[spoiler]
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)
[/spoiler]
Edit: Nvm, I figured out why the change to Game_Battler wasn't having an impact, I forgot I had LunaticDamage script which overrides it.
>Current Project: Time Killer 2<
Description: Random, plotless project designed to kill spare time. No storyline, just a building to explore.

Status: Fascinated by how appalling the default database is balance wise.

Mark20

Lol, I like your sig... Not to go off topic. 8)