namespace Gen7 { [Ability effect=Battery] class BatteryAbility : PkmnScript { void OnSwitchIn(Pokemon@ pokemon) override { pokemon.BattleSide.AddVolatile("Battery"); } void OnRemove() override { cast(GetOwner()).BattleSide.RemoveVolatile("Battery"); } } }