From b620d23ff5018cd3ec76be6b8a4fba205ef45b29 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Sun, 7 Apr 2024 22:04:05 +0300 Subject: [PATCH] Remove city-state construction bonuses from difficulty --- core/src/com/unciv/models/ruleset/Building.kt | 3 +-- core/src/com/unciv/models/ruleset/unit/BaseUnitCost.kt | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index d6eb2e307f..7506069bda 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -121,7 +121,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction { if (civInfo.isCityState()) productionCost *= 1.5f - if (civInfo.isHuman()) { + else if (civInfo.isHuman()) { if (!isWonder) productionCost *= civInfo.getDifficulty().buildingCostModifier } else { @@ -259,7 +259,6 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction { if (unique.type != UniqueType.OnlyAvailable && unique.type != UniqueType.CanOnlyBeBuiltWhen && !unique.conditionalsApply(StateForConditionals(civ, cityConstructions.city))) continue - @Suppress("NON_EXHAUSTIVE_WHEN") when (unique.type) { // for buildings that are created as side effects of other things, and not directly built, // or for buildings that can only be bought diff --git a/core/src/com/unciv/models/ruleset/unit/BaseUnitCost.kt b/core/src/com/unciv/models/ruleset/unit/BaseUnitCost.kt index 4b3302665c..f7f4059751 100644 --- a/core/src/com/unciv/models/ruleset/unit/BaseUnitCost.kt +++ b/core/src/com/unciv/models/ruleset/unit/BaseUnitCost.kt @@ -22,12 +22,13 @@ class BaseUnitCost(val baseUnit: BaseUnit) { for (unique in baseUnit.getMatchingUniques(UniqueType.CostPercentageChange, stateForConditionals)) productionCost *= unique.params[0].toPercent() - if (civInfo.isCityState()) - productionCost *= 1.5f - productionCost *= if (civInfo.isHuman()) + productionCost *= if (civInfo.isCityState()) + 1.5f + else if (civInfo.isHuman()) civInfo.getDifficulty().unitCostModifier else civInfo.gameInfo.getDifficulty().aiUnitCostModifier + productionCost *= civInfo.gameInfo.speed.productionCostModifier return productionCost.toInt() }