32 lines
808 B
C#
32 lines
808 B
C#
|
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<StringKey> DefoggedEffects = new()
|
||
|
{
|
||
|
"mist",
|
||
|
"light_screen",
|
||
|
"reflect",
|
||
|
"safe_guard",
|
||
|
"spikes",
|
||
|
"toxic_spikes",
|
||
|
"stealth_rock",
|
||
|
};
|
||
|
|
||
|
/// <inheritdoc />
|
||
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|