1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-10 09:11:04 -09:00

Fixed Torment of Hailfire interaction with Sigarda (fixes )

This commit is contained in:
L_J 2018-02-23 14:45:01 +00:00 committed by GitHub
parent e5ef545d8f
commit ac09be4b2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,31 +86,37 @@ class TormentOfHailfireEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
int repeat = source.getManaCostsToPay().getX(); int repeat = source.getManaCostsToPay().getX();
for (int i = 0; i < repeat; i++) { for (int i = 1; i <= repeat; i++) {
for (UUID opponentId : game.getOpponents(source.getControllerId())) { for (UUID opponentId : game.getOpponents(source.getControllerId())) {
Player opponent = game.getPlayer(opponentId); boolean hasChosen = false;
if (opponent != null) { while (!hasChosen) {
int permanents = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_NON_LAND, opponentId, game); Player opponent = game.getPlayer(opponentId);
if (permanents > 0 && opponent.chooseUse(outcome, "Sacrifices a nonland permanent? (Iteration " + i + " of " + repeat + ")", if (opponent != null) {
"Otherwise you have to discard a card or lose 3 life.", "Sacrifice", "Discard or life loss", source, game)) { int permanents = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_NON_LAND, opponentId, game);
Target target = new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_NON_LAND); if (permanents > 0 && opponent.chooseUse(outcome, "Sacrifices a nonland permanent? (Iteration " + i + " of " + repeat + ")",
if (opponent.choose(outcome, target, source.getSourceId(), game)) { "Otherwise you have to discard a card or lose 3 life.", "Sacrifice", "Discard or life loss", source, game)) {
Permanent permanent = game.getPermanent(target.getFirstTarget()); Target target = new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_NON_LAND);
if (permanent != null) { if (opponent.choose(outcome, target, source.getSourceId(), game)) {
permanent.sacrifice(source.getSourceId(), game); Permanent permanent = game.getPermanent(target.getFirstTarget());
continue; if (permanent != null) {
if (permanent.sacrifice(source.getSourceId(), game)) {
hasChosen = true;
continue;
}
}
} }
} }
if (!opponent.getHand().isEmpty() && opponent.chooseUse(outcome, "Discard a card? (Iteration " + i + " of " + repeat + ")",
"Otherwise you lose 3 life.", "Discard", "Lose 3 life", source, game)) {
opponent.discardOne(false, source, game);
hasChosen = true;
continue;
}
opponent.loseLife(3, game, false);
hasChosen = true;
} }
if (!opponent.getHand().isEmpty() && opponent.chooseUse(outcome, "Discard a card? (Iteration " + i + " of " + repeat + ")",
"Otherwise you lose 3 life.", "Discard", "Lose 3 life", source, game)) {
opponent.discardOne(false, source, game);
continue;
}
opponent.loseLife(3, game, false);
} }
} }
} }
return true; return true;
} }