I was looking into making a state that when applied to a hero or enemy, its skills that would normally deal damage, restore the target's HP instead. I'm guessing this is not possible through regular editor tools...? Does a plugin exist that could achieve something like this?
Condition to turn damage into healing instead?
RPG Maker MV SupportIt can be possible actually.
Similar thing here. (Tip: multiply a whole damage formula part with -1. That negative part you make actually adds HP
because -(-something) = +something ).
https://forums.rpgmakerweb.com/index.php?threads/damage-formula-with-a-state-condition.26218/
Similar thing here. (Tip: multiply a whole damage formula part with -1. That negative part you make actually adds HP
because -(-something) = +something ).
https://forums.rpgmakerweb.com/index.php?threads/damage-formula-with-a-state-condition.26218/
I don't know what this means.
Try this:
b.isStateAffected(x) ? (-1 * (y)) : (y)
Where x is your state and y is your damage formula.
For example this what it will be for the regular attack skill and with state 15 as the reversing state:
b.isStateAffected(15) ? (-1 * (a.atk*4 -2 * b.def)) : (a.atk*4 - 2 * b.def)
No plugins nesscary just some basic coding.Oh and this goes in to the damage formula box for your skills.
A good place to learn more is here:
https://forums.rpgmakerweb.com/index.php?threads/damage-formulas-101.81905/
b.isStateAffected(x) ? (-1 * (y)) : (y)
Where x is your state and y is your damage formula.
For example this what it will be for the regular attack skill and with state 15 as the reversing state:
b.isStateAffected(15) ? (-1 * (a.atk*4 -2 * b.def)) : (a.atk*4 - 2 * b.def)
No plugins nesscary just some basic coding.Oh and this goes in to the damage formula box for your skills.
A good place to learn more is here:
https://forums.rpgmakerweb.com/index.php?threads/damage-formulas-101.81905/
* is the multiplication operator. Thus 2*4 = 8 (two times four equals eight)
Simple math.
X = 10 * 2
Thus X = 20
Now if this is damage, in the end 20 will be subtracted from HP. Right?
HP - 20
Now imagine putting a negative number to be subtracted.
It will be HP - (-20)
This is like saying HP - (20 * (-1))
Now if this is damage, it will mathematically result to HP + 20
instead of HP - 20.
Yes, that is what I've tried, but it results in 0 damage dealt.
Hmm I can see how this isn't working.
Try this instead:
Fix your damage formulas back to the way they were.
Then make sure you have Yanfly Core Engine and Yanfly Skill Core plugins and use this notetag.
<Pre-Damage Eval>
if(user.isStateAffected(x)){
value =-value;
}
</Pre-Damage Eval>
Place this notetag in the affected skills like say the "Attack" skill.
Replace x with the number of the state that's going to inflict this reversing.
Now what should happen is that the user of said skill, should heal targets when attacking/dealing damage and should damage/hurt targets when healing. It'll also reverse the Drain feature, so instead of drain an enemy and heal themselves, they'll drain them selves and heal the enemy.
Basically this should work.
Try this instead:
Fix your damage formulas back to the way they were.
Then make sure you have Yanfly Core Engine and Yanfly Skill Core plugins and use this notetag.
<Pre-Damage Eval>
if(user.isStateAffected(x)){
value =-value;
}
</Pre-Damage Eval>
Place this notetag in the affected skills like say the "Attack" skill.
Replace x with the number of the state that's going to inflict this reversing.
Now what should happen is that the user of said skill, should heal targets when attacking/dealing damage and should damage/hurt targets when healing. It'll also reverse the Drain feature, so instead of drain an enemy and heal themselves, they'll drain them selves and heal the enemy.
Basically this should work.
Original thread: https://forums.rpgmakerweb.com/threads/condition-to-turn-damage-into-healing-instead.95149/