Stormflurry (MV Plugin Tips & Tricks)

From Yanfly.moe Wiki
Revision as of 18:20, 9 July 2019 by Yanfly (talk | contribs) (Created page with "{{Yanfly Tips & Tricks MV |preview = <youtube>https://www.youtube.com/watch?v=m0FxtyQHmtw</youtube> |desc = Stormflurry is an effect from the World of Warcraft, which when a...")
(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.


Stormflurry is an effect from the World of Warcraft, which when applied to the user, will give skills a small chance to deal additional damage. And then, that additional damage has a small chance to deal additional damage! Yep, you read that right! Damage that deals damage. Here’s how we can recreate that 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 your Stormflurry state’s notebox. Change the values to reflect your game’s settings.
<Custom Establish Effect>
// Create empty pools for skills and skipp types.
var skills = [];
var skillTypes = [];
// Insert the skills this passive can be used with.
skills.push(681, 689, 697, 705, 713, 719);
// Insert the skill types this passive can be used with.
skillTypes.push(18);
// Check if the action is a skill, the skill pool contain the skill or if the skill type pool contains the skill's type
if (this.isSkill() && (skills.contains(this.item().id)) || skillTypes.contains(this.item().stypeId)) {
  // Check if the target exists and has suffered HP damage
  if (target && target.result() && target.result().hpDamage > 0) {
    // Make a copy of the target's original action results
    var originalResult = JsonEx.makeDeepCopy(target._result);
    // Clear those results
    target.clearResult();
    // Calculate the extra damage
    var extraDmg = Math.ceil(0.40 * originalResult.hpDamage);
    // Calculate the success rate to deal extra damage
    var successRate = 0.20;
    // Make the number of times struck
    var struck = 0;
    // Set the maximum number of times the action can be struck
    var maxHits = 5;
    // Make a loop
    for (;;) {
      // Check if the target is alive and the action has passed the success rate
      if (target.isAlive() && Math.random() < successRate) {
        // Increase the number of times struck by 1
        struck += 1;
        // Make the target receive damage
        target.gainHp(-extraDmg);
        // Show the damage popup
        target.startDamagePopup();
        // Check if the target is dead
        if (target.isDead()) {
          // Make the target collapse
          target.performCollapse();
        }
        // Clear the target's results
        target.clearResult();
        // Check if the number of times struck has hit the maximum
        if (struck >= maxHits) {
          // If it did, break the loop
          break;
        }
      // If the extra damage success rate fails
      } else {
        // Then break the loop
        break;
      }
    }
    // If the number of times struck is greater than 0
    if (struck > 0) {
      // Then play an animation on the target
      target.startAnimation(5);
    }
    // Revert the target's results back to its original results
    target._result = originalResult;
  }
}
</Custom Establish Effect>

Enjoy!