diff -Nbaur nethack-3.4.0/include/display.h nethack-statue/include/display.h --- nethack-3.4.0/include/display.h Thu Mar 21 10:42:44 2002 +++ nethack-statue/include/display.h Tue Sep 17 11:55:04 2002 @@ -270,7 +270,8 @@ #define GLYPH_INVIS_OFF (NUMMONS + GLYPH_PET_OFF) #define GLYPH_DETECT_OFF (1 + GLYPH_INVIS_OFF) #define GLYPH_BODY_OFF (NUMMONS + GLYPH_DETECT_OFF) -#define GLYPH_RIDDEN_OFF (NUMMONS + GLYPH_BODY_OFF) +#define GLYPH_STATUE_OFF (NUMMONS + GLYPH_BODY_OFF) +#define GLYPH_RIDDEN_OFF (NUMMONS + GLYPH_STATUE_OFF) #define GLYPH_OBJ_OFF (NUMMONS + GLYPH_RIDDEN_OFF) #define GLYPH_CMAP_OFF (NUM_OBJECTS + GLYPH_OBJ_OFF) #define GLYPH_EXPLODE_OFF ((MAXPCHARS - MAXEXPCHARS) + GLYPH_CMAP_OFF) @@ -291,14 +292,27 @@ /* This has the unfortunate side effect of needing a global variable */ /* to store a result. 'otg_temp' is defined and declared in decl.{ch}. */ -#define obj_to_glyph(obj) \ - (Hallucination ? \ +#define random_obj_to_glyph() \ ((otg_temp = random_object()) == CORPSE ? \ random_monster() + GLYPH_BODY_OFF : \ - otg_temp + GLYPH_OBJ_OFF) : \ - ((obj)->otyp == CORPSE ? \ + otg_temp + GLYPH_OBJ_OFF) + +#define obj_to_glyph(obj) \ + ((obj)->otyp == STATUE ? \ + statue_to_glyph(obj) : \ + Hallucination ? \ + random_obj_to_glyph() : \ + (obj)->otyp == CORPSE ? \ (int) (obj)->corpsenm + GLYPH_BODY_OFF : \ - (int) (obj)->otyp + GLYPH_OBJ_OFF)) + (int) (obj)->otyp + GLYPH_OBJ_OFF) + +/* MRKR: Statues now have glyphs corresponding to the monster they */ +/* brepresent and look like monsters when you are hallucinating. */ + +#define statue_to_glyph(obj) \ + (Hallucination ? \ + random_monster() + GLYPH_MON_OFF : \ + (int) (obj)->corpsenm + GLYPH_STATUE_OFF) #define cmap_to_glyph(cmap_idx) ((int) (cmap_idx) + GLYPH_CMAP_OFF) #define explosion_to_glyph(expltype,idx) \ @@ -308,6 +322,7 @@ cmap_to_glyph(trap_to_defsym(what_trap((trap)->ttyp))) /* Not affected by hallucination. Gives a generic body for CORPSE */ +/* MRKR: ...and the generic statue */ #define objnum_to_glyph(onum) ((int) (onum) + GLYPH_OBJ_OFF) #define monnum_to_glyph(mnum) ((int) (mnum) + GLYPH_MON_OFF) #define detected_monnum_to_glyph(mnum) ((int) (mnum) + GLYPH_DETECT_OFF) @@ -337,9 +352,11 @@ glyph_is_pet(glyph) ? ((glyph)-GLYPH_PET_OFF) : \ glyph_is_detected_monster(glyph) ? ((glyph)-GLYPH_DETECT_OFF) : \ glyph_is_ridden_monster(glyph) ? ((glyph)-GLYPH_RIDDEN_OFF) : \ + glyph_is_statue(glyph) ? ((glyph)-GLYPH_STATUE_OFF) : \ NO_GLYPH) #define glyph_to_obj(glyph) \ (glyph_is_body(glyph) ? CORPSE : \ + glyph_is_statue(glyph) ? STATUE : \ glyph_is_normal_object(glyph) ? ((glyph)-GLYPH_OBJ_OFF) : \ NO_GLYPH) #define glyph_to_trap(glyph) \ @@ -371,6 +388,8 @@ ((glyph) >= GLYPH_PET_OFF && (glyph) < (GLYPH_PET_OFF+NUMMONS)) #define glyph_is_body(glyph) \ ((glyph) >= GLYPH_BODY_OFF && (glyph) < (GLYPH_BODY_OFF+NUMMONS)) +#define glyph_is_statue(glyph) \ + ((glyph) >= GLYPH_STATUE_OFF && (glyph) < (GLYPH_STATUE_OFF+NUMMONS)) #define glyph_is_ridden_monster(glyph) \ ((glyph) >= GLYPH_RIDDEN_OFF && (glyph) < (GLYPH_RIDDEN_OFF+NUMMONS)) #define glyph_is_detected_monster(glyph) \ @@ -380,6 +399,7 @@ ((glyph) >= GLYPH_OBJ_OFF && (glyph) < (GLYPH_OBJ_OFF+NUM_OBJECTS)) #define glyph_is_object(glyph) \ (glyph_is_normal_object(glyph) \ + || glyph_is_statue(glyph) \ || glyph_is_body(glyph)) #define glyph_is_trap(glyph) \ ((glyph) >= (GLYPH_CMAP_OFF+trap_to_defsym(1)) && \ diff -Nbaur nethack-3.4.0/include/hack.h nethack-statue/include/hack.h --- nethack-3.4.0/include/hack.h Thu Mar 21 10:42:47 2002 +++ nethack-statue/include/hack.h Tue Sep 17 11:55:04 2002 @@ -53,6 +53,7 @@ #define MG_DETECT 0x04 #define MG_PET 0x08 #define MG_RIDDEN 0x10 +#define MG_STATUE 0x20 /* sellobj_state() states */ #define SELL_NORMAL (0) diff -Nbaur nethack-3.4.0/src/display.c nethack-statue/src/display.c --- nethack-3.4.0/src/display.c Wed Jul 17 13:15:52 2002 +++ nethack-statue/src/display.c Tue Sep 17 11:55:04 2002 @@ -254,8 +254,18 @@ register int x = obj->ox, y = obj->oy; register int glyph = obj_to_glyph(obj); - if (level.flags.hero_memory) + if (level.flags.hero_memory) { + + /* MRKR: While hallucinating, statues are seen as random monsters */ + /* but remembered as random objects. */ + + if (Hallucination && obj->otyp == STATUE) { + levl[x][y].glyph = random_obj_to_glyph(); + } + else { levl[x][y].glyph = glyph; + } + } if (show) show_glyph(x, y, glyph); } diff -Nbaur nethack-3.4.0/src/mapglyph.c nethack-statue/src/mapglyph.c --- nethack-3.4.0/src/mapglyph.c Wed Jul 17 13:15:52 2002 +++ nethack-statue/src/mapglyph.c Tue Sep 17 11:55:04 2002 @@ -145,6 +145,15 @@ #endif mon_color(offset); special |= MG_RIDDEN; + } else if ((offset = (glyph - GLYPH_STATUE_OFF)) >= 0) { /* a statue */ + ch = monsyms[(int)mons[offset].mlet]; +#ifdef ROGUE_COLOR + if (HAS_ROGUE_IBM_GRAPHICS && iflags.use_color) + color = CLR_RED; + else +#endif + obj_color(STATUE); + special |= MG_STATUE; } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) { /* a corpse */ ch = oc_syms[(int)objects[CORPSE].oc_class]; #ifdef ROGUE_COLOR diff -Nbaur nethack-3.4.0/src/pager.c nethack-statue/src/pager.c --- nethack-3.4.0/src/pager.c Wed Jul 17 13:15:52 2002 +++ nethack-statue/src/pager.c Tue Sep 17 11:55:04 2002 @@ -493,6 +493,8 @@ sym = showsyms[glyph_to_cmap(glyph)]; } else if (glyph_is_trap(glyph)) { sym = showsyms[trap_to_defsym(glyph_to_trap(glyph))]; + } else if (glyph_is_statue(glyph)) { + sym = monsyms[(int)mons[glyph_to_mon(glyph)].mlet]; } else if (glyph_is_object(glyph)) { sym = oc_syms[(int)objects[glyph_to_obj(glyph)].oc_class]; if (sym == '`' && iflags.bouldersym && (int)glyph_to_obj(glyph) == BOULDER) diff -Nbaur nethack-3.4.0/src/sounds.c nethack-statue/src/sounds.c --- nethack-3.4.0/src/sounds.c Wed Jul 17 13:15:52 2002 +++ nethack-statue/src/sounds.c Tue Sep 17 13:16:03 2002 @@ -888,6 +888,23 @@ tx = u.ux+u.dx; ty = u.uy+u.dy; mtmp = m_at(tx, ty); + if ((!mtmp || mtmp->mundetected) && + (otmp = vobj_at(tx, ty)) && otmp->otyp == STATUE) { + + /* Talking to a statue */ + + if (!Blind) { + if (Hallucination) { + /* if you're hallucinating, you can't tell it's a statue */ + pline_The("%s seems not to notice you.", rndmonnam()); + } + else { + pline_The("statue seems not to notice you."); + } + } + return(0); + } + if (!mtmp || mtmp->mundetected || mtmp->m_ap_type == M_AP_FURNITURE || mtmp->m_ap_type == M_AP_OBJECT) diff -Nbaur nethack-3.4.0/src/trap.c nethack-statue/src/trap.c --- nethack-3.4.0/src/trap.c Wed Jul 17 13:15:52 2002 +++ nethack-statue/src/trap.c Wed Sep 18 13:43:36 2002 @@ -442,8 +442,11 @@ /* mimic statue becomes seen mimic; other hiders won't be hidden */ if (mon->m_ap_type) seemimic(mon); else mon->mundetected = FALSE; + if ((x == u.ux && y == u.uy) || cause == ANIMATE_SPELL) pline_The("statue comes to life!"); + else if (Hallucination) /* They don't know it's a statue. */ + pline_The("%s suddenly seems more animated.", rndmonnam()); else if (cause == ANIMATE_SHATTER) pline("Instead of shattering, the statue suddenly comes alive!"); else /* cause == ANIMATE_NORMAL */ diff -Nbaur nethack-3.4.0/src/zap.c nethack-statue/src/zap.c --- nethack-3.4.0/src/zap.c Wed Jul 17 13:15:52 2002 +++ nethack-statue/src/zap.c Wed Sep 18 13:42:32 2002 @@ -1520,21 +1520,48 @@ if (res) makeknown(WAN_PROBING); break; case WAN_STRIKING: - case SPE_FORCE_BOLT: - if (obj->otyp == BOULDER) + case SPE_FORCE_BOLT: { + boolean seen_it = FALSE; + + if (obj->otyp == BOULDER) { + if (cansee(obj->ox, obj->oy)) { + pline_The("boulder falls apart."); + seen_it = TRUE; + } + else { + You_hear("a crumbling sound."); + } fracture_rock(obj); - else if (obj->otyp == STATUE) - (void) break_statue(obj); + } + else if (obj->otyp == STATUE) { + if (break_statue(obj)) { + if (cansee(obj->ox, obj->oy)) { + if (Hallucination) { + pline_The("%s shatters.", rndmonnam()); + } + else { + pline_The("statue shatters."); + } + seen_it = TRUE; + } + else { + You_hear("a crumbling sound."); + } + } + } else { if (!flags.mon_moving) - (void)hero_breaks(obj, obj->ox, obj->oy, FALSE); + seen_it = hero_breaks(obj, obj->ox, + obj->oy, FALSE); else - (void)breaks(obj, obj->ox, obj->oy); + seen_it = breaks(obj, obj->ox, obj->oy); res = 0; } - /* BUG[?]: shouldn't this depend upon you seeing it happen? */ + if (seen_it) { makeknown(otmp->otyp); + } break; + } case WAN_CANCELLATION: case SPE_CANCELLATION: cancel_item(obj);