Fix AI never casting paired commanders

This commit is contained in:
TRT
2023-08-14 20:37:37 +02:00
committed by Chris H
parent e9f825f3c0
commit 0f002e6526
5 changed files with 5 additions and 23 deletions

View File

@@ -279,6 +279,11 @@ public class AiController {
continue;
}
// can't fetch partner isn't problematic
if (tr.getKeyword() != null && tr.getKeyword().getOriginal().startsWith("Partner")) {
continue;
}
if (!ZoneType.Battlefield.toString().equals(tr.getParam("Destination"))) {
continue;
}

View File

@@ -593,15 +593,6 @@ public class PlayerControllerAi extends PlayerController {
return !ComputerUtil.wantMulligan(player, cardsToReturn);
}
@Override
public CardCollectionView getCardsToMulligan(Player firstPlayer) {
if (!ComputerUtil.wantMulligan(player, 0)) {
return null;
}
return player.getCardsIn(ZoneType.Hand);
}
@Override
public CardCollectionView londonMulliganReturnCards(final Player mulliganingPlayer, int cardsToReturn) {
// TODO This is better than it was before, but still suboptimal (but fast).

View File

@@ -191,7 +191,6 @@ public abstract class PlayerController {
public abstract Object vote(SpellAbility sa, String prompt, List<Object> options, ListMultimap<Object, Player> votes, Player forPlayer);
public abstract CardCollectionView getCardsToMulligan(Player firstPlayer);
public abstract boolean mulliganKeepHand(Player player, int cardsToReturn);
public abstract CardCollectionView londonMulliganReturnCards(Player mulliganingPlayer, int cardsToReturn);

View File

@@ -319,11 +319,6 @@ public class PlayerControllerForTests extends PlayerController {
return true;
}
@Override
public CardCollectionView getCardsToMulligan(Player firstPlayer) {
return null;
}
@Override
public void declareAttackers(Player attacker, Combat combat) {
//Doing nothing is safe in most cases, but not all (creatures that must attack etc). TODO: introduce checks?

View File

@@ -1460,14 +1460,6 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
return inp.getSelectedCards();
}
@Override
public CardCollectionView getCardsToMulligan(final Player firstPlayer) {
// Partial Paris is gone, so it being commander doesn't really matter anymore...
final InputConfirmMulligan inp = new InputConfirmMulligan(this, player, firstPlayer);
inp.showAndWait();
return inp.isKeepHand() ? null : player.getCardsIn(ZoneType.Hand);
}
@Override
public void declareAttackers(final Player attackingPlayer, final Combat combat) {
if (mayAutoPass()) {