Tips & Tricks – Critical Protect – RPG Maker MV

Yanfly Engine Plugins is a plugin library made for RPG Maker MV, a wonderful piece of software to help you make that role playing game of your dreams. You can find out more about RPG Maker MV here.

In some games, certain buffs occur automatically once the user reaches critical HP levels. This Tips & Tricks video will show you how to apply a DEF buff on your battlers when their HP drops to under 25%!

You can get the copy/paste code here: 

Place this inside of your state’s notebox. Change the values in red to fit your game:

<Custom Battle Effect>
// Reset Critical Protect flag each battle.
user._criticalProtect = false;
</Custom Battle Effect>

<Custom Victory Effect>
// Reset Critical Protect flag each battle.
user._criticalProtect = false;
</Custom Victory Effect>

<Custom Escape Effect>
// Reset Critical Protect flag each battle.
user._criticalProtect = false;
</Custom Escape Effect>

<Custom Defeat Effect>
// Reset Critical Protect flag each battle.
user._criticalProtect = false;
</Custom Defeat Effect>

<Custom Respond Effect>
// This is the HP Rate the target has to be under to activate Critical Protect.
var crisis = 0.25;
// Check if the player is in battle, the target is alive, and the HP rate is under the right amount.
if ($gameParty.inBattle() && target.isAlive() && target.hpRate() <= crisis && !target._criticalProtect) {
  // Set the critical protect flag to true.
  target._criticalProtect = true;
  // The number of turns the buff will last.
  var turns = 5;
  // Adds DEF (ID: 3) buff to target.
  target.addBuff(3, turns);
  // Play an animation to indicate it activated.
  target.startAnimation(53);
}
</Custom Respond Effect>

Happy protecting!

Please wait while you are redirected...or Click Here if you do not want to wait.