Hello, I'm back with another javascipt problem haha. I almost had this one solved, but I seem to be having a bit of trouble...
Currently, I am using yanfly's buffs and states core (http://www.yanfly.moe/wiki/Buffs_&_States_Core_(YEP)) to create an item that, when used, counters the next physical attack you take. It doesn't wear off unless you are either hit by a physical attack once, or the battle ends.
The problem is: I can't get the custom action effects to remove the state after the user is hit.
This is the first code I tried:
Using that one did not remove the state at all, even after changing "target" to "user" just incase that's why it was messing up. Unfortunately, that did not fix it.
Then, I tried this one:
This one almost worked, since enemies would hit the user, get countered, and the state would be removed. However, the user affected with the state attacking an enemy removed the state as well, and that's not what I want.
Can anyone help me out on this? I saw a similar thread before, but that user had a similar problem as me where the state wasn't being removed. I've also tried disabling all other plugins incase it was a compatibility issue, but that didn't fix the problem either...
Currently, I am using yanfly's buffs and states core (http://www.yanfly.moe/wiki/Buffs_&_States_Core_(YEP)) to create an item that, when used, counters the next physical attack you take. It doesn't wear off unless you are either hit by a physical attack once, or the battle ends.
The problem is: I can't get the custom action effects to remove the state after the user is hit.
This is the first code I tried:
Code:
<Custom Deselect Effect>
if (this.isPhysical()){
target.removeState(28);
}
</Custom Deselect Effect>
Then, I tried this one:
Code:
<Custom Conclude Effect>
if (this.Physical() && target.result().isHit()) {
user.removeState(14);
}
</Custom Conclude Effect>
Can anyone help me out on this? I saw a similar thread before, but that user had a similar problem as me where the state wasn't being removed. I've also tried disabling all other plugins incase it was a compatibility issue, but that didn't fix the problem either...