20 lines
669 B
C#
20 lines
669 B
C#
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
|
|
|
/// <summary>
|
|
/// Natural Cure is an ability that heals status conditions when switching out.
|
|
///
|
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Natural_Cure_(Ability)">Bulbapedia - Natural Cure</see>
|
|
/// </summary>
|
|
[Script(ScriptCategory.Ability, "natural_cure")]
|
|
public class NaturalCure : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void OnSwitchOut(IPokemon oldPokemon, byte position)
|
|
{
|
|
if (!oldPokemon.StatusScript.IsEmpty)
|
|
{
|
|
oldPokemon.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(oldPokemon));
|
|
oldPokemon.ClearStatus();
|
|
}
|
|
}
|
|
} |