Cyclone (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.


Cyclone is a spell from the World of WarCraft that stuns an opponent. However, when repeatedly used on the same opponent, the duration of the stun lowers each time. Furthermore, only one Cyclone can be active at a time per team. Here’s how to 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.

Instructions

Follow video instructions.

Find the copy/paste version of the code here:

Place this in the notebox for the Cyclone Bridge state. Change the values to fit your game’s settings
<Custom Apply Effect>
// Set the target's default cyclone times to 0.
target._cycloneTimes = target._cycloneTimes || 0;
// Get the number of turns cyclone will last.
var turns = Math.max(5 - target._cycloneTimes * 2, 1);
// Add the real Cyclone state.
target.addState(134);
// Set the number of turns on the Cyclone state.
target.setStateTurns(134, turns);
// Raise the number of times the target has been affected by Cyclone.
target._cycloneTimes += 1;
</Custom Apply Effect>

<Custom Remove Effect>
// Clear the number of times the target has been affected by Cyclone.
target._cycloneTimes = undefined;
</Custom Remove Effect>
Place this in the notebox for the Cyclone skill’s notebox. Change the values to fit your game’s settings.
<Before Eval>
// Get all of the viable battle members.
var members = BattleManager.allBattleMembers();
// Loop through each member.
for (var i = 0; i < members.length; ++i) {
  // Get current member.
  var member = members[i];
  // If the member exists and is affected by Cyclone...
  if (member && member.isStateAffected(134)) {
    // ...then remove Cyclone.
    member.removeState(134);
  }
}
</Before Eval>

Happy storming!