Seraphic Planar Breastplate (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.


This video, we’ll show an item effect from Everquest Online Adventures that will be recreated in RPG Maker MV. When the user is dealt damage, the armor will respond by dealing magic damage to the foe that physically attacked the user. After the magic damage is dealt, the user is healed for half the amount.

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 in the passive state that is tied to the armor. Change the values to reflect the settings of your game.

<Custom Respond Effect>
// Check if the target is alive and the HP value is above 0.
if (target.isAlive() && target.hp > 0) {
  // Check if the user received physical HP damage from an opponent
  if (this.isHpEffect() && this.isPhysical() && user.isActor() !== target.isActor()) {
    // Calculate the damage dealt.
    var dmg = Math.ceil(target.mat * 0.50);
    // Make the attacker lose that HP.
    user.gainHp(-dmg);
    // Start the damage popup.
    user.startDamagePopup();
    // If the attacker is dead...
    if (user.isDead()) {
      // Make the attacker collapse.
      user.performCollapse();
    }
    // Clear the attacker's results.
    user.clearResult();
    // Make a copy of the wearer's results.
    var result = JsonEx.makeDeepCopy(target._result);
    // Calculate the healing.
    var heal = Math.ceil(dmg * 0.50);
    // Make the wearer gain the heal amount.
    target.gainHp(heal);
    // Start the damage popup.
    target.startDamagePopup();
    // Clear the wearer's results.
    target.clearResult();
    // Return the wearer's results to what it was before.
    target._result = result;
  }
}
</Custom Respond Effect>

Happy RPG Making!