mimic statues & 2009 startup banner (trunk only)
A mimic posing as a statue was displayed as a tengu statue (and
recognizeable as such now that statues are displayed as the corresponding
monster rather than rock-class back tick), but the lookat code described
it as a giant ant statue (since there was no obj->corpsenm available to
indicate the monster type, it defaulted to 0). This adds monst->mextra
field `mcorpsenm' so that mimics have a place to remember what sort of
statue or corpse they are mimicking. And it picks a random monster type
when they take such forms so that the old tengu hack becomes irrelevant.
newmextra() and newoextra() initialized pointers via memset(...,0)
which is not portable; switch to explicit assignments. The wizard mode
code to display memory used for monsters and objects added in amounts
for the miscellaneous things pointed to by monst->mextra and obj->oextra
structs but didn't include memory for those structs themselves; add it.
Simplify monster save/restore slightly; there's no need for extra zeroes
to represent monst->mextra->X sizes when monst->mextra is null.
Update the startup banner for 2009. I should have done this with a
separate patch but I'm taking a shortcut. :-]
This commit is contained in:
@@ -1418,6 +1418,7 @@ struct monst *mtmp2, *mtmp1;
|
||||
(genericptr_t)EDOG(mtmp1),
|
||||
sizeof(struct edog));
|
||||
}
|
||||
if (has_mcorpsenm(mtmp1)) MCORPSENM(mtmp2) = MCORPSENM(mtmp1);
|
||||
}
|
||||
|
||||
STATIC_OVL void
|
||||
@@ -1431,6 +1432,7 @@ struct mextra *x;
|
||||
if (x->eshk) free((genericptr_t)x->eshk);
|
||||
if (x->emin) free((genericptr_t)x->emin);
|
||||
if (x->edog) free((genericptr_t)x->edog);
|
||||
/* [no action needed for x->mcorpsenm] */
|
||||
free((genericptr_t)x);
|
||||
}
|
||||
}
|
||||
@@ -2331,6 +2333,8 @@ register struct monst *mtmp;
|
||||
unsigned old_app = mtmp->mappearance;
|
||||
uchar old_ap_type = mtmp->m_ap_type;
|
||||
|
||||
if (has_mcorpsenm(mtmp)) freemcorpsenm(mtmp);
|
||||
|
||||
mtmp->m_ap_type = M_AP_NOTHING;
|
||||
mtmp->mappearance = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user