Checking equipment slots in MV (part 2)

I have some questions about equipment checks via events and scripts. Like, how to check the equipment slot of all active party members? I mean, how to check that all party members are "naked" (wears no equipment)?

Because I know how to check the equipment slot of a specific actor.
Spoiler: This script
$gameActors.actor(actor ID).equips()[armor type ID]
But how to do that to all actors in the party, without no need to name them?

And how to autofill equipment slot of one specific actor via scripts in the event? And how to do that with all party members?
Code:
$gameParty.members().map(member => member.equips()).filter(equipList => !equipList.every(equipSlot => equipSlot === null)).length === 0

That will return true if all party members are unequipped and false otherwise.

Code:
$gameParty.members()[0].forceChangeEquip(1, $dataArmors[3])

That will force armour 3 to be equipped on the first party member's shield slot (you need to own the item for this to work, and the member needs to be able to equip it)

Code:
$gameParty.members().forEach(member => member.forceChangeEquip(1, $dataArmors[3]))

This will do the same thing on all party members.
Code:
$gameParty.members().map(member => member.equips()).filter(equipList => !equipList.every(equipSlot => equipSlot === null)).length === 0

That will return true if all party members are unequipped and false otherwise.
Okay, thank you.
What if I want to check only one slot, not all of them? Like, "body" one?
In the every function call add equipSlot.id === 2 before the null check, would be my first thing to try.
I guess it supposed to look like this?
Code:
$gameParty.members().map(member => member.equips()).filter(equipList => !equipList.every(equipSlot.id === 2 => equipSlot === null)).length === 0
And if I want to just autofill equip slot by any armor (a not specific one), I just need to remove the number within square brackets?
Code:
$gameParty.members()[0].forceChangeEquip(1, $dataArmors[])
every(equipSlot => equipSlot.id === 2 && equipSlot === null)

If you want to autofill the slot with any armour you'll need to do a bit more work to grab what armours the party actually has, just blank square brackets won't do anything.
Alright, I understand.
Then how to check "nudity" (I mean, that one specific equipment slot is empty) of any in party? Nor specific actor, neither all actors in party.
To check if equip slot 4 is empty on actor 3:

JavaScript:
$gameActors.actor(3).equipSlots().map((val, i) => val == 4 ? i : 0).filter(i => i != 0).every(slot => $gameActor.actor(3)._equips[slot].isNull())

Or if you don't need to account for dual-wielding or plugins adding multiple of the same slot, you can simplify it to:

JavaScript:
$gameActors.actor(3)._equips[4].isNull()
Okay. But how I can check if slot is empty on any of the actors at the party?
I want to make next situation in the game: the player enters the temple. A priest can heal his characters if they are dressed up. Otherwise, if one of these actors is undressed ("Body" equipment slot is empty), he won't help anymore. If all party members undressed, then the priest kicks them out from the temple.
Because mostly I am checking equipment only in one main character. Although sometimes player has more than 1 actor in the party.
Assuming you're using the default set of equipment slots, you can do

Code:
$gameParty.members().some(member => member._equips[3].isNull())

Original thread: https://forums.rpgmakerweb.com/threads/checking-equipment-slots-in-mv-part-2.124317/