I’m making a state which will change an actor’s maximum HP while it’s applied. Adjusting the max value is easy, but I’d like to also keep the actor’s current HP at the same relative percentage from before the state was applied, and also after it expires. So for example:
- Harold has 150/200 HP (75%).
- A state is applied to Harold which reduces his max HP by 20% to 160. I want his current HP to drop accordingly to 120/160 (75%).
- Harold recovers 8 HP from a healing spell while the state is affecting him, so he now has 128/160 HP (80%).
- The state expires on Harold, so now he has 160/200 HP (80%).
However, I wouldn’t want Harold to lose any HP if he’s at 1 HP when the state is applied, so the values would need to round up.
Could someone help me figure out the best way to implement something like this? Thanks!
Max HP Modification State - Keep Current HP Proportional?
● ARCHIVED · READ-ONLY