I want to make a skill where 1 monster give it's hp to another monster equal to it's max hp, then the user die in the process. Is this possible ? If it's possible, then how do I achieve this? For your information I am using yanfly battle core
Give one HP to another
RPG Maker MV SupportIf you're using Yanfly Skill Core you can use
to kill the user of the skill.
Code:
<Post-Damage Eval>
a.gainHp(-a.mhp);
a.performCollapse();
</Post-Damage Eval>
to kill the user of the skill.
Cool
Ex : user have 1000 HP. The skill cut his HP by 600. So if the user use the skill for the 2nd time, then it dies
Cool I'll try it. Okay what about if I want the user give certain value of hp, and die if the value higher than its current hp ?
Ex : user have 1000 HP. The skill cut his HP by 600. So if the user use the skill for the 2nd time, then it dies
In that case just replace the a.mhp with the amount of HP you want them to lose and only run the collapse effect if that would kill them.
Code:
<Post-Damage Eval>
a.gainHp(-600);
if(a.isDead())
{
a.performCollapse();
}
</Post-Damage Eval>
Problem Solved. Thanks !
Original thread: https://forums.rpgmakerweb.com/threads/give-one-hp-to-another.141358/