Hey all! I'm needing some assistance with this one.
I'm wanting a state that decreases the afflicted character's max HP per battler turn in battle by 5% of their original max HP. When the state is removed (either by magic or item that heals it, or by death) their max HP returns to what it was originally. Their current HP would remain as it is. Like if they had 30 max HP originally, then it was decreased over some turns to 15 max HP, and they took 5HP damage so they'd have 10/15HP and then they get healed of the state, they would have 10/30HP.
I have SOME of this figured out from scrounging around, but don't quite have the whole thing. I have a state that is applied to all characters and battlers that just monitors their turn. In that state, I have the code below. It works excellent for a couple other afflictions I've got.
Here's what I've got so far, from frankensteining code pieces together the best I could:
Now the above code works at decreasing max HP for each turn made in battle, but when one is afflicted, it applies to all party members. I know that's because of
Any and all help is welcome! Thank you!
I'm wanting a state that decreases the afflicted character's max HP per battler turn in battle by 5% of their original max HP. When the state is removed (either by magic or item that heals it, or by death) their max HP returns to what it was originally. Their current HP would remain as it is. Like if they had 30 max HP originally, then it was decreased over some turns to 15 max HP, and they took 5HP damage so they'd have 10/15HP and then they get healed of the state, they would have 10/30HP.
I have SOME of this figured out from scrounging around, but don't quite have the whole thing. I have a state that is applied to all characters and battlers that just monitors their turn. In that state, I have the code below. It works excellent for a couple other afflictions I've got.
Here's what I've got so far, from frankensteining code pieces together the best I could:
Code:
<Custom Action End Effect>
$gameParty.aliveMembers().forEach(battler => {
if (battler.isStateAffected(16)) {
$gameParty.members().forEach(function(m){
m.addParam(0, -(battler.mhp * 0.05));
});
if (battler.hp <= 0) {
battler.performCollapse();
}
}
}
</Custom Action End Effect>
Now the above code works at decreasing max HP for each turn made in battle, but when one is afflicted, it applies to all party members. I know that's because of
$gameParty.members().forEach(function(m){m.addParam(0, -(battler.mhp * 0.05));}); but when I cut it down to addParam(0, -(battler.mhp * 0.05)) it doesn't work. Even tried battler.addParam(0, -(battler.mhp * 0.05)) with no luck. It also decreases the max HP based on the current max HP rather than the original max HP. Using any healing item that removes the state also doesn't return the max HP back to its original either.Any and all help is welcome! Thank you!