-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtechnology_robots.lua
94 lines (82 loc) · 2.87 KB
/
technology_robots.lua
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
-- https://github.com/wube/factorio-data/blob/master/core/lualib/util.lua
require("utility")
base_count = {
["worker-robots-speed-2"] = 100,
["worker-robots-speed-4"] = 250,
["worker-robots-speed-6"] = 1000,
["worker-robots-storage-1"] = 200,
["worker-robots-storage-2"] = 300,
["worker-robots-storage-3"] = 450,
}
-- Fast/Heavy construction robot MK1-3 --
for _, sub in ipairs({ "fast", "heavy" }) do
for i = 1, 3 do
name = utility.get_tiered_robot_research_name("construction", sub, i)
prev = utility.get_tiered_robot_research_name("construction", sub, i - 1)
tech = table.deepcopy(data.raw["technology"]["construction-robotics"])
if sub == "fast" then
tech_direct = string.format("worker-robots-speed-%d", i * 2)
tech_cross = string.format("worker-robots-storage-%d", i - 1)
cost = 4
tech.icons = util.technology_icon_constant_movement_speed(tech.icon)
else
tech_direct = string.format("worker-robots-storage-%d", i)
tech_cross = string.format("worker-robots-speed-%d", (i - 1) * 2)
cost = 4
tech.icons = util.technology_icon_constant_capacity(tech.icon)
end
tech.name = name
tech.prerequisites = {
prev,
tech_direct,
}
if i == 1 then
table.insert(tech.prerequisites, "low-density-structure")
elseif i >= 2 then
table.insert(tech.prerequisites, tech_cross)
end
tech.effects = { { recipe = name, type = "unlock-recipe" } }
tech.unit = {
count = base_count[tech_direct] * cost,
ingredients = table.deepcopy(data.raw["technology"][tech_direct].unit.ingredients),
time = data.raw["technology"][tech_direct].unit.time,
}
data:extend({ tech })
end
end
-- Fast/Heavy logistic robot MK1-3 --
for _, sub in ipairs({ "fast", "heavy" }) do
for i = 1, 3 do
name = utility.get_tiered_robot_research_name("logistic", sub, i)
prev = utility.get_tiered_robot_research_name("logistic", sub, i - 1)
tech = table.deepcopy(data.raw["technology"]["logistic-robotics"])
if sub == "fast" then
tech_direct = string.format("worker-robots-speed-%d", i * 2)
tech_cross = string.format("worker-robots-storage-%d", i - 1)
cost = 4
tech.icons = util.technology_icon_constant_movement_speed(tech.icon)
else
tech_direct = string.format("worker-robots-storage-%d", i)
tech_cross = string.format("worker-robots-speed-%d", (i - 1) * 2)
cost = 4
tech.icons = util.technology_icon_constant_capacity(tech.icon)
end
tech.name = name
tech.prerequisites = {
prev,
tech_direct,
}
if i == 1 then
table.insert(tech.prerequisites, "low-density-structure")
elseif i >= 2 then
table.insert(tech.prerequisites, tech_cross)
end
tech.effects = { { recipe = name, type = "unlock-recipe" } }
tech.unit = {
count = base_count[tech_direct] * cost,
ingredients = table.deepcopy(data.raw["technology"][tech_direct].unit.ingredients),
time = data.raw["technology"][tech_direct].unit.time,
}
data:extend({ tech })
end
end