Hello! I have a skill that needs to deal heavy HP damage based on the current hp of the user before the user self destructs.
For reference, this skill works like the combination of pokemon moves Explosion and Eruption.
The problem is, I must set HP to zero and perform collapse before dealing damage. But if I do that, the HP value will be zero and do no bonus damage to enemies.
I will need to set a variable that will store the current hp before collapse. I was told that damage formula uses semi scripting language, so I figured I first would initialize the variable, set the variable, then retrieve it during the damage calculation.
Here's my code:
or
Either way, this does zero damage and does not collapse the user.
This functions sort of correctly, but deals almost no damage.
What gives? How do I make this work properly?
For reference, this skill works like the combination of pokemon moves Explosion and Eruption.
The problem is, I must set HP to zero and perform collapse before dealing damage. But if I do that, the HP value will be zero and do no bonus damage to enemies.
I will need to set a variable that will store the current hp before collapse. I was told that damage formula uses semi scripting language, so I figured I first would initialize the variable, set the variable, then retrieve it during the damage calculation.
Here's my code:
JavaScript:
let var = a.hp; a.setHp(0); a.performCollapse(); (var) + (a.mat * 2) - b.mdf * 2
or
JavaScript:
var = a.hp; a.setHp(0); a.performCollapse(); (var) + (a.mat * 2) - b.mdf * 2
Either way, this does zero damage and does not collapse the user.
JavaScript:
a.setHp(0); a.performCollapse(); a.hp + (a.mat * 2) - b.mdf * 2
This functions sort of correctly, but deals almost no damage.
What gives? How do I make this work properly?