another monster has killed the monster mdef */
| 3374 | |
| 3375 | /* another monster has killed the monster mdef */ |
| 3376 | void |
| 3377 | monkilled( |
| 3378 | struct monst *mdef, |
| 3379 | const char *fltxt, |
| 3380 | int how) |
| 3381 | { |
| 3382 | struct permonst *mptr = mdef->data; |
| 3383 | |
| 3384 | if (fltxt && (mdef->wormno ? worm_known(mdef) |
| 3385 | : cansee(mdef->mx, mdef->my))) |
| 3386 | pline_mon(mdef, "%s is %s%s%s!", Monnam(mdef), |
| 3387 | nonliving(mptr) ? "destroyed" : "killed", |
| 3388 | *fltxt ? " by the " : "", fltxt); |
| 3389 | else |
| 3390 | /* sad feeling is deferred until after potential life-saving */ |
| 3391 | iflags.sad_feeling = mdef->mtame ? TRUE : FALSE; |
| 3392 | |
| 3393 | /* no corpse if digested or disintegrated or flammable golem burnt up; |
| 3394 | no corpse for a paper golem means no scrolls; golems that rust or |
| 3395 | rot completely are described as "falling to pieces" so they do |
| 3396 | leave a corpse (which means staves for wood golem, leather armor for |
| 3397 | leather golem, iron chains for iron golem, not a regular corpse) */ |
| 3398 | gd.disintegested = (how == AD_DGST || how == -AD_RBRE |
| 3399 | || (how == AD_FIRE && completelyburns(mptr))); |
| 3400 | if (gd.disintegested) |
| 3401 | mondead(mdef); /* never leaves a corpse */ |
| 3402 | else |
| 3403 | mondied(mdef); /* calls mondead() and maybe leaves a corpse */ |
| 3404 | |
| 3405 | if (!DEADMONSTER(mdef)) |
| 3406 | return; /* life-saved */ |
| 3407 | /* extra message if pet golem is completely destroyed; |
| 3408 | if not visible, this will follow "you have a sad feeling" */ |
| 3409 | if (mdef->mtame) { |
| 3410 | const char *rxt = (how == AD_FIRE && completelyburns(mptr)) ? "roast" |
| 3411 | : (how == AD_RUST && completelyrusts(mptr)) ? "rust" |
| 3412 | : (how == AD_DCAY && completelyrots(mptr)) ? "rot" |
| 3413 | : 0; |
| 3414 | if (rxt) |
| 3415 | pline("May %s %s in peace.", noit_mon_nam(mdef), rxt); |
| 3416 | } |
| 3417 | return; |
| 3418 | } |
| 3419 | |
| 3420 | void |
| 3421 | set_ustuck(struct monst *mtmp) |
no test coverage detected