From 7d2ba0cf2ea2151b01481355b97c82dea94001ee Mon Sep 17 00:00:00 2001 From: Kevin Shin Date: Sat, 25 Aug 2018 23:24:01 -0500 Subject: [PATCH] all tests passing and satisfied with minimal changes; ready to merge --- Mage/src/main/java/mage/game/GameImpl.java | 3 +-- .../main/java/mage/game/permanent/PermanentImpl.java | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Mage/src/main/java/mage/game/GameImpl.java b/Mage/src/main/java/mage/game/GameImpl.java index 6b7eecdb42..1dfe7b8a0c 100644 --- a/Mage/src/main/java/mage/game/GameImpl.java +++ b/Mage/src/main/java/mage/game/GameImpl.java @@ -1980,10 +1980,9 @@ public abstract class GameImpl implements Game, Serializable { // handle bestow unattachment Card card = this.getCard(perm.getId()); if (card != null && card.isCreature()) { - //TODO: cleanup UUID wasAttachedTo = perm.getAttachedTo(); perm.attachTo(null, this); - BestowAbility.becomeCreature(perm, this); + //BestowAbility.becomeCreature(perm, this); fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, wasAttachedTo, perm.getId(), perm.getControllerId())); } else if (movePermanentToGraveyardWithInfo(perm)) { somethingHappened = true; diff --git a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java index 47dbc5b887..776f0b775d 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java @@ -1439,20 +1439,18 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { //20180810 - 701.3d //If an object leaves the zone it's in, all attached permanents become unattached + //note that this code doesn't actually detach anything, and is a bit of a bandaid public void detachAllAttachments(Game game) { for(UUID attachmentId : getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); Card attachmentCard = game.getCard(attachmentId); if(attachment != null && attachmentCard != null) { - attachment.attachTo(null, game); - //make bestow cards and licids into creatures - if(attachmentCard.isCreature()) { + //aura test to stop bludgeon brawl shenanigans from using this code + //consider adding code to handle that case? + if(attachment.hasSubtype(SubType.AURA, game) && attachmentCard.isCreature()) { BestowAbility.becomeCreature(attachment, game); } - - game.fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, - getId(), attachment.getId(), attachment.getControllerId())); } } }