]> granicus.if.org Git - nethack/commitdiff
Add a cold, watery gehennom filler maze
authorPasi Kallinen <paxed@alt.org>
Mon, 16 Jan 2023 17:09:28 +0000 (19:09 +0200)
committerPasi Kallinen <paxed@alt.org>
Mon, 16 Jan 2023 17:17:19 +0000 (19:17 +0200)
dat/hellfill.lua

index 0c87550dea60f1f87fc4dcd112a056bbe93f5519..0612923652823bec473119ac59391fcca20d025f 100644 (file)
@@ -160,8 +160,6 @@ function rnd_hell_prefab()
    hell_prefabs[pf]();
 end
 
--- TODO: cold hells? (ice & water instead of lava. sometimes floor = ice)
-
 hells = {
    -- 1: "mines" style with lava
    function ()
@@ -228,6 +226,29 @@ hells = {
          des.terrain(outside_walls, " ");  -- return the outside back to solid wall
       end
    end,
+
+   -- 6: cold maze, with ice and water
+   function ()
+      local cwid = math.random(4);
+      des.level_init({ style = "solidfill", fg = " ", lit = 0 });
+      des.level_flags("mazelevel", "noflip");
+      des.level_init({ style = "maze", wallthick = 1, corrwid = cwid });
+      local outside_walls = selection.match(" ");
+      local icey = selection.negate():percentage(10):grow():filter_mapchar(".");
+      des.terrain(icey, "I");
+      if (cwid == 1 and percent(25)) then
+         rnd_hell_prefab();
+      end
+      if (cwid > 1) then
+         -- turn some ice into wall of water
+         des.terrain(icey:percentage(1), "W");
+      end
+      des.terrain(icey:percentage(5), "P");
+      if (percent(25)) then
+         des.terrain(selection.match("w"), "W"); -- walls of water
+      end
+      des.terrain(outside_walls, " ");  -- return the outside back to solid wall
+   end,
 };
 
 local hellno = math.random(1, #hells);