* Searing Blaze - Fixed that damage was not raised to 3 if the controller played a land before.

This commit is contained in:
LevelX2 2015-06-14 23:56:23 +02:00
parent 516b6ea8e7
commit 75645946e0
2 changed files with 45 additions and 16 deletions

View file

@ -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<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
Set<UUID> availablePossibleTargets = super.possibleTargets(sourceId, sourceControllerId, game);
Set<UUID> possibleTargets = new HashSet<UUID>();
Set<UUID> possibleTargets = new HashSet<>();
MageObject object = game.getObject(sourceId);
if (object instanceof StackObject) {
UUID playerId = ((StackObject)object).getStackAbility().getFirstTarget();

View file

@ -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);
}
}