YEP.161 – Lunatic Pack – Passive Condition Cases – 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.

You can grab the plugin here:

English Mirror

Support Team Yanfly on Patreon

Passive States can be a powerful addition to a game, but if they are always active throughout a battle, they can be a little too powerful. Sometimes, you will want to limit the extent at which your passive states will be active by imposing conditional cases upon them. If all of the passive’s conditional cases have been met, then the passive will become active. This plugin adds a multitude of conditional cases for you to be able to use in your game and limit certain passive states from having their effects active at all times.

*NOTE*: This plugin is best used with RPG Maker MV version 1.5.0+. You can still use this plugin with a lower version number, but you will have a much harder time altering the plugin parameters without it.


Introduction


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

This plugin requires the following plugins:

– Auto Passive States

Passive States can be a powerful addition to a game, but if they are always active throughout a battle, they can be a little too powerful. Sometimes, you will want to limit the extent at which your passive states will be active by imposing conditional cases upon them. If all of the passive’s conditional cases have been met, then the passive will become active. This plugin adds a multitude of conditional cases for you to be able to use in your game and limit certain passive states from having their effects active at all times.

*NOTE*: This plugin is best used with RPG Maker MV version 1.5.0+. You can still use this plugin with a lower version number, but you will have a much harder time altering the plugin parameters without it.


Notetags


For updated versions of the notetags, please refer to the plugin’s helpfile.


Lunatic Mode – Effect Code


For experienced users that know JavaScript and have RPG Maker MV 1.5.0+, you

can add new notetag effects that can be used by the plugin or alter the effects of currently existing notetag effects from the plugin parameters entry: Effect Code. It should look something like this:

// -------------
// Switch On/Off
// -------------
if (data.match(/SWITCH[ ](\d+)[ ]ON/i)) {
  var switchId = parseInt(RegExp.$1);
  condition = $gameSwitches.value(switchId);

} else if (data.match(/SWITCH[ ](\d+)[ ]OFF/i)) {
  var switchId = parseInt(RegExp.$1);
  condition = !$gameSwitches.value(switchId);

...

// -------------------------------
// Add new effects above this line
// -------------------------------
} else {
  skip = true;
}

Here’s what each of the variables used in this code bit refer to:

  --------------------   ---------------------------------------------------
  Variable:              Refers to:
  --------------------   ---------------------------------------------------
  condition              Current condition setting. If it returns true, then
                         the current condition case passes. Otherwise, no.
                         The passive state needs all its condition cases to
                         to become an active passive state.

  a                      Returns the action user
  user                   Returns the action user
  subject                Returns the action user

  s[x]                   Return switch x (true/false)
  v[x]                   Return variable x's current value

  skip                   Default: false. If true, returns the previous rate

If you need to revert the Effect Code back to its original state, delete the plugin from your plugin manager list and then add it again. The code will be back to default.


Happy RPG Making!