]> granicus.if.org Git - nethack/commitdiff
kicking a drawbridge
authorcohrs <cohrs>
Tue, 30 Sep 2003 18:49:48 +0000 (18:49 +0000)
committercohrs <cohrs>
Tue, 30 Sep 2003 18:49:48 +0000 (18:49 +0000)
There was some unreachable code in dokick related to drawbridges.  Since I
liked the current "Ouch!" behavior, I moved the drawbridge test inside the
IS_STWALL code but made sure to update the maploc so kickstr would return
the right thing.  Since there may be more than one drawbridge (perhaps it
should test for Valkyrie?) changed the kickstr prefix for drawbridge to "a".

doc/fixes34.3
src/dokick.c

index 8e357f98572c0b1474537a1d79caf84b04b23499..926f43286a036ed7bc5981cf7c91d88b6aaed442 100644 (file)
@@ -36,6 +36,7 @@ add tab support to menu strings for control-x minimal_enlightenment()
 if the monster that a statue represents is not made of flesh then don't
        allow stone_to_flesh to animate it, make a meatball instead
 attempting to saddle a cockatrice while wearing gloves shouldn't stone you
+kicking a closed drawbridge and dieing should not say "kicking a wall"
 
 
 Platform- and/or Interface-Specific Fixes
index bb248eebc12efb2b2ed188272afc600332e42299..65dd15d6227c9f96a7728881f11a7f24e3543a10 100644 (file)
@@ -601,7 +601,7 @@ char *buf;
        else if (IS_SINK(maploc->typ)) what = "a sink";
 #endif
        else if (IS_ALTAR(maploc->typ)) what = "an altar";
-       else if (IS_DRAWBRIDGE(maploc->typ)) what = "the drawbridge";
+       else if (IS_DRAWBRIDGE(maploc->typ)) what = "a drawbridge";
        else if (maploc->typ == STAIRS) what = "the stairs";
        else if (maploc->typ == LADDER) what = "a ladder";
        else if (maploc->typ == IRONBARS) what = "an iron bar";
@@ -612,7 +612,7 @@ char *buf;
 int
 dokick()
 {
-       register int x, y;
+       int x, y;
        int avrg_attrib;
        register struct monst *mtmp;
        boolean no_kick = FALSE;
@@ -993,6 +993,12 @@ ouch:
                    exercise(A_DEX, FALSE);
                    exercise(A_STR, FALSE);
                    if (Blind) feel_location(x,y); /* we know we hit it */
+                   if (is_drawbridge_wall(x,y) >= 0) {
+                       pline_The("drawbridge is unaffected.");
+                       /* update maploc to refer to the drawbridge */
+                       (void) find_drawbridge(&x,&y);
+                       maploc = &levl[x][y];
+                   }
                    if(!rn2(3)) set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
                    losehp(rnd(ACURR(A_CON) > 15 ? 3 : 5), kickstr(buf),
                        KILLED_BY);
@@ -1000,12 +1006,6 @@ ouch:
                        hurtle(-u.dx, -u.dy, rn1(2,4), TRUE); /* assume it's heavy */
                    return(1);
                }
-               if (is_drawbridge_wall(x,y) >= 0) {
-                   pline_The("drawbridge is unaffected.");
-                   if(Levitation)
-                       hurtle(-u.dx, -u.dy, rn1(2,4), TRUE); /* it's heavy */
-                   return(1);
-               }
                goto dumb;
        }