This commit is contained in:
25
Scripts/BattleSide/BatteryEffect.as
Normal file
25
Scripts/BattleSide/BatteryEffect.as
Normal file
@@ -0,0 +1,25 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user