Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically get base turn duration for trade routes #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion UI/TradeSupport.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down