{
  duration: 5,
  onFieldStart(field, source) {
    this.add("-fieldstart", "move: Magnetic Room", "[of] " + source);
  },
  onUpdate(pokemon) {
    if (this.field.getPseudoWeather("Gravity")) {
      this.field.removePseudoWeather("magneticroom");
      return;
    }
    if (pokemon.volatiles["smackdown"]) {
      return;
    }
    if (!pokemon.volatiles["magnetrise"]) {
      pokemon.addVolatile("magnetrise");
    }
  },
  onFieldResidualOrder: 27,
  onFieldResidualSubOrder: 5,
  onFieldEnd() {
    for (const target of this.getAllActive()) {
      if (target.volatiles["magnetrise"])
        target.removeVolatile("magnetrise");
    }
    this.add("-fieldend", "move: Magnetic Room");
  }
}