Elemental Exposure (MV Plugin Tips & Tricks)

From Yanfly.moe Wiki
Revision as of 15:47, 8 July 2019 by Yanfly (talk | contribs) (Created page with "{{Yanfly Tips & Tricks MV |preview = <youtube>https://www.youtube.com/watch?v=VVfD7qBJljI</youtube> |desc = The Wizard, from Diablo 3, has an ability that causes whatever ta...")
(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.


The Wizard, from Diablo 3, has an ability that causes whatever target it deals elemental damage to, to gain an exposed weakness taking more damage from anyone (not just elemental damage). This effect can stack multiple times. Here’s how you 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.

Get the copy/paste code here:

Place this into your Elemental Exposure state. Change the values to fit your game.
<Custom Establish Effect>
// Check if this action damages HP.
if (this.isHpEffect() && value > 0) {
  // Get the elements used by the action.
  var actionElements = this.getItemElements();
  // These are the target elements to match.
  var matchingElements = [7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
  // Set the initial condition value to being unmet.
  var condition = false;
  // Loop through each of the action's elements.
  for (var i = 0; i < actionElements.length; ++i) {
    // If the target elements match the currently looped element...
    if (matchingElements.contains(actionElements[i])) {
      // Then set the condition to being met.
      condition = true;
      // Break the loop.
      break;
    }
  }
  // If the condition is met...
  if (condition) {
    // Then get the Exposed Weakness state ID.
    var exposedState = 82;
    // Add that state to the target.
    target.addState(exposedState);
  }
}
</Custom Establish Effect>
Place this into your Exposed Weakness state. Change the values to fit your game.
<Custom Apply Effect>
// Default the number of Exposed Weakness stacks on the target to 0.
target._exposedWeakness = target._exposedWeakness || 0;
// Increase the target's Exposed Weakness stacks by cap it at 4.
target._exposedWeakness = Math.min(4, target._exposedWeakness + 1);
// Get the multiplier used by the effect.
var counterText = '+' + (target._exposedWeakness * 5) + '%';
// Apply that to the counter displayed on the target.
target.setStateCounter(stateId, counterText);
</Custom Apply Effect>

<Custom Remove Effect>
// Upon removal, remove the number of Exposed Weakness stacks.
target._exposedWeakness = undefined;
// Remove the state counter associated with Exposed Weakness.
target.removeStateCounter(stateId);
</Custom Remove Effect>

<Custom React Effect>
// Check if this is an HP damage effect.
if (this.isHpEffect() && value > 0) {
  // Default the number of Exposed Weakness stacks on the target to 0.
  target._exposedWeakness = target._exposedWeakness || 0;
  // Start the initial multiplier with 100%.
  var multiplier = 1;
  // Increase the multiplier by 5% per weakness.
  multiplier += target._exposedWeakness * 0.05;
  // Apply the multiplier to the dealt damage.
  value *= multiplier;
  // Round the damage upward.
  value = Math.ceil(value);
}
</Custom React Effect>

Happy exposing!