From f68f15e3b5189c1734cf84cf5ea2aef8f4f09c93 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 30 Mar 2026 18:23:51 +0300 Subject: [PATCH] Simplify some special level lua These were generated by a script that converted the des-file format to lua. --- dat/Rog-strt.lua | 4 ++-- dat/astral.lua | 4 ++-- dat/minetn-1.lua | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dat/Rog-strt.lua b/dat/Rog-strt.lua index 55bf11969..1e4700d49 100644 --- a/dat/Rog-strt.lua +++ b/dat/Rog-strt.lua @@ -157,10 +157,10 @@ des.monster({ id = "leprechaun", x=74, y=04, peaceful=0 }) des.monster({ id = "leprechaun", x=25, y=19, peaceful=0 }) des.monster({ id = "water nymph", x=25, y=18, peaceful=0 }) -- Wandering the streets. -for i=1,4 + math.random(1 - 1,1*3) do +for i = 1, math.random(4,7) do des.monster({ id = "water nymph", coord = streets:rndcoord(1), peaceful=0 }) des.monster({ id = "leprechaun", coord = streets:rndcoord(1), peaceful=0 }) end -for i=1,7 + math.random(1 - 1,1*3) do +for i = 1, math.random(7,10) do des.monster({ id = "chameleon", coord = streets:rndcoord(1), peaceful=0 }) end diff --git a/dat/astral.lua b/dat/astral.lua index f0ba8951e..6d6f0808b 100644 --- a/dat/astral.lua +++ b/dat/astral.lua @@ -35,7 +35,7 @@ des.map([[ -- chance to alter above map and turn the wings of the bottom-center into -- a pair of big (5x15) rooms -for i=1,2 do +for i = 1, 2 do -- 3.6.[01]: 75% chance that both sides opened up, 25% that neither did; -- 3.6.2: 60% twice == 36% chance that both sides open up, 24% left side -- only, 24% right side only, 16% that neither side opens up @@ -58,7 +58,7 @@ for i=1,2 do des.terrain(41,18, ".") end -- extra monsters; was [6 + 3d4] when both wings were opened up at once - for i=1,3 + math.random(2 - 1,2*3) do + for j = 1, math.random(4,9) do des.monster({ id="Angel", coord = hall:rndcoord(1), align="noalign", peaceful=0 }) if percent(50) then des.monster({ coord = hall:rndcoord(1), peaceful=0 }) diff --git a/dat/minetn-1.lua b/dat/minetn-1.lua index 960553d4e..ef10d70b7 100644 --- a/dat/minetn-1.lua +++ b/dat/minetn-1.lua @@ -88,7 +88,7 @@ des.object({ id = "corpse", montype="watchman" }) des.object({ id = "corpse", montype="watch captain" }) -- Rubble! -for i=1,9 + math.random(2 - 1,2*5) do +for i = 1, math.random(10,19) do if percent(90) then des.object("boulder") end @@ -118,7 +118,7 @@ des.object({ id = "wand of magic missile", coord = place[5], buc="uncursed", spe local inside = selection.floodfill(18,8) local near_temple = selection.area(17,8, 23,14) & inside -for i=1,5 + math.random(1 - 1,1*10) do +for i = 1, math.random(5,15) do if percent(50) then des.monster({ id = "orc-captain", coord = inside:rndcoord(1), peaceful=0 }); else @@ -131,13 +131,13 @@ for i=1,5 + math.random(1 - 1,1*10) do end -- shamans can be hanging out in/near the temple -- one of the shamans is higher level -for i=1,math.random(1,6) do +for i = 1, math.random(1,6) do des.monster({ id = "orc shaman", coord = near_temple:rndcoord(0), peaceful=0, m_lev_adj = (i == 1) and 3 or 0 }); end -- these are not such a big deal -- to run into outside the bars -for i=1,9 + math.random(2 - 1,2*5) do +for i = 1, math.random(10,19) do if percent(90) then des.monster({ id = "hill orc", peaceful = 0 }) else