[RM MV] NEED A TWEAK FOR YANFLY TIP AND TRICK : SECOND CHANCE

Posts

Pages: 1
Hi,

I would like a tweak to Yanfly tip a trick : second chance.
I would like the code check if the target is under 30% HP, it will heal him 10% of his HP.

I understand where to change the part but I don't know the code to calculate that in %.

<Custom React Effect>
// Check to see if the party is in battle.
if ($gameParty.inBattle()) {
// Sets the flag if the target has more than 1 HP at the time of death.
target._secondChance = target.hp > 1;
}
</Custom React Effect>

<Custom Respond Effect>
// Check to see if the party is in battle, has the Second Chance flag, and if the target is dead with 0 HP.
if ($gameParty.inBattle() && target._secondChance && target.hp <= 0) {
// Play the revival animation.
target.startAnimation(49);
// Set the target's HP to 1.
target.setHp(1);
}
</Custom Respond Effect>
Topic can be closed.
I was able to solve the problem.
Pages: 1