YEP.25 – Damage Core

Yanfly Engine Plugins is a plugin library made for RPG Maker MV, a wonderful piece of software to help you make that role playing game of your dreams. You can find out more about RPG Maker MV here.

You can grab the plugin here:
English Dropbox
English Mirror
Portuguese Dropbox
Portuguese Mirror

The Damage Core plugin enables you to have full control over the damage calculation process of your game ranging from individual damage formulas to damage caps to damage calculation steps.


Introduction


The game gives a lot of control over the damage formula, but it doesn’t give much control for everything else after calculating the damage formula. This plugin will give you control over the order the damage fomrula is calculated in addition to letting you insert your own changes to the damage formula at whatever you you wish.

If you have YEP_BattleEngineCore.js installed, place this plugin under YEP_BattleEngineCore.js if you wish to make use of the extra features this plugin has to offer.


Notetags


The following are some notetags you can use to modify the damage caps.

Skill and Item Notetag:

<Bypass Damage Cap>
This causes the skill/item to ignore the damage cap and go with the regular value of the calculated damage. This will cancel out any damage cap effects otherwise. This will take priority over any damage cap breaking effects.

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

<Bypass Damage Cap>
This will cause the related battler to bypass any damage capping effects and its skills/items will go with the uncapped calculated value.

<Damage Cap: x>
<Heal Cap: x>
This will set the skill to have a damage/healing cap of x. This will cancel out any damage cap bypassers. If a battler has more than one damage cap, it will go with the highest value. This means if an actor that has a weapon that brings the damage cap to 99,999 and an accessory that brings the damage cap to 999,999, then the battler’s damage cap will be the highest value of 999,999.


Plugin Commands


The following are plugins you can use to set the damage cap rulings for your game. Keep in mind that individual aspects such as equipment traits, skill properties, etc. will take priority over these default caps.

Plugin Command:

SetDamageCap 9999
Sets the default damage cap to 9999.

SetHealingCap 9999
Sets the default healing cap to 9999.

EnableDamageCap
Enables default cap for both damage and healing.

DisableDamageCap
Disables default cap for both damage and healing.


Lunatic Mode – Damage Formula


For those who think the damage formula box is too small and would like to use the notebox instead to declare the damage formula, you can use the notetags below:

Skill and Item Notetags:

<damage formula>
value = 500;
value += 2500;
</damage formula>
This will overwrite the damage formula found at the top and use the strings in the middle as the formula instead. Keep in mind that using comments here will cancel out anything following after. New variables can be used, too, to make damage calculations a bit easier.

value – Refers to the amount that will become the base damage value.
user – Refers to the actor/enemy using the skill/item.
subject – Refers to the actor/enemy using the skill/item.
target – Refers to the target actor/enemy on the receiving end of the skill/item.


Lunatic Mode – Damage Steps


The damage formula isn’t all there is to calculating the damage that appears at the very end. In this plugin’s parameters towards the bottom, you’ll see a large list of Damage Steps. Each one of these steps is a line of code that the damage count will run through in order to calculate and finalize the damage output.

The purpose of those parameters is to allow you ease of access on where you want to insert code that is your own or custom code provided by another plugin. Here’s a quick reference on how the original damage flow looked like:

Game_Action.prototype.makeDamageValue = function(target, critical) {
var item = this.item();
var baseDamage = this.evalDamageFormula(target);
var value = baseDamage * this.calcElementRate(target);
if (this.isPhysical()) {
value *= target.pdr;
}
if (this.isMagical()) {
value *= target.mdr;
}
if (baseDamage < 0) {
value *= target.rec;
}
if (critical) {
value = this.applyCritical(value);
}
value = this.applyVariance(value, item.damage.variance);
value = this.applyGuard(value, target);
value = Math.round(value);
return value;
};

In the vein of keeping everything organized, the following lines have been incorporated into new functions:

Formula New Function
value *= target.pdr value = this.applyPhysicalRate
value *= target.mdr value = this.applyMagicalRate
value *= target.rec value = this.applyHealRate
value = this.applyCritical(value) value = this.applyCriticalRate


Yanfly Engine Plugins – Battle Engine Extension – Action Sequence Commands


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


BYPASS DAMAGE CAP
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
This will override all damage caps. This is applied to healing, too.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: bypass damage cap


DAMAGE CAP: x
HEALING CAP: x
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
This sets the action’s damage cap to x, overriding all over damage caps in play except its own. This will also apply to healing, too.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: damage cap: 999
healing cap: 999999


DAMAGE RATE: x%
DAMAGE RATE: x.y
DAMAGE RATE: VARIABLE x
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
This changes the damage rate across all types of damage (physical, magical, and certain hit). The damage rate is reset at the end of each action sequence. If you use a variable, it is treated as a percentage.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: damage rate: 50%
damage rate: 8.667
damage rate: variable 3


FLAT DAMAGE: +x
FLAT DAMAGE: -x
FLAT DAMAGE: VARIABLE x
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
This adds a flat damage across all types of damage (physical, magical, and certain hit). The flat damage is reset at the end of each action sequence. If you use a variable, it is added onto the damage.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: flat damage: +100
flat damage: -250
flat damage: variable 3


FLAT GLOBAL: +x
FLAT GLOBAL: -x
FLAT GLOBAL: VARIABLE x
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
This adds a flat global damage and heal across all types of damage (physical, magical, and certain hit). The flat damage and heal is reset at the end of each action sequence. If you use a variable, it is added onto the damage and heal.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: flat global: +100
flat global: -250
flat global: variable 3


FLAT HEAL: +x
FLAT HEAL: -x
FLAT HEAL: VARIABLE x
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
This adds a flat heal across all types of damage (physical, magical, and certain hit). The flat heal is reset at the end of each action sequence. If you use a variable, it is added onto the heal.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: flat heal: +100
flat heal: -250
flat heal: variable 3


GLOBAL RATE: x%
GLOBAL RATE: x.y
GLOBAL RATE: VARIABLE x
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
This changes the damage and healing rates across all types of damage (physical, magical, and certain hit). The damage and healing rates are reset at the end of each action sequence. If you use a variable, it is treated as a percentage.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: global rate: 50%
global rate: 8.667
global rate: variable 3


HEAL RATE: x%
HEAL RATE: x.y
HEAL RATE: VARIABLE x
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
This changes the healing rate across all types of damage (physical, magical, and certain hit). The healing rate is reset at the end of each action sequence. If you use a variable, it is treated as a percentage.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: heal rate: 50%
heal rate: 8.667
heal rate: variable 3


RESET DAMAGE CAP
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
This will reset the damage cap implemented by the Damage Cap action sequence. This will also reset the effects of the Bypass Damage Cap action sequence.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: reset damage cap


RESET DAMAGE MODIFIERS
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
This will cause all damage and healing modifiers caused by action sequences to reset. While they normally reset at the end of each action sequence, this will allow you to do it manually.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: reset damage modifiers


Happy RPG Making!


Happy RPG Making!


These plugins and Tips & Tricks ideas are made possible thanks to our creative patrons on Patreon! The majority of our Tips & Tricks ideas are placed within the Patreon-exclusive Sample Project for quick and easy access! If you'd like to make a Plugin Suggestion, Yanfly's Patreon-based Suggestion Box a visit here:


If you have any bugs to report, visit the following link:


If you have any questions about Action Sequences, visit the following link:



Thank you!