Fire Aura (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 Fire Aura, from Mega Man Battle Network, nullifies damage until broken. It will block all damage under a certain threshhold until the damage overcomes the aura or if a certain element is used to pierce the aura. Here’s how to make 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.

Instructions

Follow video instructions.

You can grab the copy/paste code here:

Insert the following notetags into your Fire Aura state’s notebox. Change the values to reflect the settings of your game.
<Custom Apply Effect>
// Calculate the threshhold for the effect
var threshhold = Math.ceil(target.mhp * 0.10);
// Set the state counter to display the threshhold
target.setStateCounter(stateId, threshhold);
// Create the text stating the effect's threshhold
var text = '<CENTER>\\c[4]' + state.name + '\\c[0] blocks damage under \\c[4]' + threshhold + '\\c[0]!';
// Set the wait time for the message
var wait = 60;
// Display the text.
BattleManager.addText(text, wait);
// Select which elements will pierce the barrier
var pierceElements = [10, 12];
// Create an empty slot for the element text
var elementNames = '';
// Loop through the text
while (pierceElements.length > 0) {
  // Get the currently looped element
  var elementId = pierceElements.shift();
  // Add the name to the list
  elementNames += '\\c[4]' + $dataSystem.elements[elementId] + '\\c[0]';
  // Check if the length of the elements remaining exceeds 0
  if (pierceElements.length > 0) {
    // Add a comma
    elementNames += ', ';
  }
};
// Create a text explaining what elements can pierce the effect
text = '<CENTER>Deal more than \\c[4]' + threshhold + '\\c[0] damage or ' + elementNames + ' damage to break barrier!'
// Display the text
BattleManager.addText(text, 0);
</Custom Apply Effect>

<Custom Regenerate Effect>
// Calculate the threshhold
var threshhold = Math.ceil(target.mhp * 0.10);
// Display the threshhold on the state
target.setStateCounter(stateId, threshhold);
</Custom Regenerate Effect>

<Custom React Effect>
// Check if the action deals HP damage
if (this.isHpEffect() && value > 0) {
  // Get the elements that can pierce the effect
  var pierceElements = [10, 12];
  // Calculate the threshhold
  var threshhold = Math.ceil(target.mhp * 0.10);
  // Get the current elements of the action
  var elements = this.getItemElements();
  // Check if the effect was pierced by damage alone
  var pierced = value > threshhold;
  // Create an empty text for the elements.
  var elementNames = '';
  // If the effect wasn't pierced
  if (!pierced) {
    // Create a loop through the elements
    while (pierceElements.length > 0) {
      // Get the currently looped element
      var elementId = pierceElements.shift();
      // Check if the action elements contain a piercing element
      if (elements.contains(elementId)) {
        // If it does, set it to true
        pierced = true;
      }
      // Add the element name
      elementNames += '\\c[4]' + $dataSystem.elements[elementId] + '\\c[0]';
      // If the looped elements still has something left
      if (pierceElements.length > 0) {
        // ... Then add a comma
        elementNames += ', ';
      }
    }
  }
  // Create a text to be displayed
  var text = '<CENTER>\\c[4]' + state.name + '\\c[0]';
  // Set the wait time
  var wait = 60;
  // Check if the effect was pierced
  if (pierced) {
    // If it is, remove the state
    target.removeState(stateId);
    // And state that it was pierced
    text += ' has been pierced!';
    // Display the text
    BattleManager.addText(text, wait);
  } else {
    // If it wasn't, then set the damage to 0
    value = 0;
    // Start a barrier animation
    target.startAnimation(53);
    // Display the text stating how much damage it blocks
    text += ' blocks damage under \\c[4]' + threshhold + '\\c[0]!';
    // Add the text
    BattleManager.addText(text, wait);
    // Create a new line stating how to pierce the effect
    text = '<CENTER>Deal more than \\c[4]' + threshhold + '\\c[0] damage or ' + elementNames + ' damage to break barrier!'
    // Ad the text
    BattleManager.addText(text, 0);
  }
}
</Custom React Effect>

Enjoy!