MCPcopy Create free account
hub / github.com/NetHack/NetHack / heal_legs

Function heal_legs

src/do.c:2448–2486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2446}
2447
2448void
2449heal_legs(
2450 int how) /* 0: ordinary, 1: dismounting steed, 2: limbs turn to stone */
2451{
2452 if (Wounded_legs) {
2453 disp.botl = TRUE;
2454 if (ATEMP(A_DEX) < 0)
2455 ATEMP(A_DEX)++;
2456
2457 /* when mounted, wounded legs applies to the steed;
2458 during petrification countdown, "your limbs turn to stone"
2459 before the final stages and that calls us (how==2) to cure
2460 wounded legs, but we want to suppress the feel better message */
2461 if (!u.usteed && how != 2) {
2462 const char *legs = body_part(LEG);
2463
2464 if ((EWounded_legs & BOTH_SIDES) == BOTH_SIDES)
2465 legs = makeplural(legs);
2466 /* this used to say "somewhat better" but that was
2467 misleading since legs are being fully healed */
2468 Your("%s %s better.", legs, vtense(legs, "feel"));
2469 }
2470
2471 HWounded_legs = EWounded_legs = 0L;
2472
2473 /* Wounded_legs reduces carrying capacity, so we want
2474 an encumbrance check when they're healed. However,
2475 while dismounting, first steed's legs get healed,
2476 then hero is dropped to floor and a new encumbrance
2477 check is made [in dismount_steed()]. So don't give
2478 encumbrance feedback during the dismount stage
2479 because it could seem to be shown out of order and
2480 it might be immediately contradicted [able to carry
2481 more when steed becomes healthy, then possible floor
2482 feedback, then able to carry less when back on foot]. */
2483 if (how == 0)
2484 encumber_msg();
2485 }
2486}
2487
2488/*do.c*/

Callers 10

throne_sit_effectFunction · 0.85
peffect_speedFunction · 0.85
peffect_extra_healingFunction · 0.85
peffect_full_healingFunction · 0.85
mount_steedFunction · 0.85
dismount_steedFunction · 0.85
stoned_dialogueFunction · 0.85
nh_timeoutFunction · 0.85
fix_worst_troubleFunction · 0.85
fpostfxFunction · 0.85

Calls 5

body_partFunction · 0.85
makepluralFunction · 0.85
YourFunction · 0.85
vtenseFunction · 0.85
encumber_msgFunction · 0.85

Tested by

no test coverage detected