{
  num: -356003,
  accuracy: 95,
  basePower: 50,
  category: "Special",
  name: "TearfulSword",
  pp: 10,
  priority: 0,
  flags: { protect: 1, mirror: 1, metronome: 1, sword: 1, heal: 1 },

  onTry(source, target) {
    
    if (target?.tearStains > 0) {
      this.add('-activate', source, 'move: TearfulSword');
    }
  },
  onHit(target, source, move) {
    if (target?.tearStains > 0) {
      const tearLayers = target.tearStains;
      const healAmount = Math.min(
        Math.floor(source.maxhp * 0.1 * tearLayers),
        source.maxhp - source.hp
      );

      
      this.add('-start', target, 'tearfulSwordAbsorb', tearLayers);

      if (healAmount > 0) {
        this.heal(healAmount, source, source);
      }

      
      target.tearStains = 0;
      
    } else {
      
      this.add('-fail', source, 'move: TearfulSword', '[no tears]');
    }
  },

  target: "normal",
  type: "Ghost",
  contestType: "Clever",
  zMove: { basePower: 160 },
  maxMove: { basePower: 130 }
}