More abilities, refactor custom triggers to be typed.
All checks were successful
Build / Build (push) Successful in 48s
All checks were successful
Build / Build (push) Successful in 48s
This commit is contained in:
24
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/MagnetPull.cs
Normal file
24
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/MagnetPull.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Magnet Pull is an ability that prevents Steel-type Pokémon from fleeing or switching out.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Magnet_Pull_(Ability)">Bulbapedia - Magnet Pull</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "magnet_pull")]
|
||||
public class MagnetPull : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventOpponentRunAway(IFleeChoice choice, ref bool prevent)
|
||||
{
|
||||
if (choice.User.Types.Any(x => x.Name == "steel"))
|
||||
prevent = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventOpponentSwitch(ISwitchChoice choice, ref bool prevent)
|
||||
{
|
||||
if (choice.User.Types.Any(x => x.Name == "steel"))
|
||||
prevent = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user