Adds more abilities
This commit is contained in:
32
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Comatose.cs
Normal file
32
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Comatose.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Comatose is an ability that makes the Pokémon always be in a sleep state, but still able to attack.
|
||||
/// The Pokémon cannot be affected by other status conditions, and moves that would normally fail on sleeping Pokémon
|
||||
/// will work normally. The Pokémon will still be affected by sleep-related moves and abilities.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Comatose_(Ability)">Bulbapedia - Comatose</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "comatose")]
|
||||
public class Comatose : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatusChange(IPokemon pokemonImpl, StringKey status, ref bool preventStatus)
|
||||
{
|
||||
if (status == ScriptUtils.ResolveName<Status.Sleep>())
|
||||
{
|
||||
preventStatus = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, IDictionary<StringKey, object?>? parameters)
|
||||
{
|
||||
if (eventName == CustomTriggers.BypassSleep && parameters != null)
|
||||
{
|
||||
parameters["bypass_sleep"] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user