I have been using YEP Skill Core plugin to restrict my actors from casting spells in some certain condition. Now i have a skill which applies a state to an actor, or an enemy. I want to restrict my actor from casting this skill when any member in battle (including actors and enemies) is still affected by this state. So far, i have been successfully doing this on my party by checking the number of actors affected by the state via this condition:
However, i haven't figured out a way to do so when the state affects an enemy. So i want to know how to apply the above condition to $gameTroop and check the number of enemies affected.
Code:
<Custom Requirement>
if ($gameParty.battleMembers().filter( function (actor) { return actor.isStateAffected(67); } ).length > 0){
value = false;
}
else{
value = true;
}
</Custom Requirement>
However, i haven't figured out a way to do so when the state affects an enemy. So i want to know how to apply the above condition to $gameTroop and check the number of enemies affected.