namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "kings_shield")]
public class KingsShield : ProtectionScript
{
    /// <inheritdoc />
    public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        base.OnSecondaryEffect(move, target, hit);
        // Default form is shield form
        if (move.User.Species.Name == "aegislash" && move.User.Form.Name != "default")
        {
            move.User.ChangeForm(move.User.Species.GetDefaultForm());
        }
    }
}