From 4f2670204c4862b41b5b9c7b4ec34df9df2b1aa3 Mon Sep 17 00:00:00 2001 From: kacperks Date: Tue, 22 Nov 2022 00:14:02 +0100 Subject: [PATCH 1/2] gowin --- mods/poop/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mods/poop/init.lua b/mods/poop/init.lua index 311a7ca..ff64a95 100644 --- a/mods/poop/init.lua +++ b/mods/poop/init.lua @@ -1,5 +1,13 @@ currentPage = 1 +function game_over() + minetest.show_formspec("poop:game_over", "size[8,8]label[0,0;Game Over!]") +end + +function you_win() + minetest.show_formspec("poop:you_win", "size[8,8]label[0,0;You Won! Tha]") +end + minetest.register_item(":", { -- Hand type = "none", wield_image = "Poop.png", From 0979bc6ece903e6f13bba57859606454638913d5 Mon Sep 17 00:00:00 2001 From: kacperks Date: Tue, 22 Nov 2022 00:24:49 +0100 Subject: [PATCH 2/2] gowin --- mods/poop/init.lua | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/mods/poop/init.lua b/mods/poop/init.lua index c923047..f7eb507 100644 --- a/mods/poop/init.lua +++ b/mods/poop/init.lua @@ -4,8 +4,21 @@ function game_over() minetest.show_formspec("poop:game_over", "size[8,8]label[0,0;Game Over!]") end -function you_win() - minetest.show_formspec("poop:you_win", "size[8,8]label[0,0;You Won! Tha]") +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 @@ -366,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