Skip to content

Commit

Permalink
T.U.R.D. tech costs are now determined by their science packs unlocks…
Browse files Browse the repository at this point in the history
… only.
  • Loading branch information
Septiple committed Jan 11, 2024
1 parent 2a5dfc2 commit 094f907
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.2.17
Date: ?
Changes:
- T.U.R.D. tech costs are now determined by their science packs unlocks only.
---------------------------------------------------------------------------------------------------
Version: 0.2.16
Date: 2024-1-8
Changes:
Expand Down
33 changes: 12 additions & 21 deletions prototypes/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,18 @@ local config = {
TC_WIN_TECH_COST_OVERRIDE = mods.pystellarexpedition and 5000 or 3000,
TC_EXP_THRESHOLD = 0.001,
TC_COST_ROUNDING_TARGETS = {10, 11, 12, 13, 14, 15, 16, 17.5, 20, 22.5, 25, 27.5, 30, 33, 36, 40, 45, 50, 55, 60, 65, 70, 75, 80, 90}, -- Should be >=10 & <100
TC_TURD_MULTIPLIER = function(tech)
local multiplier = 10
local multipliers = {
['automation-science-pack'] = 10,
['py-science-pack-1'] = 9,
['logistic-science-pack'] = 8,
['military-science-pack'] = 7,
['py-science-pack-2'] = 7,
['chemical-science-pack'] = 6,
['py-science-pack-3'] = 5,
['production-science-pack'] = 4,
['py-science-pack-4'] = 3,
['utility-science-pack'] = 2,
['space-science-pack'] = 1,
}
for _, pack in pairs(tech.unit.ingredients) do
pack = pack.name
multiplier = math.min(multiplier, multipliers[pack] or 10)
end
return multiplier
end,
TC_TURD_COST = {
500, -- automation-science-pack
2000, -- py-science-pack-1
5000, -- logistic-science-pack
10000, -- py-science-pack-2
10000, -- chemical-science-pack
5000, -- py-science-pack-3
5000, -- production-science-pack
3000, -- py-science-pack-4
2000, -- utility-science-pack
1000, -- space-science-pack
},
TC_SCIENCE_PACK_COUNTS_PER_LEVEL = {},
TC_TECH_INGREDIENTS_PER_LEVEL = {},
TC_MIL_SCIENCE_IS_PROGRESSION_PACK = not not mods["pystellarexpedition"],
Expand Down
2 changes: 1 addition & 1 deletion prototypes/functions/auto_tech.lua
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ function auto_tech:run()
if tech and not tech.unit.count_formula and tech.name ~= config.WIN_GAME_TECH then
local count = self.cost_rounding(config.TC_STARTING_TECH_COST * math.max(1, math.pow(factor, tech_ts.level[node.key] - 2) * math.pow(spf, tech_highest_sp[node.name] - 1)))
local turd_adjusted_count = count
if tech.is_turd then turd_adjusted_count = count * config.TC_TURD_MULTIPLIER(tech) end
if tech.is_turd then turd_adjusted_count = config.TC_TURD_COST[tech_highest_sp[node.name]] end

set_tech_property(tech, {unit = {count = turd_adjusted_count}})
tech.unit.count = turd_adjusted_count
Expand Down

0 comments on commit 094f907

Please sign in to comment.