- Joined
- Jun 16, 2014
- Messages
- 260
- Reaction score
- 71
- Primarily Uses
I'm trying to adjust Actor's HP so that it scales with various buffs/debuffs. Here's the general gist:
Actor1 has an MHP of 100
They have 70 HP
If they have a debuff that makes MHP 75%, their HP should scale down to 35. If it's a buff that makes it 200%, then it should be 140 HP.
What I'd like to do is:
Take current HP, divide by max HP. This gives a percentage. We save this as a variable. Then, set their HP to be equal to MHP * variable. This is what it looks like thus far:
The problem is, this is gainHP. So, they'll actually be GIVEN that much HP, rather than adjusting their HP to that number. Any thoughts?
Actor1 has an MHP of 100
They have 70 HP
If they have a debuff that makes MHP 75%, their HP should scale down to 35. If it's a buff that makes it 200%, then it should be 140 HP.
What I'd like to do is:
Take current HP, divide by max HP. This gives a percentage. We save this as a variable. Then, set their HP to be equal to MHP * variable. This is what it looks like thus far:
Code:
$gameActors.actor(1).gainHp($gameActors.actor(1).mhp*$gameVariables.value(39))


