Further work on the script interface rework

This commit is contained in:
2025-07-05 11:30:18 +02:00
parent 1feb27e826
commit 4499927551
100 changed files with 418 additions and 352 deletions

View File

@@ -6,17 +6,17 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Magnet_Pull_(Ability)">Bulbapedia - Magnet Pull</see>
/// </summary>
[Script(ScriptCategory.Ability, "magnet_pull")]
public class MagnetPull : Script
public class MagnetPull : Script, IScriptPreventOpponentRunAway, IScriptPreventOpponentSwitch
{
/// <inheritdoc />
public override void PreventOpponentRunAway(IFleeChoice choice, ref bool prevent)
public 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)
public void PreventOpponentSwitch(ISwitchChoice choice, ref bool prevent)
{
if (choice.User.Types.Any(x => x.Name == "steel"))
prevent = true;