[DOM] Updated Corrosive Ooze.

This commit is contained in:
LevelX2 2018-04-18 10:58:12 +02:00
parent ac836cb90e
commit d2a51dc4c0
2 changed files with 11 additions and 11 deletions

View file

@ -27,6 +27,8 @@
*/ */
package mage.cards.c; package mage.cards.c;
import java.util.LinkedList;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
@ -35,7 +37,6 @@ import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
@ -46,8 +47,6 @@ import mage.filter.predicate.permanent.EquippedPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
* *
* @author rscoates * @author rscoates
@ -68,7 +67,7 @@ public class CorrosiveOoze extends CardImpl {
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = 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); Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new CorrosiveOozeEffect()), true);
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false)); this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false));
} }
@ -100,23 +99,24 @@ class CorrosiveOozeEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget()); Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent != null) { if (permanent != null) {
LinkedList<UUID> attachments = new LinkedList(); LinkedList<UUID> attachments = new LinkedList();
attachments.addAll(permanent.getAttachments()); attachments.addAll(permanent.getAttachments());
for (UUID uuid : attachments) { for (UUID uuid : attachments) {
Permanent aura = game.getPermanent(uuid); Permanent attachment = game.getPermanent(uuid);
if (aura != null && aura.hasSubtype(SubType.EQUIPMENT, game)) { if (attachment != null && attachment.hasSubtype(SubType.EQUIPMENT, game)) {
aura.destroy(source.getSourceId(), game, false); attachment.destroy(source.getSourceId(), game, false);
} }
} }
return true;
} }
return false; return false;
} }
@Override @Override
public String getText(Mode mode) { 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";
} }
} }

View file

@ -85,7 +85,7 @@ public class BlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbilityImpl
Permanent blocked = game.getPermanent(event.getTargetId()); Permanent blocked = game.getPermanent(event.getTargetId());
if (blocked != null && filter.match(blocked, game)) { if (blocked != null && filter.match(blocked, game)) {
if (setTargetPointer) { if (setTargetPointer) {
this.getEffects().setTargetPointer(new FixedTarget(event.getTargetId())); this.getEffects().setTargetPointer(new FixedTarget(blocked, game));
} }
return true; return true;
} }
@ -94,7 +94,7 @@ public class BlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbilityImpl
Permanent blocker = game.getPermanent(event.getSourceId()); Permanent blocker = game.getPermanent(event.getSourceId());
if (blocker != null && filter.match(blocker, game)) { if (blocker != null && filter.match(blocker, game)) {
if (setTargetPointer) { if (setTargetPointer) {
this.getEffects().setTargetPointer(new FixedTarget(event.getSourceId())); this.getEffects().setTargetPointer(new FixedTarget(blocker, game));
} }
return true; return true;
} }