MZ Adding Elemental Weakness on Equip Menu

I want to show what elemental weakness/resistance the actor will have before equipping something, similar to the actor's stats. My problem is how I will approach this. Do I:

a. Clone the actor and equip the weapon/armor. Then get the clone's elemental rate.
b. Equip the weapon/armor to the actor, get his elemental rate, and then immediately restore the original weapon/armor to the actor.
c. There's a better way to do this?
a. Clone the actor and equip the weapon/armor. Then get the clone's elemental rate.
FWIW, this is pretty much what the engine does. when it shows you the difference between your stats before and after reequipping gear, it does it by making a clone of the actor and force equipping them with the highlighted gear
FWIW, this is pretty much what the engine does. when it shows you the difference between your stats before and after reequipping gear, it does it by making a clone of the actor and force equipping them with the highlighted gear
Now that you mention this, is it this function?
JavaScript:
Window_EquipItem.prototype.updateHelp = function() {
    Window_ItemList.prototype.updateHelp.call(this);
    if (this._actor && this._statusWindow && this._slotId >= 0) {
        const actor = JsonEx.makeDeepCopy(this._actor);
        actor.forceChangeEquip(this._slotId, this.item());
        this._statusWindow.setTempActor(actor);
    }
};
Now that you mention this, is it this function?
yep, thats the one. any time the player moves around in that menu, it calls that function. and all that function does is clone the actor, equip it with the new gear, and then updates the status window to show the changes. so if you wanted to do a similar thing with element rates, theres already a mechanism to do it. you just need to build/adjust the UI to display it
Thanks for this
This thread is closed due to being reported as solved. If you need it reopened, report the thread to let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/adding-elemental-weakness-on-equip-menu.173314/