Elemental avoidance

In persona, there is a skill called “evade elec” that allows you to have an easier time avoiding electric spells. Is there a plugin for MZ that allows you to have that level of interaction with spells?

I couldn’t find an MZ plugin that does it the Persona way, where it’s a chance boost against one element. The closest I found is VisuStella’s Consumable Defensive States. It has state notetags like <1 Time Evasion Element: Thunder>, but that fully dodges the element until the charges run out, so it plays more like a shield than Evade Elec.

If you want the chance version, a small plugin could handle it. Try this code, maybe it could get you there:

/*:
 * @target MZ
 * @plugindesc Extra evasion against specific elements.
 * @help
 * Notetag for skills, states, actors, classes, weapons, armors, enemies:
 *   <Element Evade 4: 50>
 * Adds 50% evasion against actions using element 4.
 * On a skill, any actor who has learned it gets the bonus.
 */
(() => {
    const regex = /<Element Evade (\d+):\s*(\d+)>/gi;
    const _itemEva = Game_Action.prototype.itemEva;
    Game_Action.prototype.itemEva = function(target) {
        let eva = _itemEva.call(this, target);
        if (this.isCertainHit()) return eva;
        const elementId = this.item().damage.elementId;
        const elements = elementId < 0 ? this.subject().attackElements() : [elementId];
        const sources = target.traitObjects().concat(target.isActor() ? target.skills() : []);
        for (const obj of sources) {
            for (const match of obj.note.matchAll(regex)) {
                if (elements.includes(Number(match[1]))) {
                    eva += Number(match[2]) / 100;
                }
            }
        }
        return eva;
    };
})();

Save it as a .js file in your plugins folder and turn it on in the Plugin Manager. Then put <Element Evade 4: 50> in the note box of your Evade Elec skill, and any actor who has learned it gets an extra 50% chance to evade attacks with element 4. Change the 4 to your electric element’s ID from the Types tab of the database (in a new project Thunder should be 4). It also works on states, armor, classes, actors and enemies. Certain Hit skills ignore it.

1 Like