/* NetHack 3.5 do.c $Date$ $Revision$ */
-/* SCCS Id: @(#)do.c 3.5 2008/01/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
void
heal_legs()
{
- if(Wounded_legs) {
+ if (Wounded_legs) {
if (ATEMP(A_DEX) < 0) {
ATEMP(A_DEX)++;
context.botl = 1;
if (!u.usteed)
#endif
{
- /* KMH, intrinsics patch */
- if((EWounded_legs & BOTH_SIDES) == BOTH_SIDES) {
- Your("%s feel somewhat better.",
- makeplural(body_part(LEG)));
- } else {
- Your("%s feels somewhat better.",
- body_part(LEG));
- }
+ const char *legs = body_part(LEG);
+
+ if ((EWounded_legs & BOTH_SIDES) == BOTH_SIDES)
+ legs = makeplural(legs);
+ /* this used to say "somewhat better" but that was
+ misleading since legs are being fully healed */
+ Your("%s %s better.", legs, vtense(legs, "feel"));
}
+
HWounded_legs = EWounded_legs = 0;
+
+ /* Wounded_legs reduces carrying capacity, so we want
+ an encumbrance check when they're healed. However,
+ while dismounting, first steed's legs get healed,
+ then hero is dropped to floor and a new encumbrance
+ check is made [in dismount_steed()]. So don't give
+ encumbrance feedback during the dismount stage
+ because it could seem to be shown out of order and
+ it might be immediately contradicted [able to carry
+ more when steed becomes healthy, then possible floor
+ feedback, then able to carry less when back on foot]. */
+ if (!in_steed_dismounting) (void)encumber_msg();
}
- (void)encumber_msg();
}
/*do.c*/
/* NetHack 3.5 steed.c $Date$ $Revision$ */
-/* SCCS Id: @(#)steed.c 3.5 2006/12/13 */
/* Copyright (c) Kevin Hugo, 1998-1999. */
/* NetHack may be freely redistributed. See license for details. */
* healed upon dismount (Wounded_legs context switch).
* By preventing a hero with Wounded_legs from
* mounting a steed, the potential for abuse is
- * minimized, if not eliminated altogether.
+ * reduced. However, dismounting still immediately
+ * heals the steed's wounded legs. [In 3.4.3 and
+ * earlier, that unintentionally made the hero's
+ * temporary 1 point Dex loss become permanent.]
*/
if (Wounded_legs) {
Your("%s are in no shape for riding.", makeplural(body_part(LEG)));
struct obj *otmp;
coord cc;
const char *verb = "fall";
- boolean repair_leg_damage = TRUE;
+ boolean repair_leg_damage = (Wounded_legs != 0L);
unsigned save_utrap = u.utrap;
boolean have_spot = landing_spot(&cc,reason,0);
} else
You("dismount %s.", mon_nam(mtmp));
}
- /* While riding these refer to the steed's legs
- * so after dismounting they refer to the player's
- * legs once again.
- */
- if (repair_leg_damage) HWounded_legs = EWounded_legs = 0;
+ /* While riding, Wounded_legs refers to the steed's legs;
+ after dismounting, it reverts to the hero's legs. */
+ if (repair_leg_damage) {
+ /* [TODO: make heal_legs() take a parameter to handle this] */
+ in_steed_dismounting = TRUE;
+ heal_legs();
+ in_steed_dismounting = FALSE;
+ }
/* Release the steed and saddle */
u.usteed = 0;
(void) rloc(mtmp, FALSE);
return;
}
- if (!DEADMONSTER(mtmp)) {
+ if (mtmp->mhp > 0) {
place_monster(mtmp, u.ux, u.uy);
if (!u.uswallow && !u.ustuck && have_spot) {
struct permonst *mdat = mtmp->data;
* falling into the hole).
*/
/* [ALI] No need to move the player if the steed died. */
- if (!DEADMONSTER(mtmp)) {
+ if (mtmp->mhp > 0) {
/* Keep steed here, move the player to cc;
* teleds() clears u.utrap
*/