Buff Breaker (MV Plugin Tips & Tricks)

From Yanfly.moe Wiki
Revision as of 20:25, 8 July 2019 by Yanfly (talk | contribs) (Created page with "{{Yanfly Tips & Tricks MV |preview = <youtube>https://www.youtube.com/watch?v=0KghRQXukrs</youtube> |desc = Buff Breaker is an effect that clears the board of buffs and debu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.


Buff Breaker is an effect that clears the board of buffs and debuffs. For each debuff cleared, the unit will be healed. For each buff cleared, the unit will be dealt damage. Here’s how to create 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:

Insert the following code into your Buff Breaker skill’s notebox. Change the values to fit your game’s settings.

<Target: Everybody>

<After Eval>
// Initialize the HP value.
var hp = 0;
// Loop through all 8 parameters.
for (var i = 0; i < 8; i++) {
  // If it is a buff...
  if (target._buffs[i] > 0) {
    // Then increase the damage by a formula.
    hp -= user.mat * 2;
  }
  // If it is a debuff...
  if (target._buffs[i] < 0) {
    // Then increase the healing by a formula.
    hp += user.mdf * 2;
  }
  // Reset the buff to neutral.
  target._buffs[i] = 0;
}
// Check if the HP change is positive...
if (hp > 0) {
  // Play an animation.
  target.startAnimation(41);
// Check if the HP change is negative...
} else if (hp < 0) {
  // Play an animation.
  target.startAnimation(56);
}
// Check if the HP amount isn't 0...
if (hp !== 0) {
  // Alter the target's HP.
  target.gainHp(hp);
  // Start the damage popup for the target.
  target.startDamagePopup();
}
// Clear the target's results.
target.clearResult();
</After Eval>

Enjoy!