-
Notifications
You must be signed in to change notification settings - Fork 1
/
items.lua
174 lines (169 loc) · 3.81 KB
/
items.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
-- This file contains all items, including ones that are core prototypes.
-- Core prototypes are named prototypes that the game requires to always exist, for example a "copper-cable" item.
local properties = require("common-properties")
-- These functions are applied directly to the prototype table.
-- This allows to easily create many prototypes that inherit from the same base class/prototype, without copy pasting properties.
local function add_item_properties(prototype)
prototype = properties.add_icon(prototype)
prototype.stack_size = 1
return prototype
end
local function add_selection_tool_properties(prototype)
prototype = add_item_properties(prototype)
prototype.selection_color = properties.color()
prototype.alt_selection_color = properties.color()
prototype.selection_mode = "nothing"
prototype.alt_selection_mode = "nothing"
prototype.selection_cursor_box_type = "entity"
prototype.alt_selection_cursor_box_type = "entity"
return prototype
end
-- item prototypes, one of each, alphabetical by type
data:extend({
add_item_properties
{
type = "ammo",
name = "dummy-ammo",
ammo_type =
{
category = "dummy-ammo-category"
}
},
add_item_properties
{
type = "armor",
name = "dummy-armor",
infinite = true
},
add_selection_tool_properties
{
type = "blueprint",
name = "dummy-blueprint"
},
add_item_properties
{
type = "blueprint-book",
name = "dummy-blueprint-book",
inventory_size = 1
},
add_item_properties
{
type = "capsule",
name = "dummy-capsule",
capsule_action =
{
type = "equipment-remote",
equipment = "dummy-active-defense-equipment"
}
},
add_selection_tool_properties
{
type = "copy-paste-tool",
name = "dummy-copy-paste-tool"
},
add_selection_tool_properties
{
type = "deconstruction-item",
name = "dummy-deconstruction-item"
},
add_item_properties
{
type = "gun",
name = "dummy-gun",
attack_parameters = properties.attack_parameters()
},
add_item_properties
{
type = "item",
name = "dummy-item"
},
add_item_properties
{
type = "item-with-entity-data",
name = "dummy-item-with-entity-data"
},
add_item_properties
{
type = "item-with-inventory",
name = "dummy-item-with-inventory",
inventory_size = 1
},
add_item_properties
{
type = "item-with-label",
name = "dummy-item-with-label"
},
add_item_properties
{
type = "item-with-tags",
name = "dummy-item-with-tags"
},
add_item_properties
{
type = "mining-tool",
name = "dummy-mining-tool", -- deprecated prototype
infinite = true
},
add_item_properties
{
type = "module",
name = "dummy-module",
tier = 1,
effect = {},
category = "dummy-module-category"
},
add_item_properties
{
type = "rail-planner",
name = "dummy-rail-planner",
straight_rail = "dummy-straight-rail",
curved_rail = "dummy-curved-rail"
},
add_item_properties
{
type = "repair-tool",
name = "dummy-repair-tool",
infinite = true,
speed = 1
},
add_selection_tool_properties
{
type = "selection-tool",
name = "dummy-selection-tool"
},
add_item_properties
{
type = "spidertron-remote",
name = "dummy-spidertron-remote",
icon_color_indicator_mask = properties.sprite_filename
},
add_item_properties
{
type = "tool",
name = "dummy-tool",
infinite = true
},
add_selection_tool_properties
{
type = "upgrade-item",
name = "dummy-upgrade-item"
}
})
-- core item prototypes that are not contained in the above data:extend
data:extend({
add_item_properties
{
type = "item",
name = "copper-cable"
},
add_item_properties
{
type = "item",
name = "red-wire"
},
add_item_properties
{
type = "item",
name = "green-wire"
}
})