Let's say I want a skill's damage to be 50 + (a.atk - b.def). However, if b.def is greater than a.atk, I don't want this part of the formula to reduce the 50 - the damage should just be 50. Yet obviously, if a.atk is greater than b.def, I'd like the difference to be added to the 50. Is there an easy way to achieve this?
damage formula with minimum base damage
RPG Maker VXAce Supportif a.atk - b.def <= 49; 50; else; a.atk - b.def; end
That should work for you. Alternatively, you can also say....
if a.atk - b.def < 50; 50; else; a.atk - b.def; end
Either way, it has the same effect.
That should work for you. Alternatively, you can also say....
if a.atk - b.def < 50; 50; else; a.atk - b.def; end
Either way, it has the same effect.
[50 + a.atk - b.def, 50].max
a.atk < b.def ? 50 : 50 + a.atk - b.def
minimum dmg 50, max dmg 50 + result
edit: just saw ace, not sure if uses same "? :" formula as mv
minimum dmg 50, max dmg 50 + result
edit: just saw ace, not sure if uses same "? :" formula as mv
this.
although, I would flip it
a.atk > b.def ? 50 + a.atk - b.def : 50
because it seems like a.atk < b.def is like a particular less-occurring case of atk vs def.
since a.atk > b.def would seem to be the standard, return that from true rather than false.
Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-with-minimum-base-damage.95231/