This commit is contained in:
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Drought.cs
Normal file
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Drought.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user