mirror of
https://github.com/correl/mage.git
synced 2025-03-17 09:16:26 -09:00
Fixed Torment of Hailfire interaction with Sigarda (fixes #4452)
This commit is contained in:
parent
e5ef545d8f
commit
ac09be4b2b
1 changed files with 25 additions and 19 deletions
|
@ -86,8 +86,10 @@ 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())) {
|
||||||
|
boolean hasChosen = false;
|
||||||
|
while (!hasChosen) {
|
||||||
Player opponent = game.getPlayer(opponentId);
|
Player opponent = game.getPlayer(opponentId);
|
||||||
if (opponent != null) {
|
if (opponent != null) {
|
||||||
int permanents = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_NON_LAND, opponentId, game);
|
int permanents = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_NON_LAND, opponentId, game);
|
||||||
|
@ -97,20 +99,24 @@ class TormentOfHailfireEffect extends OneShotEffect {
|
||||||
if (opponent.choose(outcome, target, source.getSourceId(), game)) {
|
if (opponent.choose(outcome, target, source.getSourceId(), game)) {
|
||||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
permanent.sacrifice(source.getSourceId(), game);
|
if (permanent.sacrifice(source.getSourceId(), game)) {
|
||||||
|
hasChosen = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!opponent.getHand().isEmpty() && opponent.chooseUse(outcome, "Discard a card? (Iteration " + i + " of " + repeat + ")",
|
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)) {
|
"Otherwise you lose 3 life.", "Discard", "Lose 3 life", source, game)) {
|
||||||
opponent.discardOne(false, source, game);
|
opponent.discardOne(false, source, game);
|
||||||
|
hasChosen = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
opponent.loseLife(3, game, false);
|
opponent.loseLife(3, game, false);
|
||||||
|
hasChosen = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue