* Bestow - Fixed that creature with bestow went to graveyard if enchanted target got protection from a color of the bestow permanent.

This commit is contained in:
LevelX2 2014-01-03 12:38:51 +01:00
parent cb4b2cbc05
commit 74e3fa63a8
7 changed files with 158 additions and 7 deletions

View file

@ -70,6 +70,9 @@ import mage.target.common.TargetCreaturePermanent;
* it an Aura spell ends. It continues resolving as a creature spell and will be put onto the battlefield
* under the control of the spells controller. This is an exception to rule 608.3a.
*
* 702.102e If an Aura with bestow is attached to an illegal object or player, it becomes unattached.
* This is an exception to rule 704.5n.
*
* You dont choose whether the spell is going to be an Aura spell or not until the spell is already on
* the stack. Abilities that affect when you can cast a spell, such as flash, will apply to the creature
* card in whatever zone youre casting it from. For example, an effect that said you can cast creature

View file

@ -1296,8 +1296,16 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
}
} else {
if (!auraFilter.match(attachedTo, this) || attachedTo.hasProtectionFrom(perm, this)) {
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) {
somethingHappened = true;
// handle bestow unattachment
Card card = this.getCard(perm.getId());
if (card != null && card.getCardType().contains(CardType.CREATURE)) {
UUID wasAttachedTo = perm.getAttachedTo();
perm.attachTo(null, this);
fireEvent(new GameEvent(GameEvent.EventType.UNATTACHED, wasAttachedTo, perm.getId(), perm.getControllerId()));
} else {
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) {
somethingHappened = true;
}
}
}
}