fix the embedded url times

This commit is contained in:
Ryan Barlow
2026-01-25 19:51:11 +00:00
parent de3794313d
commit 1a9ccc6415
3 changed files with 30 additions and 3 deletions
+2 -2
View File
@@ -4,7 +4,6 @@ import {
Difficulty,
Game,
GameMode,
GameType,
Gold,
Player,
PlayerInfo,
@@ -25,6 +24,7 @@ import { Config, GameEnv, NukeMagnitude, ServerConfig, Theme } from "./Config";
import { Env } from "./Env";
import { PastelTheme } from "./PastelTheme";
import { PastelThemeDark } from "./PastelThemeDark";
import { spawnPhaseTurns } from "./Timing";
const DEFENSE_DEBUFF_MIDPOINT = 150_000;
const DEFENSE_DEBUFF_DECAY_RATE = Math.LN2 / 50000;
@@ -542,7 +542,7 @@ export class DefaultConfig implements Config {
return 3;
}
numSpawnPhaseTurns(): number {
return this._gameConfig.gameType === GameType.Singleplayer ? 100 : 300;
return spawnPhaseTurns(this._gameConfig.gameType);
}
numBots(): number {
return this.bots();
+19
View File
@@ -0,0 +1,19 @@
import { GameType } from "../game/Game";
export const TICKS_PER_SECOND = 10;
export const SPAWN_PHASE_TICKS = {
singleplayer: 100,
multiplayer: 300,
} as const;
export type GameTypeLike = GameType | string | undefined;
export function spawnPhaseTurns(gameType: GameTypeLike): number {
return gameType === GameType.Singleplayer
? SPAWN_PHASE_TICKS.singleplayer
: SPAWN_PHASE_TICKS.multiplayer;
}
export function spawnPhaseSeconds(gameType: GameTypeLike): number {
return spawnPhaseTurns(gameType) / TICKS_PER_SECOND;
}