{
  name: "DeathFrozen",
  rating: 4.5,
  num: -356009,

  
  onStart(pokemon) {
    
    if (pokemon.hp < pokemon.maxhp) {
      this.heal(pokemon.maxhp - pokemon.hp, pokemon, pokemon, '[from] ability: DeathFrozen');
    }

    
    if (pokemon.status) {
      pokemon.cureStatus();
    }

    
    if (!this.field.isWeather('hail')) {
      this.field.setWeather('hail', pokemon);
    }
  },

  
  onResidualOrder: 1,
  onResidual(pokemon) {
    if (!this.field.isWeather('hail')) {
      this.field.setWeather('hail', pokemon);
    }
  },

  
  onTryHit(target, source, move) {
    if (move.ohko) {
      this.add('-immune', target, '[from] ability: DeathFrozen');
      return null;
    }
  },

  
  onSetStatus(status, target, source, effect) {
    if (effect && effect.status) {
      this.add('-immune', target, '[from] ability: DeathFrozen');
    }
    return false;
  },

  
  onBoost(boost, target, source, effect) {
    if (effect?.name === 'Intimidate' && boost.atk && boost.atk < 0) {
      delete boost.atk;
      this.add('-fail', target, 'unboost', 'Attack', '[from] ability: DeathFrozen');
    }
  },

  
  onTryAddVolatile(status, target) {
    if (['confusion', 'flinch', 'taunt', 'torment'].includes(status.id)) {
      this.add('-immune', target, '[from] ability: DeathFrozen');
      return null;
    }
  }
}