Even more abilities
This commit is contained in:
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/GrassySurge.cs
Normal file
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/GrassySurge.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Grassy Surge is an ability that creates Grassy Terrain when the Pokémon enters battle.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Grassy_Surge_(Ability)">Bulbapedia - Grassy Surge</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "grassy_surge")]
|
||||
public class GrassySurge : 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.SetTerrain(ScriptUtils.ResolveName<Terrain.GrassyTerrain>(), batchId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user