I'm attempting to make a skill for my game called 'Scathe', a spell that deals double damage to targets inflicted with 'ailment' states. I'm using VisuStella Skills and States categories to define states as ailments, and using Yanfly's Tips and Tricks tutorials (and a thread here on the forums that reworks them to work in MZ) I tried to write notetag code to get it to work. The skill still deals damage, but the doubling damage aspect doesn't take effect. I'm sure I'm missing something. If anyone could look over the code and tell me if there are any mistakes i've missed.
When making this, I was referencing the entries for Mind/Power Charge and Collect & Inject Ailments on Trihan's thread here. Help in figuring this out would be much appreciated.
JavaScript:
<JS Post-Start Action>
const category = 'Ailment';
const states = target.states();
user._targetInflicted = false;
for (let i = 0; i < states.length; ++i) {
const state = states[i];
if (state && state.categories.contains(category)) {
user._targetInflicted = true;
break;
}
}
</JS Post-Start Action>
<JS Pre-Damage As User>
if(user._targetInflicted && value > 0) {
value *= 2;
value = Math.ceil(value);
}
</JS Pre-Damage As User>
When making this, I was referencing the entries for Mind/Power Charge and Collect & Inject Ailments on Trihan's thread here. Help in figuring this out would be much appreciated.