This commit is contained in:
1brucben
2025-05-08 01:58:22 +02:00
parent c3ea0811eb
commit bb20da6764
4 changed files with 10 additions and 5 deletions
+5 -5
View File
@@ -616,10 +616,7 @@ export class DefaultConfig implements Config {
let toAdd =
10 +
(1400 / max + 1 / 125) * (0.8 * player.troops() + 1.2 * player.workers());
const adjustedPop =
typeof player.adjustedPopulation === "function"
? player.adjustedPopulation()
: player.population();
const adjustedPop = player.adjustedPopulation();
const ratio = 1 - adjustedPop / max;
toAdd *= ratio;
@@ -645,7 +642,10 @@ export class DefaultConfig implements Config {
}
}
return Math.min(player.population() + toAdd, max) - player.population();
return (
Math.min(player.adjustedPopulation() + toAdd, max) -
player.adjustedPopulation()
);
}
goldAdditionRate(player: Player): number {
+1
View File
@@ -99,6 +99,7 @@ export interface PlayerUpdate {
tilesOwned: number;
gold: number;
population: number;
adjustedPopulation: number;
workers: number;
troops: number;
targetTroopRatio: number;
+3
View File
@@ -225,6 +225,9 @@ export class PlayerView {
population(): number {
return this.data.population;
}
adjustedPopulation(): number {
return this.data.adjustedPopulation;
}
workers(): number {
return this.data.workers;
}
+1
View File
@@ -137,6 +137,7 @@ export class PlayerImpl implements Player {
tilesOwned: this.numTilesOwned(),
gold: Number(this._gold),
population: this.population(),
adjustedPopulation: this.adjustedPopulation(),
workers: this.workers(),
troops: this.troops(),
targetTroopRatio: this.targetTroopRatio(),