Deukhoofd eea5697109
All checks were successful
Build / Build (push) Successful in 49s
Fixes all warnings
2025-05-19 11:50:51 +02:00

26 lines
666 B
C#

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);
}
}