MV YEP Equip Req Question

I've searched the forums (& Google & the Script Call list) pretty thoroughly for a solution, but haven't found one.

My question is this:
I'm using Yanfly's Equip Requirement, correction... Yanfly's Passive States plugin & am trying to mimic a common function in other games, where a person earns a passive bonus on their gear IF 'x' amount of pieces are equipped at the same time.

I've toyed with:
Code:
(user.isAtypeEquipped(1))
... but the prob here is that this just uses Armor type 1 (which in my case is Light Armor ~ aka a primary armor class for pieces that could be on a character's head, chest, legs, etc..

What I need is something like (if such a code exists):
Code:
(user.isEtypeEquipped(1) && user.isEtypeEquipped(2))
... so that the condition requires a piece of armor to be equipped on a character's head+chest+etc..

Thoughts? (TIA)
I'm not sure how this ties into the plugin you're talking about.

The Equip Requirements plugin does exactly what it says, sets requirements that you need to meet in order to be able to equip something.

It doesn't do anything like what you're describing about giving a bonus for equipping certain items.

The common term for that in games is "armor sets," and if you Google it you should be able to find a number of plugins that help you create them in RPG Maker.

For example, this plugin

and this plugin

and this thread talking about alternate solutions
My last response (the original reply) was WAY too detailed. Sorry @ATT_Turan... Let me try to simplify my request, as I understand what Equipment Sets are, & what I'm trying to do isn't that....

Here is exactly what I'm trying to do:
I have a skill called "Armor Master", which grants a passive Defense bonus ONLY when a character is wearing 2 or more pieces of the SAME type of armor; rather that's 2+ pieces of light, medium, or heavy. In my Armor Type database, is as follows:
1 = Light Armor
2 = Med Armor
3 = Heavy Armor

In my Equipment Type database is:
1 = Weapon
2 = Head
3 = Body
4 = Legs

I've already tried using Yanfly's Passive States to accomplish this, but am trying to create a custom, lunatic condition (within the skill note-tag itself), so that the passive Defense bonus is only given to the character when they are wearing 2 or more pieces of the SAME TYPE of armor. So....... you see... this isn't an equipment set scenario, as it applies to ANY armor of the same type... not just specific pieces.
I've already tried using Yanfly's Passive States to accomplish this
This is the correct thing to do.

It's possible there's a slightly more efficient way to do this, but here's what comes to mind:
Code:
<Custom Passive Condition>
var armorTypes=[0, 0, 0, 0];

user.armors().forEach(item => armorTypes[item.atypeId]++);

condition=armorTypes.some(element => element>=2);
</Custom Passive Condition>

That should make your state become active if the actor has two of the same type of armor equipped.
Thanks @ATT_Turan. I'll give that a try soon.

After spending around 4-5 hrs pouring through forums yesterday, I came across THIS thread, which is very similar to your suggestion, which makes it even more likely that your suggestion will work. I'll update you with the results tonight. On a side note, I have to go out of town this week end, but I may not find a solution to my request before I leave... so I would like to request that the forum admins keep this thread open, even though I can't respond for a few days. Rather I find a solution or not, I have a habit to make a "close thread request" post when appropriate. Thanks
Sorry for the late reply, @ATT_Turan. Your suggestion worked. Thanks for your input.

This thread may be closed now Admins. Thanks.

Original thread: https://forums.rpgmakerweb.com/threads/yep-equip-req-question.152726/