-
Notifications
You must be signed in to change notification settings - Fork 1
/
tools.lua
181 lines (155 loc) · 4.43 KB
/
tools.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
-- Licenses of media (3D Meshes and textures)
-- ---------------------------------------
-- Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
-- Copyright (C) 2019 - 2020 Steamed_Punk steamedpunk.mt at gmail.com
-- TOMAHAWK
minetest.register_tool("nativeamericanvillage:tomahawk", {
description = "Tomahawk",
inventory_image = "indianvillage_tomahawk.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=8},
},
sound = {breaks = "default_tool_breaks"},
})
-- TOMAHAWK_CRAFT
minetest.register_craft({
output = "nativeamericanvillage:tomahawk",
recipe = {
{'default:steel_ingot', 'default:steel_ingot', ''},
{'default:steel_ingot','default:stick', 'mobs:chicken_feather'},
{'', 'default:stick', ''},
}
})
-- TOMAHAWK_CRAFT_ITEM
minetest.register_craftitem(":nativeamericanvillage:tomahawk", {
description = ("Tomahawk"),
inventory_image = "indianvillage_tomahawk.png",
stack_max = 16,
})
-- TOMAHAWK_THROWING
local tomahawk_sneak = false
throwing.register_bow("nativeamericanvillage:tomahawk", {
itemcraft = "nativeamericanvillage:tomahawk",
description = "Tomahawk",
texture = "indianvillage_tomahawk.png",
wield_image = "indianvillage_tomahawk.png",
cooldown = 1,
delay = 0.4,
allow_shot = function(player, itemstack, index)
tomahawk_sneak = player:get_player_control().sneak
local ok = itemstack:get_name() ~= ""
if tomahawk_sneak == true then
return ok
else
return ok, ok and ItemStack(nil)
end
end,
throw_itself = true,
sound = "sling_throw",
spawn_arrow_entity = function(pos, arrow, player)
local obj = minetest.add_entity(pos, "nativeamericanvillage:tomahawk", tostring(tomahawk_sneak))
obj:set_properties{
textures = {arrow},
}
return obj
end
})
minetest.register_entity("nativeamericanvillage:tomahawk", throwing.make_arrow_def{
visual = "wielditem",
visual_size = {x=0.2, y=0.2},
collisionbox = {-0.2,-0.2,-0.2, 0.2,0.2,0.2},
target = throwing.target_node,
on_hit_sound = "",
on_throw_sound = "",
on_activate = function(self, staticdata)
self.sneak = staticdata == "true"
end,
on_hit = function(self, pos, last_pos, node, object, hitter, data)
if self.sneak then
data.itemstack:set_count(1)
end
minetest.spawn_item(
{
x = math.floor(last_pos.x+0.5),
y = math.floor(last_pos.y+0.5),
z = math.floor(last_pos.z+0.5)
},
data.itemstack
)
end,
on_throw = function(self, pos, thrower, itemstack, index, data)
data.itemstack = itemstack
end,
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=8},
},
sound = {breaks = "default_tool_breaks"},
})
-- KNIFE
minetest.register_tool("nativeamericanvillage:stone_knife", {
description = "Stone Knife",
inventory_image = "nativeamericanvillage_knife.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=8},
},
sound = {breaks = "default_tool_breaks"},
})
-- KNIFE_CRAFT
minetest.register_craft({
output = "nativeamericanvillage:stone_knife",
recipe = {
{'', '', ''},
{'','default:stone', ''},
{'', '', 'default:stick'},
}
})
-- KNIFE_CRAFT_ITEM
minetest.register_craftitem(":nativeamericanvillage:stone_knife", {
description = ("Stone Knife"),
inventory_image = "nativeamericanvillage_knife.png",
stack_max = 16,
})
-- SCRAPER
minetest.register_tool("nativeamericanvillage:scraper", {
description = "Scraper",
inventory_image = "nativeamericanvillage_scraper.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=8},
},
sound = {breaks = "default_tool_breaks"},
})
-- SCRAPER_CRAFT
minetest.register_craft({
output = "nativeamericanvillage:scraper",
recipe = {
{'', '', ''},
{'','nativeamericanvillage:horn', ''},
{'', 'nativeamericanvillage:bone', ''},
}
})
-- SCRAPER_CRAFT_ITEM
minetest.register_craftitem(":nativeamericanvillage:scraper", {
description = ("Scraper"),
inventory_image = "nativeamericanvillage_scraper.png",
stack_max = 16,
})