-
Notifications
You must be signed in to change notification settings - Fork 1
/
weapons.lua
99 lines (83 loc) · 2.21 KB
/
weapons.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
-- Registrations for slinghot mod
local S = core.get_translator(slingshot.modname)
local textures = {
rubber_band = "rubber_band",
wood = "wood",
iron = "iron",
}
if slingshot.old_textures then
for k, v in pairs(textures) do
textures[k] = v .. "-old"
end
end
local rubber_available = core.registered_items["technic:rubber"] ~= nil
local latex_available = core.registered_items["technic:raw_latex"] ~= nil
if rubber_available or latex_available then
core.register_craftitem("slingshot:rubber_band", {
description = S("Rubber Band"),
inventory_image = "slingshot_" .. textures.rubber_band .. ".png",
})
end
if rubber_available then
core.register_craft({
output = "slingshot:rubber_band 6",
type = "shapeless",
recipe = {"technic:rubber"},
})
end
if latex_available then
core.register_craft({
output = "slingshot:rubber_band 2",
recipe = {
{"technic:raw_latex", "technic:raw_latex", ""},
{"technic:raw_latex", "", "technic:raw_latex"},
{"", "technic:raw_latex", "technic:raw_latex"},
}
})
end
-- A wooden slingshot
slingshot.register("wood", {
description = S("Wooden Slingshot"),
image = "slingshot_" .. textures.wood .. ".png",
damage_groups = {fleshy=1},
velocity = 10,
wear_rate = 500,
})
for _, a in ipairs({slingshot.modname .. ":wooden", "wood_slingshot", "wooden_slingshot"}) do
core.register_alias(a, slingshot.modname .. ":wood")
end
local ing_1 = "group:stick"
local ing_2 = ""
if core.registered_items["slingshot:rubber_band"] then
ing_2 = "slingshot:rubber_band"
end
core.register_craft({
output = slingshot.modname .. ":wood",
recipe = {
{ing_1, ing_2, ing_1},
{"", ing_1, ""},
{"", ing_1, ""},
}
})
-- A stronger iron slingshot
slingshot.register("iron", {
description = S("Iron Slingshot"),
image = "slingshot_" .. textures.iron .. ".png",
damage_groups = {fleshy=3},
velocity = 15,
wear_rate = 250,
})
for _, a in ipairs({slingshot.modname .. ":slingshot", "iron_slingshot"}) do
core.register_alias(a, slingshot.modname .. ":iron")
end
if core.registered_items["default:steel_ingot"] then
ing_1 = "default:steel_ingot"
core.register_craft({
output = slingshot.modname .. ":iron",
recipe = {
{ing_1, ing_2, ing_1},
{"", ing_1, ""},
{"", ing_1, ""},
}
})
end