Skip to content

Commit

Permalink
swallowed time (trunk only)
Browse files Browse the repository at this point in the history
     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.
  • Loading branch information
nethack.rankin committed Mar 28, 2006
1 parent ecb98e0 commit 08e9280
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions doc/fixes35.0
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 16 additions & 5 deletions src/mhitu.c
Original file line number Diff line number Diff line change
@@ -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. */

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 08e9280

Please sign in to comment.