namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// Magnet Pull is an ability that prevents Steel-type Pokémon from fleeing or switching out. /// /// Bulbapedia - Magnet Pull /// [Script(ScriptCategory.Ability, "magnet_pull")] public class MagnetPull : Script { /// public override void PreventOpponentRunAway(IFleeChoice choice, ref bool prevent) { if (choice.User.Types.Any(x => x.Name == "steel")) prevent = true; } /// public override void PreventOpponentSwitch(ISwitchChoice choice, ref bool prevent) { if (choice.User.Types.Any(x => x.Name == "steel")) prevent = true; } }