From 542997be8fe85d6ce55b097d888cebcf452aaf99 Mon Sep 17 00:00:00 2001 From: Duncan Townsend Date: Thu, 22 Jan 2015 17:41:12 -0500 Subject: [PATCH] Breath of Fury must successfully sacrifice its attached creature in order for the remainder of the effect to happen --- .../src/mage/sets/ravnika/BreathOfFury.java | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/Mage.Sets/src/mage/sets/ravnika/BreathOfFury.java b/Mage.Sets/src/mage/sets/ravnika/BreathOfFury.java index 341e361df3..9a77b764fc 100644 --- a/Mage.Sets/src/mage/sets/ravnika/BreathOfFury.java +++ b/Mage.Sets/src/mage/sets/ravnika/BreathOfFury.java @@ -145,22 +145,20 @@ class BreathOfFuryEffect extends OneShotEffect { filter.add(new CanBeEnchantedPredicate(enchantment)); Target target = new TargetControlledCreaturePermanent(filter); target.setNotTarget(true); - if (enchantedCreature != null && controller != null) { - // sacrifice the enchanted creature (don't check return state because controller has sarificed independant if something replaced later); - // e.g. Commander replacement effect going to command zone - enchantedCreature.sacrifice(source.getSourceId(), game); - if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { - controller.choose(outcome, target, source.getSourceId(), game); - Permanent newCreature = game.getPermanent(target.getFirstTarget()); - if (newCreature != null && - newCreature.addAttachment(enchantment.getId(), game)) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterControlledCreaturePermanent(), controller.getId(), game)) { - permanent.untap(game); - } - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); - + // It's important to check that the creature was successfully sacrificed here. Effects that prevent sacrifice will also prevent Breath of Fury's effect from working. + // Commanders going to the command zone and Rest in Peace style replacement effects don't make Permanent.sacrifice return false. + if (enchantedCreature != null && controller != null + && enchantedCreature.sacrifice(source.getSourceId(), game) + && target.canChoose(source.getSourceId(), source.getControllerId(), game)) { + controller.choose(outcome, target, source.getSourceId(), game); + Permanent newCreature = game.getPermanent(target.getFirstTarget()); + if (newCreature != null && + newCreature.addAttachment(enchantment.getId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterControlledCreaturePermanent(), controller.getId(), game)) { + permanent.untap(game); } + game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); } return true; }