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

Function ustatusline

src/insight.c:3401–3489  ·  view source on GitHub ↗

stethoscope or probing applied to hero -- one-line feedback */

Source from the content-addressed store, hash-verified

3399
3400/* stethoscope or probing applied to hero -- one-line feedback */
3401void
3402ustatusline(void)
3403{
3404 NhRegion *reg;
3405 char info[BUFSZ];
3406 size_t ln;
3407
3408 info[0] = '\0';
3409 if (Sick) {
3410 Strcat(info, ", dying from");
3411 if (u.usick_type & SICK_VOMITABLE)
3412 Strcat(info, " food poisoning");
3413 if (u.usick_type & SICK_NONVOMITABLE) {
3414 if (u.usick_type & SICK_VOMITABLE)
3415 Strcat(info, " and");
3416 Strcat(info, " illness");
3417 }
3418 }
3419 if (Stoned)
3420 Strcat(info, ", solidifying");
3421 if (Slimed)
3422 Strcat(info, ", becoming slimy");
3423 if (Strangled)
3424 Strcat(info, ", being strangled");
3425 if (Vomiting)
3426 Strcat(info, ", nauseated"); /* !"nauseous" */
3427 if (Confusion)
3428 Strcat(info, ", confused");
3429 if (Blind) {
3430 Strcat(info, ", blind");
3431 if (u.ucreamed) {
3432 if ((long) u.ucreamed < BlindedTimeout || Blindfolded
3433 || !haseyes(gy.youmonst.data))
3434 Strcat(info, ", cover");
3435 Strcat(info, "ed by sticky goop");
3436 } /* note: "goop" == "glop"; variation is intentional */
3437 }
3438 if (Stunned)
3439 Strcat(info, ", stunned");
3440 if (Wounded_legs && !u.usteed) {
3441 /* EWounded_legs is used to track left/right/both rather than some
3442 form of extrinsic impairment; HWounded_legs is used for timeout;
3443 both apply to steed instead of hero when mounted */
3444 long legs = (EWounded_legs & BOTH_SIDES);
3445 const char *what = body_part(LEG);
3446
3447 if (legs == BOTH_SIDES)
3448 what = makeplural(what);
3449 /* when it's just one leg, ^X reports which, left or right;
3450 ustatusline() doesn't, in order to keep the output a bit shorter */
3451 Sprintf(eos(info), ", injured %s", what);
3452 }
3453 if (Glib)
3454 Sprintf(eos(info), ", slippery %s", fingers_or_gloves(TRUE));
3455 if (u.utrap)
3456 Strcat(info, ", trapped");
3457 if (Fast)
3458 Strcat(info, Very_fast ? ", very fast" : ", fast");

Callers 2

zapyourselfFunction · 0.85
use_stethoscopeFunction · 0.85

Calls 11

body_partFunction · 0.85
makepluralFunction · 0.85
eosFunction · 0.85
fingers_or_glovesFunction · 0.85
sticksFunction · 0.85
a_monnamFunction · 0.85
visible_region_atFunction · 0.85
reg_damgFunction · 0.85
piousnessFunction · 0.85
align_strFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected