Curada (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.


Curada is a healing skill from Final Fantasy Record Keeper. It does the standard healing towards the target but the gives an effect where it will heal the next 2000 damage missing from the target whenever it is missing HP, allowing for better sustain.

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:

Insert the following code into your Stock Heal state’s notebox. Change the value to reflect your game’s settings.
<Custom Apply Effect>
// Default the user's stock heal value to 0.
user._stockHeal = user._stockHeal || 0;
// Add 2000 points to the stock heal amount.
user._stockHeal += 2000;
// Set the state counter to display the amount of HP stock heal will recover
user.setStateCounter(stateId, user._stockHeal);
</Custom Apply Effect>

<Custom Remove Effect>
// Clear the stock heal value
user._stockHeal = undefined;
// Set the state counter for the stock heal to 0
user.setStateCounter(stateId, 0);
</Custom Remove Effect>

<Custom Regenerate Effect>
// Default the user's stock heal value to 0.
user._stockHeal = user._stockHeal || 0;
// Check if the user is alive and if the user's HP isn't full
if (user.isAlive() && user.hpRate() < 1) {
  // Calculate the missing HP
  var missingHp = Math.min(user.mhp - user.hp, user._stockHeal);
  // Decrease the stock heal amount
  user._stockHeal -= missingHp;
  // Update the stock heal counter
  user.setStateCounter(stateId, user._stockHeal);
  // Gain the missing HP
  user.gainHp(missingHp);
  // Start a damage popup
  user.startDamagePopup();
  // Clear the results
  user.clearResult();
}
// Check if the stock heal is depleted
if (user._stockHeal <= 0) {
  // If it is, then remove the state
  user.removeState(stateId);
}
</Custom Regenerate Effect>

<Custom Deselect Effect>
// Default the target's stock heal to 0
target._stockHeal = target._stockHeal || 0;
// Check if the target is alive and if the target is missing any HP
if (target.isAlive() && target.hpRate() < 1) {
  // Calculate the missing HP
  var missingHp = Math.min(target.mhp - target.hp, target._stockHeal);
  // Decrease the stock heal value
  target._stockHeal -= missingHp;
  // Update the stock heal counter
  target.setStateCounter(stateId, target._stockHeal);
  // Recover missing HP for the target
  target.gainHp(missingHp);
  // Start a damage popup
  target.startDamagePopup();
  // Clear the target's results
  target.clearResult();
}
// Check if stock heal has run out
if (target._stockHeal <= 0) {
  // If it has, remove the stock heal state
  target.removeState(stateId);
}
</Custom Deselect Effect>

Enjoy!