Difference between revisions of "Counter Control (YEP)"

From Yanfly.moe Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{MvPlugin
 
{{MvPlugin
 
|preview = <youtube>https://www.youtube.com/watch?v=er2SJA59IGE</youtube>
 
|preview = <youtube>https://www.youtube.com/watch?v=er2SJA59IGE</youtube>
|link1 = <html><iframe src="https://itch.io/embed/398273" height="167" width="552" frameborder="0"></iframe></html>
+
|link2 = <html><iframe src="https://itch.io/embed/508138" height="167" width="552" frameborder="0"></iframe></html>
|link2 = [http://yanfly.moe/plugins/en/YEP_X_CounterControl.js Mirror]
+
|link3 = <html><iframe src="https://itch.io/embed/398158" height="167" width="552" frameborder="0"></iframe></html>
  
 
}}
 
}}

Latest revision as of 10:40, 13 June 2020

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.



Download

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.


Masterarbeit Writer

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.


Introduction

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

If you are using Imported.YEP_X_BattleSysATB or Imported.YEP_X_BattleSysCTB,
place this plugin under those plugins in the plugin list.

The default counterattack trait in RPG Maker MV doesn't give many options
for the developer. It's a skill that flatout cancels out the physical skill
of the attacker by evading it and then producing a normal attack from the
counterattacker. This plugin will give you more control over how counters
work in the sense that you can choose to have the counter connect first
before allowing the counter skill to proc.

Instructions

How Advanced Counters Work

A counterattack is an action that serves as a reaction to an action used by
an opposing battler unless the action is marked as able of being countered
by allied members.

Now begins a clash between the attacker's anti-counter stat (newly added)
against the target's counter stat plus any of the action's modifiers. Once
the finalized counter rate is decided, a random number check is made to see
if the counter will pass. If it doesn't, no counter will occur. If it does,
the next step occurs.

The target will then generate a pool of skills it can use as counters. It
will go in a priority list mentioned in the next section below. The battle
system will then go through the pool of skills in order and select the first
counter skill that meets all of the conditions required. If no skill is
selected, no skill will be used as a counter. All skills have a mandatory
requirement of being able to pay the skill's cost and can use it.

Once the skill is selected, the counter skill is placed in the counter queue
and waits for the current attacker's turn to be over. Once over, the actions
in the counter queue will begin. The counterattacker will perform counter
actions without conflicting with their own turns. This process will repeat
itself until the counter queue is emptied.

During the counter queue process, counter skills can trigger counter skills,
too. For that reason, there is a maximum queue size determined by the plugin
parameters. Once the queue count reaches this size, no more counter skills
will be added to the counter queue.

Counter Skill Priority List

When the pool of counter skills is being generated, they will be generated
in the following order:

1. States - Highest Priority Notebox
2. States - Lowest Priority Notebox
3. Equipment - Weapons Notebox
4. Equipment - Armors Notebox
5. Actor - Current Class Notebox
6. Actor - Actor Notebox
7. Enemy - Enemy Notebox

The order of the pool of counter skills matter in that when going through
the conditions of the counter skill to be used, the first counter skill
whose condition is met will be the one used.

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.

---

You can use the following notetags to alter counters in your game. Each of
these notetags will alter counters in a particular way.

Actor and Enemy Notetags:

  <Default Counter: x>
  <Default Counter: name>
  Sets the default counter skill to x. If it is left as 0, then the counter
  skill will be RPG Maker MV's default counter skill. If you are using the
  name of the skill, and there are multiple skills in the database with the
  same name, then priority will be given to the skill with the highest ID.
  *Note: Use 0 for x if you wish to add RPG Maker MV's default counter.

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

  <Counter Skills: x>
  <Counter Skills: x, x, x>
  <Counter Skills: x to y>
  This will add to the list of possible counter skills for the battler.
  If multiple skill ID's are listed, then they're all added. Priority will
  be given to the counter skills listed earlier.
  *Note: Use 0 for x if you wish to add RPG Maker MV's default counter.
  *Note2: See the Counter List priority to see which skills will be given
  priority on the counter skill list.

  <Counter Skill: name>
  This will add the named skill to the list of possible counter skills for
  the battler. If there are multiple skills in the database with the same
  name, then priority will be given to the skill with the highest ID.
  *Note: See the Counter List priority to see which skills will be given
  priority on the counter skill list.

  <Counter Total: +x>
  <Counter Total: -x>
  Alters the number of times the battler can counter by x. This is the
  amount of times the battler can counter until the battler's turn comes up
  at which, the number of times is reset.

  <Target Counter: x%>
  When this battler attacks an opponent target, this will cause the target
  counter rate to be altered by x% rate. If a target has 10% CNT, then a
  notetag of 50% will cause the counter rate to become 5%.

  <Target Counter: +x%>
  <Target Counter: -x%>
  When this battler attacks an opponent target, this will cause the target
  counter rate to increase or decrease by x%. If a target has 10% CNT, then
  a notetag of +50% will cause the counter rate to become +60%.

  <Evade Counter>
  This will change all counter skills used by the related battler to become
  evade counters regardless of their default nature. However, if the battler
  is affected by a trait that is <Hit Counter>, then priority will be given
  to the <Hit Counter> trait instead.

  <Hit Counter>
  This will change all counter skills used by the related battler to become
  hit counters regardless of their default nature. If the battler is also
  affected by <Evade Counter>, this effect will take priority.

Skill and Item Notetags:

  <Ally Counter>
  Makes this action able to proc counter skills by allied members.

  <Ally Cannot Counter>
  Makes this action unable to proc counter skills by allied members.

  <Cannot Counter>
  Causes this action to be un-counterable. This means that it will always
  return a 0% counterattack possibility.

  <Counter Rate: x%>
  This will cause this action to proc a counter from the target by x% rate.
  This means if the target has a 10% chance to counter and this notetag is
  50%, then the target will have a 5% chance to counter.

  <Counter Rate: +x%>
  <Counter Rate: -x%>
  This will cause this action to proc a counter from the target by an
  additive x%. This means if the target has a 10% chance to counter and this
  notetag is +50%, then the target has a 60% chance to counter.

Skill Notetags:

  <Evade Counter>
  If this skill is being used as the counter skill, the battler will evade
  the current action and then counter.

  <Hit Counter>
  If this skill is being used as the counter skill, the battler will take
  the hit against the current action and then counter.

  <Counter Name: text>
  This changes the displayed name of the skill when used as a counter skill
  to 'text'.

  <Counter Icon: x>
  This changes the displayed icon of the skill when used as a counter skill
  to x icon.

Counter Conditions

When making your counter skills, you can have those counter skills respond
only to specific conditions. If all conditions are met, the counter skill
will occur. If a single condition isn't met, that counter skill will then be
skipped and the next one will be checked. To add counter conditions, use the
following notetags:

Skill Notetags:

  <Counter Condition>
   condition
   condition
  </Counter Condition>
  Replace the 'condition' text in between the notetags with the listed in
  the conditions list below to best fit what you want.

--- Example ---

  <Counter Condition>
   physical hit
   single target
  </Counter Condition>
  This skill will only be used as a counter skill if the current action is
  a physical hit that's single target.

Counter Condition List

Here is a list of all the counter conditions that come with this plugin that
you can use. Keep in mind that all of the counter conditions must be met
before a counter will take effect. If even a single counter condition fails
to be met, the counter skill will not proc.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
ATTACKER param eval
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Replace 'param' with 'level', 'maxhp', 'hp', 'maxmp', 'mp', 'atk', 'def',
'mat', 'mdf', 'agi', or 'luk'. This will run a check against the attacker's
parameter. If the check returns 'true', the counter condition is met. If it
returns 'false', the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Attacker level > 50
           Attacker hp <= attacker.mhp * 0.50
           Attacker atk > defender.def
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
CERTAIN HIT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is a certain hit, the counter
condition is met. If it isn't, the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Certain Hit
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
COUNTER HIT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is a counter skill, the
counter condition is met. If it isn't, the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Counter Hit
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
DEFENDER param eval
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Replace 'param' with 'level', 'maxhp', 'hp', 'maxmp', 'mp', 'atk', 'def',
'mat', 'mdf', 'agi', or 'luk'. This will run a check against the defender's
parameter. If the check returns 'true', the counter condition is met. If it
returns 'false', the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Defender level > 50
           Defender hp <= defender.mhp * 0.50
           Defender atk > attacker.def
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
ELEMENT: x
ELEMENT: name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target has element X attached to it,
the counter condition is met. If it isn't, the counter condition isn't met.
Replace 'x' with the element ID or the element name in the database system
tab. If multiple elements share the same name, priority will be given to the
element with the highest ID.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Element: 4
           Element: Fire
           Element: Ice
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
EVAL: code
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
For those with JavaScript experience, you can use the above line to perform
an eval check to see if the conditions are met for the counter skill. If the
eval check returns 'true', the condition is met. If it returns 'false', the
condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Eval: attacker.name() === 'Harold'
           Eval: defender.hpRate() <= 0.50
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
ITEM: x
ITEM: name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current aciton used against the target is item x, the counter
condition is met. If it isn't, the counter condition isn't met. Replace 'x'
with the item ID. If you choose to use the item name, and your database
has multiple items with the same name, priority will be given to the item
with the highest ID.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Item: 30
           Item: Bomb
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
MAGICAL HIT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is a magical hit, the counter
condition is met. If it isn't, the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Magical Hit
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
MULTI TARGET
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is a multi target action, the
counter condition is met. If it isn't, the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Multi Target
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
NOT CERTAIN HIT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is NOT certain hit, the
counter condition is met. If it is, the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Not Certain Hit
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
NOT COUNTER HIT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is NOT a counter skill, the
counter condition is met. If it is, the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Not Counter Hit
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
NOT ELEMENT: x
NOT ELEMENT: name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target has element X attached to it,
the counter condition is NOT met. If it isn't, the counter condition is met.
Replace 'x' with the element ID or the element name in the database system
tab. If multiple elements share the same name, priority will be given to the
element with the highest ID.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Not Element: 4
           Not Element: Fire
           Not Element: Ice
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
NOT ITEM: x
NOT ITEM: name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current aciton used against the target is NOT item x, the counter
condition is met. If it is, the counter condition isn't met. Replace 'x'
with the item ID. If you choose to use the item name, and your database
has multiple items with the same name, priority will be given to the item
with the highest ID.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Not Item: 30
           Not Item: Bomb
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
NOT MAGICAL HIT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is NOT a magical hit, the
counter condition is met. If it is, the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Not Magical Hit
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
NOT PHYSICAL HIT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is NOT a physical hit, the
counter condition is met. If it is, the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Not Physical Hit
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
NOT SKILL: x
NOT SKILL: name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current aciton used against the target is NOT skill x, the counter
condition is met. If it is, the counter condition isn't met. Replace 'x'
with the skill ID. If you choose to use the skill name, and your database
has multiple skills with the same name, priority will be given to the skill
with the highest ID.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Not Skill: 50
           Not Skill: Firaga
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
NOT STYPE: x
NOT STYPE: name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is NOT a skill and skill type
x, the counter condition is met. If it isn't the counter condition isn't
met. Replace 'x' with the Skill Type ID. If you choose to use the skill type
name and your database has multiple skill types with the same name, priority
will be given to the skill type with the highest ID.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Not Stype: 1
           Not Stype: Magic
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
PHYSICAL HIT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is a physical hit, the counter
condition is met. If it isn't, the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Physical Hit
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
RANDOM: x%
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This will run a random check. There is a x% chance that this counter check
will pass. If it passes, the counter condition is met. If it doesn't, the
counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Random: 30%
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
SINGLE TARGET
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is a single target action, the
counter condition is met. If it isn't, the counter condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Single Target
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
SKILL: x
SKILL: name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current aciton used against the target is skill x, the counter
condition is met. If it isn't, the counter condition isn't met. Replace 'x'
with the skill ID. If you choose to use the skill name, and your database
has multiple skills with the same name, priority will be given to the skill
with the highest ID.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Skill: 50
           Skill: Firaga
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STYPE: x
STYPE: name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If the current action used against the target is a skill and skill type x,
the counter condition is met. If it isn't the counter condition isn't met.
Replace 'x' with the Skill Type ID. If you choose to use the skill type name
and your database has multiple skill types with the same name, priority will
be given to the skill type with the highest ID.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Stype: 1
           Stype: Magic
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
SWITCH x OFF
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If switch x is OFF (false) prior to the current action being used against
the target, the counter condition is met. If it is ON (true), the counter
condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Switch 10 Off
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
SWITCH x ON
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If switch x is ON (ftrue) prior to the current action being used against
the target, the counter condition is met. If it is OFF (false), the counter
condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Switch 10 On
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
VARIABLE x eval
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This runs an eval check against variable x. If the eval check returns 'true'
the condition is met. If it returns 'false' then the condition isn't met.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example:   Variable 15 >= 15
           Variable 16 <= 20
           Variable 17 === $gameParty.aliveMembers().length
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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.

Custom Counter Skills

For those with JavaScript proficiency, you can use the following Lunatic
Mode notetags to give a dynamic set of skills granted for counter usage.

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

  <Custom Counter Skills>
   if (user.name() === 'Harold') {
     skills.push(50, 51, 52);
   } else if (user.name() === 'Therese') {
     skills.push(53, 54, 55);
   } else if (user.name() === 'Marsha') {
     skills.push(56, 57, 58);
   } else if (user.name() === 'Lucius') {
     skills.push(59, 60, 61);
   }
  </Custom Counter Skills>
  The 'skills' variable is an array that will contain all the counter skills
  that will be added to the list of potential skills the battler can counter
  actions with provided that their requirements are met.

Custom Counter Total

For those with JavaScript proficiency, you can use the following Lunatic
Mode notetags to give a dynamic counter total bonus:

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

  <Custom Counter Total>
   value = user.level;
  </Custom Counter Total>
  The 'value' variable is the total amount of counters is increased or
  decreased by. If the total counter value reaches 0 or less than 0 for the
  battler, the battler is unable to use counter skills.

Custom Target Counter Rate

For those with JavaScript proficiency, you can use the following Lunatic
Mode notetags to make the attacker's traits alter the target's CNT rate.

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

  <Custom Target Counter Rate>
   rate -= user.hpRate();
  </Custom Target Counter Rate>
  The 'rate' variable is the final rate used to determine the counter rate
  the target has. It is already given the value calculated from the target's
  CNT value. This is calculated before the skill's custom counter rate.

Custom Counter Rates

For those with JavaScript proficiency, you can use the following Lunatic
Mode notetags to give skills a dynamic chance for the target to counter.

Skill and Item Notetags:

  <Custom Counter Rate>
   rate += target.hpRate();
  </Custom Counter Rate>
  The 'rate' variable is the final rate used to determine the counter rate
  the target has. It is already given the value calculated from the target's
  CNT value plus any additional counter rate modifiers from the skill. This
  is calculated after the attacker's custom target counter rate.

Custom Counter Condition

For those with JavaScript proficiency, you can use the following Luantic
Mode notetags to give counter skills a custom counter condition. While you
can do the same with an Eval condition, this notetag is for those who prefer
to take control over everything at once.

Skill Notetags:

  <Custom Counter Condition>
   if (attacker.name() === 'Harold') {
     condition = true;
   } else if (defender.name() === 'Therese') {
     condition = true;
   } else {
     condition = false;
   }
  </Custom Counter Condition>
  The 'condition' variable determines whether or not the counter skill will
  pass or fail. If the 'condition' variable returns 'true', the condition is
  met. If the 'condition' variable returns 'false', the condition fails to
  be met. Once the condition is met, the rest of the <Counter Condition>
  conditions will be checked.

Tips & Tricks

The following Tips & Tricks effects use this plugin:

Changelog

Version 1.10:
- Fixed a bug that caused "Counter Hit" to not work properly.

Version 1.09:
- Bypass the isDevToolsOpen() error when bad code is inserted into a script
call or custom Lunatic Mode code segment due to updating to MV 1.6.1.

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

Version 1.07a:
- Lunatic Mode fail safes added.
- Optimization update

Version 1.06:
- Updated for RPG Maker MV version 1.3.2.

Version 1.05:
- Fixed a bug that caused the Eval: condition to not work and crash.
- Fixed an issue that caused default counter attacks to trigger upon magical
actions.

Version 1.04:
- Fixed a bug that caused counter-countered actions to no longer disappear
from queue.

Version 1.03:
- Fixed a bug that caused enemies to get a free action after a counter in
the DTB engine.

Version 1.02:
- Fixed a bug that didn't replace the proper skill for the countered battler
appropriate causing some action effects to not proc correctly.

Version 1.01:
- Fixed a bug that caused the <Counter Skills: 0> notetag to not work.

Version 1.00:
- Finished Plugin!