namespace Gen7 { class SuppressWeatherAbility : PkmnScript { void OnSwitchIn(Pokemon@ pokemon) override { pokemon.Battle.SuppressWeather(); pokemon.Battle.AddVolatile("SuppressWeather"); }; void OnRemove() override { auto battle = cast(GetOwner()).Battle; battle.UnsuppressWeather(); auto script = cast(battle.GetVolatile("SuppressWeather")); script.Unstack(); } } }