30 lines
1.0 KiB
C#
30 lines
1.0 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
|
using PkmnLib.Static.Utils;
|
|
|
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
[Script(ScriptCategory.Move, "smack_down")]
|
|
public class SmackDown : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
|
{
|
|
var battleData = target.BattleData;
|
|
if (battleData == null)
|
|
return;
|
|
|
|
target.Volatile.Add(new SmackDownEffect());
|
|
|
|
var chargeBounceEffect = ScriptUtils.ResolveName<ChargeBounceEffect>();
|
|
if (target.Volatile.Contains(chargeBounceEffect))
|
|
target.Volatile.Remove(chargeBounceEffect);
|
|
var flyEffect = ScriptUtils.ResolveName<ChargeFlyEffect>();
|
|
if (target.Volatile.Contains(flyEffect))
|
|
target.Volatile.Remove(flyEffect);
|
|
var skyDropEffect = ScriptUtils.ResolveName<ChargeSkyDropEffect>();
|
|
if (target.Volatile.Contains(skyDropEffect))
|
|
target.Volatile.Remove(skyDropEffect);
|
|
}
|
|
} |