* Corrosive Ooze - Fixed that the equipments were not destroyed.

This commit is contained in:
LevelX2 2018-04-24 23:34:45 +02:00
parent 242e55dcd4
commit b496adcb11
2 changed files with 7 additions and 16 deletions

View file

@ -27,26 +27,19 @@
*/ */
package mage.cards.c; package mage.cards.c;
import java.util.LinkedList;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; 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.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DestroyAllAttachedEquipmentEffect; import mage.abilities.effects.common.DestroyAllAttachedEquipmentEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType; import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.EquippedPredicate; import mage.filter.predicate.permanent.EquippedPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
/** /**
* *

View file

@ -1,5 +1,8 @@
package mage.abilities.effects.common; package mage.abilities.effects.common;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome; import mage.constants.Outcome;
@ -8,15 +11,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/** /**
* *
* @author Quercitron * @author Quercitron
*/ */
public class DestroyAllAttachedEquipmentEffect extends OneShotEffect { public class DestroyAllAttachedEquipmentEffect extends OneShotEffect {
public DestroyAllAttachedEquipmentEffect() { public DestroyAllAttachedEquipmentEffect() {
@ -37,9 +35,9 @@ public class DestroyAllAttachedEquipmentEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
Permanent target = game.getPermanent(source.getFirstTarget()); Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (target != null) { if (targetPermanent != null) {
List<UUID> attachments = new ArrayList<>(target.getAttachments()); List<UUID> attachments = new ArrayList<>(targetPermanent.getAttachments());
for (UUID attachmentId : attachments) { for (UUID attachmentId : attachments) {
Permanent attachment = game.getPermanent(attachmentId); Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.hasSubtype(SubType.EQUIPMENT, game)) { if (attachment != null && attachment.hasSubtype(SubType.EQUIPMENT, game)) {