This commit is contained in:
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Limber.cs
Normal file
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Limber.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Limber is an ability that prevents the Pokémon from being paralyzed.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Limber_(Ability)">Bulbapedia - Limber</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "limber")]
|
||||
public class Limber : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted,
|
||||
ref bool preventStatus)
|
||||
{
|
||||
if (status != ScriptUtils.ResolveName<Status.Paralyzed>())
|
||||
return;
|
||||
|
||||
// If the status is being inflicted by a move, we can also prevent the move from inflicting it
|
||||
if (selfInflicted)
|
||||
return;
|
||||
|
||||
pokemon.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon));
|
||||
preventStatus = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user