From 8f5c25a5df17b11f71cda61ff3e847d252c81a9d Mon Sep 17 00:00:00 2001 From: Jamie-nyanchi <80130176+JamieNyanchi@users.noreply.github.com> Date: Sat, 11 Nov 2023 20:56:43 -0600 Subject: [PATCH] Dynamically get base turn duration When calculating the duration of trade routes, dynamically get the base turn duration instead of using a hardcoded value of 20 --- UI/TradeSupport.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UI/TradeSupport.lua b/UI/TradeSupport.lua index ad74573..b404b38 100644 --- a/UI/TradeSupport.lua +++ b/UI/TradeSupport.lua @@ -1121,7 +1121,8 @@ function GetTripsRequiredFromTradePathLength(tradePathLength:number) -- Previous formula that is semi correct -- local tripsToDestination = 1 + math.floor(iSpeedCostMultiplier/tradePathLength * 0.1); -- NOTE: Not 100% sure of this formula. Ran a few experiments and it seems to be this one - local iMinTurnsRequired = (math.floor(iSpeedCostMultiplier * 0.1) * 2.0) + 1 + local iTurnDurationBase = GameInfo.GlobalParameters["TRADE_ROUTE_TURN_DURATION_BASE"].Value; + local iMinTurnsRequired = (math.floor(iTurnDurationBase * (iSpeedCostMultiplier / 100.0))) + 1; -- Expansion 2 added a modifier called TradeRouteMinimumEndTurnChange that changes required turns based on Era if GameInfo.Eras_XP2 ~= nil then