From 426653eab5a161f19fba825a8bc69150cee9d503 Mon Sep 17 00:00:00 2001 From: 1brucben <1benjbruce@gmail.com> Date: Tue, 3 Jun 2025 19:51:44 +0200 Subject: [PATCH] Adjust hospital --- resources/lang/en.json | 2 +- src/core/configuration/DefaultConfig.ts | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/resources/lang/en.json b/resources/lang/en.json index 844decdb9..2f5099010 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -356,7 +356,7 @@ "port": "Sends trade ships to generate gold", "defense_post": "Increase defenses of nearby borders", "city": "Increase max population", - "hospital": "Boosts population growth by 5%" + "hospital": "Lowers troop casualties by 5%" }, "not_enough_money": "Not enough money" }, diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 06016d02c..b845c9d39 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -442,7 +442,7 @@ export class DefaultConfig implements Config { ? 0n : BigInt( Math.min( - 12_000_000, + 3_000_000, Math.pow( 2, p.unitsIncludingConstruction(UnitType.Hospital).length, @@ -569,6 +569,14 @@ export class DefaultConfig implements Config { const traitorDebuff = defender.isTraitor() ? this.traitorDefenseDebuff() : 1; + const attackerHospitalBonus = Math.pow( + 0.95, + attacker.units(UnitType.Hospital).length, + ); + const defenderHospitalBonus = Math.pow( + 0.95, + defender.units(UnitType.Hospital).length, + ); const baseTroopLoss = 10; const attackLossModifier = 1.3; const baseTileCost = 45; @@ -576,9 +584,10 @@ export class DefaultConfig implements Config { return { attackerTroopLoss: mag * + attackerHospitalBonus * (baseTroopLoss + attackLossModifier * defenderDensity * traitorDebuff), - defenderTroopLoss: defenderDensity, + defenderTroopLoss: defenderDensity * defenderHospitalBonus, tilesPerTickUsed: baseTileCost * within(defenderDensity, 3, 50) ** 0.2 * @@ -694,10 +703,6 @@ export class DefaultConfig implements Config { toAdd *= 0.7; } - if (player.units(UnitType.Hospital).length > 0) { - toAdd *= 1 + 0.05 * player.units(UnitType.Hospital).length; - // hospital boosts population growth - } if (player.type() === PlayerType.FakeHuman) { switch (this._gameConfig.difficulty) { case Difficulty.Easy: