-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathitems.lua
More file actions
217 lines (193 loc) · 6.12 KB
/
items.lua
File metadata and controls
217 lines (193 loc) · 6.12 KB
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
-- Burnt Pizza
jpizza.register_pizza("jelys_pizzaria:burnt_pizza", {
description = "Burnt Pizza",
texture = {"jelys_pizzaria_burnt_pizza.png", "jelys_pizzaria_burnt_pizza.png"},
on_punch = function(pos, oldnode, digger)
local down = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
local itemstack = digger:get_wielded_item()
local downdef = minetest.registered_nodes[down.name]
if itemstack:get_name() == "jelys_pizzaria:pizza_cutter" and downdef.groups.pizza_oven == nil then
jpizza.spawn_slices(pos, "jelys_pizzaria:burnt_pizza_slice")
minetest.remove_node(pos)
end
end,
on_destruct = function(pos)
local down = {x=pos.x, y=pos.y-1,z=pos.z}
if minetest.get_node(down).name == "jelys_pizzaria:pizza_oven" then
minetest.get_meta(down):set_string("infotext", "Empty Pizza Oven")
end
end,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_craftitem("jelys_pizzaria:burnt_pizza_slice", {
description = "Burned Pizza Slice",
inventory_image = "jelys_pizzaria_burnt_pizza_slice.png",
stack_max = 12,
on_use = function(itemstack, player, pointed_thing)
minetest.chat_send_player(player:get_player_name(), "Blecht")
return minetest.do_item_eat(-2, "", itemstack, player, pointed_thing)
end
})
--Tools
minetest.register_node("jelys_pizzaria:rolling_pin", {
description = "Rolling Pin",
inventory_image = "jelys_pizzaria_rolling_pin_inv.png",
tiles={"default_wood.png"},
drawtype = "nodebox",
groups={oddly_breakable_by_hand=3},--just in case somebody places it
visual_size = 2,
tool_capabilities = {
full_punch_interval = 2.0,
max_drop_level=0,
groupcaps={
rolling_pin = {times={[2]=3.00, [3]=5.60}, uses=1, maxlevel=1},
},
damage_groups = {}
},
stack_max=1,
node_box = {
type = "fixed",
fixed = {
{-0.125, -0.125, -0.5, 0.125, 0.125, 0.5},
{-0.0625, -0.0625, -0.6875, 0.0625, 0.0625, 0.6875},
}
},
sound = {breaks = "default_tool_breaks"},
on_place = function() return end,
node_placement_prediction = "",
})
minetest.register_tool("jelys_pizzaria:pizza_cutter", {
description = "Pizza Cutter",
inventory_image = "jelys_pizzaria_pizza_cutter.png",
wield_image = "jelys_pizzaria_pizza_cutter.png^[transformFX",
sound = {breaks = "default_tool_breaks"}
})
--Hunger support
if jpizza.has_depends.hunger_ng then
hunger_ng.add_hunger_data("jelys_pizzaria:burnt_pizza_slice", {satiates = -3, heals = -2})
hunger_ng.add_hunger_data("jelys_pizzaria:cheese_pizza_slice", {satiates = 1})
end
if jpizza.has_depends.hbhunger and minetest.global_exists("hbhunger") then
hbhunger.register_food("jelys_pizzaria:burnt_pizza_slice", 0, "", 2)
hbhunger.register_food("jelys_pizzaria:cheese_pizza_slice", 1)
end
--Craft recipes
minetest.register_craft({
output = "jelys_pizzaria:rolling_pin",
recipe = {
{"", "", "group:stick"},
{"", "group:wood",""},
{"group:stick", "",""},
}
})
minetest.register_craft({
output = "jelys_pizzaria:pizza_cutter",
recipe = {
{"","default:steel_ingot", "default:steel_ingot"},
{"","group:stick", "default:steel_ingot"},
{"group:stick", "", ""}
},
})
minetest.register_craft({
output = "jelys_pizzaria:pizza_box_closed",
recipe = {
{"dye:green", "dye:white","dye:red"},
{"default:paper", "default:paper","default:paper"},
}
})
minetest.register_craft({
type = "shapeless",
output = "jelys_pizzaria:dough 2",
recipe = {"farming:flour", "bucket:bucket_water"},
replacements = {
{"bucket:bucket_water", "bucket:bucket_empty"}
}
})
minetest.register_craft({
type = "shapeless",
output = "jelys_pizzaria:dough 2",
recipe = {"farming:flour", "bucket:bucket_river_water"},
replacements = {
{"bucket:bucket_river_water", "bucket:bucket_empty"}
}
})
--Easter Eggs
minetest.register_craftitem("jelys_pizzaria:hainac_slice", {
description = "Slice of \"Heart attack in a circle\" pizza",
inventory_image = "jelys_pizzaria_hainac_slice.png",
groups = {food = 1},
on_use = function(itemstack, player, pointed_thing)
minetest.after(1, function(itemstack, player, pointed_thing)
if player:get_hp() > 0 then
minetest.do_item_eat(20, "", itemstack, player, pointed_thing)
end
end, itemstack, player, pointed_thing)
return minetest.do_item_eat(-10, "", itemstack, player, pointed_thing)
end
})
jpizza.register_pizza("jelys_pizzaria:hainac_pizza", {
description = "Whole \"Heart attack in a circle\" Pizza",
texture = {"jelys_pizzaria_pizza_hainac.png", "jelys_pizzaria_cooked_dough.png"},
done = 1,
on_punch = function(pos, oldnode, digger)
local down = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
local itemstack = digger:get_wielded_item()
local downdef = minetest.registered_nodes[down.name]
if itemstack:get_name() == "jelys_pizzaria:pizza_cutter" and downdef.groups.pizza_oven == nil then
jpizza.spawn_slices(pos, "jelys_pizzaria:hainac_slice")
minetest.remove_node(pos)
end
end,
})
local h = "jelys_pizzaria:hainac_slice"
minetest.register_craft({
type = "shapeless",
output = "jelys_pizzaria:hainac_pizza",
recipe = {h,h,h,h,h,h},
})
if jpizza.has_depends.dungeon_loot and minetest.settings:get_bool("jelys_pizzaria.enable_dungeon_loot") then
--Cheese
dungeon_loot.register({
name = "jelys_pizzaria:cheese",
chance = 0.1,
count = {1, 2},
y = {-32768, 0},
})
dungeon_loot.register({
name = "jelys_pizzaria:cheese",
chance = 0.2,
count = {3, 7},
y = {-32768, -500},
})
dungeon_loot.register({
name = "jelys_pizzaria:cheese",
chance = 0.2,
count = {3, 7},
y = {-431, -431},
})
--Heart attack in a circle
dungeon_loot.register({
name = "jelys_pizzaria:hainac_slice",
chance = 0.01,
count = {1,2},
y = {-608, -400},
})
dungeon_loot.register({
name = "jelys_pizzaria:hainac_slice",
chance = 0.06,
count = {1,2},
y = {-850, -800},
})
dungeon_loot.register({
name = "jelys_pizzaria:hainac_slice",
chance = 0.85,
count = {8, 10},
y = {-431, -431},
})
--Pizza Oven
dungeon_loot.register({
name = "jelys_pizzaria:pizza_oven",
chance = 0.006,
y = {-32768, -500},
})
end