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

Function mstatusline

src/insight.c:3274–3398  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3272
3273/* stethoscope or probing applied to monster -- one-line feedback */
3274void
3275mstatusline(struct monst *mtmp)
3276{
3277 aligntyp alignment = mon_aligntyp(mtmp);
3278 char info[BUFSZ], monnambuf[BUFSZ];
3279
3280 info[0] = 0;
3281 if (mtmp->mtame) {
3282 Strcat(info, ", tame");
3283 if (wizard) {
3284 Sprintf(eos(info), " (%d", mtmp->mtame);
3285 if (!mtmp->isminion)
3286 Sprintf(eos(info), "; hungry %ld; apport %d",
3287 EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport);
3288 Strcat(info, ")");
3289 }
3290 } else if (mtmp->mpeaceful)
3291 Strcat(info, ", peaceful");
3292
3293 if (mtmp->data == &mons[PM_LONG_WORM]) {
3294 int segndx, nsegs = count_wsegs(mtmp);
3295
3296 /* the worm code internals don't consider the head to be one of
3297 the worm's segments, but we count it as such when presenting
3298 worm feedback to the player */
3299 if (!nsegs) {
3300 Strcat(info, ", single segment");
3301 } else {
3302 ++nsegs; /* include head in the segment count */
3303 segndx = wseg_at(mtmp, gb.bhitpos.x, gb.bhitpos.y);
3304 Sprintf(eos(info), ", %d%s of %d segments",
3305 segndx, ordin(segndx), nsegs);
3306 }
3307 }
3308 if (ismnum(mtmp->cham) && mtmp->data != &mons[mtmp->cham])
3309 /* don't reveal the innate form (chameleon, vampire, &c),
3310 just expose the fact that this current form isn't it */
3311 Strcat(info, ", shapechanger");
3312 /* pets eating mimic corpses mimic while eating, so this comes first */
3313 if (mtmp->meating)
3314 Strcat(info, ", eating");
3315 /* a stethoscope exposes mimic before getting here so this
3316 won't be relevant for it, but wand of probing doesn't */
3317 if (mtmp->mundetected || mtmp->m_ap_type
3318 || visible_region_at(gb.bhitpos.x, gb.bhitpos.y))
3319 mhidden_description(mtmp,
3320 MHID_PREFIX | MHID_ARTICLE | MHID_ALTMON | MHID_REGION,
3321 eos(info));
3322 if (mtmp->mcan)
3323 Strcat(info, ", cancelled");
3324 if (mtmp->mconf)
3325 Strcat(info, ", confused");
3326 if (mtmp->mblinded || !mtmp->mcansee)
3327 Strcat(info, ", blind");
3328 if (mtmp->mstun)
3329 Strcat(info, ", stunned");
3330 if (mtmp->msleeping)
3331 Strcat(info, ", asleep");

Callers 2

probe_monsterFunction · 0.85
use_stethoscopeFunction · 0.85

Calls 13

mon_aligntypFunction · 0.85
eosFunction · 0.85
count_wsegsFunction · 0.85
wseg_atFunction · 0.85
ordinFunction · 0.85
visible_region_atFunction · 0.85
mhidden_descriptionFunction · 0.85
mbodypartFunction · 0.85
makepluralFunction · 0.85
align_strFunction · 0.85
size_strFunction · 0.85
find_macFunction · 0.85

Tested by

no test coverage detected