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


In the World of WarCraft, Cauterize is an effect that will prevent the user from a fatal blow for some time by recovering a percentage of the user’s health and then burning the user over a small period of time. This effect has a cooldown and will not occur again after some turns. Here’s how to recreate it 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.

Instructions

Follow video instructions.

You can grab the copy/paste code here:

Insert the following code into the Cauterize Passive state. Change the values to reflect your game.
<Custom Battle Effect>
// Get the cauterize reraise state ID.
var reraise = 240;
// Add the reraise effect to the user.
user.addState(reraise);
// Set the cooldown to 0.
user._cauterizeCooldown = 0;
</Custom Battle Effect>

<Custom Regenerate Effect>
// Default the cooldown to 0.
user._cauterizeCooldown = user._cauterizeCooldown || 0;
// Check if the cooldown is above 0.
if (user._cauterizeCooldown > 0) {
  // If it is, decrease it by 1.
  user._cauterizeCooldown -= 1;
  // If the cooldown has reached 0...
  if (user._cauterizeCooldown <= 0) {
    // Then get the reraise state.
    var reraise = 240;
    // And apply it to the user.
    user.addState(reraise);
  }
}
</Custom Regenerate Effect>
Insert the following code into the Cauterize Reraise state. Change the values to reflect your game.
<Category: Bypass Death Removal>

<Custom Deselect Effect>
// Check if the target is at 0 HP or is dead.
if (target.hp <= 0 || target.isDead()) {
  // Start the reraise animation.
  target.startAnimation(49);
  // The amount of HP% to recover for the target.
  var rate = 0.35;
  // Calculate the amount to heal.
  var heal = Math.floor(target.mhp * rate);
  // Remove reraise from the target.
  target.removeState(stateId);
  // Heal the target.
  target.gainHp(heal);
  // Display a damage popup.
  target.startDamagePopup();
  // Clear the results.
  target.clearResult();
  // Get the burning state's ID.
  var burningState = 241;
  // Add the burning state to the target.
  target.addState(burningState);
  // Set the reraise cooldown to 10 turns.
  target._cauterizeCooldown = 10;
}
</Custom Deselect Effect>
Insert the following code into the Cauterize Burning state. Change the values to reflect your game.
<Custom Regenerate Effect>
// Play an animation on the user whenever burning effect occurs.
user.startAnimation(13);
</Custom Regenerate Effect>

Enjoy!