2022-11-21 20:18:59 +01:00
|
|
|
minetest.register_item(":", { -- Hand
|
|
|
|
type = "none",
|
|
|
|
wield_image = "Poop.png",
|
|
|
|
wield_scale = {x=1.5,y=2,z=4.5},
|
|
|
|
tool_capabilities = {
|
|
|
|
max_drop_level = 0,
|
|
|
|
full_punch_interval = 0.4,
|
2022-11-21 20:54:36 +01:00
|
|
|
range = 5,
|
2022-11-21 20:18:59 +01:00
|
|
|
groupcaps =
|
|
|
|
{
|
|
|
|
oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0},
|
|
|
|
snappy = {times={[3]=0, [2]=0, [1]=0}, uses=0, maxlevel=3},
|
|
|
|
crumbly = {times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3},
|
|
|
|
cracky = {times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3},
|
|
|
|
choppy = {times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3},
|
|
|
|
},
|
|
|
|
damage_groups = {fleshy = 3, snappy = 2},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2022-11-20 23:28:08 +01:00
|
|
|
function sraj_dzwiek()
|
|
|
|
--make random sound
|
|
|
|
local sounds = {
|
|
|
|
"shitting1",
|
|
|
|
"shitting2",
|
|
|
|
"shitting3"}
|
|
|
|
local sound = sounds[math.random(1, #sounds)]
|
|
|
|
minetest.sound_play(sound, {pos = pos, gain = 2.0, max_hear_distance = 10})
|
|
|
|
|
|
|
|
end
|
|
|
|
function pakuj_guwno()
|
|
|
|
local sounds = {
|
|
|
|
"shit_packing1",
|
|
|
|
"shit_packing2",
|
|
|
|
"shit_packing3"}
|
|
|
|
local sound = sounds[math.random(1, #sounds)]
|
|
|
|
minetest.sound_play(sound, {pos = pos, gain = 2.0, max_hear_distance = 10})
|
|
|
|
end
|
2022-11-20 20:43:58 +01:00
|
|
|
minetest.register_node("poop:box", {
|
|
|
|
description = "cardboard box",
|
|
|
|
tiles = {"BOX.png"},
|
|
|
|
|
|
|
|
drop = 'poop:box',
|
|
|
|
legacy_mineral = true,
|
2022-11-20 22:47:32 +01:00
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.3125, -0.5, -0.375, 0.3125, -0.0625, 0.375}, -- NodeBox1
|
|
|
|
}
|
|
|
|
}
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
2022-11-20 23:20:26 +01:00
|
|
|
|
|
|
|
-- make a tool called flashlight that can be used to light up the world
|
|
|
|
minetest.register_tool("poop:flashlight", {
|
|
|
|
description = "Flashlight",
|
|
|
|
inventory_image = "flashlight.png",
|
|
|
|
wield_image = "flashlight.png",
|
|
|
|
wield_scale = {x=1,y=1,z=1},
|
|
|
|
tool_capabilities = {
|
|
|
|
full_punch_interval = 1.0,
|
|
|
|
max_drop_level=0,
|
|
|
|
groupcaps={
|
|
|
|
cracky = {times={[1]=3.00, [2]=0.70, [3]=0.40}, uses=20, maxlevel=1},
|
|
|
|
},
|
|
|
|
damage_groups = {fleshy=2},
|
|
|
|
},
|
|
|
|
light_source = 14,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_tool("poop:tool", {
|
|
|
|
description = "My Tool",
|
|
|
|
inventory_image = "flux_capacitor.png",
|
|
|
|
tool_capabilities = {
|
|
|
|
full_punch_interval = 1.5,
|
|
|
|
max_drop_level = 1,
|
|
|
|
groupcaps = {
|
|
|
|
crumbly = {
|
|
|
|
maxlevel = 2,
|
|
|
|
uses = 20,
|
|
|
|
times = { [1]=1.60, [2]=1.20, [3]=0.80 }
|
|
|
|
},
|
|
|
|
},
|
|
|
|
damage_groups = {fleshy=2},
|
|
|
|
},
|
|
|
|
})
|
2022-11-20 20:43:58 +01:00
|
|
|
minetest.register_node("poop:floor", {
|
|
|
|
description = "Floor",
|
|
|
|
tiles = {"floor.png"},
|
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "",
|
2022-11-20 23:20:26 +01:00
|
|
|
legacy_mineral = true, groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("poop:Poop", {
|
|
|
|
description = "Just Shit",
|
|
|
|
tiles = {"Poop.png"},
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "",
|
|
|
|
groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("poop:tv", {
|
2022-11-20 22:38:05 +01:00
|
|
|
description = "CRT TV",
|
2022-11-20 20:43:58 +01:00
|
|
|
tiles = {"PC2.png", "PC2.png","PC2.png","PC.png","PC2.png","PC2.png"},
|
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "", groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("poop:bricks", {
|
|
|
|
description = "Bricks",
|
|
|
|
tiles = {"Bricks.png"},
|
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "",
|
|
|
|
groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
minetest.register_node("poop:grey_bricks", {
|
|
|
|
description = "Bricks 2",
|
2022-11-20 23:20:26 +01:00
|
|
|
tiles = {"Bricks2.png"}, groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "",
|
|
|
|
groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
minetest.register_node("poop:planks", {
|
|
|
|
description = "Planks",
|
|
|
|
tiles = {"Planks.png"},
|
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "", groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
minetest.register_node("poop:purpleblock", {
|
|
|
|
description = "Purple Block",
|
|
|
|
tiles = {"purpleblock.png"},
|
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "", groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
minetest.register_node("poop:purpleblock", {
|
|
|
|
description = "Purple Block",
|
|
|
|
tiles = {"purpleblock.png"},
|
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "", groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
minetest.register_node("poop:redblock", {
|
|
|
|
description = "Red Block",
|
|
|
|
tiles = {"redblock.png"},
|
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "", groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("poop:aquablock", {
|
|
|
|
description = "Aqua Block",
|
|
|
|
tiles = {"aquablock.png"},
|
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "", groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
minetest.register_node("poop:glass", {
|
|
|
|
description = "Glass",
|
|
|
|
tiles = {"glass.png"},
|
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "", groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
minetest.register_node("poop:Poop2", {
|
|
|
|
description = "Poop with more density",
|
|
|
|
tiles = {"sraka.png"},
|
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "", groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("poop:flux_capacitor", {
|
|
|
|
description = "Flux Capacitor from Back to the Future",
|
|
|
|
tiles = {"fluxcap2.png", "fluxcap2.png","fluxcap2.png","fluxcap.png","fluxcap2.png","fluxcap2.png"},
|
|
|
|
|
2022-11-21 20:27:51 +01:00
|
|
|
drop = "", groups = {cracky=3, stone=1},
|
2022-11-20 20:43:58 +01:00
|
|
|
})
|
2022-11-20 21:59:55 +01:00
|
|
|
minetest.register_alias("mapgen_stone", "poop:floor")
|
|
|
|
|
|
|
|
local pooped_things = 0
|
|
|
|
|
|
|
|
minetest.register_craftitem("poop:plumba", {
|
|
|
|
description = "Plumba",
|
|
|
|
inventory_image = "plumba.png",
|
|
|
|
on_use = function(itemstack, user, pointed_thing)
|
|
|
|
-- check if pointing at a node
|
|
|
|
if pointed_thing.type ~= "node" then
|
|
|
|
return
|
|
|
|
end
|
2022-11-20 22:47:32 +01:00
|
|
|
-- get node at pointed thing position
|
|
|
|
local node = minetest.get_node(pointed_thing.under)
|
|
|
|
-- check if node is poop
|
|
|
|
if node.name == "poop:Poop" then
|
|
|
|
minetest.remove_node(pointed_thing.under)
|
|
|
|
minetest.add_node(pointed_thing.under, {name="poop:box"}) -- display GUI that tells user how much poop he has pooped
|
|
|
|
formspec = "size[8,8]"..
|
|
|
|
"label[0,0;You packed "..pooped_things.." shits!]"..
|
|
|
|
"button_exit[0,1;2,2;exit;Exit]"
|
|
|
|
minetest.show_formspec(user:get_player_name(), "poop:gui", formspec)
|
|
|
|
pooped_things = pooped_things + 1
|
2022-11-20 23:28:08 +01:00
|
|
|
pakuj_guwno()
|
2022-11-20 22:47:32 +01:00
|
|
|
return itemstack
|
|
|
|
else if node.name == "poop:Poop2" then
|
|
|
|
minetest.remove_node(pointed_thing.under)
|
|
|
|
minetest.add_node(pointed_thing.under, {name="poop:box"})
|
|
|
|
-- display GUI that tells user how much poop he has pooped
|
|
|
|
formspec = "size[8,8]"..
|
|
|
|
"label[0,0;You packed "..pooped_things.." shits!]"..
|
|
|
|
"button_exit[0,1;2,2;exit;Exit]"
|
|
|
|
minetest.show_formspec(user:get_player_name(), "poop:gui", formspec)
|
|
|
|
pooped_things = pooped_things + 1
|
2022-11-20 23:28:08 +01:00
|
|
|
pakuj_guwno()
|
2022-11-20 22:47:32 +01:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
})
|
2022-11-20 21:59:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
minetest.register_craftitem("poop:pooper", {
|
|
|
|
description = "Pooper",
|
|
|
|
inventory_image = "SHITitem.png",
|
|
|
|
on_use = function(itemstack, user, pointed_thing)
|
|
|
|
-- check if pointing at a node
|
|
|
|
if pointed_thing.type ~= "node" then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
-- make a random number between 1 and 10
|
|
|
|
local random_number = math.random(1, 10)
|
|
|
|
if random_number < 5 then
|
2022-11-20 22:47:32 +01:00
|
|
|
local node = minetest.get_node(pointed_thing.above)
|
|
|
|
if node.name == "air" then
|
|
|
|
minetest.add_node(pointed_thing.above, {name="poop:Poop"})
|
|
|
|
else
|
|
|
|
minetest.add_node(pointed_thing.under, {name="poop:Poop"})
|
|
|
|
end
|
2022-11-20 21:59:55 +01:00
|
|
|
else
|
2022-11-20 22:47:32 +01:00
|
|
|
local node = minetest.get_node(pointed_thing.above)
|
|
|
|
if node.name == "air" then
|
|
|
|
minetest.add_node(pointed_thing.above, {name="poop:Poop2"})
|
|
|
|
else
|
|
|
|
minetest.add_node(pointed_thing.under, {name="poop:Poop2"})
|
|
|
|
end
|
2022-11-20 21:59:55 +01:00
|
|
|
end
|
2022-11-20 23:28:08 +01:00
|
|
|
sraj_dzwiek()
|
2022-11-20 21:59:55 +01:00
|
|
|
return itemstack
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_on_joinplayer(function(player)
|
|
|
|
player:get_inventory():set_list("main", {})
|
|
|
|
|
|
|
|
player:setpos({x=0, y=10, z=0})
|
|
|
|
-- set time to day
|
|
|
|
minetest.set_timeofday(0.5)
|
|
|
|
minetest.sound_play("pooping_together", {
|
|
|
|
gain = 1,
|
|
|
|
pitch = 1,
|
|
|
|
loop = true,
|
|
|
|
})
|
|
|
|
player:get_inventory():add_item("main", "poop:plumba")
|
|
|
|
player:get_inventory():add_item("main", "poop:pooper")
|
2022-11-20 23:20:26 +01:00
|
|
|
player:get_inventory():add_item("main", "poop:flashlight")
|
|
|
|
player:get_inventory():add_item("main", "poop:tool")
|
2022-11-20 21:59:55 +01:00
|
|
|
-- give the player all the possible nodes in this mod 2000 times
|
2022-11-20 23:20:26 +01:00
|
|
|
for i = 1, 2000 do
|
|
|
|
player:get_inventory():add_item("main", "poop:floor")
|
|
|
|
player:get_inventory():add_item("main", "poop:tv")
|
|
|
|
player:get_inventory():add_item("main", "poop:bricks")
|
|
|
|
player:get_inventory():add_item("main", "poop:grey_bricks")
|
|
|
|
player:get_inventory():add_item("main", "poop:planks")
|
|
|
|
player:get_inventory():add_item("main", "poop:purpleblock")
|
|
|
|
player:get_inventory():add_item("main", "poop:redblock")
|
|
|
|
player:get_inventory():add_item("main", "poop:aquablock")
|
|
|
|
player:get_inventory():add_item("main", "poop:glass")
|
|
|
|
player:get_inventory():add_item("main", "poop:flux_capacitor")
|
|
|
|
end
|
2022-11-20 21:59:55 +01:00
|
|
|
end)
|