From 7a18387ff2a18a334c8859f1f0d9d61362a5f0df Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 1 May 2023 15:37:30 -0700 Subject: [PATCH] Fix github issue #1016 - buried zombie theme room Reported by vultur-cadens: it was possible to encounter ettin zombies and giant zombies at shallow levels if those levels were generated with the "buried zombies" theme room. This uses a simpler fix than the suggestion(s); it's only applicable to the zombie room though. Also, vary the zombify_mon timeout. If the hero happened to be in the room at the time that that expired, they would all claw their way out of the ground at once. The new variation is quite small so they still escape burial as a group, but over the span of 21 turns rather than all on one turn. Fixes #1016 --- dat/themerms.lua | 17 ++++++++++++++--- doc/fixes3-7-0.txt | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dat/themerms.lua b/dat/themerms.lua index 3bf6a1b34..57b5fd879 100644 --- a/dat/themerms.lua +++ b/dat/themerms.lua @@ -1,6 +1,7 @@ -- NetHack themerms.lua $NHDT-Date: 1652196294 2022/05/10 15:24:54 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.16 $ -- Copyright (c) 2020 by Pasi Kallinen -- NetHack may be freely redistributed. See license for details. +-- -- themerooms is an array of tables and/or functions. -- the tables define "frequency", "contents", "mindiff" and "maxdiff". -- frequency is optional; if omitted, 1 is assumed. @@ -95,12 +96,21 @@ themeroom_fills = { -- Buried zombies function(rm) - local zombifiable = { "kobold", "gnome", "orc", "dwarf", "elf", "human", "ettin", "giant" }; + local diff = nh.level_difficulty() + -- start with [1..4] for low difficulty + local zombifiable = { "kobold", "gnome", "orc", "dwarf" }; + if diff > 3 then -- medium difficulty + zombifiable[5], zombifiable[6] = "elf", "human"; + if diff > 6 then -- high difficulty (relatively speaking) + zombifiable[7], zombifiable[8] = "ettin", "giant"; + end + end for i = 1, (rm.width * rm.height) / 2 do shuffle(zombifiable); - local o = des.object({ id = "corpse", montype = zombifiable[1], buried = true }); + local o = des.object({ id = "corpse", montype = zombifiable[1], + buried = true }); o:stop_timer("rot-corpse"); - o:start_timer("zombify-mon", 1000); + o:start_timer("zombify-mon", math.random(990, 1010)); end end, @@ -265,6 +275,7 @@ themerooms = { end }); end, + { frequency = 6, contents = function() diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 2ee625e6e..f91e72c6f 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1551,6 +1551,7 @@ anti-magic field's reduction of hero's maximum energy could result in current energy being one point higher than maximum if hero was killed by a wand zapped by a monster, cause of death was reported as "killed by a bolt of imagined by " +throttle the difficulty of the monsters in theme room "buried zombies" Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository