[Desktop] Display which DeckZone the unplayable cards are from

This commit is contained in:
Paco Ito
2022-01-27 05:08:33 +00:00
committed by Michael Kamensky
parent 93f42be5ec
commit 2493b08093
7 changed files with 68 additions and 11 deletions

View File

@@ -2077,18 +2077,23 @@ public class AiController {
return result;
}
public Collection<? extends PaperCard> complainCardsCantPlayWell(Deck myDeck) {
List<PaperCard> result = Lists.newArrayList();
public Map<DeckSection, List<? extends PaperCard>> complainCardsCantPlayWell(Deck myDeck) {
Map<DeckSection, List<? extends PaperCard>> complaints = new HashMap<>();
// When using simulation, AI should be able to figure out most cards.
if (!useSimulation) {
for (Entry<DeckSection, CardPool> ds : myDeck) {
List<PaperCard> result = Lists.newArrayList();
for (Entry<PaperCard, Integer> cp : ds.getValue()) {
if (cp.getKey().getRules().getAiHints().getRemAIDecks())
if (cp.getKey().getRules().getAiHints().getRemAIDecks()) {
result.add(cp.getKey());
}
}
if (!result.isEmpty()) {
complaints.put(ds.getKey(), result);
}
}
}
return result;
return complaints;
}
// this is where the computer cheats

View File

@@ -28,6 +28,7 @@ import forge.card.MagicColor;
import forge.card.mana.ManaCost;
import forge.card.mana.ManaCostShard;
import forge.deck.Deck;
import forge.deck.DeckSection;
import forge.game.Game;
import forge.game.GameEntity;
import forge.game.GameObject;
@@ -1125,7 +1126,12 @@ public class PlayerControllerAi extends PlayerController {
}
@Override
public Collection<? extends PaperCard> complainCardsCantPlayWell(Deck myDeck) {
public void revealAISkipCards(String message, Map<Player, Map<DeckSection, List<? extends PaperCard>>> deckCards) {
// Ai won't understand that anyway
}
@Override
public Map<DeckSection, List<? extends PaperCard>> complainCardsCantPlayWell(Deck myDeck) {
return brains.complainCardsCantPlayWell(myDeck);
}