{
  num: -356001,
  accuracy: 95,
  basePower: 100,
  category: "Special",
  name: "Tears Of Elegy",
  pp: 5,
  priority: 0,
  flags: { charge: 1, protect: 1, mirror: 1, metronome: 1 },

  onTryMove(source, target, move) {
    const isInDespair = source.despairMark || source.despairActive || source.sorrowSurvived;

    if (isInDespair) {
      return true; 
    }

    if (source.volatiles['twoturnmove']?.move === 'tearsofelegy') {
      return true; 
    }

    
    source.addVolatile('twoturnmove', source, move);
    source.volatiles['twoturnmove'].duration = 2;
    source.volatiles['twoturnmove'].move = 'tearsofelegy';

    this.boost({ spd: 1 }, source, source, null, true);

    
    this.add('-start', source, 'tearsofelegyCharge');

    return false; 
  },

  onModifyMove(move, pokemon, target) {
    if (target?.tearStains > 0) {
      const tearLayers = target.tearStains;
      move.consumeTargetTears = tearLayers;
      move.basePower += 25 * tearLayers;
    }
  },

  onHit(target, source, move) {
    if (move.consumeTargetTears > 0 && target.tearStains > 0) {
      const layers = target.tearStains;
      const powerBoost = 25 * layers;

      
      this.add('-start', target, 'tearsofelegyConsume', powerBoost);

      target.tearStains = 0;
    }
  },
  condition: {
    duration: 2,
    onStart(pokemon) {
      
    },
    onEnd(pokemon) {
      
    }
  },

  onSwitchOut(pokemon) {
    if (pokemon.volatiles['twoturnmove']?.move === 'tearsofelegy') {
      pokemon.removeVolatile('twoturnmove');
    }
  },

  target: "normal",
  type: "Psychic",
  contestType: "Beautiful",
  zMove: { basePower: 200 },
  maxMove: { basePower: 150 }
}