RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VXA] A.Attack*Element Resistance - B.Def

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 89
Spoiler for:
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
Code: [Select]
  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)
Code: [Select]
(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)
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.
« Last Edit: November 04, 2012, 12:02:11 AM by noian »
>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.

***
© 2012 chapman productions inc
Rep:
Level 55
=O
Lol, I like your sig... Not to go off topic. 8)