Hi, I'm trying to make skill with damage formula similar to what Auron's Masamune has in FFX. So that at full HP actor deals only half damage, and then something like full damage at 50% of health and double damage when HP is low. Or something pretty much like that. Can anyone offer help with this one?
Damage Formula
RPG Maker VXAce SupportSo you want 50% damage at 100% HP, 100% damage at 50% HP, and 200% damage at "low" HP (for the sake of argument, we'll define low as 10%)
Do you want these to be the absolute percentages in those ranges (so 50% would persist from 100% HP to 51% HP) or do you want it to scale?
Do you want these to be the absolute percentages in those ranges (so 50% would persist from 100% HP to 51% HP) or do you want it to scale?
d = damage_formula; if a.hp <= a.mhp; d / 2; elsif a.hp <= a.mhp / 2; d; elsif a.hp <= a.mhp / 4; d * 2; end^That should do it, but it may not fit in the formula box.
That won't work Hollow; any value of HP is either going to be less than or equal to max HP, so it'll only ever return d / 2.
Ah, that's true. Sorry, the order should be switched, then:
Code:
d = damage_formula; if a.hp <= a.mhp / 4; d * 2; elsif a.hp <= a.mhp / 2; d; elsif a.hp <= a.mhp; d / 2; end
If the OP is happy to go for a smooth progression, rather than 2 distinct jumps in damage, I think this would work. This scales it up from whatever the damage formula produces at full HP, to something that gives a thumping attack at low HP. The damage formula would have to be calculated for what it would produce at the midway point to achieve what the OP has asked for, as this formula gives a 1% increase in attack for every 1% reduction in HP (I think).
[SIZE=10.5pt]damage_formula + ((damage_formula) * (a.mhp - a.hp)/a.mhp)[/SIZE]
[SIZE=10.5pt]damage_formula + ((damage_formula) * (a.mhp - a.hp)/a.mhp)[/SIZE]
I tried that Hallow's formula and it works perfectly! Thanks to everyone who took up the challenge.
Original thread: https://forums.rpgmakerweb.com/threads/damage-formula.40861/