MV YEP CUSTOM PASSIVE CONDITION HELP

Hey all!

Just had a quick question. Does Yanfly's Custom Passive conditions accept operators? such as && ? i ask because I am
creating a passive that requres shield and spear to both be equipped. If so can anyone tell me what i am doing wrong in my code?
Please and thanks. Here is said code:



<Custom Passive Condition>

if(user.isAtypeEquipped(7) && if(user.isWtypeEquipped(12)) {

condition = true;

} else {

condition = false;

}

</Custom Passive Condition>




So to recap. If spear and shield equpped. Allow passive. Currently It just gives the user the passive, even when nothing is equipped.
you say sword and spear up top but shield and spear in the recap....
i can say && does work cus someone helped me with passive conditions before that have it.
i cant help though cus horrible at code. but thought would point out the contradiction with the whole sword/spear/shield thing cus really confusing. and think might need space between if (
but again, im hopelessly horrible with code
you say sword and spear up top but shield and spear in the recap....
i can say && does work cus someone helped me with passive conditions before that have it.
i cant help though cus horrible at code. but thought would point out the contradiction with the whole sword/spear/shield thing cus really confusing. and think might need space between if (
but again, im hopelessly horrible with code

sry meant spear and shield. will edit.
lunatic code for custom passive works like all kind of operators,
like && (and), || (or), ! or !! or anything around those.
you just need to format it correctly in order to work.

but I think you need it around those lines:

</Custom Passive Condition>
if(user.isAtypeEquipped(7) && user.isWtypeEquipped(12)) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>

the way you did,

"if(user.isAtypeEquipped(7) && if(user.isWtypeEquipped(12))"

you nested the "if" and also missing 1 ")" on the first part and it might not
work or not correctly.

I cant promise my way works but there are coders that know lunatic codes 🙂

Original thread: https://forums.rpgmakerweb.com/threads/yep-custom-passive-condition-help.128241/