26 lines
666 B
C#
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);
|
|
}
|
|
} |