- Joined
- Jul 2, 2018
- Messages
- 43
- Reaction score
- 3
- First Language
- English
- Primarily Uses
- RMMV
Hi! I'm using Yanfly's Buffs and States Core, and have some code to try to make is so the longer you have this state the more damage it deals to the character. The note tags read as follows:
I have no idea why this isn't working. I've tried rewriting the code and am wondering if maybe the gainHp function just doesn't support negative values?
<Help Description>
They're freezing cold. Find some way to warm
them up quickly, as their hp drains fast.
</Help Description>
// Make this status apply when temperature
// is 0.
<Passive Condition: TP Below 5>
<Custom Apply Effect>
this._freezingCounter = 1;
</Custom Apply Effect>
<Custom Regenerate Effect>
var n = this._freezingCounter / 16;
var value = Math.floor(n * user.mhp * -1);
user.gainHp(value);
this._freezingCounter += 1;
// If you're above 4 degrees, remove "freezing"
if (user.tp >= 5) {
user.removeState(12);
}
</Custom Regenerate Effect>
I have no idea why this isn't working. I've tried rewriting the code and am wondering if maybe the gainHp function just doesn't support negative values?