Skill Cooldowns (YEP)

From Yanfly.moe Wiki
Jump to navigation Jump to search


System

This is a plugin created for RPG Maker MV.

For help on how to install plugins, click here.

For help on how to update plugins, click here.

Got errors with your RPG Maker MV plugin? Click here.

Download

Required Plugins

The following plugins are required in order to use this plugin.

Place the following plugins above this plugin located in the Plugin Manager.

Yanfly Engine Plugins

This plugin is a part of the Yanfly Engine Plugins library.

Click here if you want to help support Team Yanfly on Patreon.

Introduction

This plugin requires YEP_SkillCore.
Make sure this plugin is located under YEP_SkillCore in the plugin list.

This plugin allows you to give your skills cooldowns. Cooldowns are a limit
enforced on a skill to prevent them from being used constantly.

Cooldown Types

Cooldown (Standard)
The standard cooldown only occurs if the skill has a cooldown to pay. When
used, the skill cannot be used for x turns as indicated by the cooldown.
There are a number of things that contribute to cooldowns going down. The
first would be simply waiting. Each turn in battle causes a cooldown to
drop by 1 turn. Skills and the such can be used to speed up this process.
The second would be to finish battles. Finishing a battle will cause all
cooldowns to drop by a certain amount (can be defined in the parameters).
And the third would be walking on the field map. Every certain amount of
steps allow a skill's cooldown to decrease.

Warmups
As far as most things go, Warmups do the same thing as Cooldowns: prevent
skills from being used until their timer is up. The difference, however, is
that warmups only occur once during battle: at the very start of it. If a
skill has a warmup timer, it will trigger the moment it goes into battle
and instantly disappear after battle. Warmups do not stack on top of any
existing cooldowns. If a cooldown is already occurring when a skill is in
the warmup phase, both the warmup and cooldown simultaneously update.

Linked Cooldowns
A linked cooldown occurs when a skill that's used causes another skill in
the owner's skill library to have a cooldown. All other attributes of this
cooldown are the same as a standard cooldown's. This cooldown type will take
priority over Skill Type Cooldowns and Global Cooldowns if this value is
defined.

Skill Type Cooldowns
When a Skill Type Cooldown occurs, all skills currently in the battler's
skill library with the matching Skill Type will be on cooldown. All other
attributes of this cooldown are the same as a standard cooldown's. This
cooldown type will take priority over Global Cooldowns if this value is
defined.

When a cooldown is applied for a skill that already has a cooldown, the
cooldown will change to whatever is the largest value. This means if a
skill has 3 turns for a cooldown and a Skill Type Cooldown would set for
1 turn, the 3 turns would remain. On the flip side, if the skill has 3 turns
and the Skill Type Cooldown would set for 5 turns, then the cooldown would
be changed to 5 turns instead.

Notetags

NotetagsMV.png

RPG Maker MV's editor is unable to allow for custom traits/properties that a game dev may wish to associate with a database object, event, map, etc. Notetags are used to work around such limitations by allowing the game dev to tag certain traits/properties using specific Notetags declared by the related plugin.

Here is a list of Notetag(s) that you may use.

Use the following notetags to alter the cooldown properties of a skill.

Skill Notetags:
  <Cooldown: x>
  Sets the cooldown for the skill to X turns. This cooldown only affects
  this skill alone. This value will take priority over Skill Type Cooldowns
  and Global Cooldowns.

  <Warmup: x>
  Sets the warmup for the skill to X turns. When entering a new battle, the
  skill will be on a warmup phase and cannot be used until the warmup phase
  is over.

  <After Battle Cooldown: +x>
  <After Battle Cooldown: -x>
  After a battle ends (victory, loss, or escape), change the cooldown for
  this skill by +x turns or -x turns.

  <Cooldown Steps: x>
  Outside of battle, every x steps that the Player takes, this skill's
  cooldown will drop by 1.

  <Skill x Cooldown: y>
  <Skill name Cooldown: y>
  When using this skill, after paying the skill cost, skill x will have a
  linked cooldown of y turns. This value will take priority over Skill Type
  Cooldowns and Global Cooldowns.

  <SType x Cooldown: y>
  When using this skill, after paying the skill cost, all skills with the
  matching Skill Type x to have a cooldown of y. This value will take
  priority over Global Cooldowns.

  <Global Cooldown: x>
  When using this skill, all skills within the battler's skill library area
  set to be on cooldown for x turns. This value has less priority than
  Individual Cooldowns and Skill Type Cooldowns.

  <Bypass Cooldown>
  This causes the skill to bypass cooldowns, no matter what. This should be
  used for skills like Attack, Guard, Escape, etc. that should not have a
  cooldown assigned to them.

Skill and Item Notetags:
  <Skill x Cooldown: +y>
  <Skill x Cooldown: -y>
  <Skill name Cooldown: +y>
  <Skill name Cooldown: -y>
  Targets hit by this skill will have skill x's cooldown adjusted by y.
  This does not apply to the user and applies only to the targets.

  <SType x Cooldown: +y>
  <SType x Cooldown: -y>
  Targets hit by this skill will have all skills in their skill library with
  Skill Type x to have their cooldowns adjusted by y. This does not apply to
  the user and applies only to the targets.

  <Global Cooldown: +x>
  <Global Cooldown: -x>
  Targets hit by this skill will have all skills in their skill library to
  have their cooldowns adjusted by y. This does not apply to the user and
  applies only to the targets.

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

  <Skill x Cooldown Duration: y%>
  <Skill name Cooldown Duration: y%>
  Alters the cooldown duration of skill x to y% when the cooldown cost is
  applied. This effect only applies to skill x.

  <SType x Cooldown Duration: y%>
  Alters the cooldown duration of skills with Skill Type x to y% when the
  cooldown cost is applied. This effect only applies to Skill Type x.

  <Global Cooldown Duration: x%>
  Alters the cooldown duration of all skills to x% when the cooldown cost
  is applied.

  <Skill x Cooldown Rate: y%>
  <Skill name Cooldown Rate: y%>
  Sets the cooldown rate for skill x to y% when the cooldown counter goes
  down. This effect only applies to skill x.

  <SType x Cooldown Rate: y%>
  Sets the cooldown rate for Skill Type x skills to y% when the cooldown
  counter goes down. This effect only applies to Skill Type x skills.

  <Global Cooldown Rate: x%>
  Sets the cooldown rate for all skills to x% when the cooldown counter
  goes down.

  <Skill x Cooldown: +y>
  <Skill x Cooldown: -y>
  <Skill name Cooldown: +y>
  <Skill name Cooldown: -y>
  If the user performs skill x, it will have an increased or decreased
  cooldown value as long as the user is the actor, class, enemy, or has the
  weapon or armor equipped, or is affected by the state with this notetag.
  These flat cooldown modifications are applied after the rates and duration
  modifiers have been calculated.

  <SType x Cooldown: +y>
  <SType x Cooldown: -y>
  If the user performs skill with skill type x, it will have an increased or
  decreased cooldown value as long as the user is the actor, class, enemy,
  or has the weapon or armor equipped, or is affected by the state with this
  notetag. These flat cooldown modifications are applied after the rates and
  duration modifiers have been calculated.

  <Global Cooldown: +x>
  <Global Cooldown: -x>
  If the user performs any skill, it will have an increased or decreased
  cooldown value as long as the user is the actor, class, enemy, or has the
  weapon or armor equipped, or is affected by the state with this notetag.
  These flat cooldown modifications are applied after the rates and duration
  modifiers have been calculated.

  <Skill x Warmup: +y>
  <Skill x Warmup: -y>
  <Skill name Warmup: +y>
  <Skill name Warmup: -y>
  At the start of battle, skill x will have an increased or decreased warmup
  value as long as the user is the actor, class, enemy, or has the weapon or
  armor equipped, or is affected by the state with this notetag. These flat
  warmup modifications are applied after the rates and duration modifiers
  have been calculated.

  <SType x Warmup: +y>
  <SType x Warmup: -y>
  At the start of battle, all skills with skill type x it will have an
  increased or decreased warmup value as long as the user is the actor,
  class, enemy, or has the weapon or armor equipped, or is affected by the
  state with this notetag. These flat warmup modifications are applied after
  the rates and duration modifiers have been calculated.

  <Global Warmup: +x>
  <Global Warmup: -x>
  At the start of battle, all skills will have an increased or decreased
  warmup value as long as the user is the actor, class, enemy, or has the
  weapon or armor equipped, or is affected by the state with this notetag.
  These flat warmup modifications are applied after the rates and duration
  modifiers have been calculated.

Lunatic Mode

JavaScript.png

For advanced users who have an understanding of JavaScript, you can use the following features added by the plugin to further enhance what you can do with your game project.

Specialized Cooldowns
For skills, you can set cooldowns to have a special code determine its value
when the skill is used.

Skill Notetag
  <Cooldown Eval>
  cooldown = x;
  cooldown += x;
  </Cooldown Eval>
  Insert these two tags into the skill's notebox to give it a unique way to
  determine the cooldown's value. The 'cooldown' variable determines the
  amount of turns for the cooldown.

  <Warmup Eval>
  warmup = x;
  warmup += x;
  </Warmup Eval>
  Insert these two tags into the skill's notebox to give it a unique way to
  determine the warmup's value. The 'warmup' variable determines the amount
  of turns for the warmup.

Action Sequences

These are action sequences that you can use with this plugin. Action Sequences will require Yanfly's Battle Engine Core to work.

Action Sequences - ala Melody

Battle Engine Core includes Yanfly Engine Melody's Battle Engine system, where each individual aspect of the skill and item effects can be controlled to a degree. These are called Action Sequences, where each command in the action sequence causes the game to perform a distinct individual action.

Each skill and item consists of five different action sequences. They are as follows:

1. Setup Actions
They prepare the active battler before carrying out the bulk of the action

and its individual effects. Usually what you see here are things such as the active battler moving forward a bit, unsheathing their weapon, etc. This step will occur before the active battler expends their skill or item costs.

2. Whole Actions
These actions will affect all of the targets simultaneously. Although this

section does not need to be used, most actions will use this for displaying animations upon all enemies. This step occurs after skill and item costs.

3. Target Actions
This section will affect all of the targets individually. Used primarily

for physical attacks that will deliver more personal forms of damage. Actions that occur here will not affect other targets unless specifically ordered to do so otherwise.

4. Follow Actions
This section will dedicate towards cleanup work after the individual

targeting actions. Here, it'll do things such as removing immortal flags, start up common events, and more.

5. Finish Actions
This section will have the active battler close up the action sequence.

Usually stuff like running waits and holds at the last minute for skills and items, moving back to place, and others.

Now that you know each of the five steps each action sequence goes through, here's the tags you can insert inside of skills and items. Pay attention to each tag name.

1. <setup action>
    action list
    action list
   </setup action>

2. <whole action>
    action list  
    action list  
   </whole action>

3. <target action>
    action list
    action list
   </target action>

4. <follow action>
    action list
    action list
   </follow action>

5. <finish action>
    action list
    action list
   </finish action>

They will do their own respective action sets. The methods to insert for the action list can be found below in the core of the Help Manual.

Furthermore, to prevent overflooding every single one of your database item's noteboxes with action sequence lists, there's a shortcut you can take to copy all of the setup actions, whole actions, target actions, follow actions, and finish actions with just one line.

<action copy: x:y>

Replace x with "item" or "skill" to set the type for the action list code to directly copy. The integer y is then the ID assigned for that particular object type. For example, to copy 45th skill's action sequences, the code would be <action copy: skill:45> for anything that will accept these action codes. If you do use this notetag, it will take priority over any custom that you've placed in the notebox.

Target Typing

You may notice that in some of the actions below will say "refer to target typing" which is this section right here. Here's a quick run down on the various targets you may select.

user This will select the active battler.
target, targets These will select the active targets in question.
actors, existing actors These will select all living actors.
all actors This will select all actors including dead ones.
dead actors This will select only dead actors.
actors not user This will select all living actors except for the user.
actor x This will select the actor in slot x.
character x This will select the specific character with actor ID x.
enemies, existing enemies This will select all living enemies.
all enemies This will select all enemies, even dead.
dead enemies This will select only dead enemies.
enemies not user This will select all enemies except for the user.
enemy x This will select the enemy in slot x.
friends This will select the battler's alive allies.
all friends This will select the all of battler's allies, even dead.
dead friends This will select the battler's dead allies.
friends not user This will select the battler's allies except itself.
friend x This will select the battler's ally in slot x.
opponents This will select the battler's alive opponents.
all opponents This will select the all of the battler's opponents.
dead opponents This will select the battler's dead opponents.
opponent x This will select the battler's opponent in slot x.
all alive Selects all living actors and enemies.
all members Selects all living and dead actors and enemies.
all dead Selects all dead actors and enemies.
all not user This will select all living battlers except user.
focus Selects the active battler and its targets.
not focus Selects everything but the active battler and its targets.
prev target Requires Action Sequence Impact.

During <Target Actions>, this will get the previous target in the targets list.

next target Requires Action Sequence Impact.

During <Target Actions>, this will get the next target in the targets list.

$UnisonMemberX Requires Unison Attack.

Replace X with the Unison Attack participant where X is slot used based on the <Unison Skill: x, y, z> notetag.

$UnisonMembers Requires Unison Attack.

Returns all of the participating Unison Skill members.

Action Sequence List

The following is a list of Action Sequences provided by this plugin.

If you have YEP_BattleEngineCore.js installed with this plugin located
underneath it in the Plugin Manager, you can make use of these extra
cooldown related action sequences.

=============================================================================
GLOBAL COOLDOWN: targets, +X
GLOBAL COOLDOWN: targets, -X
GLOBAL COOLDOWN: targets, X
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sets the cooldown for all of the targets to be adjusted by X value. This
applies to every skill that doesn't bypass cooldowns.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usage Example: global cooldown: target, +5
               global cooldown: user, -3
               global cooldown: enemies, 10
=============================================================================

=============================================================================
SKILL X COOLDOWN: targets, +Y
SKILL X COOLDOWN: targets, -Y
SKILL X COOLDOWN: targets, Y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Causes skill X to be adjusted by Y value for the targets. This only applies
the specific skill x's cooldown.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usage Example: skill 10 cooldown: target, +5
               skill 12 cooldown: user, -3
               skill 15 cooldown: enemies, 10
=============================================================================

=============================================================================
SKILL TYPE X COOLDOWN: targets, +Y
SKILL TYPE X COOLDOWN: targets, -Y
SKILL TYPE X COOLDOWN: targets, Y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Causes skill type X skills to be adjusted by Y value for the targets. This
only applies the specific skill type x skill's cooldown.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usage Example: skill type 1 cooldown: target, +5
               skill type 2 cooldown: user, -3
               skill type 5 cooldown: enemies, 10
=============================================================================

Tips & Tricks

The following Tips & Tricks effects use this plugin:

Changelog

Version 1.12:
- Updated for RPG Maker MV version 1.5.0.
- Added Parameter: Cooldown Bypass List

Version 1.11:
- Lunatic Mode fail safes added.

Version 1.10:
- Compatibility update with Equip Battle Skills.
- Documentation update. Added help information for <warmup: x>.

Version 1.09:
- Fixed a bug with the <Skill x Cooldown Rate: y%>,
<SType x Cooldown Rate: y%>, and <Global Cooldown Rate: x%> notetags not
working as intended.

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

Version 1.07:
- Named versions of these notetags have been added:
<Skill x Cooldown: y>, <Skill x Cooldown: +/-y>,
<Skill x Cooldown Duration: y%>, <Skill x Cooldown: +/-y>,
<Skill x Warmup: +/-y>

Version 1.06a:
- Fixed a bug with cooldown duration modifiers not modifying by the correct
value indicated.
- Added a fail safe for when there are no targets.

Version 1.05:
- Fixed a bug that prevented <Cooldown Eval> from running properly.

Version 1.04:
- Fixed a bug that didn't alter cooldowns correctly.

Version 1.03:
- Optimized for Battle Engine Core v1.08.

Version 1.02a:
- Added return for drawSkillCost to assist others scripters when making
compatibility notes.

Version 1.01:
- Cooldowns can now be applied to skills that aren't learned by the actor.

Version 1.00:
- Finished plugin!