Hello,
I'm trying to using this Thornmail state from Yanfly's Tips and Tricks
However, I want to make it so it deals damage to the enemy, if the player Evades the enemy's physical attack, or if the enemy's physical attack Misses the player.
I tried a lot of things for the condition, but I just can't seem to get it to work.
Would anyone be able to help?
I'm trying to using this Thornmail state from Yanfly's Tips and Tricks
JavaScript:
<Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
// Sets the Recoil Rate to 15%.
var rate = 0.15;
// Determines the amount of recoil damage dealt.
var recoil = value * rate;
// Sets the DEF bonus rate to 25%.
var rate = 0.25;
// Determines the amount of bonus damage dealt.
var bonus = target.def * rate;
// Rounds up the bonus damage and recoil damage.
var dmg = Math.ceil(bonus + recoil);
// Makes the attacker lose damage equal to the dmg variable.
user.gainHp(-1 * dmg);
// Check to see if the attacker is dead.
if (user.isDead()) {
// If the attacker is dead, make it collapse.
user.performCollapse();
}
}
</Custom React Effect>
However, I want to make it so it deals damage to the enemy, if the player Evades the enemy's physical attack, or if the enemy's physical attack Misses the player.
I tried a lot of things for the condition, but I just can't seem to get it to work.
Would anyone be able to help?