From 84a04cec2717d958a818b253c73ae5fe96510eff Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 20 Aug 2019 04:05:20 +0200 Subject: [PATCH] Randomize spawner position (a bit) --- init.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index e7ed4b5..2ab2749 100644 --- a/init.lua +++ b/init.lua @@ -133,7 +133,14 @@ local function make(pos, brick, sandstone, stone, sand, ptype, room_id) end end local ok, msg, flood_sand = tsm_pyramids.make_room(pos, ptype, room_id) - add_spawner({x=pos.x+11,y=pos.y+2, z=pos.z+17}) + local r = math.random(1,3) + if r == 1 then + add_spawner({x=pos.x+11,y=pos.y+2, z=pos.z+17}) + elseif r == 2 then + add_spawner({x=pos.x+17,y=pos.y+2, z=pos.z+11}) + else + add_spawner({x=pos.x+5,y=pos.y+2, z=pos.z+11}) + end make_entrance({x=pos.x,y=pos.y, z=pos.z}, brick, sand, flood_sand) minetest.log("action", "Created pyramid at ("..pos.x..","..pos.y..","..pos.z..")") return ok, msg