if (any actor) have weapon/armor equipped

In my game several actors can equip a Tool item that is checked against a conditional branch, so if you equip the Wrench you can repair and the Crowbar allows for forcing open doors.


What I would like is a way for the game to easily check if any actor in the active party (not counting reserve) is equipped with said item. Without it, I need to run conditional branches for every actor in the party, and that will become a nuisance if I decide to add more actors later, making the previous events obsolete.


The conditional has?armor checks if said armor is in the inventory, so it doesn't fulfill my needs.
Unfortunately there is no other way even with javascript - the only thing that you would get is a plugin that checks every actor independently in a loop, so the only difference would be that it is a single call in the event but still a series of single checks inside the plugin.


And that could be done in a common event as well if you have to check it multiple times. just designate one switch or variable to check for the tool equipped, place all the conditional branches for checking in a common event and call that event before the conditional branch.
@Andar your idea is great! Why I haven't thought about it before?
Put the following into a script box of a conditional branch - it will be true if any battle member has the tool equipped, and false if nobody does (it will also be false if a reserve member has it equipped).  The example below assumes the tool is a weapon with id 8.  Replace the 8 with whatever id it really is.

Code:
$gameParty.battleMembers().some(function(actor) { return actor.equips().contains($dataWeapons[8]); });
@Shaz thank you for saving my skin again! This way I can use the @Andar idea of common event and your script call to make this working quickly!


EDIT:


Tried but didn't worked. First I changed it to $dataArmors[8] but, when it didn't worked, I made a dummy weapon to be used with the original script and still didn't worked. I'll try to figure it out, but nevertheless, thanks.

Original thread: https://forums.rpgmakerweb.com/threads/if-any-actor-have-weapon-armor-equipped.56936/