From e2f20110240bc5089a33c2f7da07d7975c7d5d19 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sat, 25 Mar 2023 22:11:08 +0300 Subject: [PATCH] Gold per turn is worth less the more turns 'in the future' we're talking about --- core/src/com/unciv/logic/trade/TradeEvaluation.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/trade/TradeEvaluation.kt b/core/src/com/unciv/logic/trade/TradeEvaluation.kt index b959e6323d..737ebafc19 100644 --- a/core/src/com/unciv/logic/trade/TradeEvaluation.kt +++ b/core/src/com/unciv/logic/trade/TradeEvaluation.kt @@ -13,6 +13,7 @@ import com.unciv.models.ruleset.unique.UniqueType import com.unciv.ui.components.extensions.toPercent import com.unciv.ui.screens.victoryscreen.RankingType import kotlin.math.min +import kotlin.math.pow import kotlin.math.sqrt class TradeEvaluation { @@ -80,7 +81,8 @@ class TradeEvaluation { fun evaluateBuyCost(offer: TradeOffer, civInfo: Civilization, tradePartner: Civilization): Int { when (offer.type) { TradeType.Gold -> return offer.amount - TradeType.Gold_Per_Turn -> return offer.amount * offer.duration + // GPT loses 1% of value for each 'future' turn, meaning: gold now is more valuable than gold in the future + TradeType.Gold_Per_Turn -> return (1..offer.duration).sumOf { (offer.amount * 0.99f.pow(offer.duration)).toInt() } TradeType.Treaty -> { return when (offer.name) { // Since it will be evaluated twice, once when they evaluate our offer and once when they evaluate theirs