Hello,
I'm trying to use Yanfly's Berserker example from his tips and tricks video
However I want to make it so the player gains damage based on how low their MP is. I am using Mana Shields, so each hit to the player will reduce MP. I tried using the code below and it doesn't work. Would anyone be able to help me find the correct solution?
I'm trying to use Yanfly's Berserker example from his tips and tricks video
JavaScript:
<Custom Confirm Effect>
// Check if the damage dealt deals physical HP damage.
if (this.isPhysical() && this.isHpEffect() && value > 0) {
// Base the bonus damage off of the user's HP rate.
value *= 2.00 - user.hpRate();
// Add bonus damage equal to the user's missing HP.
value += (user.mhp - user.hp) * 0.50;
// Round up the calculations.
value = Math.ceil(value);
}
</Custom Confirm Effect>
However I want to make it so the player gains damage based on how low their MP is. I am using Mana Shields, so each hit to the player will reduce MP. I tried using the code below and it doesn't work. Would anyone be able to help me find the correct solution?
JavaScript:
<Custom Confirm Effect>
// Check if the damage dealt is physical and if MP lost is more than 0.
if (this.isPhysical() && this.isMpEffect() && value > 0) {
// Base the bonus damage off of the user's MP rate.
value *= 2.00 - user.mpRate();
// Add bonus damage equal to the user's missing MP.
value += (user.mmp - user.mp) * 0.50;
// Round up the calculations.
value = Math.ceil(value);
}
</Custom Confirm Effect>