namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
///
/// Desolate Land is an ability that creates extremely harsh sunlight when the Pokémon enters battle.
/// This sunlight is so intense that it prevents other weather conditions and makes Water-type moves fail.
/// This ability is exclusive to Primal Groudon.
///
/// Bulbapedia - Desolate Land
///
[Script(ScriptCategory.Ability, "desolate_land")]
public class DesolateLandAbility : Script
{
///
public override void OnSwitchIn(IPokemon pokemon, byte position)
{
var battle = pokemon.BattleData?.Battle;
if (battle == null)
return;
battle.SetWeather(ScriptUtils.ResolveName(), -1);
if (battle.WeatherName == ScriptUtils.ResolveName())
{
((Weather.DesolateLands)battle.WeatherScript.Script!).MarkAsPlaced(pokemon);
battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon));
}
}
}