From d2a51dc4c00592f24d1969503a58dc76b01612f7 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 18 Apr 2018 10:58:12 +0200 Subject: [PATCH] [DOM] Updated Corrosive Ooze. --- Mage.Sets/src/mage/cards/c/CorrosiveOoze.java | 18 +++++++++--------- ...BlocksOrBecomesBlockedTriggeredAbility.java | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java b/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java index 614a5f039f..31bc5dfbe2 100644 --- a/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java +++ b/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java @@ -27,6 +27,8 @@ */ package mage.cards.c; +import java.util.LinkedList; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.Mode; @@ -35,7 +37,6 @@ import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; -import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -46,8 +47,6 @@ import mage.filter.predicate.permanent.EquippedPredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import java.util.UUID; - /** * * @author rscoates @@ -68,7 +67,7 @@ public class CorrosiveOoze extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - // Whenever Corrosive Ooze blocks or becomes blocked by an equipped creature, destroy all Equipment attached to that creature at end of combat.. + // Whenever Corrosive Ooze blocks or becomes blocked by an equipped creature, destroy all Equipment attached to that creature at end of combat. Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new CorrosiveOozeEffect()), true); this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false)); } @@ -100,23 +99,24 @@ class CorrosiveOozeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null) { LinkedList attachments = new LinkedList(); attachments.addAll(permanent.getAttachments()); for (UUID uuid : attachments) { - Permanent aura = game.getPermanent(uuid); - if (aura != null && aura.hasSubtype(SubType.EQUIPMENT, game)) { - aura.destroy(source.getSourceId(), game, false); + Permanent attachment = game.getPermanent(uuid); + if (attachment != null && attachment.hasSubtype(SubType.EQUIPMENT, game)) { + attachment.destroy(source.getSourceId(), game, false); } } + return true; } return false; } @Override public String getText(Mode mode) { - return "destroy all Equipment attached to that creature"; + return "destroy all Equipment attached to that creature at end of combat"; } } diff --git a/Mage/src/main/java/mage/abilities/common/BlocksOrBecomesBlockedTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/BlocksOrBecomesBlockedTriggeredAbility.java index 0149ac9c1f..24606307cd 100644 --- a/Mage/src/main/java/mage/abilities/common/BlocksOrBecomesBlockedTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/BlocksOrBecomesBlockedTriggeredAbility.java @@ -85,7 +85,7 @@ public class BlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbilityImpl Permanent blocked = game.getPermanent(event.getTargetId()); if (blocked != null && filter.match(blocked, game)) { if (setTargetPointer) { - this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId())); + this.getEffects().setTargetPointer(new FixedTarget(blocked, game)); } return true; } @@ -94,7 +94,7 @@ public class BlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbilityImpl Permanent blocker = game.getPermanent(event.getSourceId()); if (blocker != null && filter.match(blocker, game)) { if (setTargetPointer) { - this.getEffects().setTargetPointer(new FixedTarget(event.getSourceId())); + this.getEffects().setTargetPointer(new FixedTarget(blocker, game)); } return true; }