More moves implemented
This commit is contained in:
32
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Defog.cs
Normal file
32
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Defog.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user