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

RicardoxRyu

Villager
Member
Joined
Jun 25, 2020
Messages
7
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,232
Reaction score
710
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

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

Latest Threads

Latest Profile Posts

51F2AC5E-A605-446E-9439-D77AA6A0B0ED.pngAdded console to my content thread here
Sweet nostalgia. My fave Final Fantasy game.
Steam page is now live!
1632768058957.png
just discovered thig game called Willowbrooke Post... beautiful artstyle if I do say so myself... does anyone know what this kind of style is called??
In one of my game projects, I am working on an arena where you can fight combatants or bet on monsters, and, man, it is taking so long, lmao. I do not think that it helps that I am using an evented combat system with a lot of things that I have to edit.

Forum statistics

Threads
115,423
Messages
1,089,742
Members
150,169
Latest member
switchstone
Top