namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// Magma Armor is an ability that prevents the Pokémon from being frozen. /// /// Bulbapedia - Magma Armor /// [Script(ScriptCategory.Ability, "magma_armor")] public class MagmaArmor : Script, IScriptOnSwitchIn, IScriptPreventStatusChange { /// public void PreventStatusChange(IBattlePokemon pokemon, StringKey status, bool selfInflicted, ref bool preventStatus) { if (status == ScriptUtils.ResolveName()) { pokemon.Battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon)); preventStatus = true; } } /// public void OnSwitchIn(IBattlePokemon pokemon, byte position) { if (pokemon.HasStatus(ScriptUtils.ResolveName())) { pokemon.Battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon)); pokemon.ClearStatus(); } } }