]> granicus.if.org Git - nethack/commitdiff
swallowed time (trunk only)
authornethack.rankin <nethack.rankin>
Tue, 28 Mar 2006 04:57:40 +0000 (04:57 +0000)
committernethack.rankin <nethack.rankin>
Tue, 28 Mar 2006 04:57:40 +0000 (04:57 +0000)
     From a bug report, making engulf time longer for high AC
didn't make sense for non-digestion attacks:  taking longer to die from
being digested (high AC lets you last longer there) is much different from
being stuck inside a vortex or elemental and suffering extra buffettings
or whatever.  Calculate swallow time differently for non-digestion than
for digestion.  (The adjustment based around level 25 doesn't make much
sense either, but I left that in.)

     If you survive total digestion via life saving, you get a message
about the monster not liking your taste.  I don't think that's appropriate,
but haven't tried to figure out how to fix it.

doc/fixes35.0
src/mhitu.c

index b66e6ee8e6a93963cbbd4d36d0475d005c2ccbbd..6e7fc3c8656a8ceb0a70926d5d0e1c39d3e7139a 100644 (file)
@@ -131,6 +131,7 @@ avoid "Something's in the way" message with unidentified wand of locking
 better handling for Fort Ludios and endgame in wizard mode's `^V ?' menu
 no free lunch for gelatinous cubes eating scrolls of mail
 eating gold in front of the vault guard will make the guard angry
+calculate engulf time differently for non-digestion attacks than for digestion
 
 
 Platform- and/or Interface-Specific Fixes
index 32d4e9d3a74e021fa28002697cc648661ce58270..ddd5c1f1045ca67ac663fcdbd5f603a37425ae19 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mhitu.c    3.5     2006/02/01      */
+/*     SCCS Id: @(#)mhitu.c    3.5     2006/03/27      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1662,11 +1662,22 @@ gulpmu(mtmp, mattk)     /* monster swallows you, or damage if u.uswallow */
                display_nhwindow(WIN_MESSAGE, FALSE);
                vision_recalc(2);       /* hero can't see anything */
                u.uswallow = 1;
+               /* for digestion, shorter time is more dangerous;
+                  for other swallowings, longer time means more
+                  chances for the swallower to attack */
+               if (mattk->adtyp == AD_DGST) {
+                   tim_tmp = 25 - (int)mtmp->m_lev;
+                   if (tim_tmp > 0) tim_tmp = rnd(tim_tmp) / 2;
+                   else if (tim_tmp < 0) tim_tmp = -(rnd(-tim_tmp) / 2);
+                   /* having good armor & high constitution makes
+                      it take longer for you to be digested, but
+                      you'll end up trapped inside for longer too */
+                   tim_tmp += -u.uac + 10 + (ACURR(A_CON) / 3 - 1);
+               } else {
+                   /* higher level attacker takes longer to eject hero */
+                   tim_tmp = rnd((int)mtmp->m_lev + 10 / 2);
+               }
                /* u.uswldtim always set > 1 */
-               tim_tmp = 25 - (int)mtmp->m_lev;
-               if (tim_tmp > 0) tim_tmp = rnd(tim_tmp) / 2;
-               else if (tim_tmp < 0) tim_tmp = -(rnd(-tim_tmp) / 2);
-               tim_tmp += -u.uac + 10;
                u.uswldtim = (unsigned)((tim_tmp < 2) ? 2 : tim_tmp);
                swallowed(1);
                for (otmp2 = invent; otmp2; otmp2 = otmp2->nobj)