Hello,
I'm trying to create a few skill effects that happen when different out comes appear in battle.
For example, I created a JS snippet that gives a target a state if they are hit with an element that they resist or block. See below:
I placed this snippet in the Visustella global "post-damage" settings and it works perfectly.
However, what I'm trying to do is create a similar tag, but for when a skill or item is missed. It's a similar if statement, but I can't get it to work no matter where I place this code (Pre or Post apply, Pre or post damage).
To be honest, I'm not even sure if its doing it right, so I'm seeking help here in getting this to work. In end, I'm just trying to get a state on the target that dodged an attack.
I'm trying to create a few skill effects that happen when different out comes appear in battle.
For example, I created a JS snippet that gives a target a state if they are hit with an element that they resist or block. See below:
JavaScript:
//Apply State if the skill was resisted or blocked.
if (target.elementRate(skill.damage.elementId) < 1) {
$gameTemp.requestAnimation([target], 2)
target.addState(24);
}
I placed this snippet in the Visustella global "post-damage" settings and it works perfectly.
However, what I'm trying to do is create a similar tag, but for when a skill or item is missed. It's a similar if statement, but I can't get it to work no matter where I place this code (Pre or Post apply, Pre or post damage).
To be honest, I'm not even sure if its doing it right, so I'm seeking help here in getting this to work. In end, I'm just trying to get a state on the target that dodged an attack.
JavaScript:
//Apply state if the skill was missed or evaded.
if (target.result().missed || target.result().evaded) {
$gameTemp.requestAnimation([target], 2)
target.addState(24);
}