{
    num: -356022, 
    accuracy: 100,
    basePower: 0, 
    category: "Status",
    name: "Eye Lamp", 
    pp: 10,
    priority: 0,
    flags: { protect: 1, mirror: 1, metronome: 1 },
    
    onHit(target, source, move) {

        if (target === source) return;
        
        const isConfused = target.volatiles['confusion'];
        
        if (isConfused) {
            
            if (target.status) {
                this.add('-fail', target, target.status, '[from] move: Eye Lamp');
            } else {
                const statusSuccess = target.trySetStatus('slp', source, move);
                if (statusSuccess) {
                    this.add('-status', target, 'slp', '[from] move: Eye Lamp');
                    
                    this.add('-activate', source, 'move: Eye Lamp');
                }
            }
        } else {
            
            const confusionSuccess = target.addVolatile('confusion', source, move);
            if (!confusionSuccess) {
                this.add('-immune', target, '[from] move: Eye Lamp');
            } else {
                
                if (target.volatiles['confusion']) {
                    target.volatiles['confusion'].duration = 3;
                }
                this.add('-start', target, 'confusion', '[from] move: Eye Lamp');
                
                const trapSuccess = target.addVolatile('trapped', source, move, 'trapper');
                if (trapSuccess) {
                    
                    if (target.volatiles['trapped']) {
                        target.volatiles['trapped'].duration = 3;
                    }
                    this.add('-activate', source, 'move: Eye Lamp');
                }
            }
        }
    },
    secondary: null,
    target: "allAdjacent", 
    type: "Normal", 
    contestType: "Clever"
}