{
    name: "Dubious Disc",
    spritenum: 113,
    fling: {
        basePower: 50
    },
    onAfterMove(source, target, move) {
        if (move.id !== 'triattack') return;
        if (source.species.id !== 'porygonz') return;
        if (!this.randomChance(1, 5)) return;

        const effect = this.sample(['toxic', 'infestation', 'confusion']);
        switch (effect) {
            case 'toxic':
                if (target.trySetStatus('tox', source, this.effect)) {
                    target.trySetStatus('tox', source);
                }
                break;
            case 'infestation':
                if (target.volatiles['partiallytrapped'] || !target.runStatusImmunity('trapped')) return;
                const infestationMove = this.dex.moves.get('infestation');
            target.addVolatile('partiallytrapped', source, infestationMove);
            break;
            case 'confusion':
                if (target.side.getSideCondition('safeguard')) {
                    this.add('-immune', target, '[from] Safeguard');
                    return;
                }
                if (target.hasAbility('owntempo')) {
                    this.add('-immune', target, '[from] ability: Own Tempo');
                    return;
                }
                target.addVolatile('confusion', source);
                this.add('-start', target, 'confusion', '[from] item: Dubious Disc');
                break;
        }
    },
    num: 324,
    gen: 4
}
