라이어 게임: 설명·토론·투표·정답 맞히기 시간 무제한(할 일을 마칠 때까지, 연결 끊긴 사람은 유예 뒤 넘김), 설명·투표·지목 소리, 움직임
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -130,6 +130,15 @@ function matchAll(m: TopicModel, text: string): Map<string, number> {
|
||||
|
||||
// ---------------------------------------------------------------- the bot
|
||||
|
||||
/** How a computer paces a 무제한 phase: like the default clock of that phase. */
|
||||
const UNLIMITED_PACE_MS: Record<Exclude<LiarView['phase']['kind'], 'ended'>, number> = {
|
||||
reveal: 10_000,
|
||||
describe: 30_000,
|
||||
discussion: 90_000,
|
||||
vote: 30_000,
|
||||
guess: 30_000,
|
||||
};
|
||||
|
||||
class LiarBot {
|
||||
readonly v: LiarView;
|
||||
readonly me: PlayerId;
|
||||
@@ -197,8 +206,11 @@ class LiarBot {
|
||||
return this.v.phase.startedAt;
|
||||
}
|
||||
|
||||
/** Phase length; 무제한 phases are paced like the default clock (so a computer neither rushes nor stalls). */
|
||||
private get phaseLen(): number {
|
||||
return Math.max(1000, (this.v.phase.endsAt ?? this.phaseStart) - this.phaseStart);
|
||||
const ph = this.v.phase;
|
||||
if (ph.endsAt === null && ph.kind !== 'ended') return UNLIMITED_PACE_MS[ph.kind];
|
||||
return Math.max(1000, (ph.endsAt ?? this.phaseStart) - this.phaseStart);
|
||||
}
|
||||
|
||||
/** `lo..hi` seconds into the phase (scaled by pace), never later than `cap` of it. */
|
||||
|
||||
Reference in New Issue
Block a user