MV Yanfly's EquipRequirement Condition

I am using Yanfly's EquipRequirement plugin (see below) and I am having trouble creating a equip requirement that would lock the user from equipping a particular armor piece if another equipment is already equipped. This is similar to another post from 6 years ago (also linked below) but I wasn't able to get the code working for my usecase. Any help would be greatly appreciated. Thank you in advance!

Plugin:

Similar Post:


Here's the snippet of the notetag I've attempted thus far
Code:
<Custom Equip Requirement Condition>
if (user.equips()[1].id == 3) {
     condition = false;
  }
else {
    condition = true;
  }
</Custom Equip Requirement Condition>

More detail on what I'm trying to accomplish with screenshots:

If the user has "Blazing Thunder Ring" equipped than "Scorched Ground Ring" will become locked.

Database type:
1709018859709.png

Armor:
1709019160667.png
Are you using 'Independent Items' for Armor in YEP_ItemCore? If so, try:

JavaScript:
<Custom Equip Requirement Condition>
 condition = user.equips()[1].baseItemId != 3;
</Custom Equip Requirement Condition>

If not, this works for me:

JavaScript:
<Custom Equip Requirement Condition>
 condition = user.equips()[1].id != 3;
</Custom Equip Requirement Condition>

If neither of those are working there might be a Plugin issue (Like wrong Yanfly Plugin order, or an issue from another plugin.)
I do have Item Core and your first code worked! But now I have another issue . . . Using Yanfly's equip core, the user is able to wear 2 Accessories. With your code, the condition only works if the accessory is equipped in the first slot, but fails when equipped onto the second. Is there any way to have it so that both accessory slots contain that same requirement?

Works as intended in 1st Accessory Slot
1709046311073.png

1709046322968.png

Fails in 2nd accessory Slot:
1709046361620.png

1709046377158.png


Additionally, is there a way to apply this condition for multiple equipment? i.e something like this

Code:
<Custom Equip Requirement Condition>
 condition = user.equips()[1].baseItemId != [3,4,5];
</Custom Equip Requirement Condition>
Try this. If it doesn't work, it can be written out longer-hand.

Code:
<Custom Equip Requirement Condition>
let prohibited = [3, 4, 5];

condition = !prohibited.some(id => [1, 2].some(slot => user.equips()[slot].baseItemId == id));
</Custom Equip Requirement Condition>
thanks, that seem to have done the trick for the multiple conditions! I wasn't sure if I needed to replace any of the code with actual IDs, but I ended up replacing the final slot in the brackets to the ID and got what I needed.


Code:
<Custom Equip Requirement Condition>
let prohibited = [3, 5, 6, 7, 8];

condition = !prohibited.some(id => [1, 2].some(slot => user.equips()[1].baseItemId == id));
</Custom Equip Requirement Condition>


however, equipping the accessory in the 2nd accessory slot still seems to negate the requirement condition. any assistance there would be helpful!
however, equipping the accessory in the 2nd accessory slot still seems to negate the requirement condition. any assistance there would be helpful!
I already gave you assistance, but it doesn't do what you want because you changed and broke the code I wrote.

As a rule, coders will tell you if you're supposed to change anything in the code they provide.
oh, apologies! I wasn't sure which issue of mine you were attempting to fix. Your original code doesn't seem to work either. what would be the longer-hand version look like? i promise i won't touch the code this time, haha



As a rule, coders will tell you if you're supposed to change anything in the code they provide.
im still quite a newbie when it comes to these forums. i'll be sure to check up on the rules after!

Original thread: https://forums.rpgmakerweb.com/threads/yanflys-equiprequirement-condition.166206/