namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;

[Script(ScriptCategory.Pokemon, "roost_effect")]
public class RoostEffect : Script, IScriptOnEndTurn, IScriptChangeTypesForIncomingMove
{
    /// <inheritdoc />
    public void ChangeTypesForIncomingMove(IExecutingMove executingMove, IPokemon target, byte hitIndex,
        IList<TypeIdentifier> types)
    {
        types.RemoveAll(x => x.Name == "flying");
    }

    /// <inheritdoc />
    public void OnEndTurn(IScriptSource owner, IBattle battle) => RemoveSelf();
}