From 914c66b10afb29e4182b14ceffac727051bf1e1b Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Fri, 14 Apr 2006 13:53:33 +0000 Subject: [PATCH] drum of earthquake - hero portion wrote: > When applying a drum of earthquake, should you "fall into a chasm" if > you're already at the bottom of a pit? (Likewise monsters.) hero already in a pit won't "fall into a chasm" from drum of earthquake --- doc/fixes34.4 | 1 + src/music.c | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index c6958f754..367461e8c 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -205,6 +205,7 @@ check for hero location in digactualhole() before clearing u.utrap clear any pits that the hero digs in the vault guard's temporary corridor shattering a monster's weapon didn't work as intended for stack of N>1 don't reveal surface information that you can neither feel or see +hero already in a pit won't "fall into a chasm" from drum of earthquake Platform- and/or Interface-Specific Fixes diff --git a/src/music.c b/src/music.c index da90daab1..844fd3834 100644 --- a/src/music.c +++ b/src/music.c @@ -219,10 +219,13 @@ int force; register int x,y; struct monst *mtmp; struct obj *otmp; - struct trap *chasm; + struct trap *chasm, *trap_at_u = t_at(u.ux, u.uy); int start_x, start_y, end_x, end_y; schar filltype; + unsigned tu_pit = 0; + if (trap_at_u) + tu_pit = (trap_at_u->ttyp == PIT || trap_at_u->ttyp ==SPIKED_PIT); start_x = u.ux - (force * 2); start_y = u.uy - (force * 2); end_x = u.ux + (force * 2); @@ -330,9 +333,14 @@ do_pit: chasm = maketrap(x,y,PIT); } else if (x == u.ux && y == u.uy) { if (Levitation || Flying || is_clinger(youmonst.data)) { - pline("A chasm opens up under you!"); - You("don't fall in!"); - } else { + if (!tu_pit) { /* no pit here previously */ + pline("A chasm opens up under you!"); + You("don't fall in!"); + } + } else if (!tu_pit || !u.utrap || + (u.utrap && u.utraptype != TT_PIT)) { + /* no pit here previously, or you were + not in it even it there was */ You("fall into a chasm!"); u.utrap = rn1(6,2); u.utraptype = TT_PIT; @@ -340,6 +348,25 @@ do_pit: chasm = maketrap(x,y,PIT); "fell into a chasm", NO_KILLER_PREFIX); selftouch("Falling, you"); + } else if (u.utrap && u.utraptype == TT_PIT) { + boolean keepfooting = ( + (Fumbling && !rn2(5)) || + (!rnl(Role_if(PM_ARCHEOLOGIST) ? 3 : 9)) || + ((ACURR(A_DEX) > 7) && rn2(5))); + You("are jostled around violently!"); + u.utrap = rn1(6,2); + u.utraptype = TT_PIT; /* superfluous */ + losehp(Maybe_Half_Phys( + rnd(keepfooting ? 2 : 4)), + "hurt in a chasm", + NO_KILLER_PREFIX); + if (keepfooting) + exercise(A_DEX, TRUE); + else + selftouch((Upolyd && + slithy(youmonst.data) || + nolimbs(youmonst.data)) ? + "Shaken, you" : "Falling down, you"); } } else newsym(x,y); break; -- 2.40.0