Gen7Data/Scripts/BattleSide/BatteryEffect.as

25 lines
643 B
ActionScript
Raw Normal View History

2021-11-21 16:54:16 +00:00
namespace Gen7 {
[Side effect=Battery]
class BatteryEffect : PkmnScript {
int num = 1;
void Stack() override {
num++;
}
void Unstack() {
num--;
if (num == 0){
cast<BattleSide@>(GetOwner()).RemoveVolatile("Battery");
}
}
void OverrideBasePower(ExecutingMove@ move, Pokemon@, uint8, uint8 &inout power) override {
if (move.UseMove.Category == MoveCategory::Special) {
auto p = power * 1.3f;
if (p > 255) p = 255;
power = uint8(p);
}
}
}
}