Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -7,17 +7,17 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
public class HyperspaceFury : Script, IScriptFailMove, IScriptOnSecondaryEffect
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
public void OnSecondaryEffect(IExecutingMove move, IBattlePokemon 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>());
|
||||
target.BattleSide.VolatileScripts.Remove(ScriptUtils.ResolveName<CraftyShieldEffect>());
|
||||
target.BattleSide.VolatileScripts.Remove(ScriptUtils.ResolveName<MatBlockEffect>());
|
||||
target.BattleSide.VolatileScripts.Remove(ScriptUtils.ResolveName<QuickGuardEffect>());
|
||||
target.BattleSide.VolatileScripts.Remove(ScriptUtils.ResolveName<WideGuardEffect>());
|
||||
move.User.ChangeStatBoost(Statistic.Defense, -1, true, false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user