-/* NetHack 3.6 extern.h $NHDT-Date: 1454485430 2016/02/03 07:43:50 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.545 $ */
+/* NetHack 3.6 extern.h $NHDT-Date: 1455672983 2016/02/17 01:36:23 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.548 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
/* ### pager.c ### */
E char *FDECL(self_lookat, (char *));
+E void FDECL(mhidden_description, (struct monst *, BOOLEAN_P, char *));
E boolean FDECL(object_from_map, (int,int,int,struct obj **));
+E int FDECL(do_screen_description, (coord, BOOLEAN_P, int, char *,
+ const char **));
+E int FDECL(do_look, (int, coord *));
E int NDECL(dowhatis);
E int NDECL(doquickwhatis);
E int NDECL(doidtrap);
E char *FDECL(dowhatdoes_core, (CHAR_P, char *));
E int NDECL(dohelp);
E int NDECL(dohistory);
-E int FDECL(do_screen_description,
- (coord, BOOLEAN_P, int, char *, const char **));
-E int FDECL(do_look, (int, coord *));
/* ### pcmain.c ### */
-/* NetHack 3.6 objnam.c $NHDT-Date: 1452043772 2016/01/06 01:29:32 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.163 $ */
+/* NetHack 3.6 objnam.c $NHDT-Date: 1455672990 2016/02/17 01:36:30 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.165 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
mimic_obj_name(mtmp)
struct monst *mtmp;
{
- if (mtmp->m_ap_type == M_AP_OBJECT
- && mtmp->mappearance != STRANGE_OBJECT) {
- int idx = objects[mtmp->mappearance].oc_descr_idx;
+ if (mtmp->m_ap_type == M_AP_OBJECT) {
if (mtmp->mappearance == GOLD_PIECE)
return "gold";
- return obj_descr[idx].oc_name;
+ if (mtmp->mappearance != STRANGE_OBJECT)
+ return simple_typename(mtmp->mappearance);
}
return "whatcha-may-callit";
}
-/* NetHack 3.6 pager.c $NHDT-Date: 1448482543 2015/11/25 20:15:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.86 $ */
+/* NetHack 3.6 pager.c $NHDT-Date: 1455672994 2016/02/17 01:36:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.92 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
return outbuf;
}
+/* describe a hidden monster; used for look_at during extended monster
+ detection and for probing */
+void
+mhidden_description(mon, altmon, outbuf)
+struct monst *mon;
+boolean altmon; /* for probing: if mimicking a monster, say so */
+char *outbuf;
+{
+ struct obj *otmp;
+ boolean fakeobj;
+ int x = mon->mx, y = mon->my, glyph = levl[x][y].glyph;
+
+ *outbuf = '\0';
+ if (mon->m_ap_type == M_AP_FURNITURE
+ || mon->m_ap_type == M_AP_OBJECT) {
+ Strcpy(outbuf, ", mimicking ");
+ if (mon->m_ap_type == M_AP_FURNITURE) {
+ Strcat(outbuf, an(defsyms[mon->mappearance].explanation));
+ } else if (mon->m_ap_type == M_AP_OBJECT
+ /* remembered glyph, not glyph_at() which is 'mon' */
+ && glyph_is_object(glyph)) {
+ objfrommap:
+ otmp = (struct obj *) 0;
+ fakeobj = object_from_map(glyph, x, y, &otmp);
+ Strcat(outbuf, (otmp && otmp->otyp != STRANGE_OBJECT)
+ ? ansimpleoname(otmp)
+ : an(obj_descr[STRANGE_OBJECT].oc_name));
+ if (fakeobj)
+ dealloc_obj(otmp);
+ } else if (mon->m_ap_type == M_AP_MONSTER && altmon) {
+ Strcat(outbuf, an(mons[mon->mappearance].mname));
+ } else {
+ Strcat(outbuf, something);
+ }
+ } else if (mon->mundetected) {
+ Strcpy(outbuf, ", hiding");
+ if (hides_under(mon->data)) {
+ Strcat(outbuf, " under ");
+ /* remembered glyph, not glyph_at() which is 'mon' */
+ if (glyph_is_object(glyph))
+ goto objfrommap;
+ Strcat(outbuf, something);
+ } else if (is_hider(mon->data)) {
+ Sprintf(eos(outbuf), " on the %s",
+ (is_flyer(mon->data) || mon->data->mlet == S_PIERCER)
+ ? "ceiling"
+ : surface(x, y)); /* trapper */
+ } else {
+ if (mon->data->mlet == S_EEL && is_pool(x, y))
+ Strcat(outbuf, " in murky water");
+ }
+ }
+}
+
/* extracted from lookat(); also used by namefloorobj() */
boolean
object_from_map(glyph, x, y, obj_p)
char *name, monnambuf[BUFSZ];
boolean accurate = !Hallucination;
- if (mtmp->data == &mons[PM_COYOTE] && accurate)
- name = coyotename(mtmp, monnambuf);
- else
- name = distant_monnam(mtmp, ARTICLE_NONE, monnambuf);
-
+ name = (mtmp->data == &mons[PM_COYOTE] && accurate)
+ ? coyotename(mtmp, monnambuf)
+ : distant_monnam(mtmp, ARTICLE_NONE, monnambuf);
Sprintf(buf, "%s%s%s",
(mtmp->mx != x || mtmp->my != y)
? ((mtmp->isshk && accurate) ? "tail of " : "tail of a ")
an(defsyms[trap_to_defsym(tt)].explanation));
}
+ /* we know the hero sees a monster at this location, but if it's shown
+ due to persistant monster detection he might remember something else */
+ if (mtmp->mundetected || mtmp->m_ap_type)
+ mhidden_description(mtmp, FALSE, eos(buf));
+
if (monbuf) {
unsigned how_seen = howmonseen(mtmp);
impossible("can't read 'data' file");
(void) dlb_fclose(fp);
return;
- } else if (sscanf(buf, "%8lx\n", &txt_offset) < 1 || txt_offset == 0L)
+ } else if (sscanf(buf, "%8lx\n", &txt_offset) < 1
+ || txt_offset == 0L)
goto bad_data_file;
/* look for the appropriate entry */
-/* NetHack 3.6 pline.c $NHDT-Date: 1432512770 2015/05/25 00:12:50 $ $NHDT-Branch: master $:$NHDT-Revision: 1.42 $ */
+/* NetHack 3.6 pline.c $NHDT-Date: 1455672995 2016/02/17 01:36:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.48 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
Strcat(info, ", eating");
/* a stethoscope exposes mimic before getting here so this
won't be relevant for it, but wand of probing doesn't */
- if (mtmp->m_ap_type)
- Sprintf(eos(info), ", mimicking %s",
- (mtmp->m_ap_type == M_AP_FURNITURE)
- ? an(defsyms[mtmp->mappearance].explanation)
- : (mtmp->m_ap_type == M_AP_OBJECT)
- ? ((mtmp->mappearance == GOLD_PIECE)
- ? "gold"
- : an(simple_typename(mtmp->mappearance)))
- : (mtmp->m_ap_type == M_AP_MONSTER)
- ? an(mons[mtmp->mappearance].mname)
- : something); /* impossible... */
+ if (mtmp->mundetected || mtmp->m_ap_type)
+ mhidden_description(mtmp, TRUE, eos(info));
if (mtmp->mcan)
Strcat(info, ", cancelled");
if (mtmp->mconf)
Strcat(info, mtmp->mspeed == MFAST ? ", fast" : mtmp->mspeed == MSLOW
? ", slow"
: ", ???? speed");
- if (mtmp->mundetected)
- Strcat(info, ", concealed");
if (mtmp->minvis)
Strcat(info, ", invisible");
if (mtmp == u.ustuck)