Initial upload

master
TenPlus1 2015-09-21 12:15:14 +01:00
parent a9616ce278
commit eef8ef0759
33 changed files with 221 additions and 0 deletions

6
depends.txt Normal file
View File

@ -0,0 +1,6 @@
default
hunger?
hbhunger?
farming?
mobs?
ethereal?

201
init.lua Normal file
View File

@ -0,0 +1,201 @@
local hmod = minetest.get_modpath("hunger")
local hbmod = minetest.get_modpath("hbhunger")
local replace_pie = function(node, puncher, pos)
if minetest.is_protected(pos, puncher:get_player_name()) then
return
end
local pie = node.name:split("_")[1]
local num = tonumber(node.name:split("_")[2])
if num == 3 then
node.name = "air"
elseif num < 3 then
node.name = pie .. "_" .. (num + 1)
end
if hmod then
local h = hunger.read(puncher)
--print ("hunger is "..h)
h = math.min(h + 4, 30)
local ok = hunger.update_hunger(puncher, h)
minetest.sound_play("hunger_eat", {
pos = pos, gain = 0.7, hear_distance = 5})
elseif hbmod then
local h = tonumber(hbhunger.hunger[puncher:get_player_name()])
--print ("hbhunger is "..h)
h = math.min(h + 4, 30)
hbhunger.hunger[puncher:get_player_name()] = h
minetest.sound_play("hbhunger_eat_generic", {
pos = pos, gain = 0.7, hear_distance = 5})
else
local h = puncher:get_hp()
--print ("health is "..h)
h = math.min(h + 4, 20)
puncher:set_hp(h)
end
minetest.set_node(pos, {name = node.name})
end
local register_pie = function(pie, desc)
minetest.register_node("pie:"..pie.."_0", {
description = desc,
paramtype = "light",
sunlight_propagates = false,
tiles = {
pie.."_top.png", pie.."_bottom.png", pie.."_side.png",
pie.."_side.png", pie.."_side.png", pie.."_side.png"
},
inventory_image = pie.."_inv.png",
wield_image = pie.."_inv.png",
groups = {},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {{-0.45, -0.5, -0.45, 0.45, 0, 0.45}},
},
on_punch = function(pos, node, puncher, pointed_thing)
replace_pie(node, puncher, pos)
end,
})
minetest.register_node("pie:"..pie.."_1", {
description = "3/4"..desc,
paramtype = "light",
sunlight_propagates = false,
tiles = {
pie.."_top.png", pie.."_bottom.png", pie.."_side.png",
pie.."_side.png", pie.."_side.png", pie.."_side.png"
},
groups = {not_in_creative_inventory = 1},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {{-0.45, -0.5, -0.25, 0.45, 0, 0.45}},
},
on_punch = function(pos, node, puncher, pointed_thing)
replace_pie(node, puncher, pos)
end,
})
minetest.register_node("pie:"..pie.."_2", {
description = "Half "..desc,
paramtype = "light",
sunlight_propagates = false,
tiles = {
pie.."_top.png", pie.."_bottom.png", pie.."_side.png",
pie.."_side.png", pie.."_side.png", pie.."_side.png"
},
groups = {not_in_creative_inventory = 1},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {{-0.45, -0.5, 0.0, 0.45, 0, 0.45}},
},
on_punch = function(pos, node, puncher, pointed_thing)
replace_pie(node, puncher, pos)
end,
})
minetest.register_node("pie:"..pie.."_3", {
description = "Piece of "..desc,
paramtype = "light",
sunlight_propagates = false,
tiles = {
pie.."_top.png", pie.."_bottom.png", pie.."_side.png",
pie.."_side.png", pie.."_side.png", pie.."_side.png"
},
groups = {not_in_creative_inventory = 1},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {{-0.45, -0.5, 0.25, 0.45, 0, 0.45}},
},
on_punch = function(pos, node, puncher, pointed_thing)
replace_pie(node, puncher, pos)
end,
})
end
-- Normal Cake
register_pie("pie", "Cake")
minetest.register_craft({
output = "pie:pie_0",
recipe = {
{"farming:sugar", "mobs:bucket_milk", "farming:sugar"},
{"farming:sugar", "mobs:egg", "farming:sugar"},
{"farming:wheat", "farming:flour", "farming:wheat"},
},
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
})
-- Chocolate Cake
register_pie("choc", "Chocolate Cake")
minetest.register_craft({
output = "pie:choc_0",
recipe = {
{"farming:cocoa_beans", "mobs:bucket_milk", "farming:cocoa_beans"},
{"farming:sugar", "mobs:egg", "farming:sugar"},
{"farming:wheat", "farming:flour", "farming:wheat"},
},
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
})
-- Strawberry Cheesecake
register_pie("scsk", "Strawberry Cheesecake")
minetest.register_craft({
output = "pie:scsk_0",
recipe = {
{"ethereal:strawberry", "mobs:bucket_milk", "ethereal:strawberry"},
{"farming:sugar", "mobs:egg", "farming:sugar"},
{"farming:wheat", "farming:flour", "farming:wheat"},
},
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
})
-- Coffee Cake
register_pie("coff", "Coffee Cake")
minetest.register_craft({
output = "pie:coff_0",
recipe = {
{"farming:coffee_beans", "mobs:bucket_milk", "farming:coffee_beans"},
{"farming:sugar", "mobs:egg", "farming:sugar"},
{"farming:wheat", "farming:flour", "farming:wheat"},
},
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
})
-- Red Velvet Cake
register_pie("rvel", "Red Velvet Cake")
minetest.register_craft({
output = "pie:rvel_0",
recipe = {
{"farming:cocoa_beans", "mobs:bucket_milk", "dye:red"},
{"farming:sugar", "mobs:egg", "farming:sugar"},
{"farming:flour", "mobs:cheese", "farming:flour"},
},
replacements = {{ "mobs:bucket_milk", "bucket:bucket_empty"}}
})
-- Meat Cake
register_pie("meat", "Meat Cake")
minetest.register_craft({
output = "pie:meat_0",
recipe = {
{"mobs:meat_raw", "mobs:egg", "mobs:meat_raw"},
{"farming:wheat", "farming:wheat", "farming:wheat"},
{"", "", ""}
},
})

14
license.txt Normal file
View File

@ -0,0 +1,14 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

BIN
textures/choc_bottom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

BIN
textures/choc_inside.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

BIN
textures/choc_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

BIN
textures/choc_side.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

BIN
textures/choc_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

BIN
textures/coff_bottom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

BIN
textures/coff_inside.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

BIN
textures/coff_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

BIN
textures/coff_side.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

BIN
textures/coff_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

BIN
textures/meat_bottom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

BIN
textures/meat_inside.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

BIN
textures/meat_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

BIN
textures/meat_side.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

BIN
textures/meat_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

BIN
textures/pie_bottom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

BIN
textures/pie_inside.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

BIN
textures/pie_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

BIN
textures/pie_side.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

BIN
textures/pie_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

BIN
textures/rvel_bottom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

BIN
textures/rvel_inside.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

BIN
textures/rvel_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

BIN
textures/rvel_side.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

BIN
textures/rvel_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

BIN
textures/scsk_bottom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

BIN
textures/scsk_inside.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

BIN
textures/scsk_inv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

BIN
textures/scsk_side.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

BIN
textures/scsk_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B