From 5673a59f0e0eb4e815d107840f6b08d241509524 Mon Sep 17 00:00:00 2001 From: PurpleCrowbar <26198472+PurpleCrowbar@users.noreply.github.com> Date: Fri, 3 Mar 2023 22:46:49 +0000 Subject: [PATCH] Fix Contempt. Closes #10087 --- Mage.Sets/src/mage/cards/c/Contempt.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/Contempt.java b/Mage.Sets/src/mage/cards/c/Contempt.java index 84ab26c44f..68047604b8 100644 --- a/Mage.Sets/src/mage/cards/c/Contempt.java +++ b/Mage.Sets/src/mage/cards/c/Contempt.java @@ -1,6 +1,8 @@ package mage.cards.c; import java.util.UUID; + +import mage.constants.AttachmentType; import mage.constants.SubType; import mage.target.common.TargetCreaturePermanent; import mage.abilities.Ability; @@ -40,7 +42,7 @@ public final class Contempt extends CardImpl { this.addAbility(ability); // Whenever enchanted creature attacks, return it and Contempt to their owners' hands at end of combat. - this.addAbility(new AttacksAttachedTriggeredAbility(new ContemptEffect())); + this.addAbility(new AttacksAttachedTriggeredAbility(new ContemptEffect(), AttachmentType.AURA, false)); } @@ -74,17 +76,16 @@ class ContemptEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent contempt = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (contempt != null) { + Effect effect = new ReturnToHandSourceEffect(); + AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(effect); Permanent attachedToPermanent = game.getPermanent(contempt.getAttachedTo()); if (attachedToPermanent != null) { - Effect effect = new ReturnToHandTargetEffect(); + effect = new ReturnToHandTargetEffect(); effect.setTargetPointer(new FixedTarget( attachedToPermanent.getId(), game)).setText("return " + attachedToPermanent.getName() + " to owner's hand."); - AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(effect); - game.addDelayedTriggeredAbility(ability, source); + ability.addEffect(effect); } - Effect effect = new ReturnToHandSourceEffect(); - AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(effect); game.addDelayedTriggeredAbility(ability, source); return true; }