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) {
landsWannaPlay = filterLandsToPlay(landsWannaPlay);
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?
Card land = chooseBestLandToPlay(landsWannaPlay);
if ((!player.canLoseLife() || player.cantLoseForZeroOrLessLife() || ComputerUtil.getDamageFromETB(player, land) < player.getLife())

View File

@@ -1420,10 +1420,8 @@ public class GameAction {
checkAgain = true;
}
}
if (!spaceSculptors.isEmpty()) {
for (Player p : spaceSculptors) {
checkAgain |= stateBasedAction704_5u(p);
}
for (Player p : spaceSculptors) {
checkAgain |= stateBasedAction704_5u(p);
}
// 704.5m World rule
checkAgain |= handleWorldRule(noRegCreats);

View File

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

View File

@@ -124,13 +124,15 @@ public class RollDiceEffect extends SpellAbilityEffect {
total += modifier;
// Run triggers
int rollNum = 1;
for (Integer roll : rolls) {
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(player);
runParams.put(AbilityKey.Sides, sides);
runParams.put(AbilityKey.Modifier, modifier);
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);
rollNum++;
}
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(player);
runParams.put(AbilityKey.Sides, sides);