## Description:

- Add trios and quads
- Add translations for duos, trios, quads
- Add duos, trios, quads to the public lobby rotation
- Increase the frequency of team games


![image](https://github.com/user-attachments/assets/a7bac4e7-9db2-486d-87bc-5779dd64da08)

![image](https://github.com/user-attachments/assets/c1b9225e-2193-4776-b97f-be01a1bdeeed)

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors
This commit is contained in:
Scott Anderson
2025-07-06 20:09:18 -04:00
committed by GitHub
parent 6353a5d6f7
commit 3a8ff6304a
10 changed files with 106 additions and 45 deletions
+3 -4
View File
@@ -1,9 +1,8 @@
import { Colord } from "colord";
import { JWK } from "jose";
import { GameConfig, GameID } from "../Schemas";
import { GameConfig, GameID, TeamCountConfig } from "../Schemas";
import {
Difficulty,
Duos,
Game,
GameMapType,
GameMode,
@@ -32,7 +31,7 @@ export interface ServerConfig {
lobbyMaxPlayers(
map: GameMapType,
mode: GameMode,
numPlayerTeams: number | undefined,
numPlayerTeams: TeamCountConfig | undefined,
): number;
numWorkers(): number;
workerIndex(gameID: GameID): number;
@@ -87,7 +86,7 @@ export interface Config {
instantBuild(): boolean;
numSpawnPhaseTurns(): number;
userSettings(): UserSettings;
playerTeams(): number | typeof Duos;
playerTeams(): TeamCountConfig;
startManpower(playerInfo: PlayerInfo): number;
populationIncreaseRate(player: Player | PlayerView): number;
+4 -5
View File
@@ -2,7 +2,6 @@ import { JWK } from "jose";
import { z } from "zod/v4";
import {
Difficulty,
Duos,
Game,
GameMapType,
GameMode,
@@ -20,7 +19,7 @@ import {
import { TileRef } from "../game/GameMap";
import { PlayerView } from "../game/GameView";
import { UserSettings } from "../game/UserSettings";
import { GameConfig, GameID } from "../Schemas";
import { GameConfig, GameID, TeamCountConfig } from "../Schemas";
import { assertNever, simpleHash, within } from "../Util";
import { Config, GameEnv, NukeMagnitude, ServerConfig, Theme } from "./Config";
import { PastelTheme } from "./PastelTheme";
@@ -167,13 +166,13 @@ export abstract class DefaultServerConfig implements ServerConfig {
lobbyMaxPlayers(
map: GameMapType,
mode: GameMode,
numPlayerTeams: number | undefined,
numPlayerTeams: TeamCountConfig | undefined,
): number {
const [l, m, s] = numPlayersConfig[map] ?? [50, 30, 20];
const r = Math.random();
const base = r < 0.3 ? l : r < 0.6 ? m : s;
let p = Math.min(mode === GameMode.Team ? Math.ceil(base * 1.5) : base, l);
if (numPlayerTeams !== undefined) {
if (typeof numPlayerTeams === "number") {
p -= p % numPlayerTeams;
}
return p;
@@ -279,7 +278,7 @@ export class DefaultConfig implements Config {
defensePostDefenseBonus(): number {
return 5;
}
playerTeams(): number | typeof Duos {
playerTeams(): TeamCountConfig {
return this._gameConfig.playerTeams ?? 0;
}