From 4bea123bf3235234aab90a99ccb78c36fc442619 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 7 May 2015 21:04:04 +0200 Subject: [PATCH] Some minor changes. Added a test. --- .../sets/bornofthegods/CourserOfKruphix.java | 1 - .../mage/sets/ravnica/LifeFromTheLoam.java | 2 +- .../sets/shardsofalara/SharuumTheHegemon.java | 3 -- .../abilities/keywords/ManifestTest.java | 39 ++++++++++++++++++- .../common/AddContinuousEffectToGame.java | 2 +- .../combat/AttacksIfAbleSourceEffect.java | 7 +--- 6 files changed, 42 insertions(+), 12 deletions(-) diff --git a/Mage.Sets/src/mage/sets/bornofthegods/CourserOfKruphix.java b/Mage.Sets/src/mage/sets/bornofthegods/CourserOfKruphix.java index d51452f4b7..f82e66ef3b 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/CourserOfKruphix.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/CourserOfKruphix.java @@ -52,7 +52,6 @@ public class CourserOfKruphix extends CardImpl { this.expansionSetCode = "BNG"; this.subtype.add("Centaur"); - this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(4); diff --git a/Mage.Sets/src/mage/sets/ravnica/LifeFromTheLoam.java b/Mage.Sets/src/mage/sets/ravnica/LifeFromTheLoam.java index f943cb5ebc..437b2adcf8 100644 --- a/Mage.Sets/src/mage/sets/ravnica/LifeFromTheLoam.java +++ b/Mage.Sets/src/mage/sets/ravnica/LifeFromTheLoam.java @@ -51,7 +51,7 @@ public class LifeFromTheLoam extends CardImpl { // Return up to three target land cards from your graveyard to your hand. this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 3, new FilterLandCard("land cards from your graveyard"))); - // Dredge 3 + // Dredge 3 (If you would draw a card, instead you may put exactly three cards from the top of your library into your graveyard. If you do, return this card from your graveyard to your hand. Otherwise, draw a card.) this.addAbility(new DredgeAbility(3)); } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SharuumTheHegemon.java b/Mage.Sets/src/mage/sets/shardsofalara/SharuumTheHegemon.java index 069b3ebceb..5a279d583f 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SharuumTheHegemon.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SharuumTheHegemon.java @@ -51,9 +51,6 @@ public class SharuumTheHegemon extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Sphinx"); - this.color.setBlue(true); - this.color.setBlack(true); - this.color.setWhite(true); this.power = new MageInt(5); this.toughness = new MageInt(5); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java index 06974adbde..b17ebe4dcc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java @@ -324,5 +324,42 @@ public class ManifestTest extends CardTestPlayerBase { assertPowerToughness(playerB, "Sandstorm Charger", 4, 5); // 3/4 and the +1/+1 counter from Megamorph } - + + /** + * When a Forest came manifested into play my Courser of Kruphix gained me a life. + * + */ + @Test + public void testManifestForest() { + + addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2); + // Play with the top card of your library revealed. + // You may play the top card of your library if it's a land card. + // Whenever a land enters the battlefield under your control, you gain 1 life. + addCard(Zone.BATTLEFIELD, playerB, "Courser of Kruphix", 1); + + // {1}{B}, {T}, Sacrifice another creature: Manifest the top card of your library. + addCard(Zone.BATTLEFIELD, playerB, "Qarsi High Priest", 1); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + + addCard(Zone.LIBRARY, playerB, "Forest", 1); + + skipInitShuffling(); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}{B},{T}, Sacrifice another creature"); + addTarget(playerB, "Silvercoat Lion"); + + + setStopAt(2, PhaseStep.END_TURN); + execute(); + + // no life gain + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + + assertPermanentCount(playerB, "face down creature", 1); + + } } diff --git a/Mage/src/mage/abilities/effects/common/AddContinuousEffectToGame.java b/Mage/src/mage/abilities/effects/common/AddContinuousEffectToGame.java index 788225bc2c..0ccc81a8dc 100644 --- a/Mage/src/mage/abilities/effects/common/AddContinuousEffectToGame.java +++ b/Mage/src/mage/abilities/effects/common/AddContinuousEffectToGame.java @@ -39,7 +39,7 @@ import mage.game.Game; */ public class AddContinuousEffectToGame extends OneShotEffect { - private ContinuousEffect effect; + private final ContinuousEffect effect; public AddContinuousEffectToGame(ContinuousEffect effect) { super(Outcome.Benefit); diff --git a/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java b/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java index 5cab193427..104d3bdfe0 100644 --- a/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java @@ -61,10 +61,7 @@ public class AttacksIfAbleSourceEffect extends RequirementEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - return true; - } - return false; + return permanent.getId().equals(source.getSourceId()); } @Override @@ -77,4 +74,4 @@ public class AttacksIfAbleSourceEffect extends RequirementEffect { return false; } -} \ No newline at end of file +}