* 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

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