Gen7Data/Scripts/Abilities/Berserk.as

10 lines
365 B
ActionScript
Raw Normal View History

2021-11-21 16:54:16 +00:00
namespace Gen7 {
[Ability effect=Berserk]
2021-11-21 16:54:16 +00:00
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);
}
}
}
}