swallowed time (trunk only)

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.
This commit is contained in:
nethack.rankin
2006-03-28 04:57:40 +00:00
parent ecb98e019c
commit 08e9280201
2 changed files with 17 additions and 5 deletions

View 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

View 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)