Tips & Tricks – Absorb Ailments – RPG Maker MV

Yanfly Engine Plugins is a plugin library made for RPG Maker MV, a wonderful piece of software to help you make that role playing game of your dreams. You can find out more about RPG Maker MV here

Support Yanfly on Patreon

Today, we have an effect that can be used to remove all status effects of a certain type and place it onto the user instead, then healing each ally for each ailment removed. This effect is immensely useful for supporting characters.

You can grab the copy/paste code here: Insert this into your Absorb Ailments damage formula box:

this._absorbHeal || 0

Insert the following code into the Absorb Ailments skill’s notebox. Alter the values in red to fit your game’s settings.

<Before Eval>
// Check if the absorption hasn't begun yet.
if (!this._absorbedAllStates) {
  // Enable the absorption flag.
  this._absorbedAllStates = true;
  // Initialize the amount to be healed.
  this._absorbHeal = 0;
  // This is how much healing each absorbed state will do.
  var heal = user.mdf;
  // Create a list of all the states that can be absorbed.
  var absorbedStates = [];
  // Put all the states that will get absorbed here.
  absorbedStates.push(21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
  absorbedStates.push(31, 32, 33, 34, 35, 36, 37, 38, 39, 40);
  // Get the group of alive allies
  var group = user.friendsUnit().aliveMembers();
  // Loop through each member in the group
  for (var i = 0; i < group.length; ++i) {
    // Get the currently looped member
    var member = group[i];
    // Check if the member exists and isn't the user
    if (member && member !== user) {
      // Loop through each of the absorbable states
      for (var j = 0; j < absorbedStates.length; ++j) {
        // Get the currently looped state's ID
        var id = absorbedStates[j]
        // Check if the state exists and if the member is affected by it
        if ($dataStates[id] && member.isStateAffected(id)) {
          // Get the turns on the state
          var turns = member.stateTurns(id);
          // Remove the state from the member
          member.removeState(id);
          // Add the state to the user
          user.addState(id);
          // Set the turns of it to the user
          user.setStateTurns(id, turns);
          // Increase the amount healed
          this._absorbHeal += heal;
        }
      }
    }
  }
}
</Before Eval>

Enjoy!

Please wait while you are redirected...or Click Here if you do not want to wait.