States that absorb % incoming damage first using Yanfly Buff and States Core

RicardoxRyu

Warper
Member
Joined
Jun 25, 2020
Messages
4
Reaction score
0
First Language
Indonesia
Primarily Uses
RMMV
Hello....
As the tittle said, I want to make States that the holder will recover some % incoming physical attack damage taken.
I'm using Yanfly Buff and States Core : http://www.yanfly.moe/wiki/Buffs_&_States_Core_(YEP) and using
this script

<Custom React Effect>
if (value > 0 && this.isPhysical()){
var heal = value * 0.3;
target.gainHp(heal);
target.startDamagePopup();
target.startAnimation(41);
value = value * 1;}
</Custom React Effect>

However... the heals comes first.
How to make the heals comes after the damage?

Sorry I don't have knowledge in scripting and still newbie
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,210
Reaction score
702
First Language
Poland
Primarily Uses
RMMV
Try:

<Custom Establish Effect>
if (value > 0 && this.isPhysical()){
var heal = Math.floor(value * 0.3);
user.gainHp(heal);
user.startDamagePopup();
user.startAnimation(41);}
</Custom Establish Effect>


Scratch that, this will trigger when actor strikes opponent and 30% of damage he strikes will heal.

Your code seems to be ok, perhaps you missunderstood something with this plugin.
 
Last edited:

RicardoxRyu

Warper
Member
Joined
Jun 25, 2020
Messages
4
Reaction score
0
First Language
Indonesia
Primarily Uses
RMMV
The heal still happens first using my code
 

Latest Threads

Latest Posts

Latest Profile Posts

Happy Friday, y'all! I just got home from work and am sitting down with a nice cider, and I'm ready to chill and enjoy myself. Not sure if I'm gonna dive into any of my game-related projects or not tonight.... we'll see how I feel after unwinding for a bit I guess!
Just found out that mint tea made from chocolate mint tastes a bit like hot cocoa with candy cane stirred in. As I'm allergic to chocolate this makes me very happy.
It's special day for me tomorrow so time to vanish for 24 hours lol.
So Deltarune Chapter 2 is supposed to release today... if it's out already, has anyone played it? And I can't because I have a stinking Mac and not a Windows PC.

Forum statistics

Threads
115,140
Messages
1,087,554
Members
149,651
Latest member
coffeeandyteevee
Top