YEP.50 – Buffs & States Core

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 Dropbox
English Mirror

Alter the basic mechanics behind buffs and states that aren’t adjustable within the RPG Maker editor. Such mechanics include altering the maximum number of times buffs can stack, changing the turns remaining on buffs and states, and the rules involved when reapplying states.


Introduction


If you are using YEP_BattleEngineCore.js, please this plugin under YEP_BattleEngineCore in the plugin list for the best effect.

Alter the basic mechanics behind buffs and states that aren’t adjustable within the RPG Maker editor. Such mechanics include altering the maximum number of times buffs can stack, changing the turns remaining on buffs and states, and the rules involved when reapplying states.

A turn indicator has been added to show the amount of turns remaining on buffs, debuffs, and states. Buffs and debuffs will operate off the plugin parameter settings while states can operate on individual settings if you choose for them to have unique settings.

Furthermore, a lot of Lunatic Mode options are added with this plugin to allow those with JavaScript proficiency maximum control with states and any unique effects that follow.


Notetags


The following are various notetags you can use to modify states and buffs.

— Buff Related —

Actor, Class, Enemy, Weapon, Armor, and State notetags:

<Max stat Buff: +x>
<Max stat Buff: -x>
<Max stat Debuff: +x>
<Max stat Debuff: -x>
Replace ‘stat’ with ‘maxhp’, ‘maxmp’, ‘atk’, ‘def’, ‘mat’, ‘mdf’, ‘agi’, or ‘luk’ without the quotes. This notetag adjusts the maximum number of times the stat can be buffed or debuffed to the Maximum Limit cap in the plugin parameters.

Skill and Item Notetags:

<stat Buff Turns: +x>
<stat Buff Turns: -x>
<stat Debuff Turns: +x>
<stat Debuff Turns: -x>
Modifies already applied buff/debuff turns on target by x value. If this brings a buff/debuff to 0 or below, the buff/debuff is removed.

— State Related —

State Notetags:

<Show Turns>
<Hide Turns>
Show/hide the turn count remaining for the state. This will override the default setting.

<Turn Font Size: x>
Sets the font size used for this specific state to be x. This will override the default setting.

<Turn Alignment: Left>
<Turn Alignment: Center>
<Turn Alignment: Right>
This sets the text alignment for the turn count indicator. This will override the default setting.

<Turn Buffer X: +x>
<Turn Buffer X: -x>
<Turn Buffer Y: +x>
<Turn Buffer Y: -x>
Allows you to adjust the x/y position manually for the turn count for this particular state. This will override the default settings.

<Turn Color: x>
This will set the turn count display color to text color x. This will override the default setting.

<Reapply Ignore Turns>
<Reapply Reset Turns>
<Reapply Add Turns>
Changes the rules when this state is reapplied on a battler. When ignored, the turn count remains unchanged. When reset, the turn count is set back to the default amount with variance. When added, the turn count is added upon with variance.

Skill and Item Notetags:

<State x Turns: +y>
<State x Turns: -y>
<State named Turns: +y>
<State named Turns: -y>
Modifies already applied state x turns on target by y value. If this brings the state to 0 or below turns, the state is removed. If you are using named states and have multiple states with the same name, priority will be given to the state with the highest ID.

Enemy Notetags:

<Show State Turns>
<Hide State Turns>
Affected by the Battle Engine Core. When selecting enemies, the state turns will show up in the help window. You can use this to have certain enemies show the state turns or hide them.


Lunatic Mode – Custom Turn Modifiers


For those with an understanding of JavaScript, you can use these notetags to give conditional turn modifiers when altering a target’s buff/state turn count. Follow the instructions below:

Skill and Item Notetags:

<Custom stat Buff Turn>
turn = 10;
turn += user.agi;
</Custom stat Buff Turn>
Replace ‘stat’ with ‘maxhp’, ‘maxmp’, ‘atk’, ‘def’, ‘mat’, ‘mdf’, ‘agi’, or ‘luk’ without the quotes. Whatever the ‘turn’ variable returns is what the turn count will be set to for the stat buff.

<Custom stat Debuff Turn>
turn = 10;
turn += user.agi;
</Custom stat Debuff Turn>
Replace ‘stat’ with ‘maxhp’, ‘maxmp’, ‘atk’, ‘def’, ‘mat’, ‘mdf’, ‘agi’, or ‘luk’ without the quotes. Whatever the ‘turn’ variable returns is what the turn count will be set to for the stat debuff.

<Custom State X Turn>
turn = 10;
turn += user.agi;
</Custom State X Turn>
This alters the turn count for state x. Whatever the ‘turn’ variable returns is what the turn count will be set for state x.

<Custom State name Turn>
turn = 10;
turn += user.agi;
</Custom State name Turn>
This alters the turn count for state ‘name’. Whatever the ‘turn’ variable returns is what the turn count will be set for state ‘name’. If you have multiple states in your database with the same name, priority will be given to the state with the highest ID.


Lunatic Mode – Custom Timing Effects


For those with an understanding of JavaScript, you can use these notetags to cause code to run at certain times.

Quick Reference:
– Apply: When a state is added.
– Remove: When a state is removed.
– Leave: When a state expires by reaching 0 turns.
– Turn Start: Whenever the battler’s turn starts.
– Action Start: Whenever the battler performs a new action.
– Action End: Whenever the battler finishes an action.
– Regenerate: Whenever the battler would regenerate HP/MP/TP.
– Turn End: Whenever the battler’s turn ends.

State Notetags:

— Timing Effects —

These effects specifically occur at certain intervals or timings.

<Custom Apply Effect>
code
code
</Custom Apply Effect>
The code in between these notetags will run when the state is added onto a battler. The code will process before the state is actually applied.

<Custom Remove Effect>
code
code
</Custom Remove Effect>
The code in between these notetags will run when the state is removed from a battler either manually or due to turn decay. The code will process before the state is actually removed but before <Custom Leave Effect>.

<Custom Leave Effect>
code
code
</Custom Leave Effect>
The code in between these notetags will run when the state is removed from a battler due to turn decay. The code will process before the state is actually removed but after <Custom Remove Effect>.

<Custom Turn Start Effect>
code
code
</Custom Turn Start Effect>
This requires YEP_BattleEngineCore. This effect will run at the start of each of the battler’s turns. The code will process after all the other turn start effects have taken course.

<Custom Action Start Effect>
code
code
</Custom Action Start Effect>
This effect will run at the start of each of the battler’s actions. The code will process before the skill/item cost takes place.

<Custom Action End Effect>
code
code
</Custom Action End Effect>
This effect will run at the end of each of the battler’s actions. The code will process before the action end steps takes place.

<Custom Regenerate Effect>
code
code
</Custom Regenerate Effect>
This effect will run whenever the battler would regenerate HP, MP, or TP. The code will process after all the other regenerate effects have ran.

<Custom Turn End Effect>
code
code
</Custom Turn End Effect>
This effect will run at the end of each of the battler’s turns. The code will process after all the other turn end effects have taken course.


Lunatic Mode – Custom Action Effects


For those with an understanding of JavaScript, you can use these notetags to cause code to run during actions.

Quick Reference:

Action Starts
– Attacker: Initiate
– Defender: Select
Action Connects as a Success Hit, skip if Missed or Evaded
– Attacker: Confirm
– Defender: React
Damage is Applied to the Defender
– Defender: Respond
– Attacker: Establish
These occur regardless if the action is successfully hit.
– Defender: Deselect
– Attacker: Conclude

State Notetags:

— On Action Effects —

These effects specifically occur when the battler is a target of an action.

<Custom Initiate Effect>
code
code
</Custom Initiate Effect>
This effect will run when the battler selects a target. This will occur before hit/miss/evade confirmation and damage execution. This effect will run before everything else has taken course.

<Custom Select Effect>
code
code
</Custom Select Effect>
This effect will run when the battler is selected as a target. This will occur before hit/miss/evade confirmation and damage execution. This effect will run after <Custom Initiate Effect> before everything else has ran.

<Custom Confirm Effect>
code
code
</Custom Confirm Effect>
This effect will run when the battler connects a hit and before damage execution occurs. This effect will run after <Custom Initiate Effect> and <Custom Select Effect> and before everything else.

<Custom React Effect>
value -= 100;
value -= user.def;
</Custom React Effect>
This effect will run when the battler is selected as a target. This will occur only if the action connects and will occur before damage execution. This effect will run before damage calculation occurs and will return the ‘value’ variable as a damage modifier. After <Custom Confirm Effect>, this effect will run.

<Custom Respond Effect>
code
code
</Custom Respond Effect>
This effect will run when the battler is selected as a target. This will occur only if the action connects and will occur after damage execution. This effect will run after damage calculation occurs. The ‘value’ variable is equal to the damage dealt to the battler. This is the first effect to run after damage execution has taken place.

<Custom Establish Effect>
code
code
</Custom Establish Effect>
This effect will run when the battler connects a hit and after damage execution occurs. This effect will run after <Custom Respond Effect> has occurred and before everything else.

<Custom Deselect Effect>
code
code
</Custom Deselect Effect>
This effect will run when the battler is selected as a target. This will occur after hit/miss/evade confirmation and damage execution. This effect will run after everything else has taken course.

<Custom Conclude Effect>
code
code
</Custom Conclude Effect>
This is the final effect to be run after the battler selects a target and will occur after hit/miss/evade confirmation and damage execution.


Happy RPG Making!


Happy RPG Making!


These plugins and Tips & Tricks ideas are made possible thanks to our creative patrons on Patreon! The majority of our Tips & Tricks ideas are placed within the Patreon-exclusive Sample Project for quick and easy access! If you'd like to make a Tips & Tricks suggestion, Yanfly's Patreon-based Suggestion Box a visit here:


If you have any bugs to report, visit the following link:


If you have any questions about Action Sequences, visit the following link:



Thank you!