Deukhoofd 00005aa4bf
All checks were successful
Build / Build (push) Successful in 47s
Implements more abilities
2025-06-09 12:10:25 +02:00

27 lines
956 B
C#

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
{
/// <inheritdoc />
public override 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);
}
}