mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-25 01:04:35 +00:00
configurable preparation time
This commit is contained in:
+3
-1
@@ -629,7 +629,9 @@ class Client {
|
||||
incrementGamesPlayed();
|
||||
|
||||
try {
|
||||
window.PageOS.session.newPageView();
|
||||
if (window.PageOS && window.PageOS.session) {
|
||||
window.PageOS.session.newPageView();
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Error calling newPageView", e);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
import { TileRef } from "../game/GameMap";
|
||||
import { PlayerView } from "../game/GameView";
|
||||
import { UserSettings } from "../game/UserSettings";
|
||||
import { getPreparationTimeSeconds } from "../gamemodes/nuke-wars/guards";
|
||||
import { GameConfig, GameID, TeamCountConfig } from "../Schemas";
|
||||
import { NukeType } from "../StatsSchemas";
|
||||
import { assertNever, sigmoid, simpleHash, within } from "../Util";
|
||||
@@ -632,12 +633,13 @@ export class DefaultConfig implements Config {
|
||||
}
|
||||
|
||||
numPreparationPhaseTurns(): number {
|
||||
// Preparation phase duration (Nuke Wars uses a 3 minute prep phase)
|
||||
// Preparation phase duration for Nuke Wars is configurable via preparationTimeSeconds
|
||||
if (
|
||||
this._gameConfig.gameMode === GameMode.Team &&
|
||||
this._gameConfig.teamGameType === TeamGameType.NukeWars
|
||||
) {
|
||||
return 180 * 10; // 180 seconds * 10 ticks/sec
|
||||
const seconds = getPreparationTimeSeconds(this._gameConfig);
|
||||
return seconds * 10; // ticks are 100ms
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user