Syntax to check if a state is applied [Yanfly Skill Core]

Slimsy Platypus

Veteran
Veteran
Joined
May 17, 2016
Messages
117
Reaction score
132
Primarily Uses
Ok I'm using Yanfly's Skill core and my goal is to have a skill requirement met when a skill is applied to the user.

This is some default code for a conditional that is provided by Yanfly in the help menu.

<Custom Requirement>
if ($gameParty.gold() > 1000) {
value = true;
} else {
value = false;
}
</Custom Requirement>

What I'd like to do is check if a state ID is present on the battler casting the skill. Can anyone help me out with what the Javascript syntax would be?
For example: value = true when state ID = 20.
(I've tried various ways using isStateAffected() ? but I just don't know enough :(

Thanks for anyone that might be able to help!
 

waynee95

Inactive
Veteran
Joined
Jul 2, 2016
Messages
686
Reaction score
609
First Language
German
Primarily Uses
RMMV
<Custom Requirement>
value = user.isStateAffected(STATE_ID);
</Custom Requirement>
 
Last edited:

Slimsy Platypus

Veteran
Veteran
Joined
May 17, 2016
Messages
117
Reaction score
132
Primarily Uses
@waynee95 thank you so much!

I am slowly but surely learning my way around enough javascript to be really dangerous. I appreciate your help!
 

Latest Threads

Latest Posts

Latest Profile Posts

I haven't been on here in forever wow(missed my forum birthday T-T). Anyways, I'm dabbling in BGMs, here's something I'm actually willing to share.

Binge-watched 6 episodes of the Erased anime... And that means I've watched half of it?! Sigh...
I'm bad at base-building games (looking at other players created an aesthetically beautiful base compared to me), but IDK why I keep playing the game and seek more of it.
Pyra and Mythra in smash ultimate are way too OP. They're basically Smash 4 Bayonetta 2.0, and not in a good way. Very toxic and unfair. At least they're hot tho.

Forum statistics

Threads
109,197
Messages
1,042,970
Members
141,700
Latest member
skybola188
Top