攻撃を回避する前にプレイヤーにチャージを強いるアクティブディフェンスを追加するプラグイン – SRD_ActiveDefense_Charge.js

タイトル
Adds an Active Defense that forces the Player to charge up before dodging an attack.
作者名
ヘルプ

Active Defense: Charge
Version 1.10
SumRndmDde


This plugin adds a new system in side-view battles which allows Players to
have the Actor battler's dodge Enemy attacks.

This system is known as The Active Defense System.

It only works in side-view battles.

In this plugin, the Active Defense that you can use is the "charge".
This Active Defense adds forces the Player to charge up before dodging
an attack. This requires the Player to time their dodges at a much
greater degree.


==========================================================================
How it Works
==========================================================================

During the Enemy attack, the Player must charge up before preforming
a dodge. To do so, they must hold down the OK button or hold down on the
screen. While the Player is holding down, a gauge next to the targeted
Actor will begin to fill.

The goal is the release the button/tap when the gauge is near the top.
This way, the Actor will preform the best dodge and move the farthest
distance.

However, the Actor must also dodge during the Enemy's Skill animation.
So, as you can imagine, the Player needs to time their charge to match
up with the Enemy's attack animation.

It is difficult, which is good for an Active Defense that will be used
throughout a game.


==========================================================================
Setting up the Notetags
==========================================================================

If you wish for a Skill to use the Active Defense System, place these
notetags within the Skill's notebox:

<Active Defense: charge>
<End Active Defense>

In this example, the Active Defense being used is the "charge".


==========================================================================
Setting up Properties
==========================================================================

Within the two notetags, you can define speicifc properties per each
Skill.

For example:

<Active Defense: charge>
Fill Speed: 2
<End Active Defense>

If this was within a Skill, it would make it so when the Enemy uses that
Skill the Player can make their Actor's charge and dodge enemy attacks.

You can a list of all the properties listed under "Defaults" within
the Parameters.


==========================================================================
Setting up Animations
==========================================================================

The times where the Player needs to dodge are based on the animations.
By default, the Actor needs to sufficiently be in a position to dodge the
attack in the exact middle of the animation; however, you can also define
"dodge frame" using the notetag in the Animation name:

<ads: x>

For example, if you wanted it to be the 3rd frame, you would do:

<ads: 3>

You can also set it to be multiple frames:

<ads: 1, 2, 3, etc...>

If the Player fails to dodge during every frame, then the Actor will
receive damage.


==========================================================================
Animation vs. Action
==========================================================================

When using Yanfly's Action Sequences, keep in mind that you need to use an
animation on the Actor battler to set up the dodge. Once an animation
is played, the Action's effect can be used.

Also keep in mind that the Actor will continue to use the same results
from the dodge until a new animation is played.

Also keep in mind if multiple animations are played, the last one will be
the one that influences the results.


==========================================================================
Global Variables
==========================================================================

Here's a list of all the global variables available to be used:

$ActiveDefense.power

Returns 1 for a dodge and 0 for a hit.

$ActiveDefense.type

Returns the current Active Defense type.
For example, it may return 'charge'.

$ActiveDefense.item

Returns the current Active Defense Database Item object.


==========================================================================
End of Help File
==========================================================================

Welcome to the bottom of the Help file.


Thanks for reading!
If you have questions, or if you enjoyed this Plugin, please check
out my YouTube channel!

https://www.youtube.com/c/SumRndmDde


Until next time,
~ SumRndmDde
パラメータ
param Hit Condition
desc The condition that must be true for the Skill to hit.
default $ActiveDefense.power <= 0

param Reset Value Code
desc This is the code that will run when the Player doesn't dodge the animation.
default $ActiveDefense.power = 0

param Set Value Code
desc Variable 'distance' = Player's distance.
Variable 'required' = required height.
default $ActiveDefense.power = 1

param == Defaults ==
default

param Dodge Speed
desc The speed in which the Actor dodges.
Input a number or a JavaScript eval using 'actor'.
default 5

param Movement Distance
desc The distance the Actor dodges.
Input a number or a JavaScript eval using 'actor'.
default actor.chargeValue

param Fill Speed
desc The speed that the gauge fills.
Input a number or a JavaScript eval using 'actor'.
default 3

param Empty Speed
desc The speed that the gauge empties.
Input a number or a JavaScript eval using 'actor'.
default 1

param Background Color
desc The background color of the gauge.
Input an HTML or JavaScript color.
default #444444

param Gauge Color 1
desc The first color of the gauge.
Input an HTML or JavaScript color.
default red

param Gauge Color 2
desc The first color of the gauge.
Input an HTML or JavaScript color.
default orange

param Charge Motion
desc The motion of the Actor when they are charging.
Input an SV-Actor motion.
default chant

param Dodge Motion
desc The motion of the Actor when they are dodging.
Input an SV-Actor motion.
default evade

param Max Charge Value
desc The maximum charge for the dodge gauge.
Input a number or JavaScript eval.
default 50

param Required Value
desc The required movement in pixels the Actor must dodge.
Input a number or JavaScript eval.
default 30

param Dodge Minimum
desc The minimum required amount of points to dodge.
Input a number.
default 15

param Sound Effect
desc The sound effect played when the battler dodges.
Input a sound effect filename.
default Evasion1

param Press Trigger
desc The condition that must be true to be pressed.
Input a JavaScript eval.
default Input.isPressed('ok') || TouchInput.isPressed()

param Release Trigger
desc The condition that must be true to be released.
Input a JavaScript eval.
default !Input.isPressed('ok') && !TouchInput.isPressed()

ライセンス表記

紹介ページ https://github.com/SumRndmDde/RPG-Maker-MV-Plugins/blob/master/SRD_ActiveDefense_Charge.js