forked from Echoes91/ethereal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
food.lua
199 lines (183 loc) · 5.37 KB
/
food.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
local S = ethereal.intllib
-- Banana (Heals one heart when eaten)
minetest.register_node("ethereal:banana", {
description = S("Banana"),
drawtype = "torchlike",
visual_scale = 1.0,
tiles = {"banana_single.png"},
inventory_image = "banana_single.png",
wield_image = "banana_single.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
},
groups = {
fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 1, leafdecay_drop = 1
},
drop = "ethereal:banana",
on_use = minetest.item_eat(2),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
if placer:is_player() then
minetest.set_node(pos, {name = "ethereal:banana", param2 = 1})
end
end,
})
-- Banana Dough
minetest.register_craftitem("ethereal:banana_dough", {
description = S("Banana Dough"),
inventory_image = "banana_dough.png",
})
minetest.register_craft({
type = "shapeless",
output = "ethereal:banana_dough",
recipe = {"farming:flour", "ethereal:banana"}
})
minetest.register_craft({
type = "cooking",
cooktime = 14,
output = "ethereal:banana_bread",
recipe = "ethereal:banana_dough"
})
-- Orange (Heals 2 hearts when eaten)
minetest.register_node("ethereal:orange", {
description = S("Orange"),
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"farming_orange.png"},
inventory_image = "farming_orange.png",
wield_image = "farming_orange.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.3, -0.2, 0.2, 0.2, 0.2}
},
groups = {
fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 3, leafdecay_drop = 1
},
drop = "ethereal:orange",
on_use = minetest.item_eat(4),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
if placer:is_player() then
minetest.set_node(pos, {name = "ethereal:orange", param2 = 1})
end
end,
})
-- Pine Nuts (Heals 1/2 heart when eaten)
minetest.register_craftitem("ethereal:pine_nuts", {
description = S("Pine Nuts"),
inventory_image = "pine_nuts.png",
wield_image = "pine_nuts.png",
on_use = minetest.item_eat(1),
})
-- Banana Loaf (Heals 3 hearts when eaten)
minetest.register_craftitem("ethereal:banana_bread", {
description = S("Banana Loaf"),
inventory_image = "banana_bread.png",
wield_image = "banana_bread.png",
on_use = minetest.item_eat(6),
})
-- Coconut (Gives 4 coconut slices, each heal 1/2 heart)
minetest.register_node("ethereal:coconut", {
description = S("Coconut"),
drawtype = "plantlike",
walkable = false,
paramtype = "light",
sunlight_propagates = true,
tiles = {"moretrees_coconut.png"},
inventory_image = "moretrees_coconut.png",
wield_image = "moretrees_coconut.png",
selection_box = {
type = "fixed",
fixed = {-0.35, -0.35, -0.35, 0.35, 0.35, 0.35}
},
groups = {
snappy = 1, oddly_breakable_by_hand = 1, cracky = 1,
choppy = 1, flammable = 1, leafdecay = 3, leafdecay_drop = 1
},
drop = "ethereal:coconut_slice 4",
sounds = default.node_sound_wood_defaults(),
})
-- Coconut Slice (Heals half heart when eaten)
minetest.register_craftitem("ethereal:coconut_slice", {
description = S("Coconut Slice"),
inventory_image = "moretrees_coconut_slice.png",
wield_image = "moretrees_coconut_slice.png",
on_use = minetest.item_eat(1),
})
-- Golden Apple (Found on Healing Tree, heals all 10 hearts)
minetest.register_node("ethereal:golden_apple", {
description = S("Golden Apple"),
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_apple_gold.png"},
inventory_image = "default_apple_gold.png",
wield_image = "default_apple_gold.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.3, -0.2, 0.2, 0.2, 0.2}
},
groups = {
fleshy = 3, dig_immediate = 3,
leafdecay = 3,leafdecay_drop = 1
},
drop = "ethereal:golden_apple",
on_use = minetest.item_eat(20),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer, itemstack)
if placer:is_player() then
minetest.set_node(pos, {name = "ethereal:golden_apple", param2 = 1})
end
end,
})
-- Hearty Stew (Heals 5 hearts - thanks to ZonerDarkRevention for his DokuCraft DeviantArt bowl texture)
minetest.register_craftitem("ethereal:hearty_stew", {
description = S("Hearty Stew"),
inventory_image = "hearty_stew.png",
wield_image = "hearty_stew.png",
on_use = minetest.item_eat(10, "ethereal:bowl"),
})
minetest.register_craft({
output = "ethereal:hearty_stew",
recipe = {
{"ethereal:wild_onion_plant","ethereal:mushroom_plant", "ethereal:fern_tubers"},
{"","ethereal:mushroom_plant", ""},
{"","ethereal:bowl", ""},
}
})
-- Extra recipe for hearty stew
if farming and farming.mod and farming.mod == "redo" then
minetest.register_craft({
output = "ethereal:hearty_stew",
recipe = {
{"ethereal:wild_onion_plant","ethereal:mushroom_plant", "farming:beans"},
{"","ethereal:mushroom_plant", ""},
{"","ethereal:bowl", ""},
}
})
end
-- Bucket of Cactus Pulp
minetest.register_craftitem("ethereal:bucket_cactus", {
description = S("Bucket of Cactus Pulp"),
inventory_image = "bucket_cactus.png",
wield_image = "bucket_cactus.png",
stack_max = 1,
on_use = minetest.item_eat(2, "bucket:bucket_empty"),
})
minetest.register_craft({
output = "ethereal:bucket_cactus",
recipe = {
{"bucket:bucket_empty","default:cactus"},
}
})