Tips & Tricks – Heal Jammer – 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.

Heal Jammer is an effect that blocks up to a certain amount of direct healing. In this case, 3,000 HP will be blocked. Once the blocked values are used up, Heal Jammer will then remove itself.

You can grab the copy/paste code here: 

Insert the following code into your Heal Jammer state’s notebox. Change the values in red to fit your game’s settings.

<Custom Apply Effect>
// Set the Heal Jammer amount.
target._antiHealBarrier = 3000;
// Set the state counter to display the amount.
target.setStateCounter(stateId, 3000);
</Custom Apply Effect>

<Custom Remove Effect>
// Clear the Heal Jammer amount.
target._antiHealBarrier = undefined;
// Clear the state counter amount.
target.setStateCounter(stateId, 0);
</Custom Remove Effect>

<Custom React Effect>
// Check if the action heals HP.
if (this.isHpEffect() && value < 0) {
  // Default the target's Heal Jammer value to 0.
  target._antiHealBarrier = target._antiHealBarrier || 0;
  // Make the offset capped by the Heal Jammer.
  var offset = Math.min(target._antiHealBarrier, Math.abs(value));
  // Alter the healing amount.
  value += offset;
  // Reduce the Heal Jammer amount.
  target._antiHealBarrier -= offset;
  // Update the new Heal Jammer counter.
  target.setStateCounter(stateId, target._antiHealBarrier);
  // If the Heal Jammer amount is 0 or less...
  if (target._antiHealBarrier <= 0) {
    // Then remove the state.
    target.removeState(stateId);
  }
  // Play an animation on the target.
  target.startAnimation(5);
  // Display a message stating the Heal Jammer blocked a certain amount of healing.
  var text = '<CENTER>\\c[4]\\i[' + $dataStates[stateId].iconIndex + ']' + $dataStates[stateId].name + '\\c[0] blocked \\c[4]\\i[' + this.item().iconIndex + ']' + this.item().name + '\\c[0] from healing \\c[6]' + target.name() + '\\c[0]!';
  // Set the wait time.
  var wait = 90;
  // Add the text to the BattleManager.
  BattleManager.addText(text, wait);
}
</Custom React Effect>

Enjoy!