{
    onResidualOrder: 28,
    onResidualSubOrder: 2,
    onResidual(pokemon) {
        if (!pokemon.hp) return;

        const adjacentPokemon = [
            ...pokemon.side.active,
            ...pokemon.side.foe.active
        ].filter(target => target && target !== pokemon && pokemon.isAdjacent(target));

        for (const target of adjacentPokemon) {
            if (target.ability === 'stench') continue;

            const effectiveness = this.dex.getEffectiveness('Poison', target);

            if (effectiveness < 0) {
                continue;
            } else if (effectiveness === 0) {
                this.damage(target.baseMaxhp / 16, target, pokemon);
            } else if (effectiveness > 0) {
                this.damage(target.baseMaxhp / 8, target, pokemon);
            }
        }
    },
    flags: {},
    name: "Stench",
    rating: 0.5,
    num: 1,
}
