* BestowAbility - Fixed that the Bestow card stays as creature on the battlefield when the creature it was enchanting leaves the battlefield.

This commit is contained in:
LevelX2 2013-09-20 01:07:45 +02:00
parent eafe3e719d
commit f6744cd29a
3 changed files with 49 additions and 11 deletions

View file

@ -33,7 +33,6 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continious.BoostEnchantedEffect;
import mage.abilities.effects.common.combat.CantBeBlockedByOneEffect;
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
import mage.abilities.keyword.BestowAbility;
import mage.abilities.keyword.FirstStrikeAbility;

View file

@ -29,35 +29,71 @@
package mage.abilities.keyword;
import mage.abilities.Ability;
import mage.constants.Zone;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.DiscardSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continious.SourceEffect;
import mage.cards.Card;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import static mage.constants.Layer.TypeChangingEffects_4;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.target.TargetPermanent;
import mage.target.common.TargetAttackingCreature;
import mage.target.common.TargetCreaturePermanent;
/**
*
* 702.102. Bestow
*
* Bestow
* FIXME: Add offical rulings
* 702.102a Bestow represents two static abilities, one that functions while the card with bestow is
* on the stack and another that functions both while its on stack and while its on the battlefield.
* Bestow [cost] means You may cast this card by paying [cost] rather than its mana cost. and If
* you chose to pay this spells bestow cost, it becomes an Aura enchantment and gains enchant creature.
* These effects last until one of two things happens: this spell has an illegal target as it resolves
* and or the permanent this spell becomes, becomes unattached. Paying a cards bestow cost follows the
* rules for paying alternative costs in rules 601.2b and 601.2eg.
*
* 702.102b If a spells controller chooses to pay its bestow cost, that player chooses a legal target
* for that Aura spell as defined by its enchant creature ability and rule 601.2c. See also rule 303.4.
*
* 702.102c A spells controller cant choose to pay its bestow cost unless that player can choose a legal
* target for that spell after it becomes an Aura spell.
*
* 702.102d As an Aura spell with bestow begins resolving, if its target is illegal, the effect making
* 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.
*
* 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
* spells as though they have flash will allow you to cast a creature card with bestow as an Aura spell
* anytime you could cast an instant.
*
* On the stack, a spell with bestow is either a creature spell or an Aura spell. Its never both.
*
* Unlike other Aura spells, an Aura spell with bestow isnt countered if its target is illegal as it
* begins to resolve. Rather, the effect making it an Aura spell ends, it loses enchant creature, it
* returns to being an enchantment creature spell, and it resolves and enters the battlefield as an
* enchantment creature.
*
* Unlike other Auras, an Aura with bestow isnt put into its owners graveyard if it becomes unattached.
* Rather, the effect making it an Aura ends, it loses enchant creature, and it remains on the
* battlefield as an enchantment creature. It can attack (and its {T} abilities can be activated,
* if it has any) on the turn it becomes unattached if its been under your control continuously,
* even as an Aura, since your most recent turn began.
*
* If a permanent with bestow enters the battlefield by any method other than being cast, it will be
* an enchantment creature. You cant choose to pay the bestow cost and have it become an Aura.
*
* Auras attached to a creature dont become tapped when the creature becomes tapped. Except in some
* rare cases, an Aura with bestow remains untapped when it becomes unattached and becomes a creature.
*
*
* @author LevelX2

View file

@ -1215,8 +1215,11 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
if (filterAura.match(perm, this)) {
//20091005 - 704.5n, 702.14c
if (perm.getAttachedTo() == null) {
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) {
somethingHappened = true;
Card card = this.getCard(perm.getId());
if (card != null && !card.getCardType().contains(CardType.CREATURE)) { // no bestow creature
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) {
somethingHappened = true;
}
}
}
else {