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

Slimsy Platypus

Veteran
Veteran
Joined
May 17, 2016
Messages
117
Reaction score
131
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
131
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

Does anyone know of NPC sprites for RMMZ? I know of Flirion's RMMV recolours, but RMMZ's sprites are slimmer and more detailed, so I'm a bit on the edge to use Flirion's im RMMZ...
I can't believe that after all those years, KH Union X Dark Road is closing the services.

Due to a situation in which I thought plugin adaptations had stopped for the QPlugins, I "ghetto" converted these 7 over yesterday. They appear to work perfectly as long as you use old style plugin commands. I am uncertain if I will have a lot of free time in the future to work on this, but if you'd like them, here they are.
Was there a thread that you could share a screenshot of your game? I feel like I found it once but can't locate it again.

I was being lazy and just copied a map to test a new parallax, but I forgot to delete all the events. This was the result. :o

Forum statistics

Threads
108,818
Messages
1,039,783
Members
141,277
Latest member
acoolusername
Top