Everything updated

This commit is contained in:
{{QWERTYKBGUI}} 2022-11-20 22:47:32 +01:00
parent 8a74677189
commit b439de0a10
2 changed files with 48 additions and 20 deletions

View File

@ -1,3 +1,4 @@
name = Pooping Simulator name = Pooping Simulator
author = kacperks, lubek.net, Looki2000, KacpereK, MCL author = kacperks, lubek.net, Looki2000, KacpereK, MCL
description = Stupid game made in one day for mtgj2022 description = Stupid game made in one day for mtgj2022
allowed_mapgens = flat

View File

@ -1,14 +1,18 @@
-- add item called plumba
-- and let it destroy only the poop to change it to box
minetest.register_node("poop:box", { minetest.register_node("poop:box", {
description = "cardboard box", description = "cardboard box",
tiles = {"BOX.png"}, tiles = {"BOX.png"},
drop = 'poop:box', drop = 'poop:box',
legacy_mineral = true, legacy_mineral = true,
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.5, -0.375, 0.3125, -0.0625, 0.375}, -- NodeBox1
}
}
}) })
minetest.register_node("poop:floor", { minetest.register_node("poop:floor", {
description = "Floor", description = "Floor",
tiles = {"floor.png"}, tiles = {"floor.png"},
@ -104,17 +108,34 @@ minetest.register_craftitem("poop:plumba", {
if pointed_thing.type ~= "node" then if pointed_thing.type ~= "node" then
return return
end end
minetest.add_node(pointed_thing.under, {name="poop:box"}) -- get node at pointed thing position
pooped_things = pooped_things + 1 local node = minetest.get_node(pointed_thing.under)
-- make a GUI box that shows how many poops you have changed to boxes with button to escape -- check if node is poop
local formspec = "size[8,8]".. if node.name == "poop:Poop" then
"button_exit[0,0;8,8;exit;You have changed "..pooped_things.." poops to boxes!]" minetest.remove_node(pointed_thing.under)
minetest.show_formspec(user:get_player_name(), "poop:plumba", formspec) minetest.add_node(pointed_thing.under, {name="poop:box"}) -- display GUI that tells user how much poop he has pooped
return itemstack formspec = "size[8,8]"..
end, "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
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
return itemstack
end
end
end
})
-- add item called pooper
minetest.register_craftitem("poop:pooper", { minetest.register_craftitem("poop:pooper", {
description = "Pooper", description = "Pooper",
@ -127,19 +148,25 @@ minetest.register_craftitem("poop:pooper", {
-- make a random number between 1 and 10 -- make a random number between 1 and 10
local random_number = math.random(1, 10) local random_number = math.random(1, 10)
if random_number < 5 then if random_number < 5 then
minetest.add_node(pointed_thing.under, {name="poop:Poop"}) 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
else else
minetest.add_node(pointed_thing.under, {name="poop:Poop2"}) 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
end end
return itemstack return itemstack
end, end,
}) })
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
-- make a GUI box that tells you how to play the game
local formspec = "size[8,8]"..
"button_exit[0,0;8,8;exit;Welcome to Poop Simulator! To play, poop on the ground using pooper and then use the plumba to change it to a box!]"
minetest.show_formspec(player:get_player_name(), "poop:welcome", formspec)
player:get_inventory():set_list("main", {}) player:get_inventory():set_list("main", {})
player:setpos({x=0, y=10, z=0}) player:setpos({x=0, y=10, z=0})