Gen7Data/Scripts/Pokemon/HealEachEndOfTurn.as

18 lines
494 B
ActionScript
Raw Normal View History

2021-03-28 18:22:46 +00:00
namespace Gen7 {
[Pokemon effect=HealEachEndOfTurn]
shared class HealEachEndOfTurnEffect : PkmnScript {
float _factor;
void OnEndTurn(Pokemon@ pokemon) override {
auto healAmount = pokemon.MaxHealth * _factor;
if (pokemon.HasHeldItem("big_root")){
healAmount *= 1.3;
}
pokemon.Heal(uint(healAmount));
}
void SetBaseHealAmount(float factor){
_factor = factor;
}
}
}