Implements clearbody, update changestatboost interface
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-03-12 11:45:18 +01:00
parent 1fdca38b29
commit 262152b81d
15 changed files with 33 additions and 20 deletions

View File

@@ -2,7 +2,7 @@ namespace Gen7 {
class AngerPoint : PkmnScript {
void OnIncomingHit(ExecutingMove@ move, Pokemon@ target, uint8 hit) override {
if (move.GetHitData(target, hit).IsCritical){
target.ChangeStatBoost(Statistic::Attack, 12);
target.ChangeStatBoost(Statistic::Attack, 12, true);
}
}
}

View File

@@ -29,7 +29,7 @@ namespace Gen7 {
if (user.GetFlatStat(Statistic::Speed) > user.GetFlatStat(Statistic::HP)) {
increaseStat = Statistic::Speed;
}
user.ChangeStatBoost(increaseStat, 1);
user.ChangeStatBoost(increaseStat, 1, true);
}
}
}

View File

@@ -3,7 +3,7 @@ namespace Gen7 {
class Berserk : PkmnScript {
void OnDamage(Pokemon@ pokemon, DamageSource, uint old, uint new) override {
if (float(old) / pokemon.MaxHealth >= 0.5f && float(new) / pokemon.MaxHealth < 0.5f) {
pokemon.ChangeStatBoost(Statistic::SpecialDefense, 1);
pokemon.ChangeStatBoost(Statistic::SpecialDefense, 1, true);
}
}
}

View File

@@ -1,8 +1,8 @@
namespace Gen7 {
[Ability effect=PreventDefLowering]
class PreventDefLowering : PkmnScript {
void PreventStatBoostChange(Pokemon@, Statistic stat, int8 amount, bool &inout prevent) override {
if (stat == Statistic::Defense && amount < 0) {
void PreventStatBoostChange(Pokemon@, Statistic stat, int8 amount, bool selfInflicted, bool &inout prevent) override {
if (stat == Statistic::Defense && amount < 0 && !selfInflicted) {
prevent = true;
}
}

View File

@@ -0,0 +1,10 @@
namespace Gen7 {
[Ability effect=PreventStatLowering]
class PreventStatLowering : PkmnScript {
void PreventStatBoostChange(Pokemon@, Statistic stat, int8 amount, bool selfInflicted, bool &inout prevent) override {
if (amount < 0 && !selfInflicted) {
prevent = true;
}
}
}
}