feedback7 G-SMALL: co-op rooms can make AI teammates draft last (PR #368 by @anAtheist987)

Applied the host-only room option 「AI 队友最后选择」, default off. Off, the draft order and the random streams stay as they are. On, humans draft before AI seats after the existing shuffle, and a skip stays ahead of the AI seats.

Dropped docs/history/0.2.2.md and every §27 citation. The player-facing sentence is in docs/PLAYING.md. The room-option rule is in docs/design/match.md, docs/design/client.md and docs/design/network.md. The #338 per-bot faction and ban presets are not included.

Tests: node --test test/lobby-ai-last.test.js test/match/ai-picks-last.test.js test/ui/ai-picks-last.test.js — 18 pass. node --test test/lobby.test.js test/client-static.test.js — 378 pass. node tools/i18n.mjs check --all --strict — 1032/1032 in en, ja, ko and zh-TW, 0 errors.
This commit is contained in:
anAtheist987 authored and sganggs committed 2026-10-08 19:57:26 +08:00
1 parent ae22335cfe
commit fd791a66cb
19 files changed
+527 -21

No files matched your search

+5
View File
@@ -12,6 +12,9 @@
// opts.mode 'solo' | 'coop'
// opts.difficulty 'FUNNY'|'NORMAL'|'HARD'|'ABYSS'
// opts.modeId string modeIdFor(mode, difficulty), e.g. 'mode_multi_hard'
// opts.aiPicksLast boolean (optional) the co-op room option 「AI 队友最后选择」 (room.setAiPicksLast, GitHub #338):
// the strategy and 机变 drafts put every human seat before every AI seat
// (MatchPhases.humansFirst); only `true` turns it on; ignored in solo
// opts.seats Array<{ seat: 0..3, playerId: string, name: string, isBot: boolean, connected: boolean,
// loadout?: { [baseChessId]: { skill: index, module: uniEquipId|'none'|null } } | null,
// notOwned?: string[] | null,
@@ -236,6 +239,8 @@ export class Match {
this.gd = new GameData(this.data, this.modeId);
if (!this.difficulty) this.difficulty = this.gd.difficulty;
this.isSolo = this.mode === 'solo' || this.gd.isSolo;
/** 「AI 队友最后选择」 (opts.aiPicksLast, GitHub #338): humans draft before AI seats (MatchPhases.humansFirst) */
this.aiPicksLast = !this.isSolo && opts.aiPicksLast === true;
this.ownsScheduler = !opts.scheduler;
this.sched = opts.scheduler || new RealScheduler({ now: opts.now || Date.now, onError: (e) => this.reportError('timer', e) });
this.registry = opts.registry || getDefaultRegistry();