From 3a858a70514b49313c78913423d8811c0ebe9dbb Mon Sep 17 00:00:00 2001 From: SomeTroglodyte <63000004+SomeTroglodyte@users.noreply.github.com> Date: Sun, 26 Sep 2021 09:54:38 +0200 Subject: [PATCH] Oversight - "base hurry cost" in pedia should be multiple of 10 (#5320) --- core/src/com/unciv/models/ruleset/Building.kt | 2 +- core/src/com/unciv/models/ruleset/unit/BaseUnit.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index 43a560a713..175cd3cd0c 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -219,7 +219,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction { val stats = mutableListOf("$cost${Fonts.production}") if (canBePurchasedWithStat(null, Stat.Gold)) { // We need what INonPerpetualConstruction.getBaseGoldCost calculates but without any game- or civ-specific modifiers - val buyCost = 30.0 * cost.toFloat().pow(0.75f) * hurryCostModifier.toPercent() / 10 * 10 + val buyCost = (30.0 * cost.toFloat().pow(0.75f) * hurryCostModifier.toPercent()).toInt() / 10 * 10 stats += "$buyCost${Fonts.gold}" } textList += FormattedLine(stats.joinToString(", ", "{Cost}: ")) diff --git a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt index 83ff8d51ed..957ab01aa6 100644 --- a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt +++ b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt @@ -124,7 +124,7 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction { stats += "$cost${Fonts.production}" if (canBePurchasedWithStat(null, Stat.Gold)) { // We need what INonPerpetualConstruction.getBaseGoldCost calculates but without any game- or civ-specific modifiers - val buyCost = 30.0 * cost.toFloat().pow(0.75f) * hurryCostModifier.toPercent() / 10 * 10 + val buyCost = (30.0 * cost.toFloat().pow(0.75f) * hurryCostModifier.toPercent()).toInt() / 10 * 10 stats += "$buyCost${Fonts.gold}" } textList += FormattedLine(stats.joinToString(", ", "{Cost}: "))