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
692
Reaction score
616
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 Profile Posts

I am adamant about not having missable quests, which means having to write entirely new scenes at each plot progression that takes into account that time and events have passed since the quest could first be accepted while still having there be a quest to solve in the first place. It's worth every second.
Surprisingly useful and thought provoking
Working on animation. Trying to see if I can apply it meaningfully to my games!
ddwk.png

working on the sprite for Devali <3
My Game Development Livestream

Forum statistics

Threads
110,377
Messages
1,052,787
Members
143,419
Latest member
haniffauziyatun
Top