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".
This commit is contained in:
cohrs
2003-09-30 18:49:48 +00:00
parent 8a4816f775
commit 2d8bc8875e
2 changed files with 9 additions and 8 deletions

View 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 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 allow stone_to_flesh to animate it, make a meatball instead
attempting to saddle a cockatrice while wearing gloves shouldn't stone you 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 Platform- and/or Interface-Specific Fixes

View File

@@ -601,7 +601,7 @@ char *buf;
else if (IS_SINK(maploc->typ)) what = "a sink"; else if (IS_SINK(maploc->typ)) what = "a sink";
#endif #endif
else if (IS_ALTAR(maploc->typ)) what = "an altar"; 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 == STAIRS) what = "the stairs";
else if (maploc->typ == LADDER) what = "a ladder"; else if (maploc->typ == LADDER) what = "a ladder";
else if (maploc->typ == IRONBARS) what = "an iron bar"; else if (maploc->typ == IRONBARS) what = "an iron bar";
@@ -612,7 +612,7 @@ char *buf;
int int
dokick() dokick()
{ {
register int x, y; int x, y;
int avrg_attrib; int avrg_attrib;
register struct monst *mtmp; register struct monst *mtmp;
boolean no_kick = FALSE; boolean no_kick = FALSE;
@@ -993,6 +993,12 @@ ouch:
exercise(A_DEX, FALSE); exercise(A_DEX, FALSE);
exercise(A_STR, FALSE); exercise(A_STR, FALSE);
if (Blind) feel_location(x,y); /* we know we hit it */ 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)); if(!rn2(3)) set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
losehp(rnd(ACURR(A_CON) > 15 ? 3 : 5), kickstr(buf), losehp(rnd(ACURR(A_CON) > 15 ? 3 : 5), kickstr(buf),
KILLED_BY); KILLED_BY);
@@ -1000,12 +1006,6 @@ ouch:
hurtle(-u.dx, -u.dy, rn1(2,4), TRUE); /* assume it's heavy */ hurtle(-u.dx, -u.dy, rn1(2,4), TRUE); /* assume it's heavy */
return(1); 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; goto dumb;
} }