]> granicus.if.org Git - nethack/commitdiff
drum of earthquake - hero portion
authornethack.allison <nethack.allison>
Fri, 14 Apr 2006 13:53:33 +0000 (13:53 +0000)
committernethack.allison <nethack.allison>
Fri, 14 Apr 2006 13:53:33 +0000 (13:53 +0000)
<Someone> 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
src/music.c

index c6958f75416ebd91d947a149bd837eb2986802a0..367461e8cb288b495612025ede4cfef6928de893 100644 (file)
@@ -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
index da90daab13add749842ada715f8f3ba7be0fe487..844fd3834258beac0497072ff936ea8d941f920f 100644 (file)
@@ -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;