Merge pull request #1470 from rikimbo/adventure_no_warn_about_ai_cards

Adventure: Don't warn about cards the AI can't play well
This commit is contained in:
Anthony Calosa
2022-09-10 16:34:29 +08:00
committed by GitHub
3 changed files with 12 additions and 1 deletions

View File

@@ -19,6 +19,9 @@ public class GameRules {
// same for me // same for me
private boolean useGrayText; private boolean useGrayText;
// whether to warn about cards AI can't play well
private boolean warnAboutAICards = true;
public GameRules(final GameType type) { public GameRules(final GameType type) {
this.gameType = type; this.gameType = type;
} }
@@ -109,4 +112,11 @@ public class GameRules {
public void setUseGrayText(final boolean useGrayText) { public void setUseGrayText(final boolean useGrayText) {
this.useGrayText = useGrayText; this.useGrayText = useGrayText;
} }
public boolean warnAboutAICards() {
return warnAboutAICards;
}
public void setWarnAboutAICards(final boolean warnAboutAICards) {
this.warnAboutAICards = warnAboutAICards;
}
} }

View File

@@ -334,7 +334,7 @@ public class Match {
} }
final Localizer localizer = Localizer.getInstance(); final Localizer localizer = Localizer.getInstance();
if (!rAICards.isEmpty() && !rules.getGameType().isCardPoolLimited()) { if (!rAICards.isEmpty() && !rules.getGameType().isCardPoolLimited() && rules.warnAboutAICards()) {
game.getAction().revealUnplayableByAI(localizer.getMessage("lblAICantPlayCards"), rAICards); game.getAction().revealUnplayableByAI(localizer.getMessage("lblAICantPlayCards"), rAICards);
} }

View File

@@ -282,6 +282,7 @@ public class DuelScene extends ForgeScene {
rules.setMatchAnteRarity(true); rules.setMatchAnteRarity(true);
rules.setGamesPerMatch(1); rules.setGamesPerMatch(1);
rules.setManaBurn(false); rules.setManaBurn(false);
rules.setWarnAboutAICards(false);
hostedMatch.setEndGameHook(() -> DuelScene.this.GameEnd()); hostedMatch.setEndGameHook(() -> DuelScene.this.GameEnd());
hostedMatch.startMatch(rules, appliedVariants, players, guiMap); hostedMatch.startMatch(rules, appliedVariants, players, guiMap);