Hi all-
I'm trying to make a custom state that lasts for one enemy attack; instead of doing damage, the enemy will instead take some. Essentially, a one-time counter that nukes itself upon activation.
Right now I'm playing around with the Thornmail state-
I'm having trouble figuring out how to avoid damage landing at all; I see value = 0 is a thing, but can you avoid the damage popup on the target?
(I figured out to remove the state, you just add target.removeState(##); )
I'm trying to make a custom state that lasts for one enemy attack; instead of doing damage, the enemy will instead take some. Essentially, a one-time counter that nukes itself upon activation.
Right now I'm playing around with the Thornmail state-
http://yanfly.moe/2016/03/12/tips-tricks-thornmail/
<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>
<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>
I'm having trouble figuring out how to avoid damage landing at all; I see value = 0 is a thing, but can you avoid the damage popup on the target?
(I figured out to remove the state, you just add target.removeState(##); )
<Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
// Sets the Recoil Rate to 100%.
var rate = 1;
// 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);
//Play Trap animation
user.startAnimation(120);
//Set damage to 0
value = 0;
// Check to see if the attacker is dead.
if (user.isDead()) {
// If the attacker is dead, make it collapse.
user.performCollapse();
}
//Remove state from target
target.removeState(30);
}
</Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
// Sets the Recoil Rate to 100%.
var rate = 1;
// 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);
//Play Trap animation
user.startAnimation(120);
//Set damage to 0
value = 0;
// Check to see if the attacker is dead.
if (user.isDead()) {
// If the attacker is dead, make it collapse.
user.performCollapse();
}
//Remove state from target
target.removeState(30);
}
</Custom React Effect>