Deukhoofd 7727f92f4e
All checks were successful
continuous-integration/drone/push Build is passing
Even more moves
2025-05-05 16:58:03 +02:00

28 lines
701 B
C#

using System.Collections.Generic;
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "spider_web_effect")]
public class SpiderWebEffect : Script
{
private HashSet<IPokemon> _targets = new();
/// <inheritdoc />
public override void PreventOpponentRunAway(IFleeChoice choice, ref bool prevent)
{
if (_targets.Contains(choice.User))
prevent = true;
}
/// <inheritdoc />
public override void PreventOpponentSwitch(ISwitchChoice choice, ref bool prevent)
{
if (_targets.Contains(choice.User))
prevent = true;
}
public void AddTarget(IPokemon target)
{
_targets.Add(target);
}
}