Oversight - "base hurry cost" in pedia should be multiple of 10 (#5320)

This commit is contained in:
SomeTroglodyte
2021-09-26 09:54:38 +02:00
committed by GitHub
parent 8d33dacc3c
commit 3a858a7051
2 changed files with 2 additions and 2 deletions

View File

@ -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}: "))

View File

@ -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}: "))