aspdmulti

Villager
Member
Joined
Aug 18, 2021
Messages
15
Reaction score
5
First Language
Bahasa
Primarily Uses
RMMV
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
 

AphoticAmaranth

An Ordinary Human
Veteran
Joined
Mar 29, 2020
Messages
94
Reaction score
83
First Language
English
Primarily Uses
RMMV
If you're using Yanfly Skill Core you can use

Code:
<Post-Damage Eval>
a.gainHp(-a.mhp);
a.performCollapse();
</Post-Damage Eval>

to kill the user of the skill.
 

aspdmulti

Villager
Member
Joined
Aug 18, 2021
Messages
15
Reaction score
5
First Language
Bahasa
Primarily Uses
RMMV
Cool
If you're using Yanfly Skill Core you can use

Code:
<Post-Damage Eval>
a.gainHp(-a.mhp);
a.performCollapse();
</Post-Damage Eval>

to kill the user of the skill.
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
 

AphoticAmaranth

An Ordinary Human
Veteran
Joined
Mar 29, 2020
Messages
94
Reaction score
83
First Language
English
Primarily Uses
RMMV
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>
 

aspdmulti

Villager
Member
Joined
Aug 18, 2021
Messages
15
Reaction score
5
First Language
Bahasa
Primarily Uses
RMMV
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 !
 

Latest Threads

Latest Profile Posts

My new 49" monitor has been dispatched from the warehouse. Will it arrive tomorrow? The day after? I love that we can track packages now, even if it does only tell me when it's left that end and when it's arrived at the local centre. As long as it doesn't end up in Melbourne again, which has happened before ...
My friend's doing a surprise stream of my game Origin Hunt on Twitch here ! Feel free to stop by :yhappy:
Me, designing it a long time ago: Having an optional boss fight as a random chance to trigger when you fish in a certain spot with a certain type of bait is fun! Cool idea!
Me, trying to playtest everything again: oh god just let me see the boss, my bag is so full of fish!
both love and pain have no boundaries

Forum statistics

Threads
117,229
Messages
1,105,689
Members
153,386
Latest member
fredflol
Top