Breath of Fury must successfully sacrifice its attached creature in order for the remainder of the effect to happen

This commit is contained in:
Duncan Townsend 2015-01-22 17:41:12 -05:00
parent 91b8089455
commit 542997be8f
No known key found for this signature in database
GPG key ID: C00ECDF315F7A593

View file

@ -145,11 +145,11 @@ class BreathOfFuryEffect extends OneShotEffect {
filter.add(new CanBeEnchantedPredicate(enchantment)); filter.add(new CanBeEnchantedPredicate(enchantment));
Target target = new TargetControlledCreaturePermanent(filter); Target target = new TargetControlledCreaturePermanent(filter);
target.setNotTarget(true); target.setNotTarget(true);
if (enchantedCreature != null && controller != null) { // 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.
// sacrifice the enchanted creature (don't check return state because controller has sarificed independant if something replaced later); // Commanders going to the command zone and Rest in Peace style replacement effects don't make Permanent.sacrifice return false.
// e.g. Commander replacement effect going to command zone if (enchantedCreature != null && controller != null
enchantedCreature.sacrifice(source.getSourceId(), game); && enchantedCreature.sacrifice(source.getSourceId(), game)
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { && target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
controller.choose(outcome, target, source.getSourceId(), game); controller.choose(outcome, target, source.getSourceId(), game);
Permanent newCreature = game.getPermanent(target.getFirstTarget()); Permanent newCreature = game.getPermanent(target.getFirstTarget());
if (newCreature != null && if (newCreature != null &&
@ -157,10 +157,8 @@ class BreathOfFuryEffect extends OneShotEffect {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterControlledCreaturePermanent(), controller.getId(), game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterControlledCreaturePermanent(), controller.getId(), game)) {
permanent.untap(game); permanent.untap(game);
} }
game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false));
}
} }
return true; return true;
} }