all tests passing and satisfied with minimal changes; ready to merge

This commit is contained in:
Kevin Shin 2018-08-25 23:24:01 -05:00
parent 3ffd812bc6
commit 7d2ba0cf2e
2 changed files with 5 additions and 8 deletions

View file

@ -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;

View file

@ -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()));
}
}
}