namespace Gen7 { [Side effect=Battery] class BatteryEffect : PkmnScript { int num = 1; void Stack() override { num++; } void Unstack() { num--; if (num == 0){ cast(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); } } } }