Echo of Light (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.


Echo of Light is a passive skill from the World of WarCraft. When directly healing an ally, the target will heal an extra 10% over a brief period of time (or in RPG Maker MV’s case, a few extra turns). Here’s how to recreate this effect in RPG Maker MV!

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.

Warning for RPG Maker MZ Users

Warning.jpg

If you are using RPG Maker MZ and VisuStella MZ, the following code may or MAY NOT work as this Tips & Tricks is made for RPG Maker MV. VisuStella MZ is NOT responsible if this Tips & Trick does not work because the code base for RPG Maker MV and RPG Maker MZ are different and the code base between Yanfly Engine Plugins and VisuStella MZ is even more drastically different.

Instructions

Follow video instructions.

You can grab the copy/paste code here:

Place the following code in the Echo of Light Passive state. Change the values to fit your game’s settings.
<Custom Establish Effect>
// Check if the action deals HP healing and the target is alive.
if (this.isHpEffect() && target.result().hpDamage < 0 && target.isAlive()) {
  // Add the Echo of Healing state.
  target.addState(164);
  // Calculate 20% of the amount healed.
  var healing = Math.abs(Math.ceil(target.result().hpDamage * 0.20));
  // Default the echo healing total to 0.
  target._echoHealing = target._echoHealing || 0;
  // Add the healing amount to the echo healing total.
  target._echoHealing += healing;
}
</Custom Establish Effect>
Place the following code in the Echo Healing state. Change the values to fit your game’s settings.
<Custom Regenerate Effect>
// Default echo healing to 0.
user._echoHealing = user._echoHealing || 0;
// Check if the user is alive and the echo healing value is greater than 0.
if (user.isAlive() && user._echoHealing > 0) {
  // Get the number of turns left for the state.
  var turns = Math.max(1, user.stateTurns(stateId));
  // Calculate the amount of healing to be done.
  var dmg = Math.ceil(user._echoHealing / turns);
  // Decrease the total echo healing amount.
  user._echoHealing -= dmg;
  // Have the user gain HP.
  user.gainHp(dmg);
  // Show an animation.
  user.startAnimation(45);
  // Start the damage popup.
  user.startDamagePopup();
  // Clear the result.
  user.clearResult();
  // Check if the user is dead.
  if (user.isDead()) {
    // Perform a collapse.
    user.performCollapse();
  }
}
</Custom Regenerate Effect>

<Custom Remove Effect>
// Reset the echo healing amount.
user._echoHealing = 0;
</Custom Remove Effect>

Enjoy!