Option to disable alliances + 2 new modifiers for variety 😄 (#3392)

## Description:

Rex had this idea: "It would be funny to have an option in private
lobbies to disable alliances."
I added it as an option.
Now people can choose to live in constant fear of their neighbors 😆 

Also added two new public game modifiers for variety (only for the
special rotation):
- Alliances disabled (low probability)
- x2 gold multiplier (low probability)

Would be nice to squeeze this into v30, last minute?

## 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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
This commit is contained in:
FloPinguin
2026-03-10 05:13:13 +01:00
committed by GitHub
parent 08836e2a57
commit 3838de1d30
12 changed files with 102 additions and 12 deletions
+3
View File
@@ -217,6 +217,8 @@ export const GameConfigSchema = z.object({
isCrowded: z.boolean(),
isHardNations: z.boolean(),
startingGold: z.number().int().min(0).optional(),
goldMultiplier: z.number().min(0.1).max(1000).optional(),
isAlliancesDisabled: z.boolean(),
})
.optional(),
nations: z
@@ -230,6 +232,7 @@ export const GameConfigSchema = z.object({
infiniteTroops: z.boolean(),
instantBuild: z.boolean(),
disableNavMesh: z.boolean().optional(),
disableAlliances: z.boolean().optional(),
randomSpawn: z.boolean(),
maxPlayers: z.number().optional(),
maxTimerValue: z.number().int().min(1).max(120).optional(), // In minutes
+1
View File
@@ -74,6 +74,7 @@ export interface Config {
donateTroops(): boolean;
instantBuild(): boolean;
disableNavMesh(): boolean;
disableAlliances(): boolean;
isRandomSpawn(): boolean;
numSpawnPhaseTurns(): number;
userSettings(): UserSettings;
+3
View File
@@ -240,6 +240,9 @@ export class DefaultConfig implements Config {
disableNavMesh(): boolean {
return this._gameConfig.disableNavMesh ?? false;
}
disableAlliances(): boolean {
return this._gameConfig.disableAlliances ?? false;
}
isRandomSpawn(): boolean {
return this._gameConfig.randomSpawn;
}
+2
View File
@@ -243,6 +243,8 @@ export interface PublicGameModifiers {
isCrowded: boolean;
isHardNations: boolean;
startingGold?: number;
goldMultiplier?: number;
isAlliancesDisabled: boolean;
}
export interface UnitInfo {
+3
View File
@@ -477,6 +477,9 @@ export class PlayerImpl implements Player {
}
canSendAllianceRequest(other: Player): boolean {
if (this.mg.config().disableAlliances()) {
return false;
}
if (other === this) {
return false;
}