MCPcopy Index your code
hub / github.com/NetHack/NetHack / normal_shape

Function normal_shape

src/mon.c:4430–4462  ·  view source on GitHub ↗

[taken out of rescham() in order to be shared by restore_cham()] */

Source from the content-addressed store, hash-verified

4428
4429/* [taken out of rescham() in order to be shared by restore_cham()] */
4430void
4431normal_shape(struct monst *mon)
4432{
4433 int mcham = (int) mon->cham;
4434
4435 if (ismnum(mcham)) {
4436 unsigned mcan = mon->mcan;
4437
4438 (void) newcham(mon, &mons[mcham], NC_SHOW_MSG);
4439 mon->cham = NON_PM;
4440 /* newcham() may uncancel a polymorphing monster; override that */
4441 if (mcan)
4442 mon->mcan = 1;
4443 newsym(mon->mx, mon->my);
4444 }
4445 if (is_were(mon->data) && mon->data->mlet != S_HUMAN) {
4446 new_were(mon);
4447 }
4448 if (M_AP_TYPE(mon) != M_AP_NOTHING) {
4449 /* this used to include a cansee() check but Protection_from_
4450 _shape_changers shouldn't be trumped by being unseen */
4451 if (!mon->meating) {
4452 /* make revealed mimic fall asleep in lieu of shape change */
4453 if (M_AP_TYPE(mon) != M_AP_MONSTER)
4454 mon->msleeping = 1;
4455 seemimic(mon);
4456 } else {
4457 /* quickmimic: pet is midst of eating a mimic corpse;
4458 this terminates the meal early */
4459 finish_meating(mon);
4460 }
4461 }
4462}
4463
4464/* freed by freedynamicdata() when game ends; doesn't need to be struct g */
4465static struct monst **itermonarr = NULL;

Callers 2

restore_chamFunction · 0.85
cancel_monstFunction · 0.85

Calls 5

newchamFunction · 0.85
newsymFunction · 0.85
new_wereFunction · 0.85
seemimicFunction · 0.85
finish_meatingFunction · 0.85

Tested by

no test coverage detected