- Joined
- Jul 17, 2020
- Messages
- 17
- Reaction score
- 33
- First Language
- French
- Primarily Uses
- RMMV
Heyo!
I'm facing a little issue which I feel should be simple, but has had me stuck for the past few hours...
Using Yanfly's Buffs & States Core and their Thornmail trick I thought about making a Guard command that heals x% the user's HP when getting hit. Everything works until the healing part occurs. Here's what's written in my State note:
<Custom React Effect>
if (value > 0) {
var heal = target.mhp * 0.1;
var heal = Math.ceil(heal);
target.gainHp(heal);
}
</Custom React Effect>
If I write user.gainHp(heal), the ennemy is indeed healed 10% of the character's hp, so the problem doesn't seem to come from above. But for some reason when I put target (or defender, or actor, or even $gameActors.actor(2) ) it doesn't work. I tried using <Custom Respond Effect> but to no avail.
As someone who doesn't know javascript, I was quite proud of "successfully" tweaking the Thornmail code from guessing what each line does, but now I'm stuck and I don't even understand why...
Using Yanfly's Buffs & States Core and their Thornmail trick I thought about making a Guard command that heals x% the user's HP when getting hit. Everything works until the healing part occurs. Here's what's written in my State note:
<Custom React Effect>
if (value > 0) {
var heal = target.mhp * 0.1;
var heal = Math.ceil(heal);
target.gainHp(heal);
}
</Custom React Effect>
If I write user.gainHp(heal), the ennemy is indeed healed 10% of the character's hp, so the problem doesn't seem to come from above. But for some reason when I put target (or defender, or actor, or even $gameActors.actor(2) ) it doesn't work. I tried using <Custom Respond Effect> but to no avail.
As someone who doesn't know javascript, I was quite proud of "successfully" tweaking the Thornmail code from guessing what each line does, but now I'm stuck and I don't even understand why...