fix #2382 - temp Dex loss becomes permanent when dismounting
From a bug report, if you dismount
from a steed whose legs are wounded, you won't recover the point of
dexterity which was removed when they becme injured. He noticed the
case where the steed had just died, but it happens for voluntary
dismount too (actually any dismount except one which wounds the hero's
legs in the process: DISMOUNT_THROWN or DISMOUNT_FELL).
It seems rather odd that the hero temporarily loses Dex when the
steed becomes injured, but I haven't changed that.
This commit is contained in:
@@ -407,6 +407,8 @@ for number_pad:2 (MSDOS compatibility), M-5 (Alt+5, or Shift+keypad5 using
|
|||||||
objects inside the Wizard's Tower can't be teleport to outside and vica versa
|
objects inside the Wizard's Tower can't be teleport to outside and vica versa
|
||||||
unlit candelabrum would become unlightable if its candles had exactly 1 turn
|
unlit candelabrum would become unlightable if its candles had exactly 1 turn
|
||||||
of fuel left and it was applied anywhere other than the invocation spot
|
of fuel left and it was applied anywhere other than the invocation spot
|
||||||
|
temporary loss of Dex from wounded legs will become permanent if it occurs
|
||||||
|
while mounted and hero dismounts before steed's legs have healed
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* NetHack 3.5 do.c $Date$ $Revision$ */
|
/* NetHack 3.5 do.c $Date$ $Revision$ */
|
||||||
/* SCCS Id: @(#)do.c 3.5 2008/01/22 */
|
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -1678,7 +1677,7 @@ register int timex;
|
|||||||
void
|
void
|
||||||
heal_legs()
|
heal_legs()
|
||||||
{
|
{
|
||||||
if(Wounded_legs) {
|
if (Wounded_legs) {
|
||||||
if (ATEMP(A_DEX) < 0) {
|
if (ATEMP(A_DEX) < 0) {
|
||||||
ATEMP(A_DEX)++;
|
ATEMP(A_DEX)++;
|
||||||
context.botl = 1;
|
context.botl = 1;
|
||||||
@@ -1688,18 +1687,29 @@ heal_legs()
|
|||||||
if (!u.usteed)
|
if (!u.usteed)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* KMH, intrinsics patch */
|
const char *legs = body_part(LEG);
|
||||||
if((EWounded_legs & BOTH_SIDES) == BOTH_SIDES) {
|
|
||||||
Your("%s feel somewhat better.",
|
if ((EWounded_legs & BOTH_SIDES) == BOTH_SIDES)
|
||||||
makeplural(body_part(LEG)));
|
legs = makeplural(legs);
|
||||||
} else {
|
/* this used to say "somewhat better" but that was
|
||||||
Your("%s feels somewhat better.",
|
misleading since legs are being fully healed */
|
||||||
body_part(LEG));
|
Your("%s %s better.", legs, vtense(legs, "feel"));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HWounded_legs = EWounded_legs = 0;
|
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*/
|
/*do.c*/
|
||||||
|
|||||||
+15
-10
@@ -1,5 +1,4 @@
|
|||||||
/* NetHack 3.5 steed.c $Date$ $Revision$ */
|
/* NetHack 3.5 steed.c $Date$ $Revision$ */
|
||||||
/* SCCS Id: @(#)steed.c 3.5 2006/12/13 */
|
|
||||||
/* Copyright (c) Kevin Hugo, 1998-1999. */
|
/* Copyright (c) Kevin Hugo, 1998-1999. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -221,7 +220,10 @@ mount_steed(mtmp, force)
|
|||||||
* healed upon dismount (Wounded_legs context switch).
|
* healed upon dismount (Wounded_legs context switch).
|
||||||
* By preventing a hero with Wounded_legs from
|
* By preventing a hero with Wounded_legs from
|
||||||
* mounting a steed, the potential for abuse is
|
* 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) {
|
if (Wounded_legs) {
|
||||||
Your("%s are in no shape for riding.", makeplural(body_part(LEG)));
|
Your("%s are in no shape for riding.", makeplural(body_part(LEG)));
|
||||||
@@ -472,7 +474,7 @@ dismount_steed(reason)
|
|||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
coord cc;
|
coord cc;
|
||||||
const char *verb = "fall";
|
const char *verb = "fall";
|
||||||
boolean repair_leg_damage = TRUE;
|
boolean repair_leg_damage = (Wounded_legs != 0L);
|
||||||
unsigned save_utrap = u.utrap;
|
unsigned save_utrap = u.utrap;
|
||||||
boolean have_spot = landing_spot(&cc,reason,0);
|
boolean have_spot = landing_spot(&cc,reason,0);
|
||||||
|
|
||||||
@@ -526,11 +528,14 @@ dismount_steed(reason)
|
|||||||
} else
|
} else
|
||||||
You("dismount %s.", mon_nam(mtmp));
|
You("dismount %s.", mon_nam(mtmp));
|
||||||
}
|
}
|
||||||
/* While riding these refer to the steed's legs
|
/* While riding, Wounded_legs refers to the steed's legs;
|
||||||
* so after dismounting they refer to the player's
|
after dismounting, it reverts to the hero's legs. */
|
||||||
* legs once again.
|
if (repair_leg_damage) {
|
||||||
*/
|
/* [TODO: make heal_legs() take a parameter to handle this] */
|
||||||
if (repair_leg_damage) HWounded_legs = EWounded_legs = 0;
|
in_steed_dismounting = TRUE;
|
||||||
|
heal_legs();
|
||||||
|
in_steed_dismounting = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Release the steed and saddle */
|
/* Release the steed and saddle */
|
||||||
u.usteed = 0;
|
u.usteed = 0;
|
||||||
@@ -546,7 +551,7 @@ dismount_steed(reason)
|
|||||||
(void) rloc(mtmp, FALSE);
|
(void) rloc(mtmp, FALSE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!DEADMONSTER(mtmp)) {
|
if (mtmp->mhp > 0) {
|
||||||
place_monster(mtmp, u.ux, u.uy);
|
place_monster(mtmp, u.ux, u.uy);
|
||||||
if (!u.uswallow && !u.ustuck && have_spot) {
|
if (!u.uswallow && !u.ustuck && have_spot) {
|
||||||
struct permonst *mdat = mtmp->data;
|
struct permonst *mdat = mtmp->data;
|
||||||
@@ -587,7 +592,7 @@ dismount_steed(reason)
|
|||||||
* falling into the hole).
|
* falling into the hole).
|
||||||
*/
|
*/
|
||||||
/* [ALI] No need to move the player if the steed died. */
|
/* [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;
|
/* Keep steed here, move the player to cc;
|
||||||
* teleds() clears u.utrap
|
* teleds() clears u.utrap
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user