Using YEP's State Categories Plugin to bypass categories / states?

Hi everyone,

I've been looking through the lunatic / regular notetags of the above mentioned aplugin, and although it includes notetags to bypass death and recover all, I can't see a way in which you could bypass entire categories of states - or individual states - in a skill.

For instance, if I want to have a skill that ignores the enemies states that are providing it with defensive buffs, how would I go about that?

Thanks.
There isn't an easy way to do that. The bypassing death and recover all tags are for states, not skills. They function by excluding those states from the states removed when full recover, or death happens to a battler inflicted with the state.

What you're looking for is not on the same level as this, as it happens from the skill being used, and ignores a state on the target. I can think of a way to do this, but it's by no means simple.

  • Use the <before eval> tag on your skill to get all states on the target, and compare them to specific states you're looking to ignore.
  • remove all states belonging to the category that you want to ignore from the battler
  • Use the <after eval> tag on your skill to add those same states detected back onto the attacked battler.
First you'll need to make a list of all the states you want to ignore:
Code:
var list = []
for (i = 1; i < $dataStates.length; i++) {
 if ($dataStates[i].category.contains('BUFFS')) {
  list.push($dataStates[i].id)
 }
}
Then you want a list of all the states currently on the target:
Code:
var OLDstates = target._states.clone()
Then you need to check the current states list against the ignored states list.
Code:
var ignoredStates = []
for (i = 0; i < OLDstates.length; i++){
 if (list.contains(OLDstates[i])) {
  ignoredStates.push(OLDstates[i])
 }
}
Now you have a list of the ignored states that are currently on the battler. The next thing to do is save this value to the battler, so it can be called later.
Code:
target._ignoredStates = ignoredStates
This is all you need in your <before eval> tag. Next you'll need to tag the skill to remove all states belonging to the category BUFFS. This will remove all states with that category when the action effect happens on the skill - effectively ignoring them all. In the <after eval> tag for the same skill, you add back the ignored states to the target, so that they function normally again following the attack.

Code:
for (i = 0; i < target._ignoredStates.length; i++){
target.addState(target._ignoredStates[i])
}
target._ignoredStates = undefined
This loop goes through each of the states stored on the target, and re-adds them after the skill is completed. It then deletes the stored values, so they won't interfere later.

The objective is to ignore the states that the battler has in the buffs category, without accidentally giving the battler all states from the buffs category, by filtering out the ones in that category that the battler doesn't have. You will likely also have to do a separate check in the loops and store the remaining turn duration of each buff, to prevent their remaining duration from being reset every time this skill is used.
Thank you @ramza . I'm going to have a look at this in more detail.

Original thread: https://forums.rpgmakerweb.com/threads/using-yeps-state-categories-plugin-to-bypass-categories-states.94700/