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
91
Reaction score
81
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
91
Reaction score
81
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 Posts

Latest Profile Posts

I think it's ready - Chapter Selection:
unknown.png
On another more gaming topic, I paid 20 bucks for a visual novel to emotionally destroy me. I may write an entry about that.
1638611395177.png
Reading about metaverses recently. I can totally imagine myself in the future, logging in with VR glasses to a virtual beach villa sitting in a virtual chair, with a virtual laptop facing the sea...coding 16-bit RM.
Mod name: "[Game name] Gameplay Overhaul"
What they actually mean: "Here is a mod that makes the game harder."
I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!

Forum statistics

Threads
117,171
Messages
1,105,132
Members
153,267
Latest member
Christopher626
Top