(要 YEP_BattleEngineCore.js)ATB(アクティブターンバトル)を追加するプラグイン – YEP_X_BattleSysATB.js

タイトル
(Requires YEP_BattleEngineCore.js) Add ATB (ActiveTurn Battle) into your game using this plugin!
作者名
ヘルプ
============================================================================
Introduction
============================================================================

The Battle System - Active Turn Battle plugin is an extension plugin for
Yanfly Engine Plugins' Battle Engine Core. This extension plugin will not
work without the main plugin.

To use the ATB system, go to the Battle Engine Core plugin and change the
'Default System' setting in the parameters to 'atb'.

The Active Turn Battle system functions in such where battlers will have a
new gauge in battle functioning as their turn gauge. As time goes by without
anything happening such as actions, menu selection, etc, the gauge fills up.
Once it is full, the battler can commit to an action.

After committing to an action, the battler charges the skill before using it
in battle to either attack an enemy, heal an ally, etc. Upon finishing the
action, the gauge drains to empty and the battler must charge it up again.

This is a battle system where agility plays an important factor in the
progress of battle where higher agility values give battlers more advantage
and lower agility values give battlers less advantage.

============================================================================
Plugin Commands
============================================================================

To change your battle system to Active Turn Battle if it isn't the default
battle system, you can use the following Plugin Command:

Plugin Command:
setBattleSys ATB Sets battle system to Active Turn Battle.
setBattleSys DTB Sets battle system to Default Turn Battle.

Using the above Plugin Commands, you can toggle between the Default Battle
System and Active Turn Battle!

============================================================================
Notetags
============================================================================

The following are notetags that pertain to and affect the ATB system.

Skill and Item Notetags:
<ATB Help>
text
text
</ATB Help>
For those planning on using multiple battle systems, sometimes you may
have your skills perform differently while using ATB. If so, using this
notetag will allow skills and items to display different help text while
ATB is enabled.

<ATB Speed: x>
<ATB Charge: x>
<ATB Gauge: x>
Usable only during ATB. This sets the target's current speed or charge to
x. If 'speed' or 'charge' is used, it will only affect those gauges while
in the respective phase. If 'gauge' is used, it will affect either.

<ATB Speed: x%>
<ATB Charge: x%>
<ATB Gauge: x%>
Usable only during ATB. This sets the target's current speed or charge to
x% of the whole gauge. If 'speed' or 'charge' is used, it will only affect
those gauges while in the respective phase. If 'gauge' is used, it will
affect either.

<ATB Speed: +x> or <ATB Speed: -x>
<ATB Charge: +x> or <ATB Charge: -x>
<ATB Gauge: +x> or <ATB Gauge: -x>
Usable only during ATB. This increases or decreases the target's current
speed or charge by x. If 'speed' or 'charge' is used, it will only affect
those gauges while in the respective phase. If 'gauge' is used, it will
affect either.

<ATB Speed: +x%> or <ATB Speed: -x%>
<ATB Charge: +x%> or <ATB Charge: -x%>
<ATB Gauge: +x%> or <ATB Gauge: -x%>
Usable only during ATB. This increases or decreases the target's current
speed or charge by x% of the whole gauge. If 'speed' or 'charge' is used,
it will only affect those gauges while in the respective phase. If 'gauge'
is used, it will affect either.

<After ATB: x>
<After ATB: x%>
This will set the skill/item user's ATB speed value to x or x%. If 'x' is
used, this will be the exact ATB value. If x% is used, this will be the
percentage of the ATB gauge that it will be at.

<ATB Interrupt>
<ATB Interrupt: x%>
This will give the skill the ability to interrupt and cancel out the
target's current action while it is in the charging phase. If the 'x%'
notetag version is used, it will have a x% chance of success.

<Cannot ATB Interrupt>
This causes the skill to be unable to be interrupted and prevent the
battler's ATB to reset.

Actor, Class, Enemy, Weapon, Armor, and State Notetags:
<ATB Start: +x>
<ATB Start: +x%>
Usable only during ATB. This will give the actor, class, enemy, weapon,
armor, or state the property of starting battle with X ATB Speed or X% of
the ATB gauge filled up.

<ATB Turn: +x>
<ATB Turn: +x%>
Usable only during ATB. This will give the actor, class, enemy, weapon,
armor, or state the property of starting a turn with X ATB Speed or X% of
the ATB gauge filled up.

============================================================================
Lunatic Mode - Conditional ATB Speed and Conditional ATB Charge
============================================================================

For those who have a bit of JavaScript experience and would like to have
more unique ways of performing ATB speed and charge changes, you can use the
following notetags:

Skill and Item Notetags:
<Target ATB Eval>
speed = x;
charge = x;
</Target ATB Eval>
You can omit speed and/or charge. Whatever you set 'speed' to will change
the ATB speed of the target. If the target is charging, 'charge' will
cause the target's charge to change to that value. To make things more
simple, 'max' will be the full gauge value.

Here is an example:

<Target ATB Eval>
speed = target.hp / target.mhpmax;
charge = target.hp / target.mhpmax;
</Target ATB Eval>
The above code will set the user's current ATB gauge to position equal to
the target's HP ratio. If the target has 25% HP, the ATB gauge will go to
25% full for the target.

--- --- --- --- ---

<After ATB Eval>
speed = x;
</After ATB Eval>
This is the ATB set after the user has used the skill/item and the custom
ATB amount you want the user to be at after. 'max' be the value of the
full gauge value. Whatever you set 'speed', the user's ATB speed value
will change to that much:

Here is an example:

<After ATB Eval>
speed = user.mp / user.mmpmax;
</After ATB Eval>
The above code will set the user's ATB gauge after using the skill/item to
equal the user's MP ratio. If the user has 25% MP, the ATB gauge will go
to 25% full for the user.

--- --- --- --- ---

<ATB Interrupt Eval>
interrupt = true;
</ATB Interrupt Eval>
This will allow you to set custom conditions for interrupting a target.
Keep in mind that even though it is a custom condition, it still requires
the target to be in the charging phase for the interrupt to work. By
setting 'interrupt = true', the target will be interrupted.

Here is an example:

<ATB Interrupt Eval>
if (user.hp > target.hp) {
interrupt = true;
}
</ATB Interrupt Eval>
The above code will state that if the user has more HP than the target,
the target will be interrupted.

============================================================================
Yanfly Engine Plugins - Battle Engine Extension - Action Sequence Commands
============================================================================

You can make use of these extra ATB related action sequences.

=============================================================================
ATB CHARGE: target, X
ATB CHARGE: target, X%
ATB CHARGE: targets, +X
ATB CHARGE: targets, +X%
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usable only for ATB. Sets the target's ATB charge to X or X%. This only
applies when the target is in the ATB charge phase. This will not affect
the user to prevent mechanical issues.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usage Example: atb charge: targets, +5000
atb charge: target, -50%
=============================================================================

=============================================================================
ATB GAUGE: target, X
ATB GAUGE: target, X%
ATB GAUGE: targets, +X
ATB GAUGE: targets, +X%
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usable only for ATB. Sets the target's ATB speed or charge (whichever the
user is currently filling up) to X or X%. This only. This will not affect
the user to prevent mechanical issues.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usage Example: atb gauge: targets, +5000
atb gauge: target, -50%
=============================================================================

=============================================================================
ATB INTERRUPT: target
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usable only for ATB. If the target is in the charging phase, interrupt it.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usage Example: atb interrupt: targets
=============================================================================

=============================================================================
ATB SPEED: target, X
ATB SPEED: target, X%
ATB SPEED: targets, +X
ATB SPEED: targets, +X%
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usable only for ATB. Sets the target's ATB speed to X or X%. This only
applies when the target is filling up its ATB gauge. This will not affect
the user to prevent mechanical issues.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usage Example: atb speed: targets, +5000
atb speed: target, -50%
=============================================================================

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

Version 1.24:
- During action end, a single tick will be forced to occur to prevent clash
amongst actors with similar AGI values and make tick values more unique.

Version 1.23:
- Timing has been changed for states that update turns at Turn Start. Now,
the states will update prior to the actor's command box opening or the enemy
make a decision on which action it will use.

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

Version 1.21:
- Counterattacks no longer cause interrupts if attack actions have interrupt
functionality.

Version 1.20:
- Updated plugin to update the AI more accordingly with Battle AI Core.

Version 1.19:
- Fixed a bug where forced actions clear out an action's effects before the
turn is over, making post-turn effects to not occur.

Version 1.18:
- Fixed a bug where changing back and forth between the Fight/Escape window
would prompt on turn start effects.

Version 1.17:
- Made a mechanic change so that turn 0 ends immediately upon battle start
rather than requiring a full turn to end.

Version 1.16:
- Added a fail safe setting up ATB Charges when the Cannot Move restriction
is imposed upon an actor.

Verison 1.15:
- Implemented a Forced Action queue list. This means if a Forced Action
takes place in the middle of an action, the action will resume after the
forced action finishes rather than cancels it out like MV does.

Version 1.14:
- Added a speed position check for Instant Casts to maintain order position.

Version 1.13:
- Fixed a bug that doesn't update state turns properly.
- Removed 'Turn Structure parameter' as it goes against the nature of a
Tick-Based battle system.

Version 1.12:
- Added speed rebalance formulas for tick-based systems (innate).

Version 1.11:
- Fixed a bug that would still allow battlers to perform actions even if the
actions got sealed midway through charging the action.

Version 1.10:
- Fixed a bug that would cause AutoBattlers to stall if they got added into
the party mid-battle.

Version 1.09:
- Mechanic change for states that update on Action End to end at the end of
a battler's turn instead of at the start.

Version 1.08a:
- Fixed a bug that crashed the game when enemies were confused.
- Preparation for Enemy ATB Gauges.

Version 1.07:
- Added 'Flash Enemy' to plugin parameters to flash the enemy once when it
starts charging a skill.

Version 1.06:
- Added pre-emptive and surprise attack mechanic plugin parameters!

Version 1.05:
- Fixed a bug with Forced Actions locking out the battle.

Version 1.04:
- Added the 'Per Tick' parameter for you to adjust the formula that governs
the speed rate at which the ATB gauge fills up.

Version 1.03:
- Fixed a bug that caused the ATB Gauge appear slow with maxed AGI.

Version 1.02c:
- Fixed a bug with the ATB GAUGE and ATB CHARGE action sequences.
- Fixed a bug with battlers still getting a turn after the battle is over.
- Fixed a bug that prevented escaping.
- Added math fail safes for calculating ATB charging.

Version 1.01:
- Fixed a bug with escaping causing battlers to go into infinite lock.
- Fixed a bug with multiple victory messages.
- Added fail safe to prevent infinite charging.
- Added <Cannot ATB Interrupt Notetag>.

Version 1.00:
- It's doooooooone!
パラメータ
param ---ATB Settings---
default
param Per Tick
desc This is how much speed is gained per tick.
default user.agi

param Initial Speed
desc The speed position of the battler at the start of battle.
This is a formula processed as an eval.
default 0

param Full Gauge
desc The target speed for an ATB gauge to be full.
This is a formula processed as an eval.
default Math.max(5000, BattleManager.highestBaseAgi()100)

param Charge Gauge
desc The wind-up time after selecting an action.
This is a formula processed as an eval.
default Math.max(2000, BattleManager.highestBaseAgi()20)

param Pre-Emptive Bonuses
desc How much of the ATB bar do you want filled up for an
ATB pre-emptive bonus from 0 to 1.
default 0.8

param Surprise Bonuses
desc How much of the ATB bar do you want filled up for an
ATB surprise bonus from 0 to 1.
default 0.8

param ---Escape---
default
param Escape Ratio
desc How ATB calculates escape ratios.
Default: 0.5$gameParty.agility() / $gameTroop.agility()
default 0.125$gameParty.agility() / $gameTroop.agility()

param Fail Escape Boost
desc Each time the player fails escape, increase the success
rate by this much. Default: 0.1
default 0.025

param ---Turn---
default
param Full Turn
desc This is how many ticks to equal a full battle turn.
This is a formula processed as an eval.
default Math.min(200, BattleManager.lowestBaseAgi()8)

param Flash Enemy
desc Flash enemies when they start charging their skills?
NO - false YES - true
default true

param ---Rubberband---
default
param Enable Rubberband
desc This is an auto-balance mechanic for AGI.
Disable - false Enable - true
default true

param Minimum Speed
desc If rubberbanding is enabled, what is the minimum
speed increase? This is a formula.
default 0.5BattleManager.highestBaseAgi()

param Maximum Speed
desc If rubberbanding is enabled, what is the maximum
speed increase? This is a formula.
default 1.5BattleManager.highestBaseAgi()

param ---Sound---
default
param Ready Sound
desc This is the sound played when the battler is ready.
default Decision1

param Ready Volume
desc This is the volume of the ready sound.
default 90

param Ready Pitch
desc This is the pitch of the ready sound.
default 120

param Ready Pan
desc This is the pan of the ready sound.
default 0

param ---Options---
default
param ATB Speed Text
desc Text used for ATB speed in options window.
default ATB Speed

param Default ATB Speed
desc Default speed at which the gauges fill up.
1 - slowest 10 - fastest
default 10

param ---Windows---
default
param Lock Status Window
desc While ATB is active, lock the status window from moving?
OFF - false ON - true
default true

param Gauge Style
desc This is the style of the ATB gauges:
0 - None 1 - Under Name 2 - Right Side
default 1

param Gauge Text
desc If style 2 is used, this is the text displayed.
default Turn

param Gauge Text Align
desc If style 2 is used, this is the text alignment.
left center right
default center

param ATB Gauge Color 1
desc The 1st gauge color of the ATB gauge as it loads up.
default 13

param ATB Gauge Color 2
desc The 2nd gauge color of the ATB gauge as it loads up.
default 5

param Slow Gauge Color 1
desc 1st gauge color of the ATB gauge if actor is slowed.
default 12

param Slow Gauge Color 2
desc 2nd gauge color of the ATB gauge if actor is slowed.
default 4

param Fast Gauge Color 1
desc 1st gauge color of the ATB gauge if actor is hasted.
default 26

param Fast Gauge Color 2
desc 2nd gauge color of the ATB gauge if actor is hasted.
default 27

param Stop Gauge Color 1
desc 1st gauge color of the ATB gauge if actor is stopped.
default 7

param Stop Gauge Color 2
desc 2nd gauge color of the ATB gauge if actor is stopped.
default 8

param Full Gauge Color 1
desc The 1st gauge color of the ATB gauge when full.
default 14

param Full Gauge Color 2
desc The 2nd gauge color of the ATB gauge when full.
default 6

param Charge Gauge Color 1
desc The 1st gauge color of the ATB gauge when charging.
default 2

param Charge Gauge Color 2
desc The 2nd gauge color of the ATB gauge when charging.
default 10

ライセンス表記
Once it is full, the battler can commit to an action.
After committing to an action, the battler charges the skill before using it
You can omit speed and/or charge. Whatever you set 'speed' to will change

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