Skill Mastery Levels (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

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

Note: If you are using YEP_SkillCore.js and/or YEP_X_SkillCooldowns.js,
place this plugin under those in the plugin manager list. This plugin works
independent of those plugins, but will work better with them if placed in
this specific order.

In some RPG's, using skills over and over will result in some form of skill
mastery, effectively increasing the damage output, decreasing the cost of
said skills, and/or lowering the cooldown duration of the skills, too. This
plugin lets you accomplish such by adding in a Skill Mastery Level mechanic.

The Skill Mastery Level mechanic works like such: when an actor or enemy
uses a skill in battle, they gain mastery EXP. Once the mastery EXP reaches
a certain threshhold, that skill's mastery level will increase, giving it
the desired mastery effects, of which can be increased damage, decreased
skill costs, or decreased cooldown duration. Each of these aspects can be
adjusted globally or individually from the formula used for the EXP required
per level up to the damage increase, cost alteration, or cooldown durations.

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.

To determine the effect the mastery level of a skill has or other various
mastery-related properties, use the following notetags for those skills:

---

Skill Notetags:

  <Max Mastery Level: x>
  - Replace 'x' with the max mastery level you want a skill to have. If you
  don't want the skill to have any mastery level at all, replace it with 0.

  <Mastery Effect: +x Damage Per Level>
  <Mastery Effect: +x HP Cost Per Level>
  <Mastery Effect: +x MP Cost Per Level>
  <Mastery Effect: +x TP Cost Per Level>
  <Mastery Effect: +x Cooldown Per Level>
  <Mastery Effect: -x Damage Per Level>
  <Mastery Effect: -x HP Cost Per Level>
  <Mastery Effect: -x MP Cost Per Level>
  <Mastery Effect: -x TP Cost Per Level>
  <Mastery Effect: -x Cooldown Per Level>
  - This will increase or decrease the damage, HP cost, MP cost, TP cost,
  cooldown turns respectively for the skill depending on its mastery level.
  Replace 'x' with a flat number value of how much you want it to shift per
  the skill's mastery level.
  - Note: HP Cost requires YEP_SkillCore.js.
  - Note: Cooldown requires YEP_X_SkillCooldowns.

  <Mastery Effect: +x% Damage Per Level>
  <Mastery Effect: +x% HP Cost Per Level>
  <Mastery Effect: +x% MP Cost Per Level>
  <Mastery Effect: +x% TP Cost Per Level>
  <Mastery Effect: +x% Cooldown Per Level>
  <Mastery Effect: -x% Damage Per Level>
  <Mastery Effect: -x% HP Cost Per Level>
  <Mastery Effect: -x% MP Cost Per Level>
  <Mastery Effect: -x% TP Cost Per Level>
  <Mastery Effect: -x% Cooldown Per Level>
  - This will increase or decrease the damage, HP cost, MP cost, TP cost,
  cooldown turns respectively for the skill depending on its mastery level.
  Replace 'x' with a percentile number value of how much you want it to
  shift per the skill's mastery level.
  - Note: HP Cost requires YEP_SkillCore.js.
  - Note: Cooldown requires YEP_X_SkillCooldowns.

  <No Damage Mastery Effect>
  <No HP Cost Mastery Effect>
  <No MP Cost Mastery Effect>
  <No TP Cost Mastery Effect>
  <No Cooldown Mastery Effect>
  - These notetags will disable their respective mastery effects from the
  default settings. They will just have their default value with nothing
  changed about them at all.
  - Note: HP Cost requires YEP_SkillCore.js.
  - Note: Cooldown requires YEP_X_SkillCooldowns.

  <Custom EXP Mastery Formula: x>
  - Makes a custom EXP mastery formula for the skill. Replace 'x' with the
  desired formula you wish to use for it.
  - Example: <Custom EXP Mastery Formula: level * 20 + 5>

  <Custom Damage Mastery Formula: x>
  - Makes a custom damage mastery formula for the skill. Replace 'x' with
  the desired formula you wish to use for it.
  - Example: <Custom Damage Mastery Formula: value * (1.00 + (level * 0.20))>

  <Custom HP Cost Mastery Formula: x>
  - Makes a custom HP cost mastery formula for the skill. Replace 'x' with
  the desired formula you wish to use for it.
  - Example: <Custom HP Cost Mastery Formula: cost * (1.00 - (level * 0.05))>
  - Note: HP Cost requires YEP_SkillCore.js.

  <Custom MP Cost Mastery Formula: x>
  - Makes a custom MP cost mastery formula for the skill. Replace 'x' with
  the desired formula you wish to use for it.
  - Example: <Custom MP Cost Mastery Formula: cost * (1.00 - (level * 0.05))>

  <Custom TP Cost Mastery Formula: x>
  - Makes a custom TP cost mastery formula for the skill. Replace 'x' with
  the desired formula you wish to use for it.
  - Example: <Custom TP Cost Mastery Formula: cost * (1.00 - (level * 0.05))>

  <Custom Cooldown Mastery Formula: x>
  - Makes a custom cooldown mastery formula for the skill. Replace 'x' with
  the desired formula you wish to use for it.
  - Example: <Custom Cooldown Mastery Formula: turns - (level * 1.5)>

---

Actor and Enemy Notetags:

  <Starting Skill Masteries>
   list
   list
   list
  </Starting Skill Masteries>
  - If you want actors and/or enemies to have initial starting skill mastery
  levels, use the above notetag. This will only apply for actors when
  starting a new game or initializing them. Replace 'list' with one of the
  following setups:

  Skill x: level
  Skill x: level, exp
  name: level
  name: level, exp
  - Replace 'x' with the ID of the skill you wish to alter the starting
  mastery level of. Alternatively, you can replace 'Skill x' with the skill
  'name'. If multiple skills have the same name in the database, this will
  apply to the first skill entry with that name.
  - Replace 'level' with the level you wish to start it off as. This cannot
  go under 0 nor go above the maximum level of the skill.
  - If used, replace 'exp' with the amount of EXP it will currently have at
  the start. This cannot be greater than or equal to the maximum value for
  the skill mastery level's EXP. If not used, it will default to 0.

  Example:

  <Starting Skill Masteries>
   Skill 5: 2
   Skill 6: 3, 4
   Firaga: 7
   Firaja: 8, 10
  </Starting Skill Masteries>
  - In the above example, the actor/enemy will have Skill 5 and 6 starting
  at levels 2 and 3 respectively. However, Skill 6 will also have some skill
  EXP starting at 4. The actor/enemy's 'Firaga' and 'Firaja' skills will
  start at levels 7 and 8 respectively while 'Firaja' will have 10 skill EXP
  at the very start.

---

Script Calls

ScriptCallsMV.png

Script Calls are event commands that are used to run JavaScript code during an event to call upon unique functions, usually added by the related plugin.

Here is a list of Script Call(s) that you may use:

For those with JavaScript experience, you can use the following script calls
reference or alter skill mastery levels to your liking:

Script Calls:

  battler.skillMasteryLevel(skillId)
  - 'battler' is a variable that represents an actor/enemy. Replace 'skillId'
  with the ID of the skill whose mastery level you wish to acquire.
  This will return the mastery level of that skill.

  battler.setSkillMasteryLevel(skillId, level)
  - 'battler' is a variable that represents an actor/enemy. Replace 'skillId'
  with the ID of the skill whose mastery level you wish to alter.
  Replace 'level' with the level of the skill you wish to set it to. This
  will not allow the skill mastery level to go below 0 or above its max level
  and the number of uses will be set to 0 for that level.

  battler.gainSkillMasteryLevel(skillId, value)
  - 'battler' is a variable that represents an actor/enemy. Replace 'skillId'
  with the ID of the skill whose mastery level you wish to increase.
  Replace 'value' with the amount of levels to increase (or decrease) the
  skill's current mastery level by.

  battler.skillMasteryUses(skillId)
  - 'battler' is a variable that represents an actor/enemy. Replace 'skillId'
  with the ID of the skill whose current mastery usage amount you wish to
  acquire the value of. This will return the current mastery usage amount
  of that skill.

  battler.setSkillMasteryUses(skillId, value)
  - 'battler' is a variable that represents an actor/enemy. Replace 'skillId'
  with the ID of the skill whose current mastery usage amount to be changed.
  Replace 'value' with the amount to set the amount to. If the usage amount
  exceeds the need to reach the next level, the skill automatically update
  to the next mastery level and set the mastery usage amount to 0.

  battler.gainSkillMasteryUses(skillId, value)
  - 'battler' is a variable that represents an actor/enemy. Replace 'skillId'
  with the ID of the skill whose current mastery usage amount to be changed.
  Replace 'value' with the amount to increase/decrease. If the usage amount
  exceeds the need to reach the next level, the skill automatically update
  to the next mastery level and set the mastery usage amount to 0.

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.

Requires YEP_SkillCore.js
There are no specific Skill Mastery Levels lunatic notetags, but this part
of the help file will serve as a means to answer potential questions that
people may have about how to add special effects based on a battler's
mastery level.

These examples require YEP_SkillCore.js as they use the Skill Core's lunatic
notetags to produce special effects.

YEP_SkillCore.js Skill Notetag Examples:

---

<After Eval>
if (user.skillMasteryLevel(item.id) >= 5) {
  target.addState(10);
  target.removeState(9);
}
<After Eval>

The above code will make a check to see if the user's current mastery level
of the skill is greater than or equal to 5. If it is, then state 10 in the
database will also be applied to the target. However, state 9 will then be
removed from the target.

---

<After Eval>
if (user.skillMasteryLevel(item.id) >= 2) {
  user.addBuff(3, 5);
  user.addDebuff(5, 8);
}
<After Eval>

The above code will make a check to see if the user's current mastery level
of the skill is greater than or equal to 2. If it is, then the user will
gain a DEF buff for 5 turns. However, the user will then suffer a debuff for
MDF for 8 turns.

For reference on what the parameter ID's are:

0 = MaxHP
1 = MaxMP
2 = ATK
3 = DEF
4 = MAT
5 = MDF
6 = AGI
7 = LUK

---

<After Eval>
if (user.skillMasteryLevel(item.id) >= 3) {
  $gameTemp.reserveCommonEvent(5)
}
<After Eval>

The above code will make a check to see if the user's current mastery level
of the skill is greater than or equal to 3. If it is, common event 5 will be
reserved and ran once applicable.

---

There are more possibilities with the way lunatic code can be used than just
these examples listed here. For some ideas, be sure to check out the Tips &
Tricks on Yanfly.moe.

Changelog

Version 1.00:
- Finished Plugin!