Hey, I'm trying to have Weapon Unleash become more and more likely, the less HP the player has. How do I do this?
Yanfly Weapon Unleash
Javascript/Plugin Support<Custom Weapon Unleash: x>
rate = user.hp / user.mhp;
</Custom Weapon Unleash: x>
That's the basic code required for that. Remember, 0 is a 0% chance of unleashing, while 1 is 100% chance. You may need to tweak the equation to make it work the way you want, but that's the basic frame.
rate = user.hp / user.mhp;
</Custom Weapon Unleash: x>
That's the basic code required for that. Remember, 0 is a 0% chance of unleashing, while 1 is 100% chance. You may need to tweak the equation to make it work the way you want, but that's the basic frame.
I don't think that functions. When I'm at full hp, I unleash every turn and the lower my HP is, the lower my chance of unleashing is. It's actually opposite of what I want.
<Custom Weapon Unleash: x>
rate = 1 - (user.hp / user.mhp);
</Custom Weapon Unleash: x>
Like I said before, the equation may need some tweaking. Try this one.
rate = 1 - (user.hp / user.mhp);
</Custom Weapon Unleash: x>
Like I said before, the equation may need some tweaking. Try this one.
Original thread: https://forums.rpgmakerweb.com/threads/yanfly-weapon-unleash.84837/