diff -c -r sl_6e4f6/include/config.h sl_dex/include/config.h *** sl_6e4f6/include/config.h Fri Nov 30 05:28:32 2001 --- sl_dex/include/config.h Sat Dec 1 12:43:44 2001 *************** *** 404,409 **** --- 404,413 ---- /* Originally added by zaga. */ #define OTHER_SERVICES /* shopkeeper services */ + #define DUMP_LOG + + #define SHOW_EXTINCT + /* #define SHOUT */ /* JRN -- shouting and petcommands - not implemented */ /* #define DEVEL_BRANCH */ /* Include development code */ diff -c -r sl_6e4f6/include/decl.h sl_dex/include/decl.h *** sl_6e4f6/include/decl.h Fri Nov 30 05:27:48 2001 --- sl_dex/include/decl.h Sat Dec 1 12:43:44 2001 *************** *** 192,197 **** --- 192,198 ---- E const char *configfile; E NEARDATA char plname[PL_NSIZ]; E NEARDATA char dogname[]; + E NEARDATA char dump_fn[]; E NEARDATA char catname[]; E NEARDATA char ghoulname[]; E NEARDATA char horsename[]; diff -c -r sl_6e4f6/include/extern.h sl_dex/include/extern.h *** sl_6e4f6/include/extern.h Fri Nov 30 05:27:48 2001 --- sl_dex/include/extern.h Wed Dec 26 23:09:28 2001 *************** *** 138,143 **** --- 138,145 ---- E int FDECL(describe_level, (char *)); E const char *FDECL(rank_of, (int,SHORT_P,BOOLEAN_P)); E void NDECL(bot); + E void FDECL(bot1str, (char *)); + E void FDECL(bot2str, (char *)); #if 0 E const char * FDECL(shorten_bot1, (const char *, int)); #endif *************** *** 181,187 **** --- 183,191 ---- E int NDECL(doextlist); E int NDECL(extcmd_via_menu); E void FDECL(enlightenment, (int)); + E void FDECL(do_enlightenment, (int, BOOLEAN_P)); E void FDECL(show_conduct, (int)); + E void FDECL(do_show_conduct, (int, BOOLEAN_P, BOOLEAN_P)); E int FDECL(xytod, (SCHAR_P,SCHAR_P)); E void FDECL(dtoxy, (coord *,int)); E int FDECL(movecmd, (CHAR_P)); *************** *** 294,299 **** --- 298,304 ---- E void FDECL(row_refresh, (int,int,int)); E void NDECL(cls); E void FDECL(flush_screen, (int)); + E void NDECL(dump_screen); E int FDECL(back_to_glyph, (XCHAR_P,XCHAR_P)); E int FDECL(zapdir_to_glyph, (int,int,int)); E int FDECL(glyph_at, (XCHAR_P,XCHAR_P)); *************** *** 557,562 **** --- 562,568 ---- E void FDECL(done1, (int)); E int NDECL(done2); + E int NDECL(dodump); #ifdef USE_TRAMPOLI E void FDECL(done_intr, (int)); #endif *************** *** 566,571 **** --- 572,578 ---- #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) E void FDECL(done, (int)); E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P)); + E void FDECL(do_container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P, BOOLEAN_P)); E void FDECL(terminate, (int)); E int NDECL(num_genocides); /* KMH, ethics */ *************** *** 804,809 **** --- 811,817 ---- E char *FDECL(xprname, (struct obj *,const char *,CHAR_P,BOOLEAN_P,long)); E int NDECL(ddoinv); E char FDECL(display_inventory, (const char *,BOOLEAN_P)); + E char FDECL(do_display_inventory, (const char *,BOOLEAN_P,BOOLEAN_P, BOOLEAN_P)); E int FDECL(display_binventory, (int,int,BOOLEAN_P)); E struct obj *FDECL(display_cinventory,(struct obj *)); E struct obj *FDECL(display_minventory,(struct monst *,int)); *************** *** 1481,1486 **** --- 1489,1495 ---- E void VDECL(impossible, (const char *,...)) PRINTF_F(1,2); E const char *FDECL(align_str, (ALIGNTYP_P)); E void FDECL(mstatusline, (struct monst *)); + E void FDECL(createmstatusline, (struct monst *, char *)); E void NDECL(ustatusline); E void NDECL(self_invis_message); *************** *** 2221,2226 **** --- 2230,2238 ---- E int FDECL(mon_wield_item, (struct monst *)); E int NDECL(abon); E int NDECL(dbon); + #ifdef DUMP_LOG + E int NDECL(dump_weapon_skill); + #endif E int NDECL(enhance_weapon_skill); E void FDECL(unrestrict_weapon_skill, (int)); E void FDECL(use_skill, (int,int)); diff -c -r sl_6e4f6/src/botl.c sl_dex/src/botl.c *** sl_6e4f6/src/botl.c Fri Nov 30 05:27:54 2001 --- sl_dex/src/botl.c Wed Dec 26 20:06:02 2001 *************** *** 193,202 **** } #endif ! STATIC_OVL void ! bot1() { - char newbot1[MAXCO]; register char *nb; register int i,j; --- 193,201 ---- } #endif ! void bot1str(newbot1) ! char* newbot1; { register char *nb; register int i,j; *************** *** 244,249 **** --- 243,257 ---- if (flags.showscore) Sprintf(nb = eos(nb), " S:%ld", botl_score()); #endif + } + + STATIC_OVL void + bot1() + { + char newbot1[MAXCO]; + + bot1str(newbot1); + curs(WIN_STATUS, 1, 0); putstr(WIN_STATUS, 0, newbot1); } *************** *** 290,296 **** static int bot2_abbrev = 0; /* Line 2 abbreviation level (max 4) */ ! STATIC_OVL void bot2str(char *newbot2) { register char *nb; --- 298,304 ---- static int bot2_abbrev = 0; /* Line 2 abbreviation level (max 4) */ ! void bot2str(char *newbot2) { register char *nb; diff -c -r sl_6e4f6/src/cmd.c sl_dex/src/cmd.c *** sl_6e4f6/src/cmd.c Fri Nov 30 05:27:54 2001 --- sl_dex/src/cmd.c Wed Dec 26 20:17:44 2001 *************** *** 69,74 **** --- 69,75 ---- extern int NDECL(dowhatis); /**/ extern int NDECL(doquickwhatis); /**/ extern int NDECL(dowhatdoes); /**/ + extern int NDECL(dodump); extern int NDECL(dohelp); /**/ extern int NDECL(dohistory); /**/ extern int NDECL(doloot); /**/ *************** *** 152,158 **** static NEARDATA struct rm *maploc; #ifdef OVLB ! STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *)); #ifdef UNIX static void NDECL(end_of_input); #endif --- 153,159 ---- static NEARDATA struct rm *maploc; #ifdef OVLB ! STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *, BOOLEAN_P, BOOLEAN_P)); #ifdef UNIX static void NDECL(end_of_input); #endif *************** *** 522,528 **** return 0; } - STATIC_PTR int playersteal() { --- 523,528 ---- *************** *** 1070,1076 **** *have_never = "have never ", *never = "never "; #define enl_msg(prefix,present,past,suffix) \ ! enlght_line(prefix, final ? past : present, suffix) #define you_are(attr) enl_msg(You_,are,were,attr) #define you_have(attr) enl_msg(You_,have,had,attr) #define you_can(attr) enl_msg(You_,can,could,attr) --- 1070,1076 ---- *have_never = "have never ", *never = "never "; #define enl_msg(prefix,present,past,suffix) \ ! enlght_line(prefix, final ? past : present, suffix, want_dump, silent) #define you_are(attr) enl_msg(You_,are,were,attr) #define you_have(attr) enl_msg(You_,have,had,attr) #define you_can(attr) enl_msg(You_,can,could,attr) *************** *** 1079,1107 **** #define you_have_X(something) enl_msg(You_,have,(const char *)"",something) static void ! enlght_line(start, middle, end) const char *start, *middle, *end; { char buf[BUFSZ]; Sprintf(buf, "%s%s%s.", start, middle, end); ! putstr(en_win, 0, buf); } /* KMH, intrinsic patch -- several of these are updated */ void ! enlightenment(final) int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */ { int ltmp; char buf[BUFSZ]; en_win = create_nhwindow(NHW_MENU); putstr(en_win, 0, final ? "Final Attributes:" : "Current Attributes:"); putstr(en_win, 0, ""); #ifdef ELBERETH if (u.uevent.uhand_of_elbereth) { static const char *hofe_titles[3] = { --- 1079,1124 ---- #define you_have_X(something) enl_msg(You_,have,(const char *)"",something) static void ! enlght_line(start, middle, end, want_dump, silent) const char *start, *middle, *end; + boolean want_dump, silent; { char buf[BUFSZ]; Sprintf(buf, "%s%s%s.", start, middle, end); ! if (!silent) ! putstr(en_win, 0, buf); ! if (want_dump) ! dump(" ", buf); } + void + enlightenment(final) + int final; + { + do_enlightenment(final, FALSE); + } /* KMH, intrinsic patch -- several of these are updated */ void ! do_enlightenment(final, want_dump) int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */ + boolean want_dump; { int ltmp; char buf[BUFSZ]; + /* D: silent is used by the enl_msg macro, so we must define it, + * even though enlightenment is never silent */ + boolean silent = FALSE; en_win = create_nhwindow(NHW_MENU); putstr(en_win, 0, final ? "Final Attributes:" : "Current Attributes:"); putstr(en_win, 0, ""); + if (want_dump) /* This one's safe: final>1 <==> want_dump==TRUE */ + dump("", "Final attributes"); + #ifdef ELBERETH if (u.uevent.uhand_of_elbereth) { static const char *hofe_titles[3] = { *************** *** 1175,1180 **** --- 1192,1198 ---- } if (Sleeping) enl_msg("You ", "fall", "fell", " asleep"); if (Hunger) enl_msg("You hunger", "", "ed", " rapidly"); + /* D: Removed dump encumbrance info - statusline has that */ /*** Vision and senses ***/ if (See_invisible) enl_msg(You_, "see", "saw", " invisible"); *************** *** 1400,1405 **** --- 1418,1424 ---- display_nhwindow(en_win, TRUE); destroy_nhwindow(en_win); + if (want_dump) dump("", ""); return; } *************** *** 1714,1726 **** show_conduct(final) int final; { char buf[BUFSZ]; int ngenocided; /* Create the conduct window */ ! en_win = create_nhwindow(NHW_MENU); ! putstr(en_win, 0, "Voluntary challenges:"); ! putstr(en_win, 0, ""); if (!u.uconduct.food) enl_msg(You_, "have gone", "went", " without food"); --- 1733,1758 ---- show_conduct(final) int final; { + do_show_conduct(final, FALSE, FALSE); + } + + void + do_show_conduct(final, want_dump, silent) + int final; + boolean want_dump, silent; + { char buf[BUFSZ]; int ngenocided; /* Create the conduct window */ ! if (!silent) { ! en_win = create_nhwindow(NHW_MENU); ! putstr(en_win, 0, "Voluntary challenges:"); ! putstr(en_win, 0, ""); ! } ! ! if (want_dump) ! dump("", "Voluntary challenges:"); if (!u.uconduct.food) enl_msg(You_, "have gone", "went", " without food"); *************** *** 1808,1815 **** #endif /* Pop up the window and wait for a key */ ! display_nhwindow(en_win, TRUE); ! destroy_nhwindow(en_win); } #endif /* OVLB */ --- 1840,1851 ---- #endif /* Pop up the window and wait for a key */ ! if (!silent) { ! display_nhwindow(en_win, TRUE); ! destroy_nhwindow(en_win); ! } ! ! if (want_dump) dump("", ""); } #endif /* OVLB */ *************** *** 1981,1986 **** --- 2017,2023 ---- {"chat", "talk to someone", dotalk, TRUE}, /* converse? */ {"conduct", "list which challenges you have adhered to", doconduct, TRUE}, {"dip", "dip an object into something", dodip, FALSE}, + {"dump", "dump screen and other information", dodump, FALSE}, {"enhance", "advance or check weapons skills", enhance_weapon_skill, TRUE}, #if 0 diff -c -r sl_6e4f6/src/decl.c sl_dex/src/decl.c *** sl_6e4f6/src/decl.c Fri Nov 30 05:27:54 2001 --- sl_dex/src/decl.c Sat Dec 1 12:43:44 2001 *************** *** 196,201 **** --- 196,204 ---- const char *him[3] = { "him", "her", "it" }; const char *his[3] = { "his", "her", "its" }; + /* originally from end.c */ + NEARDATA char dump_fn[PL_PSIZ] = DUMMY; + /* originally from dog.c */ NEARDATA char dogname[PL_PSIZ] = DUMMY; NEARDATA char catname[PL_PSIZ] = DUMMY; diff -c -r sl_6e4f6/src/display.c sl_dex/src/display.c *** sl_6e4f6/src/display.c Fri Nov 30 05:27:54 2001 --- sl_dex/src/display.c Thu Dec 27 21:52:12 2001 *************** *** 1349,1354 **** --- 1349,1428 ---- if(flags.botl || flags.botlx) bot(); } + /* D: Added to dump screen to output file */ + STATIC_PTR uchar get_glyph_char(glyph) + int glyph; + { + uchar ch; + register int offset; + + if (glyph >= NO_GLYPH) + return ' '; + + /* + * Map the glyph back to a character. + * + * 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 */ + ch = def_warnsyms[offset].sym; + } else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) { /* swallow */ + /* see swallow_to_glyph() in display.c */ + ch = (uchar) defsyms[S_sw_tl + (offset & 0x7)].sym; + } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) { /* zap beam */ + /* see zapdir_to_glyph() in display.c */ + ch = defsyms[S_vbeam + (offset & 0x3)].sym; + } else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) { /* cmap */ + ch = defsyms[offset].sym; + } else if ((offset = (glyph - GLYPH_OBJ_OFF)) >= 0) { /* object */ + ch = def_oc_syms[(int)objects[offset].oc_class]; + } else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */ + ch = def_monsyms[(int)mons[offset].mlet]; + } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) { /* a corpse */ + ch = def_oc_syms[(int)objects[CORPSE].oc_class]; + } else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */ + ch = def_monsyms[(int)mons[offset].mlet]; + } else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) { /* invisible */ + ch = DEF_INVISIBLE; + } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) { /* a pet */ + ch = def_monsyms[(int)mons[offset].mlet]; + } else { /* a monster */ + ch = def_monsyms[(int)mons[glyph].mlet]; + } + return ch; + } + + /* Take a screen dump */ + void dump_screen() + { + register int x,y; + int lastc; + /* D: botl.c has a closer approximation to the size, but we'll go with + * this */ + char buf[300], *ptr; + + for (y = 0; y < ROWNO; y++) { + lastc = 0; + ptr = buf; + for (x = 1; x < COLNO; x++) { + uchar c = get_glyph_char(gbuf[y][x].glyph); + *ptr++ = c; + if (c != ' ') + lastc = x; + } + buf[lastc] = '\0'; + dump("", buf); + } + dump("", ""); + bot1str(buf); + dump("", buf); + bot2str(buf); + dump("", buf); + dump("", ""); + dump("", ""); + } + /* ========================================================================= */ /* diff -c -r sl_6e4f6/src/end.c sl_dex/src/end.c *** sl_6e4f6/src/end.c Fri Nov 30 05:27:56 2001 --- sl_dex/src/end.c Thu Dec 27 21:53:06 2001 *************** *** 40,47 **** STATIC_DCL void FDECL(add_artifact_score, (struct obj *)); STATIC_DCL void FDECL(display_artifact_score, (struct obj *,winid)); STATIC_DCL void FDECL(savelife, (int)); ! STATIC_DCL void NDECL(list_vanquished); ! STATIC_DCL void NDECL(list_genocided); #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2) extern void FDECL(nethack_exit,(int)); --- 40,50 ---- STATIC_DCL void FDECL(add_artifact_score, (struct obj *)); STATIC_DCL void FDECL(display_artifact_score, (struct obj *,winid)); STATIC_DCL void FDECL(savelife, (int)); ! STATIC_DCL void FDECL(list_vanquished, (BOOLEAN_P, BOOLEAN_P)); ! STATIC_DCL void FDECL(list_genocided, (BOOLEAN_P, BOOLEAN_P)); ! #ifdef SHOW_EXTINCT ! STATIC_DCL void FDECL(list_genod_or_extinct, (BOOLEAN_P, BOOLEAN_P)); ! #endif #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2) extern void FDECL(nethack_exit,(int)); *************** *** 62,67 **** --- 65,251 ---- # endif #endif + FILE *dump_fp = (FILE *) 0; /* file pointer for dumps */ + + + void + dump_init() + { + dump_fp = fopen(dump_fn, "w"); + } + + void + dump_exit() + { + if (dump_fp) { + fclose(dump_fp); + dump_fp = (FILE *) 0; + } + } + + void dump(pre, str) + char *pre, *str; + { + if (dump_fp) + fprintf(dump_fp, "%s%s\n", pre, str); + } + + STATIC_PTR void + dump_you() { + char buf[BUFSZ]; + Sprintf(buf, "%s, %s %s %s %s", plname, + aligns[1 - u.ualign.type].adj, + genders[flags.female].adj, + urace.adj, + (flags.female && urole.name.f)? + urole.name.f : urole.name.m); + dump("", buf); + /* D: Add a line for clearance from the screen dump */ + dump("", ""); + } + + STATIC_PTR void + dump_inventory() + { + struct obj *obj; + (void) do_display_inventory((char *)0, TRUE, TRUE, TRUE); + do_container_contents(invent, FALSE, TRUE, TRUE, TRUE); + } + + STATIC_PTR void + dump_vanquished() + { + list_vanquished(TRUE, TRUE); + #ifdef SHOW_EXTINCT + list_genod_or_extinct(TRUE, TRUE); + #else + list_genocided(TRUE, TRUE); + #endif + } + + STATIC_PTR void + dump_minvent(mon, final) + struct monst *mon; + boolean final; + { + char *invlet = flags.inv_order; + struct obj *obj; + int classcount; + boolean hasbox = FALSE; + + for ( ; *invlet || !flags.sortpack; ++invlet) { + classcount = 0; + for (obj = mon->minvent; obj; obj = obj->nobj) { + if (Is_container(obj) && obj->otyp != BAG_OF_TRICKS) + hasbox = TRUE; + if (!flags.sortpack || obj->oclass == *invlet) { + if (flags.sortpack && !classcount) { + dump("", let_to_name(*invlet, FALSE)); + classcount++; + } + if (final) { + makeknown(obj->otyp); + obj->known = obj->bknown = + obj->dknown = obj->rknown = 1; + } + dump(" ", doname(obj)); + } + } + if (!flags.sortpack) + break; + } + if (hasbox) { + dump("", ""); + do_container_contents(mon->minvent, final, TRUE, TRUE, TRUE); + } + } + + STATIC_PTR void + dump_pets(final) + boolean final; + { + register xchar x, y; + int count = 0; + char buf[TBUFSZ], *tmp; + + /* D: Identify all nearby pets and display their stats and inventory */ + for (y = 0; y < ROWNO; ++y) { + for (x = 0; x < COLNO; ++x) { + if (isok(x, y) && distmin(u.ux, u.uy, x, y) <= 1) { + struct monst *mon = m_at(x, y); + + if (!mon) { + #ifdef STEED + if (x == u.ux && y == u.uy && u.usteed) + mon = u.usteed; + else + #endif + continue; + } + + if (DEADMONSTER(mon)) + continue; + + if (mon->mtame) { + if (!count++) { + dump("", "Your pets"); + dump("", ""); + } + tmp = x_monnam(mon, ARTICLE_A, (char*)0, + EXACT_NAME, TRUE); + if (*tmp) + *tmp = highc(*tmp); + dump("", tmp); + if (final) { + createmstatusline(mon, buf); + dump("", buf); + } + dump("", ""); + if (mon->minvent) { + sprintf(buf, "%s inventory", + s_suffix(Monnam(mon))); + dump("", buf); + dump_minvent(mon, final); + } else { + sprintf(buf, "%s %s not carrying anything%s.", + Monnam(mon), + (final? "was" : "is"), + (mon->mgold? " except gold" : "")); + dump("", buf); + } + dump("",""); + } + } + } + } + if (count) + dump("", ""); + } + + int + dodump() + { + if (!dump_fn) { + pline("Dump filename is not set"); + return(0); + } + dump_init(); + if (!dump_fp) { + pline("Can't open file for dump."); + return(0); + } + dump_you(); + dump_screen(); + dump_inventory(); + dump_pets(FALSE); + /* Dump vanquished and extinct creatures */ + dump_vanquished(); + do_show_conduct(FALSE, TRUE, TRUE); + dump_exit(); + pline("Dumped status!"); + return(0); + } + /* * The order of these needs to match the macros in hack.h. */ *************** *** 326,361 **** makeknown(obj->otyp); obj->known = obj->bknown = obj->dknown = obj->rknown = 1; } ! (void) display_inventory((char *)0, TRUE); ! container_contents(invent, TRUE, TRUE); } if (c == 'q') done_stopprint++; } if (hallu) make_hallucinated(20L, FALSE, 0L); if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'a'))) { c = yn_function("Do you want to see your attributes?",ynqchars,'y'); ! if (c == 'y') enlightenment(how >= PANICKED ? 1 : 2); /* final */ if (c == 'q') done_stopprint++; } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'v'))) { ! list_vanquished(); } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'g'))) { ! list_genocided(); } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'c'))) { c = yn_function("Do you want to see your conduct?",ynqchars,'y'); ! if (c == 'y') show_conduct(how >= PANICKED ? 1 : 2); if (c == 'q') done_stopprint++; } } /* try to get the player back in a viable state after being killed */ --- 510,556 ---- makeknown(obj->otyp); obj->known = obj->bknown = obj->dknown = obj->rknown = 1; } ! (void) do_display_inventory((char *)0, TRUE, TRUE, FALSE); ! do_container_contents(invent, TRUE, TRUE, TRUE, FALSE); } if (c == 'q') done_stopprint++; } + dump_pets(TRUE); + if (hallu) make_hallucinated(20L, FALSE, 0L); if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'a'))) { c = yn_function("Do you want to see your attributes?",ynqchars,'y'); ! if (c == 'y') do_enlightenment(how >= PANICKED ? 1 : 2, TRUE); /* final */ if (c == 'q') done_stopprint++; } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'v'))) { ! list_vanquished(TRUE, FALSE); } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'g'))) { ! #ifdef SHOW_EXTINCT ! list_genod_or_extinct(TRUE, FALSE); ! #else ! list_genocided(TRUE, FALSE); ! #endif } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'c'))) { c = yn_function("Do you want to see your conduct?",ynqchars,'y'); ! if (c == 'y') do_show_conduct(how >= PANICKED ? 1 : 2, TRUE, FALSE); if (c == 'q') done_stopprint++; } + + #ifdef DUMP_LOG + if (dump_fn) + dump_weapon_skill(); + #endif } /* try to get the player back in a viable state after being killed */ *************** *** 481,486 **** --- 676,684 ---- 100L * (long)objects[otmp->otyp].oc_cost, 250L * (long)objects[otmp->otyp].oc_cost); putstr(endwin, 0, pbuf); + + if (dump_fn) + dump("", pbuf); } if (Has_contents(otmp)) display_artifact_score(otmp->cobj,endwin); *************** *** 586,591 **** --- 784,797 ---- die: program_state.gameover = 1; + + /* D: Grab screen dump right here */ + if (dump_fn) { + dump_init(); + dump_you(); + dump_screen(); + } + /* in case of a subsequent panic(), there's no point trying to save */ program_state.something_worth_saving = 0; /* turn off vision subsystem */ *************** *** 733,738 **** --- 939,947 ---- (const char *) (flags.female ? "Demigoddess" : "Demigod")); putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); + + if (dump_fn) + dump("", pbuf); } if (how == ESCAPED || how == ASCENDED) { *************** *** 769,774 **** --- 978,985 ---- mtmp = mtmp->nmon; } if (!done_stopprint) putstr(endwin, 0, pbuf); + if (dump_fn) + dump("", pbuf); pbuf[0] = '\0'; } else { if (!done_stopprint) Strcat(pbuf, " "); *************** *** 779,784 **** --- 990,997 ---- "escaped from the dungeon", u.urexp, plur(u.urexp)); putstr(endwin, 0, pbuf); + if (dump_fn) + dump("", pbuf); } if (!done_stopprint) *************** *** 809,814 **** --- 1022,1029 ---- count, plur(count)); } putstr(endwin, 0, pbuf); + if (dump_fn) + dump("", pbuf); } } *************** *** 833,838 **** --- 1048,1055 ---- Sprintf(eos(pbuf), " with %ld point%s,", u.urexp, plur(u.urexp)); putstr(endwin, 0, pbuf); + if (dump_fn) + dump("", pbuf); } if (!done_stopprint) { *************** *** 846,851 **** --- 1063,1070 ---- u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]); putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); + if (dump_fn) + dump("", pbuf); } if (!done_stopprint) display_nhwindow(endwin, TRUE); *************** *** 864,909 **** topten(how); } if(done_stopprint) { raw_print(""); raw_print(""); } terminate(EXIT_SUCCESS); } - void container_contents(list, identified, all_containers) struct obj *list; boolean identified, all_containers; { register struct obj *box, *obj; ! char buf[BUFSZ]; for (box = list; box; box = box->nobj) { if (Is_container(box) && box->otyp != BAG_OF_TRICKS) { if (box->cobj) { ! winid tmpwin = create_nhwindow(NHW_MENU); ! Sprintf(buf, "Contents of %s:", the(xname(box))); ! putstr(tmpwin, 0, buf); ! putstr(tmpwin, 0, ""); for (obj = box->cobj; obj; obj = obj->nobj) { ! if (identified) { ! makeknown(obj->otyp); ! obj->known = obj->bknown = ! obj->dknown = obj->rknown = 1; } - putstr(tmpwin, 0, doname(obj)); } ! display_nhwindow(tmpwin, TRUE); ! destroy_nhwindow(tmpwin); if (all_containers) ! container_contents(box->cobj, identified, TRUE); } else { ! pline("%s is empty.", The(xname(box))); ! display_nhwindow(WIN_MESSAGE, FALSE); } } if (!all_containers) break; } } /* should be called with either EXIT_SUCCESS or EXIT_FAILURE */ --- 1083,1177 ---- topten(how); } + if (dump_fn) + dump_exit(); + if(done_stopprint) { raw_print(""); raw_print(""); } terminate(EXIT_SUCCESS); } void container_contents(list, identified, all_containers) struct obj *list; boolean identified, all_containers; { + do_container_contents(list, identified, all_containers, FALSE, FALSE); + } + + void + do_container_contents(list, identified, all_containers, want_dump, silent) + struct obj *list; + boolean identified, all_containers, want_dump, silent; + { register struct obj *box, *obj; ! int classcount; ! char buf[BUFSZ], *invlet; for (box = list; box; box = box->nobj) { if (Is_container(box) && box->otyp != BAG_OF_TRICKS) { if (box->cobj) { ! winid tmpwin; ! Sprintf(buf, "Contents of %s:", the(xname(box))); ! if (!silent) { ! tmpwin = create_nhwindow(NHW_MENU); ! putstr(tmpwin, 0, buf); ! putstr(tmpwin, 0, ""); ! } ! ! if (want_dump) ! dump("", buf); ! ! invlet = flags.inv_order; ! nextclass: ! classcount = 0; for (obj = box->cobj; obj; obj = obj->nobj) { ! if (!flags.sortpack || !want_dump || ! obj->oclass == *invlet) { ! if (flags.sortpack && want_dump && !classcount) { ! dump("", let_to_name(*invlet, FALSE)); ! classcount++; ! } ! if (identified) { ! makeknown(obj->otyp); ! obj->known = obj->bknown = ! obj->dknown = obj->rknown = 1; ! } ! if (!silent) ! putstr(tmpwin, 0, doname(obj)); ! ! if (want_dump) ! dump(" ", doname(obj)); } } ! ! if (flags.sortpack && want_dump) { ! if (*++invlet) ! goto nextclass; ! } ! ! if (!silent) { ! display_nhwindow(tmpwin, TRUE); ! destroy_nhwindow(tmpwin); ! } if (all_containers) ! do_container_contents(box->cobj, identified, TRUE, ! want_dump, ! silent); } else { ! if (!silent) { ! pline("%s is empty.", The(xname(box))); ! display_nhwindow(WIN_MESSAGE, FALSE); ! } ! if (want_dump) ! dump(The(xname(box)), " is empty."); } } if (!all_containers) break; } + + if (want_dump) + dump("", ""); } /* should be called with either EXIT_SUCCESS or EXIT_FAILURE */ *************** *** 925,931 **** } STATIC_OVL void ! list_vanquished() { register int i, lev; int ntypes = 0, max_lev = 0, nkilled; --- 1193,1200 ---- } STATIC_OVL void ! list_vanquished(want_dump, silent) ! boolean want_dump, silent; { register int i, lev; int ntypes = 0, max_lev = 0, nkilled; *************** *** 945,957 **** * includes all dead monsters, not just those killed by the player */ if (ntypes != 0) { ! c = yn_function("Do you want an account of creatures vanquished?", ynqchars, 'y'); ! if (c == 'q') done_stopprint++; if (c == 'y') { ! klwin = create_nhwindow(NHW_MENU); ! putstr(klwin, 0, "Vanquished creatures:"); ! putstr(klwin, 0, ""); /* countdown by monster "toughness" */ for (lev = max_lev; lev >= 0; lev--) --- 1214,1234 ---- * includes all dead monsters, not just those killed by the player */ if (ntypes != 0) { ! c = 'y'; ! if (!silent) { ! c = yn_function("Do you want an account of creatures vanquished?", ynqchars, 'y'); ! if (c == 'q') done_stopprint++; ! } if (c == 'y') { ! if (!silent) { ! klwin = create_nhwindow(NHW_MENU); ! putstr(klwin, 0, "Vanquished creatures:"); ! putstr(klwin, 0, ""); ! } ! ! if (want_dump) ! dump("", "Vanquished creatures"); /* countdown by monster "toughness" */ for (lev = max_lev; lev >= 0; lev--) *************** *** 973,991 **** Sprintf(buf, "%d %s", nkilled, makeplural(mons[i].mname)); } ! putstr(klwin, 0, buf); } /* * if (Hallucination) * putstr(klwin, 0, "and a partridge in a pear tree"); */ if (ntypes > 1) { ! putstr(klwin, 0, ""); Sprintf(buf, "%ld creatures vanquished.", total_killed); ! putstr(klwin, 0, buf); } ! display_nhwindow(klwin, TRUE); ! destroy_nhwindow(klwin); } } } --- 1250,1280 ---- Sprintf(buf, "%d %s", nkilled, makeplural(mons[i].mname)); } ! if (!silent) ! putstr(klwin, 0, buf); ! if (want_dump) ! dump(" ", buf); } /* * if (Hallucination) * putstr(klwin, 0, "and a partridge in a pear tree"); */ if (ntypes > 1) { ! if (!silent) ! putstr(klwin, 0, ""); Sprintf(buf, "%ld creatures vanquished.", total_killed); ! if (!silent) ! putstr(klwin, 0, buf); ! if (want_dump) ! dump(" ", buf); } ! if (!silent) { ! display_nhwindow(klwin, TRUE); ! destroy_nhwindow(klwin); ! } ! ! if (want_dump) ! dump("", ""); } } } *************** *** 1003,1009 **** } STATIC_OVL void ! list_genocided() { register int i; int ngenocided; --- 1292,1299 ---- } STATIC_OVL void ! list_genocided(want_dump, silent) ! boolean want_dump, silent; { register int i; int ngenocided; *************** *** 1015,1027 **** /* genocided species list */ if (ngenocided != 0) { ! c = yn_function("Do you want a list of species genocided?", ynqchars, 'y'); if (c == 'q') done_stopprint++; if (c == 'y') { ! klwin = create_nhwindow(NHW_MENU); ! putstr(klwin, 0, "Genocided species:"); ! putstr(klwin, 0, ""); for (i = LOW_PM; i < NUMMONS; i++) if (mvitals[i].mvflags & G_GENOD) { --- 1305,1324 ---- /* genocided species list */ if (ngenocided != 0) { ! c = 'y'; ! if (!silent) ! c = yn_function("Do you want a list of species genocided?", ynqchars, 'y'); if (c == 'q') done_stopprint++; if (c == 'y') { ! if (!silent) { ! klwin = create_nhwindow(NHW_MENU); ! putstr(klwin, 0, "Genocided species:"); ! putstr(klwin, 0, ""); ! } ! ! if (want_dump) ! dump("", "Genocided species"); for (i = LOW_PM; i < NUMMONS; i++) if (mvitals[i].mvflags & G_GENOD) { *************** *** 1031,1047 **** mons[i].mname); else Strcpy(buf, makeplural(mons[i].mname)); ! putstr(klwin, 0, buf); } ! putstr(klwin, 0, ""); Sprintf(buf, "%d species genocided.", ngenocided); ! putstr(klwin, 0, buf); ! display_nhwindow(klwin, TRUE); ! destroy_nhwindow(klwin); } } } /*end.c*/ --- 1328,1436 ---- mons[i].mname); else Strcpy(buf, makeplural(mons[i].mname)); ! if (!silent) ! putstr(klwin, 0, buf); ! ! if (want_dump) ! dump(" ", buf); } ! if (!silent) ! putstr(klwin, 0, ""); Sprintf(buf, "%d species genocided.", ngenocided); ! if (!silent) ! putstr(klwin, 0, buf); ! if (want_dump) ! dump("", buf); ! ! if (!silent) { ! display_nhwindow(klwin, TRUE); ! destroy_nhwindow(klwin); ! } ! if (want_dump) ! dump("", ""); } } } + #ifdef SHOW_EXTINCT + STATIC_OVL void + list_genod_or_extinct(want_dump, silent) + boolean want_dump, silent; + { + register int i; + int ngenocided = 0, nextinct = 0; + char c; + winid klwin; + char buf[BUFSZ]; + + /* get totals first */ + for (i = LOW_PM; i < NUMMONS; i++) { + if( (mvitals[i].mvflags & G_GONE) && !(mons[i].geno & G_UNIQ) ) + ngenocided++; + } + + /* genocided species list */ + if (ngenocided != 0) { + c = 'y'; + if (!silent) + c = yn_function("Do you want a list of species genocided?", + ynqchars, 'y'); + if (c == 'q') done_stopprint++; + if (c == 'y') { + if (!silent) { + klwin = create_nhwindow(NHW_MENU); + putstr(klwin, 0, "Genocided species:"); + putstr(klwin, 0, ""); + } + + if (want_dump) + dump("", "Genocided species"); + /* uniques shouldn't show up as (extinct), and fortunately, + no unique may be genocided */ + + for (i = LOW_PM; i < NUMMONS; i++) + if (mvitals[i].mvflags & G_GONE && !(mons[i].geno & G_UNIQ) ){ + if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST) + Sprintf(buf, "%s%s", + !type_is_pname(&mons[i]) ? "" : "the ", + mons[i].mname); + else + Strcpy(buf, makeplural(mons[i].mname)); + if( !(mvitals[i].mvflags & G_GENOD) ) { + Strcat(buf, " (extinct)"); + nextinct++; + } + if (!silent) + putstr(klwin, 0, buf); + if (want_dump) + dump(" ", buf); + } + + if (!silent) + putstr(klwin, 0, ""); + Sprintf(buf, "%d species genocided.", num_genocides()); + if (!silent) + putstr(klwin, 0, buf); + if (want_dump) + dump("", buf); + if (nextinct) { + Sprintf(buf, "%d species extinct.", nextinct); + if (!silent) + putstr(klwin, 0, buf); + dump("", buf); + } + + + if (!silent) { + display_nhwindow(klwin, TRUE); + destroy_nhwindow(klwin); + } + if (want_dump) + dump("", ""); + } + } + } + #endif /*end.c*/ diff -c -r sl_6e4f6/src/invent.c sl_dex/src/invent.c *** sl_6e4f6/src/invent.c Fri Nov 30 05:27:58 2001 --- sl_dex/src/invent.c Tue Dec 18 00:13:32 2001 *************** *** 1525,1530 **** --- 1525,1538 ---- register const char *lets; boolean want_reply; { + do_display_inventory(lets, want_reply, FALSE, FALSE); + } + + char + do_display_inventory(lets, want_reply, want_dump, silent) + register const char *lets; + boolean want_reply, want_dump, silent; + { struct obj *otmp; char ilet, ret; char *invlet = flags.inv_order; *************** *** 1535,1547 **** menu_item *selected; /* overriden by global flag */ ! if (flags.perm_invent) { ! win = (lets && *lets) ? local_win : WIN_INVEN; ! /* create the first time used */ ! if (win == WIN_ERR) ! win = local_win = create_nhwindow(NHW_MENU); ! } else ! win = WIN_INVEN; /* Exit early if no inventory -- but keep going if we are doing --- 1543,1560 ---- menu_item *selected; /* overriden by global flag */ ! if (!silent) { ! if (flags.perm_invent) { ! win = (lets && *lets) ? local_win : WIN_INVEN; ! /* create the first time used */ ! if (win == WIN_ERR) ! win = local_win = create_nhwindow(NHW_MENU); ! } else ! win = WIN_INVEN; ! } ! ! if (want_dump) ! dump("", "Your inventory"); /* Exit early if no inventory -- but keep going if we are doing *************** *** 1555,1561 **** to here is short circuited away. */ if (!invent && !(flags.perm_invent && !lets && !want_reply)) { ! pline("Not carrying anything%s.", u.ugold ? " except gold" : ""); return 0; } --- 1568,1578 ---- to here is short circuited away. */ if (!invent && !(flags.perm_invent && !lets && !want_reply)) { ! if (!silent) ! pline("Not carrying anything%s.", ! u.ugold ? " except gold" : ""); ! if (want_dump) ! dump(" Not carrying anything", u.ugold? " except gold" : "."); return 0; } *************** *** 1569,1584 **** ret = '\0'; for (otmp = invent; otmp; otmp = otmp->nobj) { if (otmp->invlet == lets[0]) { ! ret = message_menu(lets[0], want_reply ? PICK_ONE : PICK_NONE, xprname(otmp, (char *)0, lets[0], TRUE, 0L)); break; } } return ret; } ! start_menu(win); nextclass: classcount = 0; any.a_void = 0; /* set all bits to zero */ --- 1586,1608 ---- ret = '\0'; for (otmp = invent; otmp; otmp = otmp->nobj) { if (otmp->invlet == lets[0]) { ! if (!silent) ! ret = message_menu(lets[0], want_reply ? PICK_ONE : PICK_NONE, xprname(otmp, (char *)0, lets[0], TRUE, 0L)); + if (want_dump) { + char letbuf[7]; + sprintf(letbuf, " %c - ", lets[0]); + dump(letbuf, xprname(otmp, (char *)0, lets[0], TRUE, 0L)); + } break; } } return ret; } ! if (!silent) ! start_menu(win); nextclass: classcount = 0; any.a_void = 0; /* set all bits to zero */ *************** *** 1588,1601 **** if (!flags.sortpack || otmp->oclass == *invlet) { if (flags.sortpack && !classcount) { any.a_void = 0; /* zero */ ! add_menu(win, NO_GLYPH, &any, 0, 0, ATR_INVERSE, ! let_to_name(*invlet, FALSE), MENU_UNSELECTED); classcount++; } any.a_char = ilet; ! add_menu(win, obj_to_glyph(otmp), &any, ilet, 0, ATR_NONE, doname(otmp), MENU_UNSELECTED); } } } --- 1612,1636 ---- if (!flags.sortpack || otmp->oclass == *invlet) { if (flags.sortpack && !classcount) { any.a_void = 0; /* zero */ ! if (!silent) { ! add_menu(win, NO_GLYPH, &any, 0, 0, ! ATR_INVERSE, ! let_to_name(*invlet, FALSE), MENU_UNSELECTED); ! } ! if (want_dump) ! dump(" ", let_to_name(*invlet, FALSE)); classcount++; } any.a_char = ilet; ! if (!silent) ! add_menu(win, obj_to_glyph(otmp), &any, ilet, 0, ATR_NONE, doname(otmp), MENU_UNSELECTED); + if (want_dump) { + char letbuf[7]; + sprintf(letbuf, " %c - ", ilet); + dump(letbuf, doname(otmp)); + } } } } *************** *** 1608,1622 **** } #endif } ! end_menu(win, (char *) 0); - n = select_menu(win, want_reply ? PICK_ONE : PICK_NONE, &selected); if (n > 0) { ret = selected[0].item.a_char; free((genericptr_t)selected); } else ret = !n ? '\0' : '\033'; /* cancelled */ return ret; } --- 1643,1665 ---- } #endif } ! if (!silent) ! end_menu(win, (char *) 0); ! ! if (!silent) ! n = select_menu(win, want_reply ? PICK_ONE : PICK_NONE, &selected); ! else ! n = 0; if (n > 0) { ret = selected[0].item.a_char; free((genericptr_t)selected); } else ret = !n ? '\0' : '\033'; /* cancelled */ + if (want_dump) + dump("", ""); + return ret; } diff -c -r sl_6e4f6/src/options.c sl_dex/src/options.c *** sl_6e4f6/src/options.c Fri Nov 30 05:27:52 2001 --- sl_dex/src/options.c Sat Dec 1 12:43:44 2001 *************** *** 241,246 **** --- 241,248 ---- SET_IN_GAME }, { "dogname", "the name of your (first) dog (e.g., dogname:Fang)", PL_PSIZ, DISP_IN_GAME }, + { "dumpfile", "where to dump data (e.g. dumpfile:/tmp/nh.dump)", + PL_PSIZ, SET_IN_GAME }, { "dungeon", "the symbols to use in drawing the dungeon map", MAXDCHARS+1, SET_IN_FILE }, { "effects", "the symbols to use in drawing special effects", *************** *** 1089,1094 **** --- 1091,1105 ---- return; } + fullname = "dumpfile"; + if (match_optname(opts, fullname, 3, TRUE)) { + if (negated) bad_negation(fullname, FALSE); + else if ((op = string_for_opt(opts, !tfrom_file)) != 0 + && strlen(op) > 1) + nmcpy(dump_fn, op, PL_PSIZ); + return ; + } + fullname = "horsename"; if (match_optname(opts, fullname, 5, TRUE)) { if (negated) bad_negation(fullname, FALSE); *************** *** 2325,2330 **** --- 2336,2343 ---- flags.end_disclose[0] ? flags.end_disclose : "all" ); else if (!strcmp(optname, "dogname")) Sprintf(buf, "%s", dogname[0] ? dogname : none ); + else if (!strcmp(optname, "dumpfile")) + Sprintf(buf, "%s", dump_fn[0]? dump_fn : none ); else if (!strcmp(optname, "dungeon")) Sprintf(buf, "%s", to_be_done); else if (!strcmp(optname, "effects")) diff -c -r sl_6e4f6/src/pline.c sl_dex/src/pline.c *** sl_6e4f6/src/pline.c Fri Nov 30 05:28:02 2001 --- sl_dex/src/pline.c Wed Dec 26 22:59:08 2001 *************** *** 264,271 **** } void ! mstatusline(mtmp) ! register struct monst *mtmp; { aligntyp alignment; char info[BUFSZ], monnambuf[BUFSZ]; --- 264,272 ---- } void ! createmstatusline(mtmp, buf) ! struct monst *mtmp; ! char *buf; { aligntyp alignment; char info[BUFSZ], monnambuf[BUFSZ]; *************** *** 328,336 **** /* avoid "Status of the invisible newt ..., invisible" */ /* and unlike a normal mon_nam, use "saddled" even if it has a name */ Strcpy(monnambuf, x_monnam(mtmp, ARTICLE_THE, (char *)0, ! (SUPPRESS_IT|SUPPRESS_INVISIBLE), FALSE)); ! pline("Status of %s (%s): Level %d HP %d(%d) Pw %d(%d) AC %d%s.", monnambuf, align_str(alignment), mtmp->m_lev, --- 329,338 ---- /* avoid "Status of the invisible newt ..., invisible" */ /* and unlike a normal mon_nam, use "saddled" even if it has a name */ Strcpy(monnambuf, x_monnam(mtmp, ARTICLE_THE, (char *)0, ! (SUPPRESS_IT|SUPPRESS_INVISIBLE), FALSE)); ! sprintf(buf, ! "Status of %s (%s): Level %d HP %d(%d) Pw %d(%d) AC %d%s.", monnambuf, align_str(alignment), mtmp->m_lev, *************** *** 343,348 **** --- 345,360 ---- } void + mstatusline(mtmp) + register struct monst *mtmp; + { + char buf[TBUFSZ]; + createmstatusline(mtmp, buf); + + pline(buf); + } + + void ustatusline() { char info[BUFSZ]; diff -c -r sl_6e4f6/src/topten.c sl_dex/src/topten.c *** sl_6e4f6/src/topten.c Fri Nov 30 05:28:06 2001 --- sl_dex/src/topten.c Sat Dec 15 00:38:40 2001 *************** *** 354,359 **** --- 354,364 ---- "Since you were in %s mode, the score list will not be checked.", wizard ? "wizard" : "discover"); topten_print(pbuf); + if (dump_fn) { + dump("", ""); + dump("", ""); + dump("", pbuf); + } } goto showwin; } *************** *** 378,383 **** --- 383,390 ---- } HUP topten_print(""); + dump("", ""); + dump("", ""); /* assure minimum number of points */ if(t0->points < POINTSMIN) t0->points = 0; *************** *** 422,427 **** --- 429,436 ---- t1->points); topten_print(pbuf); topten_print(""); + dump("", pbuf); + dump("", ""); } } if(occ_cnt < 0) { *************** *** 453,468 **** } #endif /* UPDATE_RECORD_IN_PLACE */ if(!done_stopprint) if(rank0 > 0){ ! if(rank0 <= 10) topten_print("You made the top ten list!"); else { char pbuf[BUFSZ]; Sprintf(pbuf, "You reached the %d%s place on the top %d list.", rank0, ordin(rank0), ENTRYMAX); topten_print(pbuf); } topten_print(""); } } if(rank0 == 0) rank0 = rank1; --- 462,481 ---- } #endif /* UPDATE_RECORD_IN_PLACE */ if(!done_stopprint) if(rank0 > 0){ ! if(rank0 <= 10) { topten_print("You made the top ten list!"); + dump("", "You made the top ten list!"); + } else { char pbuf[BUFSZ]; Sprintf(pbuf, "You reached the %d%s place on the top %d list.", rank0, ordin(rank0), ENTRYMAX); topten_print(pbuf); + dump("", pbuf); } topten_print(""); + dump("", ""); } } if(rank0 == 0) rank0 = rank1; *************** *** 488,495 **** )) continue; if (rank == rank0 - flags.end_around && rank0 > flags.end_top + flags.end_around + 1 && ! !flags.end_own) topten_print(""); if(rank != rank0) outentry(rank, t1, FALSE); else if(!rank1) --- 501,510 ---- )) continue; if (rank == rank0 - flags.end_around && rank0 > flags.end_top + flags.end_around + 1 && ! !flags.end_own) { topten_print(""); + dump("", ""); + } if(rank != rank0) outentry(rank, t1, FALSE); else if(!rank1) *************** *** 547,552 **** --- 562,568 ---- while(bp < linebuf + COLNO - 9) *bp++ = ' '; Strcpy(bp, "Hp [max]"); topten_print(linebuf); + dump(" ", linebuf); } /* so>0: standout line; so=0: ordinary line */ *************** *** 671,678 **** while (bp < linebuf + (COLNO-1)) *bp++ = ' '; *bp = 0; topten_print_bold(linebuf); ! } else topten_print(linebuf); Sprintf(linebuf, "%15s %s", "", linebuf3); lngr = strlen(linebuf); } --- 687,697 ---- while (bp < linebuf + (COLNO-1)) *bp++ = ' '; *bp = 0; topten_print_bold(linebuf); ! dump("*", linebuf); ! } else { topten_print(linebuf); + dump(" ", linebuf); + } Sprintf(linebuf, "%15s %s", "", linebuf3); lngr = strlen(linebuf); } *************** *** 695,702 **** while (bp < linebuf + so) *bp++ = ' '; *bp = 0; topten_print_bold(linebuf); ! } else topten_print(linebuf); } STATIC_OVL int --- 714,724 ---- while (bp < linebuf + so) *bp++ = ' '; *bp = 0; topten_print_bold(linebuf); ! dump(" ", linebuf); ! } else { topten_print(linebuf); + dump(" ", linebuf); + } } STATIC_OVL int diff -c -r sl_6e4f6/src/weapon.c sl_dex/src/weapon.c *** sl_6e4f6/src/weapon.c Fri Nov 30 05:28:06 2001 --- sl_dex/src/weapon.c Sat Dec 1 12:43:44 2001 *************** *** 9,14 **** --- 9,18 ---- */ #include "hack.h" + #ifdef DUMP_LOG + STATIC_DCL int FDECL(enhance_skill, (BOOLEAN_P)); + #endif + /* categories whose names don't come from OBJ_NAME(objects[type]) */ #define PN_POLEARMS (-1) #define PN_SABER (-2) *************** *** 1037,1042 **** --- 1041,1063 ---- */ int enhance_weapon_skill() + #ifdef DUMP_LOG + { + return enhance_skill(FALSE); + } + + int dump_weapon_skill() + { + return enhance_skill(TRUE); + } + + int enhance_skill(int want_dump) + #endif + /* This is the original enhance_weapon_skill() function slightly modified + * to write the skills to the dump file. I added the wrapper functions just + * because it looked like the easiest way to add a parameter to the + * function call. - Jukka Lahtinen, August 2001 + */ { int pass, i, n, len, longest, to_advance; char buf[BUFSZ], buf2[BUFSZ]; *************** *** 1044,1052 **** anything any; winid win; boolean speedy = FALSE; ! #ifdef WIZARD if (wizard && yn("Advance skills without practice?") == 'y') speedy = TRUE; #endif --- 1065,1076 ---- anything any; winid win; boolean speedy = FALSE; ! boolean logged; #ifdef WIZARD + #ifdef DUMP_LOG + if (!want_dump) + #endif if (wizard && yn("Advance skills without practice?") == 'y') speedy = TRUE; #endif *************** *** 1059,1067 **** if (can_advance(i, speedy)) to_advance++; } win = create_nhwindow(NHW_MENU); start_menu(win); ! /* List the skills, making ones that could be advanced selectable. List the miscellaneous skills first. Possible future enhancement: list spell skills before --- 1083,1098 ---- if (can_advance(i, speedy)) to_advance++; } + #ifdef DUMP_LOG + if (want_dump) + dump("", "Your skills"); + else { + #endif win = create_nhwindow(NHW_MENU); start_menu(win); ! #ifdef DUMP_LOG ! } ! #endif /* List the skills, making ones that could be advanced selectable. List the miscellaneous skills first. Possible future enhancement: list spell skills before *************** *** 1072,1080 **** --- 1103,1129 ---- /* Print headings for skill types */ any.a_void = 0; if (i == skill_ranges[pass].first) + #ifdef DUMP_LOG + if (want_dump) { + dump(" ", skill_ranges[pass].name); + logged = FALSE; + } else + #endif add_menu(win, NO_GLYPH, &any, 0, 0, ATR_BOLD, skill_ranges[pass].name, MENU_UNSELECTED); + #ifdef DUMP_LOG + if (want_dump) { + if (P_SKILL(i) > P_UNSKILLED) { + Sprintf(buf2, "%-*s [%s]", longest, P_NAME(i), + skill_level_name(i, buf)); + dump(" ", buf2); + logged = TRUE; + } else if (i == skill_ranges[pass].last && !logged) { + dump(" ", "(none)"); + } + } else { + #endif if (P_RESTRICTED(i)) continue; /* * Sigh, this assumes a monospaced font. *************** *** 1097,1102 **** --- 1146,1154 ---- any.a_int = can_advance(i, speedy) ? i+1 : 0; add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, buf2, MENU_UNSELECTED); + #ifdef DUMP_LOG + } + #endif } Strcpy(buf, to_advance ? "Pick a skill to advance:" : "Current skills:"); *************** *** 1104,1109 **** --- 1156,1167 ---- if (wizard && !speedy) Sprintf(eos(buf), " (%d slot%s available)", u.weapon_slots, plur(u.weapon_slots)); #endif + #ifdef DUMP_LOG + if (want_dump) { + dump("", ""); + n = 0; + } else { + #endif end_menu(win, buf); n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected); destroy_nhwindow(win); *************** *** 1120,1125 **** --- 1178,1186 ---- } } } + #ifdef DUMP_LOG + } + #endif } while (speedy && n > 0); return 0; }