forked from pyanodon/autotech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.lua
More file actions
139 lines (126 loc) · 5.72 KB
/
data.lua
File metadata and controls
139 lines (126 loc) · 5.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
require "dependency-graph-lib.data"
data:extend {{
type = "mod-data",
name = "autotech-config",
data = {
-- The formula for tech cost is as follows:
-- tech.cost = tech_cost_starting_cost + (tech_cost_victory_cost - tech_cost_starting_cost) * ((tech.depth / victory_tech.depth) ^ tech_cost_exponent)
-- Where `tech.depth` repersents the number of nodes from the root node to the current node.
tech_cost_starting_cost = 20,
tech_cost_victory_cost = 5000,
tech_cost_exponent = 3,
-- Should be >=10 & <100
tech_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},
-- List of technologies that have their final cost multiplied by X after all of autotech's changes
tech_cost_additional_multipliers = {},
-- if a technology has this science pack, it will require this much time per research cycle.
tech_cost_time_requirement = {
["automation-science-pack"] = 20,
["logistic-science-pack"] = 30,
["military-science-pack"] = 30,
["chemical-science-pack"] = 30,
["production-science-pack"] = 60,
["utility-science-pack"] = 60,
["space-science-pack"] = 60,
},
tech_cost_science_pack_tiers = {
["automation-science-pack"] = 1,
["logistic-science-pack"] = 2,
["military-science-pack"] = 2,
["chemical-science-pack"] = 3,
["production-science-pack"] = 4,
["utility-science-pack"] = 4,
["space-science-pack"] = 5,
},
tech_cost_science_packs_per_tier = {1},
victory_tech = "space-science-pack",
verbose_logging = settings.startup["autotech-verbose-logging"].value == true
}
}}
if mods["space-age"] then
local config = data.raw["mod-data"]["autotech-config"].data
config.tech_cost_time_requirement["automation-science-pack"] = 20
config.tech_cost_time_requirement["logistic-science-pack"] = 30
config.tech_cost_time_requirement["military-science-pack"] = 30
config.tech_cost_time_requirement["chemical-science-pack"] = 30
config.tech_cost_time_requirement["production-science-pack"] = 60
config.tech_cost_time_requirement["utility-science-pack"] = 60
config.tech_cost_time_requirement["space-science-pack"] = 60
config.tech_cost_time_requirement["metalurgic-science-pack"] = 60
config.tech_cost_time_requirement["electromagnetic-science-pack"] = 60
config.tech_cost_time_requirement["agricultural-science-pack"] = 60
config.tech_cost_time_requirement["cyrogenic-science-pack"] = 60
config.tech_cost_time_requirement["promethium-science-pack"] = 120
config.tech_cost_science_pack_tiers["automation-science-pack"] = 1
config.tech_cost_science_pack_tiers["logistic-science-pack"] = 2
config.tech_cost_science_pack_tiers["military-science-pack"] = 2
config.tech_cost_science_pack_tiers["chemical-science-pack"] = 3
config.tech_cost_science_pack_tiers["production-science-pack"] = 4
config.tech_cost_science_pack_tiers["utility-science-pack"] = 4
config.tech_cost_science_pack_tiers["space-science-pack"] = 5
config.tech_cost_science_pack_tiers["metalurgic-science-pack"] = 6
config.tech_cost_science_pack_tiers["electromagnetic-science-pack"] = 6
config.tech_cost_science_pack_tiers["agricultural-science-pack"] = 6
config.tech_cost_science_pack_tiers["cyrogenic-science-pack"] = 7
config.tech_cost_science_pack_tiers["promethium-science-pack"] = 8
config.tech_cost_science_packs_per_tier = {1}
config.tech_cost_starting_cost = 20
config.tech_cost_victory_cost = 2000
config.tech_cost_exponent = 3
config.victory_tech = "promethium-science-pack"
end
-- By default autotech assumes nauvis as the starting planet.
-- If your mod changes this, please set
-- data.raw.planet["nauvis"].autotech_always_available = false
local nauvis = data.raw.planet["nauvis"]
nauvis.autotech_always_available = true
--- The following code is copied from base/scenarios/freeplay/freeplay.lua
--- It is impossible to read starting items otherwise in data stage.
--- If your mod changes the starting items, set `item.autotech_always_available = false` in `data-updates.lua` or `data-final-fixes.lua`
local created_items = function()
return {
["iron-plate"] = 8,
["wood"] = 1,
["pistol"] = 1,
["firearm-magazine"] = 10,
["burner-mining-drill"] = 1,
["stone-furnace"] = 1
}
end
local respawn_items = function()
return {
["pistol"] = 1,
["firearm-magazine"] = 10
}
end
local ship_items = function()
return {
["firearm-magazine"] = 8
}
end
local debris_items = function()
return {
["iron-plate"] = 8
}
end
local function set_always_available_for_starting_items(items)
for item_name in pairs(items) do
for item_type in pairs(defines.prototypes.item) do
local item = (data.raw[item_type] or {})[item_name]
if item and item.autotech_always_available == nil then
item.autotech_always_available = true
break
end
end
end
end
if mods.pystellarexpedition then
local crash_site_items = require "__pystellarexpedition__.prototypes.crash-site-items"
crash_site_items = table.invert(table.map(crash_site_items, function(item) return item.name end))
set_always_available_for_starting_items(crash_site_items)
else
set_always_available_for_starting_items(created_items())
set_always_available_for_starting_items(respawn_items())
set_always_available_for_starting_items(ship_items())
set_always_available_for_starting_items(debris_items())
end