forked from Noodlemire/projectile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrafts.lua
357 lines (317 loc) · 10.9 KB
/
crafts.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
--[[
Research N' Duplication
Copyright (C) 2020 Noodlemire
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
--]]
--Gun components
if not (pipeworks or waterworks) then
minetest.register_craftitem("projectile:steel_pipe", {
description = "Steel Pipe",
inventory_image = "projectile_steel_pipe.png"
})
end
--Basic slingshot ammo
if not hardtrees then
minetest.register_craftitem("projectile:rock", {
description = "Rock",
inventory_image = "projectile_rock.png"
})
end
--A basic arrow
minetest.register_craftitem("projectile:arrow", {
description = "Arrow",
inventory_image = "projectile_arrow.png",
})
--An arrow that burns flammable nodes that it touches
minetest.register_craftitem("projectile:arrow_fire", {
description = "Fire Arrow",
inventory_image = "projectile_arrow_fire.png",
})
--An arrow with exceptionally high velocity
minetest.register_craftitem("projectile:arrow_high_velocity", {
description = "High Velocity Arrow",
inventory_image = "projectile_arrow_high_velocity.png",
})
--An arrow that explodes on contact, rather than dealing direct damage.
minetest.register_craftitem("projectile:arrow_bomb", {
description = "Bomb Arrow",
inventory_image = "projectile_arrow_bomb.png",
})
--Basic flintlock ammo, small steel balls
minetest.register_craftitem("projectile:musket_ball", {
description = "Musket Ball",
inventory_image = "projectile_musket_ball.png",
})
--Easily shattered ammo with less direct damage than a musket ball, but much greater crowd control abilities.
minetest.register_craftitem("projectile:musket_ball_diamond", {
description = "Diamond Musket Ball",
inventory_image = "projectile_musket_ball_diamond.png",
})
--An upgrade to regular musket balls
minetest.register_craftitem("projectile:musket_ball_mithril", {
description = "Mithril Musket Ball",
inventory_image = "projectile_musket_ball_mithril.png",
})
--Standard shotgun ammo, a pile of 9 tiny balls
minetest.register_craftitem("projectile:shot_pile", {
description = "Shot Pile",
inventory_image = "projectile_shot_pile.png",
})
--Easily shattered ammo with less direct damage than shot, but each ball splits into 2 in the initial blast, causing a total of 18 pellets to be spewed.
minetest.register_craftitem("projectile:shot_pile_diamond", {
description = "Diamond Shot Pile",
inventory_image = "projectile_shot_pile_diamond.png",
})
--An upgrade to regular shot.
minetest.register_craftitem("projectile:shot_pile_mithril", {
description = "Mithril Shot Pile",
inventory_image = "projectile_shot_pile_mithril.png",
})
if hardtrees then
--Two cobblestone blocks can shapelessly be used to craft 18 rocks.
--Two are used since it's very possible that other mods use one rock to make other things.
minetest.register_craft({
type = "shapeless",
output = "hardtrees:rock 18",
recipe = {"default:cobble", "default:cobble"}
})
--If the player no longer needs rocks, 9 can be crafted back into a cobblestone block.
minetest.register_craft({
output = "default:cobble",
recipe = {
{"hardtrees:rock", "hardtrees:rock", "hardtrees:rock"},
{"hardtrees:rock", "hardtrees:rock", "hardtrees:rock"},
{"hardtrees:rock", "hardtrees:rock", "hardtrees:rock"}
}
})
else
--Two cobblestone blocks can shapelessly be used to craft 18 rocks.
--Two are used since it's very possible that other mods use one rock to make other things.
minetest.register_craft({
type = "shapeless",
output = "projectile:rock 18",
recipe = {"default:cobble", "default:cobble"}
})
--If the player no longer needs rocks, 9 can be crafted back into a cobblestone block.
minetest.register_craft({
output = "default:cobble",
recipe = {
{"projectile:rock", "projectile:rock", "projectile:rock"},
{"projectile:rock", "projectile:rock", "projectile:rock"},
{"projectile:rock", "projectile:rock", "projectile:rock"}
}
})
end
--Four sticks in a diagonal Y, with a string on top, makes a slingshot.
minetest.register_craft({
output = "projectile:slingshot",
recipe = {
{"", "group:stick", "farming:string"},
{"", "group:stick", "group:stick"},
{"group:stick", "", ""}
}
})
--Four steel bars in a diagonal Y, with a steel wire on top, makes a steel slingshot.
--Requires basic_materials
minetest.register_craft({
output = "projectile:steel_slingshot",
recipe = {
{"", "basic_materials:steel_bar", "basic_materials:steel_wire"},
{"", "basic_materials:steel_bar", "basic_materials:steel_bar"},
{"basic_materials:steel_bar", "", ""}
}
})
--Three sticks, to create the shape of the bow itself, and three strings in a diagonal line, makes a bow.
minetest.register_craft({
output = "projectile:bow",
recipe = {
{"group:stick", "group:stick", "farming:string"},
{"group:stick", "farming:string", ""},
{"farming:string", "", ""}
}
})
--Three steel bars, to create the shape of the bow itself, and three steel wires in a diagonal line, makes a bow.
--Requires basic_materials
minetest.register_craft({
output = "projectile:steel_bow",
recipe = {
{"basic_materials:steel_bar", "basic_materials:steel_bar", "basic_materials:steel_wire"},
{"basic_materials:steel_bar", "basic_materials:steel_wire", ""},
{"basic_materials:steel_wire", "", ""}
}
})
if pipeworks then
--Flintlocks are made from metal and steel, with a steel pipe for the barrel and a lever for the trigger.
minetest.register_craft({
output = "projectile:flintlock_pistol",
recipe = {
{"pipeworks:pipe_1_empty", ""},
{"basic_materials:steel_strip", "default:steel_ingot"},
{"group:stick", "default:flint"}
}
})
--Muskets add an extra pipe because they're long.
minetest.register_craft({
output = "projectile:musket",
recipe = {
{"pipeworks:pipe_1_empty", "", ""},
{"", "pipeworks:pipe_1_empty", "default:steel_ingot"},
{"basic_materials:steel_strip", "group:stick", "default:flint"}
}
})
end
if waterworks then
--Flintlocks are made from metal and steel, with a steel pipe for the barrel and a lever for the trigger.
minetest.register_craft({
output = "projectile:flintlock_pistol",
recipe = {
{"waterworks:pipe", ""},
{"basic_materials:steel_strip", "default:steel_ingot"},
{"group:stick", "default:flint"}
}
})
--Muskets add an extra pipe because they're long.
minetest.register_craft({
output = "projectile:musket",
recipe = {
{"waterworks:pipe", "", ""},
{"", "waterworks:pipe", "default:steel_ingot"},
{"basic_materials:steel_strip", "group:stick", "default:flint"}
}
})
end
if not (pipeworks or waterworks) then
--6 steel ingots in an = shape can make any kind of pipe.
minetest.register_craft({
output = "projectile:steel_pipe 12",
recipe = {
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"", "", ""},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
}
})
--Flintlocks are made from metal and steel, with a steel pipe for the barrel and a lever for the trigger.
minetest.register_craft({
output = "projectile:flintlock_pistol",
recipe = {
{"projectile:steel_pipe", ""},
{"basic_materials:steel_strip", "default:steel_ingot"},
{"group:stick", "default:flint"}
}
})
--Muskets add an extra pipe because they're long.
minetest.register_craft({
output = "projectile:musket",
recipe = {
{"projectile:steel_pipe", "", ""},
{"", "projectile:steel_pipe", "default:steel_ingot"},
{"basic_materials:steel_strip", "group:stick", "default:flint"}
}
})
end
--Blunderbusses are thucker, so a second steel ingot is used in place of a steel pipe.
minetest.register_craft({
output = "projectile:blunderbuss",
recipe = {
{"default:steel_ingot", ""},
{"basic_materials:steel_strip", "default:steel_ingot"},
{"group:stick", "default:flint"}
}
})
--Regular arrows are made from flint, a stick, and a feather.
--The feather can be provided by multiple mob mods.
--Arrows are also materials in the stronger ammo options for bows.
minetest.register_craft({
output = "projectile:arrow",
recipe = {
{"default:flint", "", ""},
{"", "group:stick", ""},
{"", "", "mobs:chicken_feather"}
}
})
minetest.register_craft({
output = "projectile:arrow",
recipe = {
{"default:flint", "", ""},
{"", "group:stick", ""},
{"", "", "animalmaterials:feather"}
}
})
minetest.register_craft({
output = "projectile:arrow",
recipe = {
{"default:flint", "", ""},
{"", "group:stick", ""},
{"", "", "creatures:feather"}
}
})
--Combining an arrow with a torch lights it on fire.
minetest.register_craft({
type = "shapeless",
output = "projectile:arrow_fire",
recipe = {"projectile:arrow", "default:torch"}
})
--Gold tools are often fast, so gold arrows focus on being fast.
--A gold ingot can turn four arrows gold.
minetest.register_craft({
type = "shapeless",
output = "projectile:arrow_high_velocity 4",
recipe = {"projectile:arrow", "projectile:arrow", "projectile:arrow", "projectile:arrow", "default:gold_ingot"}
})
--Stabbing an arrow into a TNT stick creates a bomb arrow.
minetest.register_craft({
type = "shapeless",
output = "projectile:arrow_bomb",
recipe = {"projectile:arrow", "tnt:tnt_stick"}
})
--Converting applicable materials to 12 musket balls requires putting 4 of those materials into a ball-esque shape.
minetest.register_craft({
output = "projectile:musket_ball 12",
recipe = {
{"", "default:steel_ingot", ""},
{"default:steel_ingot", "", "default:steel_ingot"},
{"", "default:steel_ingot", ""},
}
})
minetest.register_craft({
output = "projectile:musket_ball_diamond 12",
recipe = {
{"", "default:diamond", ""},
{"default:diamond", "", "default:diamond"},
{"", "default:diamond", ""},
}
})
minetest.register_craft({
output = "projectile:musket_ball_mithril 12",
recipe = {
{"", "moreores:mithril_ingot", ""},
{"moreores:mithril_ingot", "", "moreores:mithril_ingot"},
{"", "moreores:mithril_ingot", ""},
}
})
--3 of any musket ball can be split into 9 smaller balls, known as a shot pile.
minetest.register_craft({
type = "shapeless",
output = "projectile:shot_pile",
recipe = {"projectile:musket_ball", "projectile:musket_ball", "projectile:musket_ball"}
})
minetest.register_craft({
type = "shapeless",
output = "projectile:shot_pile_diamond",
recipe = {"projectile:musket_ball_diamond", "projectile:musket_ball_diamond", "projectile:musket_ball_diamond"}
})
minetest.register_craft({
type = "shapeless",
output = "projectile:shot_pile_mithril",
recipe = {"projectile:musket_ball_mithril", "projectile:musket_ball_mithril", "projectile:musket_ball_mithril"}
})