Ok so throughout playtesting today, I encountered the following error:
I kept playtesting and eventually narrowed it down to a state effect being applied by one of my skills. Basically, I have a Passive called "Trauma". This is what it does:
Edit: Ok, I see now...I just did a
Edit2: Hmm, I just realized I was supposed to use
Edit3: SOLVED!! 🙏
I kept playtesting and eventually narrowed it down to a state effect being applied by one of my skills. Basically, I have a Passive called "Trauma". This is what it does:
I notice the error appears every time I try to hover over/select a unit with this state applied (not the passive state, but the state applied by the passive effect which contains the DoT component). I'm led to believe that it's due to the damage dealt by the DoT is a decimal/fraction instead of an integer/whole number. However, I already made sure to use
Math.round() in my formula, so I'm pretty much at my wit's end now...
JavaScript:
<Custom Apply Effect>
target._trauma = Math.round(target.result() * 0.1);
</Custom Apply Effect>
<Custom React Effect>
if (value < 0 && this.isHpEffect()) {
value = Math.round(value * 0.7);
}
<Custom React Effect>
<Custom Regenerate Effect>
value = target._trauma;
target.gainHp(-value);
BattleManagerTBS.activeEntity().addPopup(value);
</Custom Regenerate Effect>
<Custom Leave Effect>
delete target._trauma;
</Custom Leave Effect>
Edit: Ok, I see now...I just did a
console.log(target._trauma); and it returned "NaN".Edit2: Hmm, I just realized I was supposed to use
target.result().hpDamage instead of target.result().Edit3: SOLVED!! 🙏