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
691
Reaction score
615
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

Of course, so, someone had covid at work today and I was exposed to them, so, I'm stuck at home for...TWO WEEKS!
oh god I'm going to die
AAAAAAAAi.png
Kind of relieved that I had medibang installed when I need to edit Sprite I was about to download gimp but I remember I had medibang installed lol
Voting for the first round of the Map Madness Tournament is now live! Vote for your favorite in each matchup!

Finally started working on Grim Trigger episode 2 today :LZScat: it's half comic/half visual novel!

GfY3Rwj.png

Forum statistics

Threads
110,368
Messages
1,052,658
Members
143,402
Latest member
IBanana
Top