Fix counting

This commit is contained in:
TRT
2022-12-14 17:53:18 +01:00
committed by tool4EvEr
parent 8d2e56e4dc
commit 35810fcb66
4 changed files with 7 additions and 8 deletions

View File

@@ -1488,7 +1488,7 @@ public class AiController {
if (landsWannaPlay != null) { if (landsWannaPlay != null) {
landsWannaPlay = filterLandsToPlay(landsWannaPlay); landsWannaPlay = filterLandsToPlay(landsWannaPlay);
Log.debug("Computer " + game.getPhaseHandler().getPhase().nameForUi); Log.debug("Computer " + game.getPhaseHandler().getPhase().nameForUi);
if (!landsWannaPlay.isEmpty()) { if (landsWannaPlay != null && !landsWannaPlay.isEmpty()) {
// TODO search for other land it might want to play? // TODO search for other land it might want to play?
Card land = chooseBestLandToPlay(landsWannaPlay); Card land = chooseBestLandToPlay(landsWannaPlay);
if ((!player.canLoseLife() || player.cantLoseForZeroOrLessLife() || ComputerUtil.getDamageFromETB(player, land) < player.getLife()) if ((!player.canLoseLife() || player.cantLoseForZeroOrLessLife() || ComputerUtil.getDamageFromETB(player, land) < player.getLife())

View File

@@ -1420,11 +1420,9 @@ public class GameAction {
checkAgain = true; checkAgain = true;
} }
} }
if (!spaceSculptors.isEmpty()) {
for (Player p : spaceSculptors) { for (Player p : spaceSculptors) {
checkAgain |= stateBasedAction704_5u(p); checkAgain |= stateBasedAction704_5u(p);
} }
}
// 704.5m World rule // 704.5m World rule
checkAgain |= handleWorldRule(noRegCreats); checkAgain |= handleWorldRule(noRegCreats);
// only check static abilities once after destroying all the creatures // only check static abilities once after destroying all the creatures

View File

@@ -80,8 +80,7 @@ public class RestartGameEffect extends SpellAbilityEffect {
} }
// special handling for Karn to filter out non-cards // special handling for Karn to filter out non-cards
CardCollection cmdCards = new CardCollection(p.getCardsIn(ZoneType.Command)); for (Card c : p.getCardsIn(ZoneType.Command)) {
for (Card c : cmdCards) {
if (c.isCommander()) { if (c.isCommander()) {
newLibrary.add(c); newLibrary.add(c);
} }

View File

@@ -124,13 +124,15 @@ public class RollDiceEffect extends SpellAbilityEffect {
total += modifier; total += modifier;
// Run triggers // Run triggers
int rollNum = 1;
for (Integer roll : rolls) { for (Integer roll : rolls) {
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(player); final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(player);
runParams.put(AbilityKey.Sides, sides); runParams.put(AbilityKey.Sides, sides);
runParams.put(AbilityKey.Modifier, modifier); runParams.put(AbilityKey.Modifier, modifier);
runParams.put(AbilityKey.Result, roll); runParams.put(AbilityKey.Result, roll);
runParams.put(AbilityKey.Number, player.getNumRollsThisTurn() + 1 - amount + rolls.indexOf(roll)); runParams.put(AbilityKey.Number, player.getNumRollsThisTurn() - amount + rollNum);
player.getGame().getTriggerHandler().runTrigger(TriggerType.RolledDie, runParams, false); player.getGame().getTriggerHandler().runTrigger(TriggerType.RolledDie, runParams, false);
rollNum++;
} }
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(player); final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(player);
runParams.put(AbilityKey.Sides, sides); runParams.put(AbilityKey.Sides, sides);