31 lines
1.3 KiB
C#
31 lines
1.3 KiB
C#
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
|
using PkmnLib.Plugin.Gen7.Scripts.Side;
|
|
|
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
[Script(ScriptCategory.Move, "hyperspace_fury")]
|
|
public class HyperspaceFury : Script, IScriptFailMove, IScriptOnSecondaryEffect
|
|
{
|
|
/// <inheritdoc />
|
|
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
|
{
|
|
var protectionScripts = target.Volatile.Select(x => x.Script).OfType<ProtectionEffectScript>();
|
|
foreach (var protectionScript in protectionScripts.ToList())
|
|
{
|
|
target.Volatile.Remove(protectionScript.Name);
|
|
}
|
|
target.BattleData?.BattleSide.VolatileScripts.Remove(ScriptUtils.ResolveName<CraftyShieldEffect>());
|
|
target.BattleData?.BattleSide.VolatileScripts.Remove(ScriptUtils.ResolveName<MatBlockEffect>());
|
|
target.BattleData?.BattleSide.VolatileScripts.Remove(ScriptUtils.ResolveName<QuickGuardEffect>());
|
|
target.BattleData?.BattleSide.VolatileScripts.Remove(ScriptUtils.ResolveName<WideGuardEffect>());
|
|
move.User.ChangeStatBoost(Statistic.Defense, -1, true, false);
|
|
}
|
|
|
|
public void FailMove(IExecutingMove move, ref bool fail)
|
|
{
|
|
if (move.User.Species.Name != SpeciesNames.Hoopa || move.User.Form.Name != FormNames.Unbound)
|
|
{
|
|
fail = true;
|
|
}
|
|
}
|
|
} |