namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Drought is an ability that creates harsh sunlight when the Pokémon enters battle.
/// This sunlight boosts Fire-type moves and weakens Water-type moves.
/// This ability is commonly associated with Groudon and Ninetales.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Drought_(Ability)">Bulbapedia - Drought</see>
/// </summary>
[Script(ScriptCategory.Ability, "drought")]
public class Drought : Script, IScriptOnSwitchIn
{
    /// <inheritdoc />
    public void OnSwitchIn(IPokemon pokemon, byte position)
    {
        var battleData = pokemon.BattleData;
        if (battleData == null)
            return;

        EventBatchId batchId = new();
        battleData.Battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon)
        {
            BatchId = batchId,
        });
        battleData.Battle.SetWeather(ScriptUtils.ResolveName<Weather.HarshSunlight>(), 5, batchId);
    }
}