]> granicus.if.org Git - nethack/commitdiff
TDTTOE: Discourage generating elf corpses on sleeping gas traps
authorAlex Smith <ais523@nethack4.org>
Wed, 6 Dec 2017 18:49:08 +0000 (18:49 +0000)
committerAlex Smith <ais523@nethack4.org>
Wed, 6 Dec 2017 18:50:46 +0000 (18:50 +0000)
These are elven /adventurers/, so they get sleep resistance at
experience level 4 (not immediately), and so there's an outside
chance they'll be killed by a sleeping gas trap. This commit
reduces the probability, though.

src/mklev.c

index c8fa866b546cf641f87e3422dce7af919264d46a..e3d28891d3d9d6b8ce6804237288db55de250d82 100644 (file)
@@ -1461,6 +1461,12 @@ coord *tm;
         case 0:
             /* elf corpses are the rarest as they're the most useful */
             victim_mnum = PM_ELF;
+            /* elven adventurers get sleep resistance early; so don't
+               generate elf corpses on sleeping gas traps unless a)
+               we're on dlvl 2 (1 is impossible) and b) we pass a coin
+               flip */
+            if (kind == SLP_GAS_TRAP && !(lvl <= 2 && rn2(2)))
+                victim_mnum = PM_HUMAN;
             break;
         case 1: case 2:
             victim_mnum = PM_DWARF;