Gen7Data/Scripts/Moves/Automize.as

16 lines
681 B
ActionScript
Raw Normal View History

2021-10-30 16:45:42 +00:00
namespace Gen7 {
class Automize : PkmnScript {
void OnSecondaryEffect(ExecutingMove@ move, Pokemon@ target, uint8 hit) override {
auto originalSpeed = move.User.GetBoostedStat(Statistic::Speed);
auto originalWeight = move.User.Weight;
move.User.ChangeStatBoost(Statistic::Speed, 2);
if (move.User.GetBoostedStat(Statistic::Speed) != originalSpeed){
// This setter function protects against going below 0.1
move.User.Weight -= 100;
if (move.User.Weight != originalWeight){
// {Pokemon} became nimble text
}
}
}
}
}