stethoscope or probing applied to monster -- one-line feedback */
| 3272 | |
| 3273 | /* stethoscope or probing applied to monster -- one-line feedback */ |
| 3274 | void |
| 3275 | mstatusline(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"); |
no test coverage detected