]> granicus.if.org Git - nethack/commitdiff
Huge monsters easily climb out of pits
authorPasi Kallinen <paxed@alt.org>
Tue, 22 Feb 2022 11:07:59 +0000 (13:07 +0200)
committerPasi Kallinen <paxed@alt.org>
Tue, 22 Feb 2022 11:08:03 +0000 (13:08 +0200)
Also, give a message when a monster trapped in a pit, a web,
or a bear trap frees itself.

doc/fixes3-7-0.txt
src/trap.c

index 4f540f85d7cd2a391ab3cd265484ebfcbe704c19..2bcfb11526a2b20859424459a1660a49ab5f52bc 100644 (file)
@@ -809,6 +809,8 @@ elves and rangers get alignment penalty for cutting down trees
 casting a forgotten spell uses some random amount of power
 heroes starting with a spell have at least one level one spell, and
        have just enough power to cast it
+huge monsters get easily out of pits
+give a message when a trapped monster frees itself from some trap
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index ba8b09480ca6348877f8c73d557352fe0546ac92..98429ead6dc5d0200916c44d5a056de023d36f36 100644 (file)
@@ -3080,7 +3080,7 @@ mintrap(register struct monst *mtmp)
             seetrap(trap);
         }
 
-        if (!rn2(40)) {
+        if (!rn2(40) || (is_pit(trap->ttyp) && mtmp->data->msize >= MZ_HUGE)) {
             if (sobj_at(BOULDER, mtmp->mx, mtmp->my)
                 && is_pit(trap->ttyp)) {
                 if (!rn2(2)) {
@@ -3090,6 +3090,14 @@ mintrap(register struct monst *mtmp)
                     fill_pit(mtmp->mx, mtmp->my);
                 }
             } else {
+                if (canseemon(mtmp)) {
+                    if (is_pit(trap->ttyp))
+                        pline("%s climbs %sout of the pit.", Monnam(mtmp),
+                              mtmp->data->msize >= MZ_HUGE ? "easily " : "");
+                    else if (trap->ttyp == BEAR_TRAP || trap->ttyp == WEB)
+                        pline("%s pulls free of the %s.", Monnam(mtmp),
+                              trapname(trap->ttyp, FALSE));
+                }
                 mtmp->mtrapped = 0;
             }
         } else if (metallivorous(mptr)) {
@@ -3497,7 +3505,7 @@ climb_pit(void)
         reset_utrap(FALSE);
         fill_pit(u.ux, u.uy);
         g.vision_full_recalc = 1; /* vision limits change */
-    } else if (!(--u.utrap)) {
+    } else if (!(--u.utrap) || g.youmonst.data->msize >= MZ_HUGE) {
         reset_utrap(FALSE);
         You("%s to the edge of the %s.",
             (Sokoban && Levitation)