]> granicus.if.org Git - nethack/commitdiff
Add triple nesting theme room
authorPasi Kallinen <paxed@alt.org>
Mon, 23 Jan 2023 17:56:22 +0000 (19:56 +0200)
committerPasi Kallinen <paxed@alt.org>
Mon, 23 Jan 2023 18:00:21 +0000 (20:00 +0200)
dat/themerms.lua

index 2f62ef9bde4e0ce196681a28172c97ddb4ac28e6..60bdd1e02f2fb7a88734362df2cfba8f4941337a 100644 (file)
@@ -227,6 +227,33 @@ themerooms = {
       });
    end,
 
+   -- Nesting rooms
+   function()
+      des.room({ type = "ordinary", w = 9 + nh.rn2(4), h = 9 + nh.rn2(4), filled = 1,
+                 contents = function(rm)
+                    local wid = math.random(math.floor(rm.width / 2), rm.width - 2);
+                    local hei = math.random(math.floor(rm.height / 2), rm.height - 2);
+                    des.room({ type = "ordinary", w = wid,h = hei, filled = 1,
+                               contents = function()
+                                  des.door({ state="random", wall="all" });
+                                  if (percent(15)) then
+                                     des.door({ state="random", wall="all" });
+                                  end
+                                  if (percent(90)) then
+                                     des.room({ type = "ordinary", filled = 1,
+                                                contents = function()
+                                                   des.door({ state="random", wall="all" });
+                                                   if (percent(15)) then
+                                                      des.door({ state="random", wall="all" });
+                                                   end
+                                                end
+                                     });
+                                  end
+                               end
+                    });
+                 end
+      });
+   end,
    {
       frequency = 6,
       contents = function()