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:
nethack.rankin
2009-01-31 08:03:41 +00:00
parent 0def692d5f
commit 71219bf093
12 changed files with 124 additions and 71 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)pager.c 3.5 2008/07/20 */
/* SCCS Id: @(#)pager.c 3.5 2009/01/30 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -213,15 +213,24 @@ lookat(x, y, buf, monbuf)
} /* mtmp */
} else if (glyph_is_object(glyph)) {
int glyphotyp = glyph_to_obj(glyph);
struct obj *otmp = vobj_at(x,y);
if (!otmp || otmp->otyp != glyph_to_obj(glyph)) {
if (glyph_to_obj(glyph) != STRANGE_OBJECT) {
otmp = mksobj(glyph_to_obj(glyph), FALSE, FALSE);
/* there might be a mimic here posing as an object */
mtmp = m_at(x, y);
if (mtmp && mtmp->m_ap_type == M_AP_OBJECT &&
mtmp->mappearance == glyphotyp) otmp = 0;
else mtmp = 0;
if (!otmp || otmp->otyp != glyphotyp) {
if (glyphotyp != STRANGE_OBJECT) {
otmp = mksobj(glyphotyp, FALSE, FALSE);
if (otmp->oclass == COIN_CLASS)
otmp->quan = 2L; /* to force pluralization */
else if (otmp->otyp == SLIME_MOLD)
otmp->spe = context.current_fruit; /* give it a type */
if (mtmp && has_mcorpsenm(mtmp)) /* mimic as corpse/statue */
otmp->corpsenm = MCORPSENM(mtmp);
Strcpy(buf, distant_name(otmp, xname));
dealloc_obj(otmp);
}