mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
* 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:
parent
cb4b2cbc05
commit
74e3fa63a8
7 changed files with 158 additions and 7 deletions
|
|
@ -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 spell’s 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 don’t 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 you’re casting it from. For example, an effect that said you can cast creature
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue