Introduction
Allows for more control over damage and stuff.
Features
Play a sound effect when dealing 0 damage, or healing for 0 hp. Pitch variances may also be set for the sounds.
Introduces adaptive & piercing damage, as well as countermeasures to them.
Allows attacks to ignore guarding.
Allows for forcing min/max variance, or no variance.
How to use
Sound effects are defined in the plugin parameters.
The following notetags are available: Skills, Items, Actors, Classes, Enemies, & States notetags:
<adaptive>
复制代码
Calculates damage using higher of target's physical or magical damage rate.
For Actors, Classes, Enemies, or States, causes all of user's attacks and skills to become adaptive.
<adaptiveeval>
复制代码
//code
复制代码
</adaptiveeval>
复制代码
Evaluates code to determine if the attack should be adaptive.
Must return either true (adaptive) or false (not adaptive).
You may use 'a' for the attacker, 'b' for the defender, and 'item' for the skill/item Object.
<piercing:x>
复制代码
,
<ppiercing:x>
复制代码
,
<mpiercing:x>
复制代码
Ignores a percentage of target's damage reduction. x must be a value between 0 and 1.
'piercing' applies to both PDR and MDR, while 'ppiercing' and 'mpiercing' apply only to PDR and MDR respectively.
For Actors, Classes, Enemies, or States, causes all of user's attacks and skills to have x piercing, overriding any skill or item notetags.
Notetag priority from highest to lowest is as follows:
States, Classes (for actors), Enemies/Actors
EXAMPLE
<piercing:0.4>
复制代码
If a physical skill with this notetag is used against a target with 80% Physical Damage Rate, the calculation is as follows:
Original damage reduction = 100% - 80% = 20%
0.4 / 40% of the damage reduction is ignored.
Target still has 20% * (1 - 0.4) = 12% damage reduction.
Final Physical Damage Rate = 100% - 12% = 88%
<piercingeval>
复制代码
//code
复制代码
</piercingeval>
复制代码
Evaluates code to determine piercing. Must return a value between 0 and 1.
You may also use
<ppiercingeval>
复制代码
for physical piercing, or
<mpiercingeval>
复制代码
for magical piercing.
You may use 'a' for the attacker, 'b' for the defender, and 'item' for the skill/item Object.
Values below 0 are treated as 0.
EXAMPLE
<mpiercingeval>
复制代码
(a.agi - b.agi) * 0.01
复制代码
</mpiercingeval>
复制代码
This would give 1% magical piercing per AGI the user has more than the target.
If the target has more AGI, piercing will be 0.
<nullguard>
复制代码
Bypasses guard. Damage will be calculated as though target was not guarding.
For Actors, Classes, Enemies, or States, causes all of user's attacks and skills to bypass guard.
Actors, Classes, Enemies, & States notetags:
<piercingplus:x>
复制代码
,
<ppiercingplus:x>
复制代码
,
<mpiercingplus:x>
复制代码
Adds x bonus piercing amount to all of the user's attacks and skills.
<piercingmult:x>
复制代码
,
<ppiercingmult:x>
复制代码
,
<mpiercingmult:x>
复制代码
Multiplies user's piercing effects by x.
This is calculated after piercingplus.
No effect if piercing is 0.
<nulladaptive>
复制代码
Protects the user from adaptive effects.
Damage will be calculated based on attacker's skill's default Hit Type.
<nullpiercing>
复制代码
,
<nullppiercing>
复制代码
,
<nullmpiercing>
复制代码
Protects the user from piercing effects.
Damage will be calculated as though attacker had no piercing.
<forceminvariance>
复制代码
,
<forcemaxvariance>
复制代码
The user will always roll the min/max value for skills and items that have variance. If both these notetags are present, the ruling defined in the plugin parameters is applied.
<forcenovariance>
复制代码
The user will not have any variance for all their skills and items.
If the user has 'forceminvariance' and/or 'forcemaxvariance', the ruling defined in the plugin parameters is applied.
Script
Spoiler: code
JavaScript:
//==========================================
// APHO_DamageCore.js
//==========================================
/*:
* @title Damage Core
* @author Apho
* @plugindesc v1.1 Allows for more control over damage and stuff.
*
* @param NoDamageSound
* @text No Damage Sound
* @type file
* @dir audio/se
* @desc Sound Effect to play when dealing 0 damage.
* @default Reflection
*
* @param NoDamageVolume
* @parent NoDamageSound
* @text Volume
* @type number
* @desc Volume of the 'no damage' sound.
* @default 90
*
* @param NoDamagePitchMin
* @parent NoDamageSound
* @text Minimum pitch
* @type number
* @desc Minimum pitch of the 'no damage' sound.
* @default 115
*
* @param NoDamagePitchMax
* @parent NoDamageSound
* @text Maximum pitch
* @type number
* @desc Maximum pitch of the 'no damage' sound.
* @default 125
* @param NoHealSound
* @text No Heal Sound
* @type file
* @dir audio/se
* @desc Sound Effect to play when healing for 0 HP.
* @default Down2
*
* @param NoHealVolume
* @parent NoHealSound
* @text Volume
* @type number
* @desc Volume of the 'no heal' sound.
* @default 90
*
* @param NoHealPitchMin
* @parent NoHealSound
* @text Minimum pitch
* @type number
* @desc Minimum pitch of the 'no heal' sound.
* @default 75
*
* @param NoHealPitchMax
* @parent NoHealSound
* @text Maximum pitch
* @type number
* @desc Maximum pitch of the 'no Heal' sound.
* @default 85
*
* @param NoHealSoundMenu
* @parent NoHealSound
* @text Menu Sound
* @type boolean
* @desc Play the sound effect when heal is used from the menu screen?
* @default true
*
* @param ForceVarianceRuling
* @text Force Variance Ruling
* @type select
* @option Cancel each other out (normal variance rates apply)
* @value 0
* @option Always force min
* @value 1
* @option Always force max
* @value 2
* @desc How should variance be handled if user has both 'forceminvariance' and 'forcemaxvariance'?
* @default 0
*
* @param NoVarianceRuling
* @parent ForceVarianceRuling
* @text No Variance Ruling
* @type select
* @option Don't override
* @value 0
* @option Override both
* @value 1
* @option Override min only
* @value 2
* @option Override max only
* @value 3
* @desc Should 'forcenovariance' be allowed to override 'forceminvariance'/'forcemaxvariance'?
* @default 1
*
* @help
* Allows for more control over damage and stuff.
* A sound effect can be played when an attack hits for 0 damage, or a heal heals
* for 0 hp.
* A min/max pitch may also be specified, which will be selected at random.
* Also, the following notetags are available:
* Skills, Items, Actors, Classes, Enemies, & States notetags:
* <adaptive>
* Calculates damage using higher of target's physical or magical damage rate.
* For Actors, Classes, Enemies, or States, causes all of user's attacks and
* skills to become adaptive.
*
* <adaptiveeval>
* //code
* </adaptiveeval>
* Evaluates code to determine if the attack should be adaptive.
* Must return either true (adaptive) or false (not adaptive).
* You may use 'a' for the attacker, 'b' for the defender, and 'item' for the
* skill/item Object.
*
* <piercing:x>, <ppiercing:x>, <mpiercing:x>
* Ignores a percentage of target's damage reduction. x must be a value between
* 0 and 1.
* 'piercing' applies to both PDR and MDR, while 'ppiercing' and 'mpiercing'
* apply only to PDR and MDR respectively.
* For Actors, Classes, Enemies, or States, causes all of user's attacks and
skills to have x piercing, overriding any skill or item notetags.
* Notetag priority from highest to lowest is as follows:
* States, Classes (for actors), Enemies/Actors
*
* EXAMPLE
* <piercing:0.4>
* If a physical skill with this notetag is used against a target with 80%
* Physical Damage Rate, the calculation is as follows:
* Original damage reduction = 100% - 80% = 20%
* 0.4 / 40% of the damage reduction is ignored.
* Target still has 20% * (1 - 0.4) = 12% damage reduction.
* Final Physical Damage Rate = 100% - 12% = 88%
*
* <piercingeval>
* //code
* </piercingeval>
* Evaluates code to determine piercing. Must return a value between 0 and 1.
* You may also use <ppiercingeval> for physical piercing, or <mpiercingeval>
* for magical piercing.
* You may use 'a' for the attacker, 'b' for the defender, and 'item' for the
* skill/item Object.
* Values below 0 are treated as 0.
*
* EXAMPLE
* <mpiercingeval>
* (a.agi - b.agi) * 0.01
* </mpiercingeval>
* This would give 1% magical piercing per AGI the user has more than the target.
* If the target has more AGI, piercing will be 0.
*
* <nullguard>
* Bypasses guard. Damage will be calculated as though target was not guarding.
* For Actors, Classes, Enemies, or States, causes all of user's attacks and
Note
This plugin, for the most part, works by overriding default functions when conditions are met. As such, I cannot guarantee full compatibility with plugins that also override the same default functions. In particular, this has limited compatibility with YEP_DamageCore, due to YEP_DamageCore overriding the makeDamgeValue function which this plugin is reliant on.
If you wish to use the adaptive, piercing, and nullguard features of this plugin together with YEP_DamageCore, you can place this plugin below it. This plugin contains checks to attempt to replicate YEP_DamageCore's default damage flow if you have it loaded; however, it may not work as intended if you have changed YEP_DamageCore's default damage steps.
Terms of use
Free for commercial and non-commercial use, as long as I get a free copy of the game.
Edits allowed for personal use.
Do not repost or claim as your own, even if edited.
Do not use for training AI models. This includes, but is not limited to, inputting the plugin contents or part thereof into AI models that train on user input.
Version history
v1.1 - 2023/7/20 - Added adaptive eval and piercing eval notetags.
v1.0 - 2023/7/13 - Initial release.