diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 86dc34caf..521c28b25 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -351,14 +351,28 @@ export class DefaultConfig implements Config { } maxPopulation(player: Player | PlayerView): number { - let maxPop = Math.pow(player.numTilesOwned(), 0.6) * 1000 + 50000; + let maxPop = + 2 * (Math.pow(player.numTilesOwned(), 0.6) * 1000 + 50000) + + player.units(UnitType.City).length * this.cityPopulationIncrease(); + if (player.type() == PlayerType.Bot) { + return maxPop / 2; + } + + if (player.type() == PlayerType.Human) { return maxPop; } - return ( - maxPop * 2 + - player.units(UnitType.City).length * this.cityPopulationIncrease() - ); + + switch (this._gameConfig.difficulty) { + case Difficulty.Easy: + return maxPop * 0.5; + case Difficulty.Medium: + return maxPop * 0.7; + case Difficulty.Hard: + return maxPop * 1; + case Difficulty.Impossible: + return maxPop * 1.5; + } } populationIncreaseRate(player: Player): number { @@ -372,24 +386,6 @@ export class DefaultConfig implements Config { if (player.type() == PlayerType.Bot) { toAdd *= 0.7; } - let difficultyMultiplier = 1; - switch (this._gameConfig.difficulty) { - case Difficulty.Easy: - difficultyMultiplier = 0.3; - break; - case Difficulty.Medium: - difficultyMultiplier = 0.5; - break; - case Difficulty.Hard: - difficultyMultiplier = 1; - break; - case Difficulty.Impossible: - difficultyMultiplier = 1.2; - break; - } - if (player.type() == PlayerType.FakeHuman) { - toAdd *= difficultyMultiplier; - } return Math.min(player.population() + toAdd, max) - player.population(); } diff --git a/src/core/configuration/DevConfig.ts b/src/core/configuration/DevConfig.ts index 717a8c3ed..56d2bf27c 100644 --- a/src/core/configuration/DevConfig.ts +++ b/src/core/configuration/DevConfig.ts @@ -18,14 +18,14 @@ export class DevConfig extends DefaultConfig { } numSpawnPhaseTurns(): number { - return this.gameConfig().gameType == GameType.Singleplayer ? 20 : 100; + return this.gameConfig().gameType == GameType.Singleplayer ? 40 : 100; // return 100 } unitInfo(type: UnitType): UnitInfo { const info = super.unitInfo(type); const oldCost = info.cost; - info.cost = (p: Player) => oldCost(p) / 1000000000; + // info.cost = (p: Player) => oldCost(p) / 1000000000; return info; }