mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Breath of Fury must successfully sacrifice its attached creature in order for the remainder of the effect to happen
This commit is contained in:
parent
91b8089455
commit
542997be8f
1 changed files with 12 additions and 14 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue