-
Notifications
You must be signed in to change notification settings - Fork 1
/
data.lua
119 lines (93 loc) · 4.08 KB
/
data.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
--DATA
require("prototypes.technology")
require("prototypes.style")
--CODE
FLI = {}
FLI.modName = "FastLongInserters"
function FastLongInserter_addInserter(baseInserter,order)
local inserter = data.raw["inserter"][baseInserter]
if inserter == nil then
error("data.raw[\"inserter\"][".. baseInserter .."] not found", 2)
end
local baseItem = inserter.minable.result
FastLongInserter_addItem(baseItem,baseInserter,order)
FastLongInserter_addRecipe(baseItem,baseInserter)
FastLongInserter_addEntity(baseItem,baseInserter)
end
function FastLongInserter_addItem(base,baseName,order)
local obj = util.table.deepcopy(data.raw["item"][base])
local icon = "__".. FLI.modName .."__/graphics/icons/FLI_" .. baseName .. ".png"
obj.name = FLI.modName .. "_" .. baseName
obj.icon = icon
obj.icon_size = 32
obj.icon_mipmaps = 0
obj.place_result = obj.name
obj.order = order
data.raw[obj.type][obj.name] = obj
end
function FastLongInserter_addRecipe(base,baseName)
local obj = util.table.deepcopy(data.raw["recipe"][base])
obj.type = "recipe"
obj.name = FLI.modName .. "_" .. baseName
obj.enabled = false
obj.ingredients = nil
obj.ingredients = {}
obj.ingredients[1] = {type = "item", name = "iron-gear-wheel", amount = 1}
obj.ingredients[2] = {type = "item", name = "iron-plate", amount = 1}
obj.ingredients[3] = {type = "item", name = baseName, amount = 1}
obj.result = nil
obj.results = {}
obj.results[1] = {type = "item", name = obj.name, amount = 1}
obj.requester_paste_multiplier = 4
data.raw[obj.type][obj.name] = obj
end
function FastLongInserter_addEntity(base,baseName)
local obj = util.table.deepcopy(data.raw["inserter"][base])
obj.name = FLI.modName .. "_" .. baseName
obj.minable.result = obj.name
local baseGraphics = "__".. FLI.modName .."__/graphics/entity/"
local baseGraphicsInserter = baseGraphics .. baseName .. "/" .. baseName
obj.hand_base_picture.filename = baseGraphics .. "inserter-hand-base.png"
obj.hand_closed_picture.filename = baseGraphicsInserter .. "-hand-closed.png"
obj.hand_open_picture.filename = baseGraphicsInserter .. "-hand-open.png"
obj.platform_picture.sheet.filename = baseGraphics .. "inserter-platform.png"
obj.pickup_position = {0, -2}
obj.insert_position = {0, 2.2}
obj.extension_speed = 0.56
data.raw[obj.type][obj.name] = obj
end
function FastLongInserter_addItemG(base,baseName,GhostName)
local obj = util.table.deepcopy(data.raw["item"][base])
local icon = "__".. FLI.modName .."__/graphics/icons/FLI_" .. "Ghost" .. ".png"
obj.name = FLI.modName .. "_" .. GhostName
obj.icon = icon
obj.icon_size = 32
obj.icon_mipmaps = 0
obj.place_result = obj.name
obj.hidden = true
data.raw[obj.type][obj.name] = obj
end
function FastLongInserter_addEntityG(base,baseName,GhostName)
local obj = util.table.deepcopy(data.raw["inserter"][base])
obj.name = FLI.modName .. "_" .. GhostName
obj.minable = null
obj.next_upgrade = null
local baseGraphics = "__".. FLI.modName .."__/graphics/entity/Ghost/"
local baseGraphicsInserter = baseGraphics .. baseName .. "/" .. baseName
obj.hand_base_picture.filename = baseGraphics .. "inserter-hand-base.png"
obj.hand_base_picture.hr_version = null
obj.hand_closed_picture.filename = baseGraphics .. "Ghost-hand-closed.png"
obj.hand_closed_picture.hr_version = null
obj.hand_open_picture.filename = baseGraphics .. "Ghost-hand-open.png"
obj.hand_open_picture.hr_version = null
obj.platform_picture.sheet.filename = baseGraphics .. GhostName .. ".png"
obj.platform_picture.sheet.hr_version = null
data.raw[obj.type][obj.name] = obj
end
FastLongInserter_addEntityG(data.raw["inserter"]["inserter"].minable.result,"inserter","Ghost_I")
FastLongInserter_addEntityG(data.raw["inserter"]["inserter"].minable.result,"inserter","Ghost_O")
FastLongInserter_addItemG(data.raw["inserter"]["inserter"].minable.result,"inserter","Ghost_I")
FastLongInserter_addItemG(data.raw["inserter"]["inserter"].minable.result,"inserter","Ghost_O")
--stLongInserter_addInserter(GrundName,order)
FastLongInserter_addInserter("fast-inserter","dd[long-fast-inserter]")
FastLongInserter_addInserter("bulk-inserter","ff[long-bulk-inserter]")