#BeforeEvents.effectAdd does not include intensity?

1 messages · Page 1 of 1 (latest)

vale portal
#

is there really not a means to get this? I feel like the intensity would be a huge part of this event handler

rotund belfry
vale portal
remote bridge
# vale portal is there really not a means to get this? I feel like the intensity would be a hu...

You can get the amplifier in the effect name, but only from 0 to 5, above that it always returns 0.

function getAmplifier(effectType) {
    const effect = effectType.split(' ').pop();
    const values = { I: 1, V: 5 }; // I-II-III-IV-V-VI
    let amplifier = 0;
    for (let i = 0; i < effect.length; i++) {
        let current = values[effect[i]];
        if (!current) return 0;
        let next = values[effect[i + 1]] || 0;
        amplifier += current < next ? -current : current;
    }
    return Math.max(amplifier - 1, 0);
}
#

The effect names are like Haste I, Speed IV, but they are translated so it may not work in all languages.