Gen7Data/Scripts/Abilities/DoubleSpeedInWeather.as

17 lines
544 B
ActionScript
Raw Normal View History

2022-02-19 15:45:57 +00:00
namespace Gen7 {
[Ability effect=DoubleSpeedInWeather]
class DoubleSpeedInWeather : PkmnScript {
string _weather;
void OnInitialize(const BattleLibrary@ library, const narray<EffectParameter@>@ parameters) override {
_weather = parameters[0].AsString();
}
void ChangeSpeed(BaseTurnChoice@ choice, uint &inout speed) override {
auto weather = choice.User.Battle.GetWeatherName();
if (weather == _weather) {
speed *= 2;
}
};
}
}