Merge branch 'wip/game-gemblo' into codex/owner/grp_discord_joke-app
# Conflicts: # apps/web/src/games/registry.ts # apps/web/src/lib/catalog-ui.ts # docs/games/README.md # e2e/games.e2e.ts # packages/games/package.json # packages/games/src/bots/index.ts # packages/games/src/index.ts # packages/shared/src/bots.ts # packages/shared/src/catalog.ts
This commit is contained in:
@@ -39,6 +39,7 @@ import { liarBot } from '../liar/bot';
|
||||
import { magicalAthleteBot } from '../magical-athlete/bot';
|
||||
import { blackjackBot } from '../blackjack/bot';
|
||||
import { sixNimmtBot } from '../six-nimmt/bot';
|
||||
import { gembloBot } from '../gemblo/bot';
|
||||
|
||||
export type { BotInput, BotReaction, BotStrategy, LiveBotDecision, LiveBotInput, LiveBotStrategy } from './types';
|
||||
export { botDraw, botPace, botPersona, hash01, idLevel, type BotLevel, type BotPersona } from './persona';
|
||||
@@ -75,6 +76,7 @@ export const BOT_STRATEGIES: Record<string, BotStrategy> = {
|
||||
'magical-athlete': magicalAthleteBot,
|
||||
blackjack: blackjackBot,
|
||||
'six-nimmt': sixNimmtBot,
|
||||
gemblo: gembloBot,
|
||||
};
|
||||
|
||||
/** Games whose computers also react out of turn on their own clock (원카드 외치기·잡기). */
|
||||
|
||||
@@ -33,8 +33,8 @@ describe('luck', () => {
|
||||
});
|
||||
|
||||
test('luck is for games with cards, tiles, dice or hidden roles — not for board games', () => {
|
||||
for (const id of ['omok', 'chess', 'janggi', 'othello', 'baduk', 'quoridor', 'connect-four', 'mafia', 'dobble']) expect(luckApplies(id)).toBe(false);
|
||||
for (const id of Object.keys(BOT_STRATEGIES).filter((g) => !['omok', 'chess', 'janggi', 'othello', 'baduk', 'quoridor', 'connect-four'].includes(g))) {
|
||||
for (const id of ['omok', 'chess', 'janggi', 'othello', 'baduk', 'quoridor', 'connect-four', 'mafia', 'dobble', 'gemblo']) expect(luckApplies(id)).toBe(false);
|
||||
for (const id of Object.keys(BOT_STRATEGIES).filter((g) => !['omok', 'chess', 'janggi', 'othello', 'baduk', 'quoridor', 'connect-four', 'gemblo'].includes(g))) {
|
||||
expect(luckApplies(id)).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ import { BOT_STRATEGIES, decideBotAction } from './index';
|
||||
import type { BotLevel } from './persona';
|
||||
|
||||
/** Games where everything is in view from the start: a shuffle only decides who goes first, so luck stays out. */
|
||||
const NO_LUCK = new Set(['omok', 'othello', 'chess', 'janggi', 'baduk', 'quoridor', 'connect-four']);
|
||||
const NO_LUCK = new Set(['omok', 'othello', 'chess', 'janggi', 'baduk', 'quoridor', 'connect-four', 'gemblo']);
|
||||
|
||||
export const luckApplies = (gameId: string): boolean => gameId in BOT_STRATEGIES && !NO_LUCK.has(gameId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user