This commit is contained in:
12
Scripts/Abilities/Battery.as
Normal file
12
Scripts/Abilities/Battery.as
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
8
Scripts/Abilities/BattleArmor.as
Normal file
8
Scripts/Abilities/BattleArmor.as
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Gen7 {
|
||||
[Ability effect=BattleArmor]
|
||||
class BattleArmor : PkmnScript {
|
||||
void BlockCritical(ExecutingMove@, Pokemon@, uint8, bool &inout blockCrit) override {
|
||||
blockCrit = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Scripts/Abilities/BattleBond.as
Normal file
16
Scripts/Abilities/BattleBond.as
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
34
Scripts/Abilities/BeastBoost.as
Normal file
34
Scripts/Abilities/BeastBoost.as
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
9
Scripts/Abilities/Berserk.as
Normal file
9
Scripts/Abilities/Berserk.as
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user