- Conspiracy: a little restructuring of chooseCardName in PlayerControllerAi.

This commit is contained in:
Agetian
2017-08-17 15:34:23 +00:00
parent bc0b69857a
commit 8632b0ffec

View File

@@ -859,9 +859,11 @@ public class PlayerControllerAi extends PlayerController {
@Override @Override
public String chooseCardName(SpellAbility sa, Predicate<ICardFace> cpp, String valid, String message) { public String chooseCardName(SpellAbility sa, Predicate<ICardFace> cpp, String valid, String message) {
if (sa.hasParam("AILogic")) {
CardCollectionView aiLibrary = player.getCardsIn(ZoneType.Library); CardCollectionView aiLibrary = player.getCardsIn(ZoneType.Library);
CardCollectionView oppLibrary = ComputerUtil.getOpponentFor(player).getCardsIn(ZoneType.Library); CardCollectionView oppLibrary = ComputerUtil.getOpponentFor(player).getCardsIn(ZoneType.Library);
final Card source = sa.getHostCard(); final Card source = sa.getHostCard();
final String logic = sa.getParam("AILogic");
if (source != null && source.getState(CardStateName.Original).hasIntrinsicKeyword("Hidden agenda")) { if (source != null && source.getState(CardStateName.Original).hasIntrinsicKeyword("Hidden agenda")) {
// If any Conspiracies are present, try not to choose the same name twice // If any Conspiracies are present, try not to choose the same name twice
@@ -876,8 +878,6 @@ public class PlayerControllerAi extends PlayerController {
} }
} }
if (sa.hasParam("AILogic")) {
final String logic = sa.getParam("AILogic");
if (logic.equals("MostProminentInComputerDeck")) { if (logic.equals("MostProminentInComputerDeck")) {
return ComputerUtilCard.getMostProminentCardName(aiLibrary); return ComputerUtilCard.getMostProminentCardName(aiLibrary);
} else if (logic.equals("MostProminentInHumanDeck")) { } else if (logic.equals("MostProminentInHumanDeck")) {