Bubble Wrap (MV Plugin Tips & Tricks)

From Yanfly.moe Wiki
Revision as of 17:04, 9 July 2019 by Yanfly (talk | contribs) (Created page with "{{Yanfly Tips & Tricks MV |preview = <youtube>https://www.youtube.com/watch?v=2uXnv-WuGKY</youtube> |desc = In MMBN, the Bubble Wrap effect will block damage (except for Ele...")
(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.


In MMBN, the Bubble Wrap effect will block damage (except for Electric), remove itself, and then come back a few turns later, making it one of the better ways to mitigate damage as a whole! Here’s how we 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:

Insert the following Lunatic Mode code into the Bubble Wrap passive state’s notebox. Change the values to reflect your game’s settings.
<Custom Battle Effect>
// Get the state ID for the bubble wrap effect state
var bubbleWrapId = 295;
// Add that state to the user
user.addState(bubbleWrapId);
// Set the cooldown to 0
user._bubbleWrapCooldown = 0;
</Custom Battle Effect>

<Custom Regenerate Effect>
// Default the bubble wrap cooldown to 0
user._bubbleWrapCooldown = user._bubbleWrapCooldown || 0;
// Check if the cooldown is above 0
if (user._bubbleWrapCooldown > 0) {
  // Decrease the cooldown by 1
  user._bubbleWrapCooldown -= 1;
  // Check if the cooldown has reached 0 or less
  if (user._bubbleWrapCooldown <= 0) {
    // Get the state ID for the bubble wrap effect state
    var bubbleWrapId = 295;
    // Play an animation on the user
    user.startAnimation(82);
    // Add the state to the user
    user.addState(bubbleWrapId);
  }
}
</Custom Regenerate Effect>
Insert the following Lunatic Mode code into the Bubble Wrap effect state’s notebox. Change the values to reflect your game’s settings!
 <Custom React Effect>
// Check if HP damage is dealt
if (this.isHpEffect() && value > 0) {
  // Get the elements used for the effect
  var elements = this.getItemElements();
  // Get the element ID for the lightning element
  var lightningElementId = 9;
  // Check if the lightning element isn't involved
  if (!elements.contains(lightningElementId)) {
    // If isn't involved, set the damage to 0
    value = 0;
  }
  // Play an animation on the target
  target.startAnimation(4);
  // Remove the bubble wrap state from the target
  target.removeState(stateId);
}
</Custom React Effect>

<Custom Remove Effect>
// Set the bubble wrap cooldown to 3 turns
user._bubbleWrapCooldown = 3;
</Custom Remove Effect>

Happy wrapping!