Heal Jammer (MV Plugin Tips & Tricks)

From Yanfly.moe Wiki
Jump to navigation Jump to search

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.


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.

Required Plugins

The following plugin(s) is required to create this Tips & Tricks effect:

For help on how to install plugins, click here.

For help on how to update plugins, click here.

About

This is a Tips & Tricks effect created for RPG Maker MV. Tips & Tricks are not to be confused with plugins. Instead, they are usually customized code created for the sake of producing unique features/effects that do not require an entire plugin to do.

Yanfly Engine Plugins

This Tips & Tricks effect is made possible due to the Yanfly Engine Plugins library.

Click here if you want to help support Team Yanfly on Patreon.

Instructions

Follow video instructions.

You can grab the copy/paste code here:

Insert the following code into your Heal Jammer state’s notebox. Change the values 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!