Wounded_legs condition
Mounting a steed while legs are wounded would offer to cure them but wasn't going through the heal_legs() routine so didn't update the status line when Wounded_legs condition is enabled. Move some common code for describing left/right/both legs into a new routine used for feedback by jumping, kicking, and ridiing. For ^X, distinguish between one wounded leg and both but don't bother with left vs right when it is just one.
This commit is contained in:
25
src/do.c
25
src/do.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 do.c $NHDT-Date: 1581886859 2020/02/16 21:00:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.227 $ */
|
||||
/* NetHack 3.6 do.c $NHDT-Date: 1582155879 2020/02/19 23:44:39 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.228 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1050,7 +1050,8 @@ dodown()
|
||||
|
||||
if (trap) {
|
||||
const char *down_or_thru = trap->ttyp == HOLE ? "down" : "through";
|
||||
const char *actn = Flying ? "fly" : locomotion(g.youmonst.data, "jump");
|
||||
const char *actn = Flying ? "fly"
|
||||
: locomotion(g.youmonst.data, "jump");
|
||||
|
||||
if (g.youmonst.data->msize >= MZ_HUGE) {
|
||||
char qbuf[QBUFSZ];
|
||||
@@ -2008,6 +2009,26 @@ dowipe()
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* common wounded legs feedback */
|
||||
void
|
||||
legs_in_no_shape(for_what, by_steed)
|
||||
const char *for_what; /* jumping, kicking, riding */
|
||||
boolean by_steed;
|
||||
{
|
||||
if (by_steed && u.usteed) {
|
||||
pline("%s is in no shape for %s.", Monnam(u.usteed), for_what);
|
||||
} else {
|
||||
long wl = (EWounded_legs & BOTH_SIDES);
|
||||
const char *bp = body_part(LEG);
|
||||
|
||||
if (wl == BOTH_SIDES)
|
||||
bp = makeplural(bp);
|
||||
Your("%s%s %s in no shape for %s.",
|
||||
(wl == LEFT_SIDE) ? "left " : (wl == RIGHT_SIDE) ? "right " : "",
|
||||
bp, (wl == BOTH_SIDES) ? "are" : "is", for_what);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
set_wounded_legs(side, timex)
|
||||
long side;
|
||||
|
||||
Reference in New Issue
Block a user