Yanfly Action Sequences - if/else conditions

Hello!


"Usage Example:


if $gameSwitches.value(1)


action effect


else if $gameSwitches.value(2)


action effect


action effect


else


action effect


action effect


action effect


end"


This is the example for the if else statements shown in the first plugin. I do not have much knowledge in JavaScript so I would like to ask if there is a way to check for what weapon type the user has equipped.


I am trying to create an attack which will check the user's weapon, and if it is a melee weapon it will have the user move to the target and attack, but if it has a ranged weapon the user will instead step back and attack from a distance. Please help! And thank you!
@tiranomaster You can use:


if user.attackMotion() !== 'missile'


This checks if the actor is using a weapon that DOESN'T use the missile animation (aka melee weapons). If you use a weapon that is supposed to be ranged but doesn't use the missile animation (like a sword that hits from afar lol), use this:


if user.isWtypeEquipped(x)


Change x to the weapon type in your database.
@killerfer Thank you! It worked really well!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-action-sequences-if-else-conditions.55431/