More abilities
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-11-21 17:54:16 +01:00
parent 8d6ee4008c
commit 669a0094d5
10 changed files with 113 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
namespace Gen7 {
[Ability effect=Battery]
class BatteryAbility : PkmnScript {
void OnSwitchIn(Pokemon@ pokemon) override {
pokemon.BattleSide.AddVolatile("Battery");
}
void OnRemove() override {
cast<Pokemon@>(GetOwner()).BattleSide.RemoveVolatile("Battery");
}
}
}

View File

@@ -0,0 +1,8 @@
namespace Gen7 {
[Ability effect=BattleArmor]
class BattleArmor : PkmnScript {
void BlockCritical(ExecutingMove@, Pokemon@, uint8, bool &inout blockCrit) override {
blockCrit = true;
}
}
}

View File

@@ -0,0 +1,16 @@
namespace Gen7 {
[Ability effect=BattleBond]
class BattleBond : PkmnScript {
void OnFaintingOpponent(ExecutingMove@ move, Pokemon@, uint8) override {
if (move.User.Species.Name == "greninja"){
move.User.ChangeForme("ash");
}
}
void OverrideBasePower(ExecutingMove@ move, Pokemon@, uint8, uint8 &inout damage) override {
if (move.User.Forme.Name == "ash" && move.UseMove.Name == "water_shuriken"){
damage = 20;
}
}
}
}

View File

@@ -0,0 +1,34 @@
namespace Gen7 {
class BeastBoost : PkmnScript {
void OnFaintingOpponent(ExecutingMove@ move, Pokemon@, uint8) override {
Statistic increaseStat = Statistic::HP;
auto user = move.User;
if (user.GetFlatStat(Statistic::Attack) > user.GetFlatStat(Statistic::HP) &&
user.GetFlatStat(Statistic::Attack) > user.GetFlatStat(Statistic::Defense) &&
user.GetFlatStat(Statistic::Attack) > user.GetFlatStat(Statistic::SpecialAttack) &&
user.GetFlatStat(Statistic::Attack) > user.GetFlatStat(Statistic::SpecialDefense) &&
user.GetFlatStat(Statistic::Attack) > user.GetFlatStat(Statistic::Speed)) {
increaseStat = Statistic::Attack;
}
if (user.GetFlatStat(Statistic::Defense) > user.GetFlatStat(Statistic::HP) &&
user.GetFlatStat(Statistic::Defense) > user.GetFlatStat(Statistic::SpecialAttack) &&
user.GetFlatStat(Statistic::Defense) > user.GetFlatStat(Statistic::SpecialDefense) &&
user.GetFlatStat(Statistic::Defense) > user.GetFlatStat(Statistic::Speed)) {
increaseStat = Statistic::Defense;
}
if (user.GetFlatStat(Statistic::SpecialAttack) > user.GetFlatStat(Statistic::HP) &&
user.GetFlatStat(Statistic::SpecialAttack) > user.GetFlatStat(Statistic::SpecialDefense) &&
user.GetFlatStat(Statistic::SpecialAttack) > user.GetFlatStat(Statistic::Speed)) {
increaseStat = Statistic::SpecialAttack;
}
if (user.GetFlatStat(Statistic::SpecialDefense) > user.GetFlatStat(Statistic::HP) &&
user.GetFlatStat(Statistic::SpecialDefense) > user.GetFlatStat(Statistic::Speed)) {
increaseStat = Statistic::SpecialDefense;
}
if (user.GetFlatStat(Statistic::Speed) > user.GetFlatStat(Statistic::HP)) {
increaseStat = Statistic::Speed;
}
user.ChangeStatBoost(increaseStat, 1);
}
}
}

View File

@@ -0,0 +1,9 @@
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);
}
}
}
}