using System.Collections.Generic; using PkmnLib.Static.Utils; namespace PkmnLib.Plugin.Gen7.Scripts.Moves; [Script(ScriptCategory.Move, "defog")] public class Defog : Script { public static HashSet DefoggedEffects = new() { "mist", "light_screen", "reflect", "safe_guard", "spikes", "toxic_spikes", "stealth_rock", }; /// public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit) { if (target.BattleData == null) return; var targetSide = target.BattleData.Battle.Sides[target.BattleData.SideIndex]; foreach (var effect in DefoggedEffects) { targetSide.VolatileScripts.Remove(effect); } } }