From: cohrs Date: Tue, 30 Sep 2003 18:49:48 +0000 (+0000) Subject: kicking a drawbridge X-Git-Tag: MOVE2GIT~1737 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d8bc8875e2c33a68f6300bc71001e64f1480c91;p=nethack kicking a drawbridge 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". --- diff --git a/doc/fixes34.3 b/doc/fixes34.3 index 8e357f985..926f43286 100644 --- a/doc/fixes34.3 +++ b/doc/fixes34.3 @@ -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 diff --git a/src/dokick.c b/src/dokick.c index bb248eebc..65dd15d62 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -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; }