RPGツクールエディタ内で調整できないバフや状態の背後にある基本的な仕組みを変更するプラグイン – YEP_BuffsStatesCore.js

タイトル
Alter the basic mechanics behind buffs and statesthat aren't adjustable within the RPG Maker editor.
作者名
ヘルプ
============================================================================
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.
- Battle: Whenever a battle is started.
- Victory: Whenever a battle is won.Note1
- Escape: Whenever a battle is escaped.Note1
- Defeat: Whenever a battle is lost.Note1

Note1: If the state is set to expire on battle end, the expiration will
occur before the custom effects would take place, meaning the effects will
not occur at all unless the expiration is set to off.

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 after 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
after 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 after the state is
actually removed and 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.

<Custom Battle Effect>
code
code
</Custom Battle Effect>
This effect will occur at the start of battle if the battler has the state
already applied (usually through a passive state).

<Custom Victory Effect>
code
code
</Custom Victory Effect>
This effect will occur at the end of battle if the party is victorious.
This will only apply to the player's party. If this state can expire at
the end of battle, this effect will not occur as state expiration will
occur before this effect will happen.

<Custom Escape Effect>
code
code
</Custom Escape Effect>
This effect will occur at the end of battle if the party has escaped.
This will only apply to the player's party. If this state can expire at
the end of battle, this effect will not occur as state expiration will
occur before this effect will happen.

<Custom Defeat Effect>
code
code
</Custom Defeat Effect>
This effect will occur at the end of battle if the party is defeated.
This will only apply to the player's party. If this state can expire at
the end of battle, this effect will not occur as state expiration will
occur before this effect will happen.

============================================================================
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.

============================================================================
Lunatic Mode - State Counters
============================================================================

State Counters are newly added features to suplement states. They are used
purely in custom manners, which means they do not serve any function by
themselves. State Counters can be used to note a number of stacks, a stored
percentage, display a message, etc. All of it is purely updated based on
JavaScript functions.

---

There are a couple of notetags you can use for states:

<Counter Font Size>
This adjusts the font size of the counter.

<Counter Alignment: left>
<Counter Alignment: center>
<Counter Alignment: right>
This changes the alignment of the counter text.

<Counter Buffer X: +x>
<Counter Buffer X: -x>
This adjusts the X buffer range for the counter text.

<Counter Buffer Y: +x>
<Counter Buffer Y: -x>
This adjusts the Y buffer range for the counter text.

<Counter Text Color: x>
This changes the font color of the text to the text color x.

---

The following are JavaScript functions you may use to adjust counters:

battler.clearStateCounters();
- This will clear all the counter values for all states.

battler.setStateCounter(stateId, value);
- This will set the counter value for the particular state to 'value'.

battler.addStateCounter(stateId, value);
- This will add to the counter value for the state. The counter must be
a number in order for this to work.

battler.clampStateCounter(stateId, min, max);
- This will set a minimum and maximum value for the counter value of the
particular state. The counter must be a number in order for this to work.

battler.removeStateCounter(stateId)
- This will clear the counter value for the state.

battler.getStateCounter(stateId)
- This will return the current state counter value.

============================================================================
Changelog
============================================================================

Version 1.11:
- Fixed a bug involving Lunatic state effects not occuring in the right
order when a state is removed.

Version 1.10b:
- Added new plugin parameter: Show Buff Rate. This will display the current
buff or debuff rate on the buff icon.
- Optimization Update.
- Documentation fix for battler.clampStateCounter(stateId, min, max).

Version 1.09b:
- Added new plugin parameters: Show Enemy Icons, Enemy Buff Turn, Enemy
State Turn, and Enemy State Counter to optionally display the enemy state
icons, states, buffs, their turns, and their counters.
- Added 'Lunatic Mode - State Counters'. Read more on it in the help file!
- Added anti-crash method for newly added effect in case non-YEP plugins
have non-battlers attached to battler sprites.
- Fixed a bug that prevented screen flashes when walking around on the map
when an actor is poisoned.

Version 1.08:
- Fixed an issue that caused adding states midway through Lunatic Mode to
shift the order of states around causing some effects to be skipped.

Version 1.07:
- Updated for RPG Maker MV version 1.1.0.

Version 1.06:
- Added new notetags for <Custom Battle Effect>, <Custom Victory Effect>,
<Custom Escape Effect>, and <Custom Defeat Effect> for Lunatic Mode.

Version 1.05a:
- Fixed a bug with the 'Show Turns' parameter not working properly.
- Fixed a bug with math issues for timed states.

Version 1.04:
- Changed timing of when Add/Remove/Leave Lunatic Effects occur to add more
flexibility in custom effects.
- Added a fail safe for when there are no targets to modify.
- Fixed a bug with reapply ignore states.

Version 1.03a:
- Fixed a bug that would cause NaN to show up in state turns.

Version 1.02:
- Synched up <Custom Turn End Effect> with tick-based battle systems.

Version 1.01:
- Fixed a bug that didn't reset the font settings with the battle status.

Version 1.00:
- Finished Plugin!
パラメータ
param ---Turn Indicator---
default
param Show Turns
desc Show turns remaining for buffs and states?
NO - false YES - true
default true

param Font Size
desc The default font size used for turn count.
Default: 28
default 16

param Turn Alignment
desc How do you want to align the turns?
left center right
default right

param Turn Buffer X
desc Buffer the x position of the turn by this much.
default -3

param Turn Buffer Y
desc Buffer the y position of the turn by this much.
default -6

param State Color
desc The default text color used for state turns.
default 0

param Buff Color
desc The default text color used for buffs.
default 24

param Debuff Color
desc The default text color used for debuffs.
default 2

param ---Enemy Icons---
default
param Show Enemy Icons
desc Do you wish to show enemy state icons?
NO - false YES - true
default true

param Enemy Buff Turn
desc Do you wish to show enemy buff turns remaining?
NO - false YES - true
default true

param Enemy State Turn
desc Do you wish to show enemy state turns remaining?
NO - false YES - true
default true

param Enemy State Counter
desc Do you wish to show enemy state counters?
NO - false YES - true
default true

param ---Buff Settings---
default
param Default Limit
desc The default number of times you can stack buff/debuff.
Default: 2
default 4

param Maximum Limit
desc The maximum number of times you can stack buff/debuff.
default 8

param Buff Formula
desc The formula used for buff rate calculation.
Default: this._buffs[paramId]0.25 + 1.0
default this._buffs[paramId]0.25 + 1.0

param Show Buff Rate
desc Shows the buff/debuff rate for buffs and debuffs.
YES - true NO - false
default false

param ---State Settings---
default
param Reapply Rules
desc The rules when reapplying an already existing state:
0 - Ignore 1 - Reset 2 - Add
default 1

param Show Enemy Turns
desc If using Battle Engine Core, show turns in help window?
NO - false YES - true
default true

param ---Counter Settings---
default
param Counter Font Size
desc The default font size used for state counters.
Default: 28
default 16

param Counter Alignment
desc How do you want to align the counter?
left center right
default center

param Counter Buffer X
desc Buffer the x position of the counter by this much.
default 0

param Counter Buffer Y
desc Buffer the y position of the counter by this much.
default 8

param Counter Color
desc The default text color used for state counters.
default 0

ライセンス表記
times the stat can be buffed or debuffed to the Maximum Limit cap in the

紹介ページ https://github.com/suppayami/yami-engine-delta/blob/master/demo/js/plugins/YEP_BuffsStatesCore.js