Spirit Shell (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.


The Spirit Shell ability from the World of WarCraft allows a Priest to convert his/her heals into barriers while the Spirit Shell state is active! Now, you can do the same with 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.

Instructions

Follow video instructions.

You can grab the copy/paste version of the code here:

Full HP -> Barrier Conversion
<Custom Confirm Effect>
// Check to see if the used action affects HP, is a skill, and heals.
if (this.isHpEffect() && this.isSkill() && value < 0) {
  // Set the number of turns for the barrier.
  var turns = 3;
  // The percentage of points converted from the heal to barrier points.
  var rate = 1.00;
  // Create the number of barrier points granted.
  var barrier = Math.floor(value * rate * -1);
  // Target gains the barrier points for the forementioned turn count.
  target.gainBarrier(barrier, turns);
  // Reduce the barrier points from the healed amount.
  value += barrier;
}
</Custom Confirm Effect>

<Custom Establish Effect>
// Get the target's results.
var result = target.result();
// Check if the altered HP result is 0.
if (result.hpDamage === 0) {
  // Set the result's HP affected flag to false.
  result.hpAffected = false;
}
</Custom Establish Effect>
40% HP -> Barrier Conversion
<Custom Confirm Effect>
// Check to see if the used action affects HP, is a skill, and heals.
if (this.isHpEffect() && this.isSkill() && value < 0) {
  // Set the number of turns for the barrier.
  var turns = 3;
  // The percentage of points converted from the heal to barrier points.
  var rate = 0.40;
  // Create the number of barrier points granted.
  var barrier = Math.floor(value * rate * -1);
  // Target gains the barrier points for the forementioned turn count.
  target.gainBarrier(barrier, turns);
  // Reduce the barrier points from the healed amount.
  value += barrier;
}
</Custom Confirm Effect>

<Custom Establish Effect>
// Get the target's results.
var result = target.result();
// Check if the altered HP result is 0.
if (result.hpDamage === 0) {
  // Set the result's HP affected flag to false.
  result.hpAffected = false;
}
</Custom Establish Effect>

Enjoy!