From 75645946e0f5c88badd33327f8ad5e364c19f198 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 23:56:23 +0200 Subject: [PATCH] * Searing Blaze - Fixed that damage was not raised to 3 if the controller played a land before. --- .../src/mage/sets/worldwake/SearingBlaze.java | 26 ++++++-------- .../abilities/keywords/LandfallTest.java | 35 +++++++++++++++++++ 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java index c5b2b73ac36..2cccea80098 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java +++ b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java @@ -96,24 +96,18 @@ class SearingBlazeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Watcher watcher = game.getState().getWatchers().get("LandPlayed", source.getControllerId()); + LandfallWatcher watcher = (LandfallWatcher) game.getState().getWatchers().get("LandPlayed"); Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget()); Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); - if (watcher != null && watcher.conditionMet()) { - if (player != null) { - player.damage(3, source.getSourceId(), game, false, true); - } - if (creature != null) { - creature.damage(3, source.getSourceId(), game, false, true); - } + int damage = 1; + if (watcher != null && watcher.landPlayed(source.getControllerId())) { + damage = 3; } - else { - if (player != null) { - player.damage(1, source.getSourceId(), game, false, true); - } - if (creature != null) { - creature.damage(1, source.getSourceId(), game, false, true); - } + if (player != null) { + player.damage(damage, source.getSourceId(), game, false, true); + } + if (creature != null) { + creature.damage(damage, source.getSourceId(), game, false, true); } return true; } @@ -143,7 +137,7 @@ class SearingBlazeTarget extends TargetPermanent { @Override public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set availablePossibleTargets = super.possibleTargets(sourceId, sourceControllerId, game); - Set possibleTargets = new HashSet(); + Set possibleTargets = new HashSet<>(); MageObject object = game.getObject(sourceId); if (object instanceof StackObject) { UUID playerId = ((StackObject)object).getStackAbility().getFirstTarget(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java index ef5349b9ae8..0f4ab1f663b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java @@ -111,5 +111,40 @@ public class LandfallTest extends CardTestPlayerBase { assertLife(playerB, 20); } + + /** + * Searing Blaze's landfall doesn't appear to be working. My opponent played + * a mountain, then played searing blaze targeting my Tasigur, the Golden + * Fang. It only dealt 1 damage to me, where it should've dealt 3, because + * my opponent had played a land. + */ + @Test + public void testSearingBlaze() { + // Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls. + // Landfall - If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead. + addCard(Zone.HAND, playerA, "Searing Blaze",1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain",1); + addCard(Zone.HAND, playerA, "Mountain"); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1); + + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Searing Blaze"); + + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Mountain", 2); + assertGraveyardCount(playerA, "Searing Blaze" , 1); + + assertLife(playerA, 20); + assertLife(playerB, 17); + + assertGraveyardCount(playerB, "Silvercoat Lion" , 1); + + } }