Target only user if not state affected?(YF Selection Control)

Im having trouble making a skill that affects only the user and cannot be cast if state X is on user.

The skill adds state X to user but does nothing if X is already on the user. It does not work, it can only target user and if user has state X, it will then target any ally and scope is set to user.


<Cannot Select: All>
<Custom Select Condition>
if (target.isStateAffected(X)) {
condition = false;}
else {
condition = true;}
</Custom Select Condition>
<Select Conditions>
Not State: X
</Select Conditions>
bump
Since your skill always targets the user, I think you'll need a different plugin: Selection Control determines who can be selected as a target of a skill, not whether a skill can be used. 😅

Maybe consider Yanfly's Skill Core plugin~
It offers a notetag that can control when a skill is usable:
JavaScript:
<Custom Requirement>
value = !user.isStateAffected(123);
</Custom Requirement>
This says "the skill is usable iff the user is not affected by state ID 123". 😤
Since your skill always targets the user, I think you'll need a different plugin: Selection Control determines who can be selected as a target of a skill, not whether a skill can be used. 😅

Maybe consider Yanfly's Skill Core plugin~
It offers a notetag that can control when a skill is usable:
JavaScript:
<Custom Requirement>[/INDENT]
[INDENT]value = !user.isStateAffected(123);[/INDENT]
[INDENT]</Custom Requirement>
This says "the skill is usable iff the user is not affected by state ID 123". 😤

Awesome thanks! so much simpler than I made it to be!

Original thread: https://forums.rpgmakerweb.com/threads/target-only-user-if-not-state-affected-yf-selection-control.121890/