diff --git a/mods/poop/init.lua b/mods/poop/init.lua index 65717c5..d6cb75c 100644 --- a/mods/poop/init.lua +++ b/mods/poop/init.lua @@ -1,5 +1,26 @@ currentPage = 1 +function game_over() + minetest.show_formspec("poop:game_over", "size[8,8]label[0,0;Game Over!]") +end + +function you_win(player) + -- teleport player to 0,0,0 + player:setpos({x=0, y=0, z=0}) + thanks = "Thanks for playing Shitting Simulator! We had a lot of fun making this game, and we hope you enjoyed it too! Thanks again!" + storyFormspec = + { + "formspec_version[4]", + "size[18, 16]", + "bgcolor[brown]", + "position[0.5, 0.5]", + "style_type[button;bgcolor=yellow;textcolor=green]", + "hypertext[1, 12.5; 12, 5;;" .. thanks .. "]\n", + "button[13, 14.9; 4, 1;exit;Quit]" + } + minetest.show_formspec(player:get_player_name(), "poop:story", table.concat(storyFormspec, "")) +end + minetest.register_item(":", { -- Hand type = "none", wield_image = "Poop.png", @@ -358,7 +379,7 @@ minetest.register_craftitem("poop:plumba", { end if pooped_things >= 100 then is_game_finished = true - + you_win(user) return end -- get node at pointed thing position