From e0ce6df6b3ee45dbd813bff226c239d4507d74e0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 22 Apr 2014 15:12:14 +0200 Subject: [PATCH] * BestowAbility - Fixed a problem that bestow cards that was put onto the battlefiedl as Auras were affected by abilities that should only affect creatures (e.g. Imposing Sovereign). --- .../src/mage/sets/coldsnap/DarkDepths.java | 10 +++---- .../cards/abilities/keywords/BestowTest.java | 28 ++++++++++++++++++- .../effects/AuraReplacementEffect.java | 19 +++++++------ Mage/src/mage/game/stack/Spell.java | 20 +++++++------ 4 files changed, 55 insertions(+), 22 deletions(-) diff --git a/Mage.Sets/src/mage/sets/coldsnap/DarkDepths.java b/Mage.Sets/src/mage/sets/coldsnap/DarkDepths.java index 34bc1ea3de9..5183e7121d0 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/DarkDepths.java +++ b/Mage.Sets/src/mage/sets/coldsnap/DarkDepths.java @@ -108,7 +108,7 @@ class DarkDepthsAbility extends StateTriggeredAbility { @Override public String getRule() { - return "When Dark Depths has no ice counters on it, sacrifice it. If you do, put a legendary 20/20 black Avatar creature token with flying and \"This creature is indestructible\" named Marit Lage onto the battlefield"; + return "When {this} has no ice counters on it, sacrifice it. If you do, put a legendary 20/20 black Avatar creature token with flying and indestructible named Marit Lage onto the battlefield."; } } @@ -117,18 +117,18 @@ class DarkDepthsAbility extends StateTriggeredAbility { class MaritLageToken extends Token { public MaritLageToken() { - super("Marit Lage", "legendary 20/20 black Avatar creature token with flying and \"This creature is indestructible\" named Marit Lage"); + super("Marit Lage", "legendary 20/20 black Avatar creature token with flying and indestructible named Marit Lage"); + this.setOriginalExpansionSetCode("CSP"); cardType.add(CardType.CREATURE); subtype.add("Avatar"); supertype.add("Legendary"); - - color = ObjectColor.BLACK; + color.setBlack(true); power = new MageInt(20); toughness = new MageInt(20); this.addAbility(FlyingAbility.getInstance()); this.addAbility(IndestructibleAbility.getInstance()); - this.setOriginalExpansionSetCode("CSP"); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java index 6ed21a83a12..1daddfaa1f2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BestowTest.java @@ -28,9 +28,9 @@ package org.mage.test.cards.abilities.keywords; -import mage.abilities.keyword.HexproofAbility; import mage.constants.PhaseStep; import mage.constants.Zone; +import mage.game.permanent.Permanent; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -137,4 +137,30 @@ public class BestowTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Hopeful Eidolon", 1, 1); } + /** + * Test that card cast with bestow will not be tapped, if creatures come into play tapped + */ + @Test + public void bestowEnchantmentWillNotBeTapped() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 6); + addCard(Zone.BATTLEFIELD, playerA, "Silent Artisan"); + + addCard(Zone.HAND, playerA, "Boon Satyr"); + + // Enchantment {1}{W} + // Creatures your opponents control enter the battlefield tapped. + addCard(Zone.BATTLEFIELD, playerB, "Imposing Sovereign"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Boon Satyr using bestow", "Silent Artisan"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + // because Boon Satyr is no creature on the battlefield, evolve may not trigger + assertPermanentCount(playerA, "Silent Artisan", 1); + assertPowerToughness(playerA, "Silent Artisan", 7, 7); + // because cast with bestow, Boon Satyr may not be tapped + assertTapped("Boon Satyr", false); + + } } diff --git a/Mage/src/mage/abilities/effects/AuraReplacementEffect.java b/Mage/src/mage/abilities/effects/AuraReplacementEffect.java index 9f0314a4134..5a3e931bebf 100644 --- a/Mage/src/mage/abilities/effects/AuraReplacementEffect.java +++ b/Mage/src/mage/abilities/effects/AuraReplacementEffect.java @@ -48,8 +48,10 @@ import mage.game.stack.Spell; /** * Cards with the Aura subtype don't change the zone they are in, if there is no - * valid target on the battlefield. Also, when entering the Battlefield and it - * was not cast, this effect gets the target to witch to attach it. + * valid target on the battlefield. Also, when entering the battlefield and it + * was not cast (so from Zone != Hand), this effect gets the target to witch to attach it + * and adds the Aura the the battlefield and attachs it to the target. + * The "attachTo:" value in game state has to be set therefore. * * This effect is automatically added to ContinuousEffects at the start of a game * @@ -149,12 +151,13 @@ public class AuraReplacementEffect extends ReplacementEffectImpl> implements StackObject, Card { } else if (this.getCardType().contains(CardType.ENCHANTMENT) && this.getSubtype().contains("Aura")) { if (ability.getTargets().stillLegal(ability, game)) { updateOptionalCosts(0); + boolean bestow = this.getSpellAbility() instanceof BestowAbility; + if (bestow) { + // Must be removed first time, after that will be removed by continous effect + // Otherwise effects like evolve trigger from creature comes into play event + card.getCardType().remove(CardType.CREATURE); + } if (card.putOntoBattlefield(game, fromZone, ability.getId(), controllerId)) { - if (this.getSpellAbility() instanceof BestowAbility) { - Permanent permanent = game.getPermanent(card.getId()); - if (permanent != null) { - // Must be removed first time, after that will be removed by continous effect - // Otherwise effects like evolve trigger from creature comes into play event - permanent.getCardType().remove(CardType.CREATURE); - } - } + if (bestow) { + card.getCardType().add(CardType.CREATURE); + } game.getState().handleSimultaneousEvent(game); return ability.resolve(game); } + if (bestow) { + card.getCardType().add(CardType.CREATURE); + } return false; } // Aura has no legal target and its a bestow enchantment -> Add it to battlefield as creature