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


In Pokémon, paralysis is a common status effect. However, unlike what paralysis does in RPG Maker MV, the Pokémon version gives the battler an attempt to complete an attack with a 25% chance of failing. Here’s how you can recreate such an 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.

Place this inside of your Paralyze status effect’s notebox. Change the values to fit your game.

// Disables instant skills from paralyze as to not abuse the mechanic.
<Cancel Instant Skill: 1 to 2000>
<Cancel Instant Item: 1 to 2000>

<Custom Action Start Effect>
// Set the paralyze success rate.
var paralyzeRate = 0.25;
// Make a random number check to see if paralyze passes...
if (Math.random() < paralyzeRate) {
  // If it does, play the paralyze animation on the target.
  user.startAnimation(64);
  // Check for the user's current action...
  if (user.currentAction()) {
    // And make the user consume its resources.
    user.useItem(user.currentAction().item());
  }
  // Clear the user's actions making the user lose the actions.
  user.clearActions();
  // Get the log window from battle.
  var logWindow = SceneManager._scene._logWindow;
  // Check if the paralyze state has text in message 3
  if (state.message3) {
    // If it does, create a message based on it.
    var msg = '<CENTER>' + user.name() + state.message3;
    // Add the text to the log window to display in battle.
    logWindow.addText(msg);
  }
  // Make the battle wait for the paralysis animation to finish playing.
  BattleManager.actionWaitForAnimation();
  // Clear the log window.
  logWindow.push('clear');
}
</Custom Action Start Effect>

Happy shocking!