Holy Prism (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.


Holy Prism is a spell from the World of WarCraft that has a different effect depending on who your target is. If the target is a foe, the target takes concentrated damage and healing is reflected to the user’s allied party. If the target is an ally, the ally will receive concentrated healing while damage is reflected to the user’s enemy party! Here’s how you can 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 these notetags inside of your skill’s notebox. Change the values to fit the settings of your game.

// Allows the player to pick an enemy or an ally.
<Enemy or Actor Select>

<Damage Formula>
// Check if the user and target are enemies.
if (a.isActor() !== b.isActor()) {
  // If they are, this is the amount of damage dealt.
  value = a.mat * 4;
// If they are allies...
} else {
  // This is the amount of HP healed.
  value = a.mat * 6;
}
</Damage Formula>

<Pre-Damage Eval>
// If the user and the target are enemies...
if (a.isActor() !== b.isActor()) {
  // Get half of the damage dealt.
  var hp = Math.floor(value / 2);
  // Get the alive members of the user's party.
  var members = user.friendsUnit().aliveMembers();
  // Loop through each member.
  for (var i = 0; i < members.length; ++i) {
    // Get the current member.
    var member = members[i];
    // If the member exists...
    if (member) {
      // ...then the member recovers HP.
      member.gainHp(hp);
      // Start the damage popup.
      member.startDamagePopup();
      // Clear the results.
      member.clearResult();
      // Start an animation.
      member.startAnimation(41);
    }
  }
// If the user and the target are allies...
} else {
  // Then get half of the value healed.
  var hp = Math.floor(value / 2);
  // Turn it into damage.
  value *= -1;
  // Get the user's opponent party's living members.
  var members = user.opponentsUnit().aliveMembers();
  // Loop through those members.
  for (var i = 0; i < members.length; ++i) {
    // Get the current member.
    var member = members[i];
    // If the member exists...
    if (member) {
      // Modify the damage received relative to the Holy element.
      var dmg = -hp * member.elementRate(13);
      // Make the member take damage.
      member.gainHp(dmg);
      // Start the damage popup.
      member.startDamagePopup();
      // Clear the results.
      member.clearResult();
      // Start an animation.
      member.startAnimation(97);
      // Check if the member is dead.
      if (member.isDead()) {
        // If it is, make it collapse.
        member.performCollapse();
      }
    }
  }
}
</Pre-Damage Eval>

Happy reflecting!