Hello! I'm working on a state that will return a portion of the damage to the attacker. This state is tied to a skill called Riposte. This skill required a melee weapon equipped (I got that covered and working) and will only return damage if the attacker is using a melee weapon (this is where I need help).
I'm using Yanfly engine plugins.
This below is what I have in my State, which returns half the damage. What I would like to add is return damage ONLY if the attacker is using a melee weapon. So, how would I code this?
I was thinking of changing the first line to add a check, but can't figure it out:
if (value > 0 && this.isPhysical() && this.somethingsomething() !== 'missile')
I'm using Yanfly engine plugins.
This below is what I have in my State, which returns half the damage. What I would like to add is return damage ONLY if the attacker is using a melee weapon. So, how would I code this?
Code:
<Custom React Effect>
if (value > 0 && this.isPhysical()) {
var recoil = value * 0.5;
var dmg = Math.ceil(recoil);
user.gainHp(-1 * dmg);
if (user.isDead()) {
user.performCollapse();
}
}
</Custom React Effect>
I was thinking of changing the first line to add a check, but can't figure it out:
if (value > 0 && this.isPhysical() && this.somethingsomething() !== 'missile')