Gen7Data/Scripts/Abilities/SuppressWeather.as

15 lines
506 B
ActionScript
Raw Normal View History

2021-11-19 17:12:10 +00:00
namespace Gen7 {
class SuppressWeatherAbility : PkmnScript {
void OnSwitchIn(Pokemon@ pokemon) override {
pokemon.Battle.SuppressWeather();
pokemon.Battle.AddVolatile("SuppressWeather");
};
void OnRemove() override {
auto battle = cast<Pokemon@>(GetOwner()).Battle;
battle.UnsuppressWeather();
auto script = cast<SuppressWeather>(battle.GetVolatile("SuppressWeather"));
script.Unstack();
}
}
}