Adapting Armor (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 Adapting Armor is a neat piece of armor. When the user takes damage from an elemental attack, the user will gain a temporary buff that grants a small resistance to the elemental damage received. Watch the video to observe how to make the Adapting Armor 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.

Get the copy/paste code here:

Place this inside of a state that will be linked to a battler through a passive state. Change the values to match your game.

<Custom Respond Effect>
// Check if the target received HP damage.
if (target.result().hpDamage > 0) {
  // Get all of the elements used for this attack.
  var elements = this.getItemElements();
  // Loop through all the elements.
  while (elements.length > 0) {
    // Get the current element.
    var element = elements.shift();
    // Set the default state.
    var state = 0;
    // If the current element ID is 7...
    if (element === 7) {
      // ...then apply state 121.
      state = 121;
    // If the current element ID is 8...
    } else if (element === 8) {
      // ...then apply state 122.
      state = 122;
    // If the current element ID is 9...
    } else if (element === 9) {
      // ...then apply state 123.
      state = 123;
    // If the current element ID is 10...
    } else if (element === 10) {
      // ...then apply state 124.
      state = 124;
    // If the current element ID is 11...
    } else if (element === 11) {
      // ...then apply state 125.
      state = 125;
    // If the current element ID is 12...
    } else if (element === 12) {
      // ...then apply state 126.
      state = 126;
    // If the current element ID is 13...
    } else if (element === 13) {
      // ...then apply state 127.
      state = 127;
    // If the current element ID is 14...
    } else if (element === 14) {
      // ...then apply state 128.
      state = 128;
    // If the current element ID is 15...
    } else if (element === 15) {
      // ...then apply state 129.
      state = 129;
    // If the current element ID is 16...
    } else if (element === 16) {
      // ...then apply state 130.
      state = 130;
    }
    // If the state is a positive number...
    if (state) {
      // ...then add the state to the target.
      target.addState(state);
      // And play an animation on the target.
      target.startAnimation(53);
    }
  }
}
</Custom Respond Effect>

Happy adapting!