Permanents now detach all attachments when they change zones. Ready to test.

This commit is contained in:
Kevin Shin 2018-08-25 03:18:32 -05:00
parent 1bc022a94a
commit e1bfd8a196
3 changed files with 76 additions and 10 deletions

View file

@ -1980,10 +1980,11 @@ public abstract class GameImpl implements Game, Serializable {
// handle bestow unattachment
Card card = this.getCard(perm.getId());
if (card != null && card.isCreature()) {
UUID wasAttachedTo = perm.getAttachedTo();
perm.attachTo(null, this);
BestowAbility.becomeCreature(perm, this);
fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, wasAttachedTo, perm.getId(), perm.getControllerId()));
//TODO: cleanup
//UUID wasAttachedTo = perm.getAttachedTo();
//perm.attachTo(null, this);
//BestowAbility.becomeCreature(perm, this);
//fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, wasAttachedTo, perm.getId(), perm.getControllerId()));
} else if (movePermanentToGraveyardWithInfo(perm)) {
somethingHappened = true;
}
@ -2000,10 +2001,11 @@ public abstract class GameImpl implements Game, Serializable {
// handle bestow unattachment
Card card = this.getCard(perm.getId());
if (card != null && card.isCreature()) {
UUID wasAttachedTo = perm.getAttachedTo();
perm.attachTo(null, this);
BestowAbility.becomeCreature(perm, this);
fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, wasAttachedTo, perm.getId(), perm.getControllerId()));
//TODO: cleanup
//UUID wasAttachedTo = perm.getAttachedTo();
//perm.attachTo(null, this);
//BestowAbility.becomeCreature(perm, this);
//fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, wasAttachedTo, perm.getId(), perm.getControllerId()));
} else if (movePermanentToGraveyardWithInfo(perm)) {
somethingHappened = true;
}