2021-11-21 16:54:16 +00:00
|
|
|
namespace Gen7 {
|
2022-02-12 16:47:59 +00:00
|
|
|
[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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|