diff -I 3.4.3 -I BUILD -w -r -u5 nethack-3.4.3/include/display.h nethack-3.4.3.1/include/display.h --- nethack-3.4.3/include/display.h 2003-12-07 18:39:13.000000000 -0500 +++ nethack-3.4.3.1/include/display.h 2003-12-19 18:45:17.477061000 -0500 @@ -270,11 +270,12 @@ #define GLYPH_CMAP_OFF (NUM_OBJECTS + GLYPH_OBJ_OFF) #define GLYPH_EXPLODE_OFF ((MAXPCHARS - MAXEXPCHARS) + GLYPH_CMAP_OFF) #define GLYPH_ZAP_OFF ((MAXEXPCHARS * EXPL_MAX) + GLYPH_EXPLODE_OFF) #define GLYPH_SWALLOW_OFF ((NUM_ZAP << 2) + GLYPH_ZAP_OFF) #define GLYPH_WARNING_OFF ((NUMMONS << 3) + GLYPH_SWALLOW_OFF) -#define MAX_GLYPH (WARNCOUNT + GLYPH_WARNING_OFF) +#define GLYPH_STATUE_OFF (WARNCOUNT + GLYPH_WARNING_OFF) +#define MAX_GLYPH (NUMMONS + GLYPH_STATUE_OFF) #define NO_GLYPH MAX_GLYPH #define GLYPH_INVISIBLE GLYPH_INVIS_OFF @@ -284,27 +285,52 @@ #define ridden_mon_to_glyph(mon) ((int) what_mon(monsndx((mon)->data))+GLYPH_RIDDEN_OFF) #define pet_to_glyph(mon) ((int) what_mon(monsndx((mon)->data))+GLYPH_PET_OFF) /* 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 random_obj_to_glyph() \ + ((otg_temp = random_object()) == CORPSE ? \ + random_monster() + GLYPH_BODY_OFF : \ + 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) + + +#define obj_to_glyph_vanilla(obj) \ (Hallucination ? \ ((otg_temp = random_object()) == CORPSE ? \ random_monster() + GLYPH_BODY_OFF : \ otg_temp + GLYPH_OBJ_OFF) : \ ((obj)->otyp == CORPSE ? \ (int) (obj)->corpsenm + GLYPH_BODY_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) \ ((((expltype) * MAXEXPCHARS) + ((idx) - S_explode1)) + GLYPH_EXPLODE_OFF) #define trap_to_glyph(trap) \ 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) #define ridden_monnum_to_glyph(mnum) ((int) (mnum) + GLYPH_RIDDEN_OFF) #define petnum_to_glyph(mnum) ((int) (mnum) + GLYPH_PET_OFF) @@ -332,13 +358,15 @@ #define glyph_to_mon(glyph) \ (glyph_is_normal_monster(glyph) ? ((glyph)-GLYPH_MON_OFF) : \ 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) \ (glyph_is_trap(glyph) ? \ ((int) defsym_to_trap((glyph) - GLYPH_CMAP_OFF)) : \ @@ -366,19 +394,26 @@ ((glyph) >= GLYPH_MON_OFF && (glyph) < (GLYPH_MON_OFF+NUMMONS)) #define glyph_is_pet(glyph) \ ((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_STATUE_VANILLA ((int) GLYPH_OBJ_OFF + STATUE) +#define glyph_is_statue_vanilla(glyph) ( glyph == GLYPH_STATUE_VANILLA) + #define glyph_is_ridden_monster(glyph) \ ((glyph) >= GLYPH_RIDDEN_OFF && (glyph) < (GLYPH_RIDDEN_OFF+NUMMONS)) #define glyph_is_detected_monster(glyph) \ ((glyph) >= GLYPH_DETECT_OFF && (glyph) < (GLYPH_DETECT_OFF+NUMMONS)) #define glyph_is_invisible(glyph) ((glyph) == GLYPH_INVISIBLE) #define glyph_is_normal_object(glyph) \ ((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)) && \ (glyph) < (GLYPH_CMAP_OFF+trap_to_defsym(1)+TRAPNUM)) #define glyph_is_cmap(glyph) \ diff -I 3.4.3 -I BUILD -w -r -u5 nethack-3.4.3/include/hack.h nethack-3.4.3.1/include/hack.h --- nethack-3.4.3/include/hack.h 2003-12-07 18:39:13.000000000 -0500 +++ nethack-3.4.3.1/include/hack.h 2003-12-19 18:16:47.197062000 -0500 @@ -51,10 +51,11 @@ #define MG_CORPSE 0x01 #define MG_INVIS 0x02 #define MG_DETECT 0x04 #define MG_PET 0x08 #define MG_RIDDEN 0x10 +#define MG_STATUE 0x20 /* sellobj_state() states */ #define SELL_NORMAL (0) #define SELL_DELIBERATE (1) #define SELL_DONTSELL (2) diff -I 3.4.3 -I BUILD -w -r -u5 nethack-3.4.3/src/display.c nethack-3.4.3.1/src/display.c --- nethack-3.4.3/src/display.c 2003-12-07 18:39:13.000000000 -0500 +++ nethack-3.4.3.1/src/display.c 2003-12-19 18:16:47.367062000 -0500 @@ -252,12 +252,22 @@ register int show; { 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); } /* * map_invisible() @@ -1227,11 +1237,12 @@ /* * This assumes an ordering of the offsets. See display.h for * the definition. */ - if (glyph >= GLYPH_WARNING_OFF) { /* a warning */ + if (glyph >= GLYPH_WARNING_OFF + && glyph < GLYPH_STATUE_OFF) { /* a warning */ text = "warning"; offset = glyph - GLYPH_WARNING_OFF; } else if (glyph >= GLYPH_SWALLOW_OFF) { /* swallow border */ text = "swallow border"; offset = glyph - GLYPH_SWALLOW_OFF; } else if (glyph >= GLYPH_ZAP_OFF) { /* zap beam */ text = "zap beam"; offset = glyph - GLYPH_ZAP_OFF; diff -I 3.4.3 -I BUILD -w -r -u5 nethack-3.4.3/src/mapglyph.c nethack-3.4.3.1/src/mapglyph.c --- nethack-3.4.3/src/mapglyph.c 2003-12-07 18:39:13.000000000 -0500 +++ nethack-3.4.3.1/src/mapglyph.c 2003-12-19 18:16:47.497062000 -0500 @@ -75,11 +75,22 @@ * Map the glyph back to a character and color. * * Warning: For speed, this makes an assumption on the order of * offsets. The order is set in display.h. */ - if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */ + 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_WARNING_OFF)) >= 0) { + /* a warning flash */ ch = warnsyms[offset]; # ifdef ROGUE_COLOR if (HAS_ROGUE_IBM_GRAPHICS) color = NO_COLOR; else diff -I 3.4.3 -I BUILD -w -r -u5 nethack-3.4.3/src/pager.c nethack-3.4.3.1/src/pager.c --- nethack-3.4.3/src/pager.c 2003-12-07 18:39:13.000000000 -0500 +++ nethack-3.4.3.1/src/pager.c 2003-12-19 18:16:47.607061000 -0500 @@ -530,10 +530,12 @@ glyph = glyph_at(cc.x,cc.y); if (glyph_is_cmap(glyph)) { 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) sym = iflags.bouldersym; } else if (glyph_is_monster(glyph)) { diff -I 3.4.3 -I BUILD -w -r -u5 nethack-3.4.3/src/restore.c nethack-3.4.3.1/src/restore.c --- nethack-3.4.3/src/restore.c 2003-12-07 18:39:13.000000000 -0500 +++ nethack-3.4.3.1/src/restore.c 2003-12-19 18:44:17.137062000 -0500 @@ -56,10 +56,12 @@ extern int amii_numcolors; #endif #include "quest.h" +#include "display.h" + boolean restoring = FALSE; static NEARDATA struct fruit *oldfruit; static NEARDATA long omoves; #define Is_IceBox(o) ((o)->otyp == ICE_BOX ? TRUE : FALSE) @@ -91,10 +93,19 @@ /* Set level.objects (as well as reversing the chain back again) */ while ((otmp = fobjtmp) != 0) { fobjtmp = otmp->nobj; place_object(otmp, otmp->ox, otmp->oy); } + + /* statue patch: imagine we're loading a vanilla nh file */ + for(x=0; xotyp == STATUE && + glyph_is_statue_vanilla(levl[x][y].glyph)) { + levl[x][y].glyph = obj_to_glyph(level.objects[x][y]); + } } /* Things that were marked "in_use" when the game was saved (ex. via the * infamous "HUP" cheat) get used up here. */ diff -I 3.4.3 -I BUILD -w -r -u5 nethack-3.4.3/src/save.c nethack-3.4.3.1/src/save.c --- nethack-3.4.3/src/save.c 2003-12-07 18:39:13.000000000 -0500 +++ nethack-3.4.3.1/src/save.c 2003-12-19 19:02:12.827062000 -0500 @@ -46,10 +46,27 @@ #define HUP if (!program_state.done_hup) #else #define HUP #endif + +/* compute object glyphs for vanilla nethack -- statue patch */ +void +make_glyphs_vanilla(lev) +xchar lev; +{ + int x,y; + + for (x = 0; x < COLNO; x++) + for (y = 0; y < ROWNO; y++) + if ( level.objects[x][y] != 0 && + level.objects[x][y]->otyp == STATUE && + glyph_is_statue(levl[x][y].glyph)) + levl[x][y].glyph = obj_to_glyph_vanilla(level.objects[x][y]); +} + + /* need to preserve these during save to avoid accessing freed memory */ static unsigned ustuck_id = 0, usteed_id = 0; int dosave() @@ -440,10 +457,13 @@ { #ifdef TOS short tlev; #endif + /* make remembered glyphs correct fo rloading into vanilla nh */ + make_glyphs_vanilla(lev); + /* if we're tearing down the current level without saving anything (which happens upon entrance to the endgame or after an aborted restore attempt) then we don't want to do any actual I/O */ if (mode == FREE_SAVE) goto skip_lots; if (iflags.purge_monsters) { diff -I 3.4.3 -I BUILD -w -r -u5 nethack-3.4.3/src/sounds.c nethack-3.4.3.1/src/sounds.c --- nethack-3.4.3/src/sounds.c 2003-12-07 18:39:13.000000000 -0500 +++ nethack-3.4.3.1/src/sounds.c 2003-12-19 18:16:48.157061000 -0500 @@ -897,10 +897,27 @@ } 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) return(0); diff -I 3.4.3 -I BUILD -w -r -u5 nethack-3.4.3/src/trap.c nethack-3.4.3.1/src/trap.c --- nethack-3.4.3/src/trap.c 2003-12-07 18:39:13.000000000 -0500 +++ nethack-3.4.3.1/src/trap.c 2003-12-19 18:20:12.077061000 -0500 @@ -495,11 +495,13 @@ canspotmon(mon) ? comes_to_life : "disappears"); if (historic) { You_feel("guilty that the historic statue is now gone."); adjalign(-1); } - } else if (cause == ANIMATE_SHATTER) + } 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 %s!", canspotmon(mon) ? "comes to life" : "disappears"); else { /* cause == ANIMATE_NORMAL */ You("find %s posing as a statue.", canspotmon(mon) ? a_monnam(mon) : something); diff -I 3.4.3 -I BUILD -w -r -u5 nethack-3.4.3/src/zap.c nethack-3.4.3.1/src/zap.c --- nethack-3.4.3/src/zap.c 2003-12-07 18:39:13.000000000 -0500 +++ nethack-3.4.3.1/src/zap.c 2003-12-19 18:16:48.667064000 -0500 @@ -1538,25 +1538,52 @@ res = 1; } 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); #ifdef TEXTCOLOR newsym(obj->ox,obj->oy); /* might change color */ diff -I 3.4.3 -I BUILD -w -r -u5 nethack-3.4.3/win/share/tilemap.c nethack-3.4.3.1/win/share/tilemap.c --- nethack-3.4.3/win/share/tilemap.c 2003-12-07 18:39:14.000000000 -0500 +++ nethack-3.4.3.1/win/share/tilemap.c 2003-12-19 19:37:00.477394000 -0500 @@ -393,10 +393,16 @@ for (i = 0; i < WARNCOUNT; i++) { tilemap[GLYPH_WARNING_OFF+i] = tilenum; tilenum++; } + /* statue patch: statues still use the same glyph as in vanilla */ + + for ( i = 0; i < NUMMONS; i++) { + tilemap[GLYPH_STATUE_OFF+i] = tilemap[GLYPH_OBJ_OFF+STATUE]; + } + lastothtile = tilenum - 1; } const char *prolog[] = { "",