]> granicus.if.org Git - nethack/commitdiff
Gehennom tweaks: replace some walls with boulders
authorPasi Kallinen <paxed@alt.org>
Tue, 24 Jan 2023 06:34:27 +0000 (08:34 +0200)
committerPasi Kallinen <paxed@alt.org>
Tue, 24 Jan 2023 06:34:27 +0000 (08:34 +0200)
dat/nhlib.lua

index 74f94cb4c9a7beee150741ba7d98bbf939980383..4d3aac38cf59612ac5b1bebc1fd86ae84de312aa 100644 (file)
@@ -101,6 +101,17 @@ function hell_tweaks(protected_area)
       lavariver = lavariver & prot;
       des.terrain(lavariver, liquid);
    end
+
+   -- replacing some walls with boulders
+   if (percent(20)) then
+      local amount = 3 * math.random(1, 8);
+      local bwalls = selection.match([[.w.]]):percentage(amount) | selection.match(".\nw\n."):percentage(amount);
+      bwalls = bwalls & prot;
+      bwalls:iterate(function (x,y)
+            des.terrain(x, y, ".");
+            des.object("boulder", x, y);
+      end);
+   end
 end
 
 -- pline with variable number of arguments