updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / nethack-patch / dump-343.diff
blobb21213cd91881e14986b7421117f2ef8d7edb06c
1 Nethack 3.4.3 dump patch, version 1.4.0
2 diff -bNurd nethack-3.4.3/dat/opthelp nh343dump/dat/opthelp
3 --- nethack-3.4.3/dat/opthelp 2003-12-08 01:39:13.000000000 +0200
4 +++ nh343dump/dat/opthelp 2006-06-26 09:53:58.000000000 +0300
5 @@ -92,6 +92,9 @@
6 boulder override the default boulder symbol with another default: [`]
7 disclose the types of information you want offered at the end of the
8 game [ni na nv ng nc]
9 +dumpfile the name of the file where to dump the disclosure information
10 + when the game ends (only if the patch has been compiled in)
11 + [none]
12 fruit the name of a fruit you enjoy eating [slime mold]
13 (basically a whimsy which NetHack uses from time to time).
14 menustyle user interface for selection of multiple objects:
15 diff -bNurd nethack-3.4.3/doc/Guidebook.mn nh343dump/doc/Guidebook.mn
16 --- nethack-3.4.3/doc/Guidebook.mn 2003-12-08 01:39:13.000000000 +0200
17 +++ nh343dump/doc/Guidebook.mn 2006-06-26 09:53:58.000000000 +0300
18 @@ -1770,6 +1770,12 @@
19 .lp dogname
20 Name your starting dog (ex. ``dogname:Fang'').
21 Cannot be set with the `O' command.
22 +.lp dumpfile
23 +The name of a file where the disclosure information is written when the
24 +game ends. You may use the macro %n that will be replaced with the name
25 +of your player character. The game must have write permissions to the
26 +directory where the file is written. Normally /tmp may be used for unix
27 +systems.
28 .lp dungeon
29 Set the graphics symbols for displaying the dungeon
30 (default \&``\ |--------||.-|++##.##<><>_|\e\e#{}.}..##\ #}'').
31 diff -bNurd nethack-3.4.3/doc/Guidebook.tex nh343dump/doc/Guidebook.tex
32 --- nethack-3.4.3/doc/Guidebook.tex 2003-12-08 01:39:13.000000000 +0200
33 +++ nh343dump/doc/Guidebook.tex 2006-06-26 09:53:58.000000000 +0300
34 @@ -2209,6 +2209,13 @@
35 Name your starting dog (ex.\ ``{\tt dogname:Fang}'').
36 Cannot be set with the `{\tt O}' command.
37 %.lp
38 +\item[\ib{dumpfile}]
39 +The name of a file where the disclosure information is written when the
40 +game ends. You may use the macro %n that will be replaced with the name
41 +of your player character. The game must have write permissions to the
42 +directory where the file is written. Normally /tmp may be used for unix
43 +systems.
44 +%.lp
45 \item[\ib{dungeon}]
46 Set the graphics symbols for displaying the dungeon (default
47 ``\verb& |--------||.-|++##& \verb&.##<><>_|\\#{}.}..## #}&'').
48 diff -bNurd nethack-3.4.3/doc/Guidebook.txt nh343dump/doc/Guidebook.txt
49 --- nethack-3.4.3/doc/Guidebook.txt 2003-12-08 01:39:13.000000000 +0200
50 +++ nh343dump/doc/Guidebook.txt 2006-06-26 09:53:58.000000000 +0300
51 @@ -2274,6 +2274,13 @@
52 Name your starting dog (ex. ``dogname:Fang''). Cannot be set
53 with the `O' command.
55 + dumpfile
56 + The name of a file where the disclosure information is
57 + written when the game ends. You may use the macro %n that
58 + will be replaced with the name of your player character.
59 + The game must have write permissions to the directory where
60 + the file is written. Normally /tmp may be used for unixes.
62 dungeon
63 Set the graphics symbols for displaying the dungeon (default
64 `` |--------||.-|++##.##<><>_|\\#{}.}..## #}''). The dungeon
65 diff -bNurd nethack-3.4.3/include/config.h nh343dump/include/config.h
66 --- nethack-3.4.3/include/config.h 2003-12-08 01:39:13.000000000 +0200
67 +++ nh343dump/include/config.h 2006-06-26 12:38:29.000000000 +0300
68 @@ -350,6 +350,10 @@
70 /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */
71 /*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
72 +#define DUMP_LOG /* Dump game end information to a file */
73 +/* #define DUMP_FN "/tmp/%n.nh" */ /* Fixed dumpfile name, if you want
74 + * to prevent definition by users */
75 +#define DUMPMSGS 20 /* Number of latest messages in the dump file */
77 /* End of Section 5 */
79 diff -bNurd nethack-3.4.3/include/decl.h nh343dump/include/decl.h
80 --- nethack-3.4.3/include/decl.h 2003-12-08 01:39:13.000000000 +0200
81 +++ nh343dump/include/decl.h 2006-06-26 09:53:58.000000000 +0300
82 @@ -184,6 +184,9 @@
83 E long done_money;
84 #endif
85 E char killer_buf[BUFSZ];
86 +#ifdef DUMP_LOG
87 +E char dump_fn[]; /* dumpfile name (dump patch) */
88 +#endif
89 E const char *configfile;
90 E NEARDATA char plname[PL_NSIZ];
91 E NEARDATA char dogname[];
92 diff -bNurd nethack-3.4.3/include/extern.h nh343dump/include/extern.h
93 --- nethack-3.4.3/include/extern.h 2003-12-08 01:39:13.000000000 +0200
94 +++ nh343dump/include/extern.h 2006-06-26 09:53:58.000000000 +0300
95 @@ -131,6 +131,10 @@
96 E int FDECL(describe_level, (char *));
97 E const char *FDECL(rank_of, (int,SHORT_P,BOOLEAN_P));
98 E void NDECL(bot);
99 +#ifdef DUMP_LOG
100 +E void FDECL(bot1str, (char *));
101 +E void FDECL(bot2str, (char *));
102 +#endif
104 /* ### cmd.c ### */
106 @@ -166,6 +170,10 @@
107 E int NDECL(extcmd_via_menu);
108 E void FDECL(enlightenment, (int));
109 E void FDECL(show_conduct, (int));
110 +#ifdef DUMP_LOG
111 +E void FDECL(dump_enlightenment, (int));
112 +E void FDECL(dump_conduct, (int));
113 +#endif
114 E int FDECL(xytod, (SCHAR_P,SCHAR_P));
115 E void FDECL(dtoxy, (coord *,int));
116 E int FDECL(movecmd, (CHAR_P));
117 @@ -281,6 +289,9 @@
118 E void FDECL(row_refresh, (int,int,int));
119 E void NDECL(cls);
120 E void FDECL(flush_screen, (int));
121 +#ifdef DUMP_LOG
122 +E void NDECL(dump_screen);
123 +#endif
124 E int FDECL(back_to_glyph, (XCHAR_P,XCHAR_P));
125 E int FDECL(zapdir_to_glyph, (int,int,int));
126 E int FDECL(glyph_at, (XCHAR_P,XCHAR_P));
127 @@ -553,6 +564,10 @@
128 #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C)
129 E void FDECL(done, (int));
130 E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P));
131 +#ifdef DUMP_LOG
132 +E void FDECL(dump, (char *, char *));
133 +E void FDECL(do_containerconts, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P));
134 +#endif
135 E void FDECL(terminate, (int));
136 E int NDECL(num_genocides);
138 @@ -790,6 +805,9 @@
139 E char *FDECL(xprname, (struct obj *,const char *,CHAR_P,BOOLEAN_P,long,long));
140 E int NDECL(ddoinv);
141 E char FDECL(display_inventory, (const char *,BOOLEAN_P));
142 +#ifdef DUMP_LOG
143 +E char FDECL(dump_inventory, (const char *,BOOLEAN_P,BOOLEAN_P));
144 +#endif
145 E int FDECL(display_binventory, (int,int,BOOLEAN_P));
146 E struct obj *FDECL(display_cinventory,(struct obj *));
147 E struct obj *FDECL(display_minventory,(struct monst *,int,char *));
148 @@ -2237,6 +2255,9 @@
149 E int NDECL(abon);
150 E int NDECL(dbon);
151 E int NDECL(enhance_weapon_skill);
152 +#ifdef DUMP_LOG
153 +E void NDECL(dump_weapon_skill);
154 +#endif
155 E void FDECL(unrestrict_weapon_skill, (int));
156 E void FDECL(use_skill, (int,int));
157 E void FDECL(add_weapon_skill, (int));
158 diff -bNurd nethack-3.4.3/src/botl.c nh343dump/src/botl.c
159 --- nethack-3.4.3/src/botl.c 2003-12-08 01:39:13.000000000 +0200
160 +++ nh343dump/src/botl.c 2006-06-26 09:53:58.000000000 +0300
161 @@ -165,10 +165,16 @@
163 #endif
165 +#ifdef DUMP_LOG
166 +void bot1str(char *newbot1)
167 +#else
168 STATIC_OVL void
169 bot1()
170 +#endif
172 +#ifndef DUMP_LOG
173 char newbot1[MAXCO];
174 +#endif
175 register char *nb;
176 register int i,j;
178 @@ -215,6 +221,15 @@
179 if (flags.showscore)
180 Sprintf(nb = eos(nb), " S:%ld", botl_score());
181 #endif
182 +#ifdef DUMP_LOG
184 +STATIC_OVL void
185 +bot1()
187 + char newbot1[MAXCO];
189 + bot1str(newbot1);
190 +#endif
191 curs(WIN_STATUS, 1, 0);
192 putstr(WIN_STATUS, 0, newbot1);
194 @@ -242,10 +257,17 @@
195 return ret;
198 +#ifdef DUMP_LOG
199 +void bot2str(newbot2)
200 +char* newbot2;
201 +#else
202 STATIC_OVL void
203 bot2()
204 +#endif
206 +#ifndef DUMP_LOG
207 char newbot2[MAXCO];
208 +#endif
209 register char *nb;
210 int hp, hpmax;
211 int cap = near_capacity();
212 @@ -292,6 +314,14 @@
213 if(Slimed) Sprintf(nb = eos(nb), " Slime");
214 if(cap > UNENCUMBERED)
215 Sprintf(nb = eos(nb), " %s", enc_stat[cap]);
216 +#ifdef DUMP_LOG
218 +STATIC_OVL void
219 +bot2()
221 + char newbot2[MAXCO];
222 + bot2str(newbot2);
223 +#endif
224 curs(WIN_STATUS, 1, 1);
225 putstr(WIN_STATUS, 0, newbot2);
227 diff -bNurd nethack-3.4.3/src/cmd.c nh343dump/src/cmd.c
228 --- nethack-3.4.3/src/cmd.c 2003-12-08 01:39:13.000000000 +0200
229 +++ nh343dump/src/cmd.c 2006-06-26 09:53:58.000000000 +0300
230 @@ -1126,6 +1126,305 @@
231 return;
234 +#ifdef DUMP_LOG
235 +void
236 +dump_enlightenment(final)
237 +int final;
239 + int ltmp;
240 + char buf[BUFSZ];
241 + char buf2[BUFSZ];
242 + const char *enc_stat[] = { /* copied from botl.c */
243 + "",
244 + "burdened",
245 + "stressed",
246 + "strained",
247 + "overtaxed",
248 + "overloaded"
249 + };
250 + char *youwere = " You were ";
251 + char *youhave = " You have ";
252 + char *youhad = " You had ";
253 + char *youcould = " You could ";
255 + dump("", "Final attributes");
257 +#ifdef ELBERETH
258 + if (u.uevent.uhand_of_elbereth) {
259 + static const char * const hofe_titles[3] = {
260 + "the Hand of Elbereth",
261 + "the Envoy of Balance",
262 + "the Glory of Arioch"
263 + };
264 + dump(youwere,
265 + (char *)hofe_titles[u.uevent.uhand_of_elbereth - 1]);
267 +#endif
269 + if (u.ualign.record >= 20)
270 + dump(youwere, "piously aligned");
271 + else if (u.ualign.record > 13)
272 + dump(youwere, "devoutly aligned");
273 + else if (u.ualign.record > 8)
274 + dump(youwere, "fervently aligned");
275 + else if (u.ualign.record > 3)
276 + dump(youwere, "stridently aligned");
277 + else if (u.ualign.record == 3)
278 + dump(youwere, "aligned");
279 + else if (u.ualign.record > 0)
280 + dump(youwere, "haltingly aligned");
281 + else if (u.ualign.record == 0)
282 + dump(youwere, "nominally aligned");
283 + else if (u.ualign.record >= -3) dump(youhave, "strayed");
284 + else if (u.ualign.record >= -8) dump(youhave, "sinned");
285 + else dump(" You have ", "transgressed");
286 + Sprintf(buf, " %d", u.ualign.record);
287 + dump(" Your alignment was ", buf);
290 + /*** Resistances to troubles ***/
291 + if (Fire_resistance) dump(youwere, "fire resistant");
292 + if (Cold_resistance) dump(youwere, "cold resistant");
293 + if (Sleep_resistance) dump(youwere, "sleep resistant");
294 + if (Disint_resistance) dump(youwere, "disintegration-resistant");
295 + if (Shock_resistance) dump(youwere, "shock resistant");
296 + if (Poison_resistance) dump(youwere, "poison resistant");
297 + if (Drain_resistance) dump(youwere, "level-drain resistant");
298 + if (Sick_resistance) dump(youwere, "immune to sickness");
299 + if (Antimagic) dump(youwere, "magic-protected");
300 + if (Acid_resistance) dump(youwere, "acid resistant");
301 + if (Stone_resistance) dump(youwere, "petrification resistant");
302 + if (Invulnerable) dump(youwere, "invulnerable");
303 + if (u.uedibility) dump(youcould, "recognize detrimental food");
305 + /*** Troubles ***/
306 + if (Halluc_resistance) dump(" ", "You resisted hallucinations");
307 + if (Hallucination) dump(youwere, "hallucinating");
308 + if (Stunned) dump(youwere, "stunned");
309 + if (Confusion) dump(youwere, "confused");
310 + if (Blinded) dump(youwere, "blinded");
311 + if (Sick) {
312 + if (u.usick_type & SICK_VOMITABLE)
313 + dump(youwere, "sick from food poisoning");
314 + if (u.usick_type & SICK_NONVOMITABLE)
315 + dump(youwere, "sick from illness");
317 + if (Stoned) dump(youwere, "turning to stone");
318 + if (Slimed) dump(youwere, "turning into slime");
319 + if (Strangled)
320 + dump(youwere, (u.uburied) ? "buried" : "being strangled");
321 + if (Glib) {
322 + Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
323 + dump(youhad, buf);
325 + if (Fumbling) dump(" ", "You fumbled");
326 + if (Wounded_legs
327 +#ifdef STEED
328 + && !u.usteed
329 +#endif
330 + ) {
331 + Sprintf(buf, "wounded %s", makeplural(body_part(LEG)));
332 + dump(youhad, buf);
334 +#ifdef STEED
335 + if (Wounded_legs && u.usteed) {
336 + Strcpy(buf, x_monnam(u.usteed, ARTICLE_YOUR, (char *)0,
337 + SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION, FALSE));
338 + *buf = highc(*buf);
339 + Strcat(buf, " had wounded legs");
340 + dump(" ", buf);
342 +#endif
343 + if (Sleeping) dump(" ", "You fell asleep");
344 + if (Hunger) dump(" ", "You hungered rapidly");
346 + /*** Vision and senses ***/
347 + if (See_invisible) dump(" ", "You saw invisible");
348 + if (Blind_telepat) dump(youwere, "telepathic");
349 + if (Warning) dump(youwere, "warned");
350 + if (Warn_of_mon && flags.warntype) {
351 + Sprintf(buf, "aware of the presence of %s",
352 + (flags.warntype & M2_ORC) ? "orcs" :
353 + (flags.warntype & M2_DEMON) ? "demons" :
354 + something);
355 + dump(youwere, buf);
357 + if (Undead_warning) dump(youwere, "warned of undead");
358 + if (Searching) dump(youhad, "automatic searching");
359 + if (Clairvoyant) dump(youwere, "clairvoyant");
360 + if (Infravision) dump(youhad, "infravision");
361 + if (Detect_monsters)
362 + dump(youwere, "sensing the presence of monsters");
363 + if (u.umconf) dump(youwere, "going to confuse monsters");
365 + /*** Appearance and behavior ***/
366 + if (Adornment) {
367 + int adorn = 0;
368 + if(uleft && uleft->otyp == RIN_ADORNMENT) adorn += uleft->spe;
369 + if(uright && uright->otyp == RIN_ADORNMENT) adorn += uright->spe;
370 + if (adorn < 0)
371 + dump(youwere, "poorly adorned");
372 + else
373 + dump(youwere, "adorned");
375 + if (Invisible) dump(youwere, "invisible");
376 + else if (Invis) dump(youwere, "invisible to others");
377 + /* ordinarily "visible" is redundant; this is a special case for
378 + the situation when invisibility would be an expected attribute */
379 + else if ((HInvis || EInvis || pm_invisible(youmonst.data)) && BInvis)
380 + dump(youwere, "visible");
381 + if (Displaced) dump(youwere, "displaced");
382 + if (Stealth) dump(youwere, "stealthy");
383 + if (Aggravate_monster) dump(" ", "You aggravated monsters");
384 + if (Conflict) dump(" ", "You caused conflict");
386 + /*** Transportation ***/
387 + if (Jumping) dump(youcould, "jump");
388 + if (Teleportation) dump(youcould, "teleport");
389 + if (Teleport_control) dump(youhad, "teleport control");
390 + if (Lev_at_will) dump(youwere, "levitating, at will");
391 + else if (Levitation)
392 + dump(youwere, "levitating"); /* without control */
393 + else if (Flying) dump(youcould, "fly");
394 + if (Wwalking) dump(youcould, "walk on water");
395 + if (Swimming) dump(youcould, "swim");
396 + if (Breathless) dump(youcould, "survive without air");
397 + else if (Amphibious) dump(youcould, "breathe water");
398 + if (Passes_walls) dump(youcould, "walk through walls");
399 +#ifdef STEED
400 + if (u.usteed && (final < 2 || strcmp(killer, "riding accident"))) {
401 + Sprintf(buf, "riding %s", y_monnam(u.usteed));
402 + dump(youwere, buf);
404 +#endif
405 + if (u.uswallow) {
406 + Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck));
407 +#ifdef WIZARD
408 + if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim);
409 +#endif
410 + dump(youwere, buf);
411 + } else if (u.ustuck) {
412 + Sprintf(buf, "%s %s",
413 + (Upolyd && sticks(youmonst.data)) ? "holding" : "held by",
414 + a_monnam(u.ustuck));
415 + dump(youwere, buf);
418 + /*** Physical attributes ***/
419 + if (u.uhitinc)
420 + dump(youhad,
421 + enlght_combatinc("to hit", u.uhitinc, final, buf));
422 + if (u.udaminc)
423 + dump(youhad,
424 + enlght_combatinc("damage", u.udaminc, final, buf));
425 + if (Slow_digestion) dump(youhad, "slower digestion");
426 + if (Regeneration) dump(" ", "You regenerated");
427 + if (u.uspellprot || Protection) {
428 + int prot = 0;
430 + if(uleft && uleft->otyp == RIN_PROTECTION) prot += uleft->spe;
431 + if(uright && uright->otyp == RIN_PROTECTION) prot += uright->spe;
432 + if (HProtection & INTRINSIC) prot += u.ublessed;
433 + prot += u.uspellprot;
435 + if (prot < 0)
436 + dump(youwere, "ineffectively protected");
437 + else
438 + dump(youwere, "protected");
440 + if (Protection_from_shape_changers)
441 + dump(youwere, "protected from shape changers");
442 + if (Polymorph) dump(youwere, "polymorphing");
443 + if (Polymorph_control) dump(youhad, "polymorph control");
444 + if (u.ulycn >= LOW_PM) {
445 + Strcpy(buf, an(mons[u.ulycn].mname));
446 + dump(youwere, buf);
448 + if (Upolyd) {
449 + if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form");
450 + else Sprintf(buf, "polymorphed into %s",
451 + an(youmonst.data->mname));
452 +#ifdef WIZARD
453 + if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone);
454 +#endif
455 + dump(youwere, buf);
457 + if (Unchanging)
458 + dump(youcould, "not change from your current form");
459 + if (Fast) dump(youwere, Very_fast ? "very fast" : "fast");
460 + if (Reflecting) dump(youhad, "reflection");
461 + if (Free_action) dump(youhad, "free action");
462 + if (Fixed_abil) dump(youhad, "fixed abilities");
463 + if (Lifesaved)
464 + dump(" ", "Your life would have been saved");
465 + if (u.twoweap) dump(youwere, "wielding two weapons at once");
467 + /*** Miscellany ***/
468 + if (Luck) {
469 + ltmp = abs((int)Luck);
470 + Sprintf(buf, "%s%slucky (%d)",
471 + ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "",
472 + Luck < 0 ? "un" : "", Luck);
473 + dump(youwere, buf);
475 +#ifdef WIZARD
476 + else if (wizard) dump(" ", "Your luck was zero");
477 +#endif
478 + if (u.moreluck > 0) dump(youhad, "extra luck");
479 + else if (u.moreluck < 0) dump(youhad, "reduced luck");
480 + if (carrying(LUCKSTONE) || stone_luck(TRUE)) {
481 + ltmp = stone_luck(FALSE);
482 + if (ltmp <= 0)
483 + dump(" ", "Bad luck did not time out for you");
484 + if (ltmp >= 0)
485 + dump(" ", "Good luck did not time out for you");
488 + if (u.ugangr) {
489 + Sprintf(buf, " %sangry with you",
490 + u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : "");
491 +#ifdef WIZARD
492 + if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr);
493 +#endif
494 + Sprintf(buf2, "%s was %s", u_gname(), buf);
495 + dump(" ", buf2);
499 + const char *p;
501 + buf[0] = '\0';
502 + if (final < 2) { /* quit/escaped/ascended */
503 + p = "survived after being killed ";
504 + switch (u.umortality) {
505 + case 0: p = "survived"; break;
506 + case 1: Strcpy(buf, "once"); break;
507 + case 2: Strcpy(buf, "twice"); break;
508 + case 3: Strcpy(buf, "thrice"); break;
509 + default: Sprintf(buf, "%d times", u.umortality);
510 + break;
512 + } else { /* game ended in character's death */
513 + p = "are dead";
514 + switch (u.umortality) {
515 + case 0: impossible("dead without dying?");
516 + case 1: break; /* just "are dead" */
517 + default: Sprintf(buf, " (%d%s time!)", u.umortality,
518 + ordin(u.umortality));
519 + break;
522 + if (p) {
523 + Sprintf(buf2, "You %s %s", p, buf);
524 + dump(" ", buf2);
527 + dump("", "");
528 + return;
530 +} /* dump_enlightenment */
531 +#endif
534 * Courtesy function for non-debug, non-explorer mode players
535 * to help refresh them about who/what they are.
536 @@ -1341,6 +1640,99 @@
537 destroy_nhwindow(en_win);
540 +#ifdef DUMP_LOG
541 +void
542 +dump_conduct(final)
543 +int final;
545 + char buf[BUFSZ];
546 + int ngenocided;
548 + dump("", "Voluntary challenges");
550 + if (!u.uconduct.food)
551 + dump("", " You went without food");
552 + /* But beverages are okay */
553 + else if (!u.uconduct.unvegan)
554 + dump("", " You followed a strict vegan diet");
555 + else if (!u.uconduct.unvegetarian)
556 + dump("", " You were a vegetarian");
557 + else if (Role_if(PM_MONK) && u.uconduct.unvegetarian < 10) {
558 + sprintf(buf, " You ate non-vegetarian food %ld time%s.",
559 + u.uconduct.unvegetarian, plur(u.uconduct.unvegetarian));
560 + dump("", buf);
563 + if (!u.uconduct.gnostic)
564 + dump("", " You were an atheist");
566 + if (!u.uconduct.weaphit)
567 + dump("", " You never hit with a wielded weapon");
568 + else if (Role_if(PM_MONK) && u.uconduct.weaphit < 10) {
569 + Sprintf(buf, " You hit with a wielded weapon %ld time%s",
570 + u.uconduct.weaphit, plur(u.uconduct.weaphit));
571 + dump("", buf);
573 +#ifdef WIZARD
574 + else if (wizard) {
575 + Sprintf(buf, "hit with a wielded weapon %ld time%s",
576 + u.uconduct.weaphit, plur(u.uconduct.weaphit));
577 + dump(" You ", buf);
579 +#endif
580 + if (!u.uconduct.killer)
581 + dump("", " You were a pacifist");
583 + if (!u.uconduct.literate)
584 + dump("", " You were illiterate");
585 +#ifdef WIZARD
586 + else if (wizard) {
587 + Sprintf(buf, "read items or engraved %ld time%s",
588 + u.uconduct.literate, plur(u.uconduct.literate));
589 + dump(" You ", buf);
591 +#endif
593 + ngenocided = num_genocides();
594 + if (ngenocided == 0) {
595 + dump("", " You never genocided any monsters");
596 + } else {
597 + Sprintf(buf, "genocided %d type%s of monster%s",
598 + ngenocided, plur(ngenocided), plur(ngenocided));
599 + dump(" You ", buf);
602 + if (!u.uconduct.polypiles)
603 + dump("", " You never polymorphed an object");
604 + else {
605 + Sprintf(buf, "polymorphed %ld item%s",
606 + u.uconduct.polypiles, plur(u.uconduct.polypiles));
607 + dump(" You ", buf);
610 + if (!u.uconduct.polyselfs)
611 + dump("", " You never changed form");
612 + else {
613 + Sprintf(buf, "changed form %ld time%s",
614 + u.uconduct.polyselfs, plur(u.uconduct.polyselfs));
615 + dump(" You ", buf);
618 + if (!u.uconduct.wishes)
619 + dump("", " You used no wishes");
620 + else {
621 + Sprintf(buf, "used %ld wish%s",
622 + u.uconduct.wishes, (u.uconduct.wishes > 1L) ? "es" : "");
623 + dump(" You ", buf);
625 + if (!u.uconduct.wisharti)
626 + dump("", " You did not wish for any artifacts");
629 + dump("", "");
631 +#endif /* DUMP_LOG */
633 #endif /* OVLB */
634 #ifdef OVL1
636 diff -bNurd nethack-3.4.3/src/decl.c nh343dump/src/decl.c
637 --- nethack-3.4.3/src/decl.c 2003-12-08 01:39:13.000000000 +0200
638 +++ nh343dump/src/decl.c 2006-06-26 09:53:58.000000000 +0300
639 @@ -209,6 +209,15 @@
641 NEARDATA struct mvitals mvitals[NUMMONS];
643 +/* originally from end.c */
644 +#ifdef DUMP_LOG
645 +#ifdef DUMP_FN
646 +char dump_fn[] = DUMP_FN;
647 +#else
648 +char dump_fn[PL_PSIZ] = DUMMY;
649 +#endif
650 +#endif /* DUMP_LOG */
652 NEARDATA struct c_color_names c_color_names = {
653 "black", "amber", "golden",
654 "light blue", "red", "green",
655 diff -bNurd nethack-3.4.3/src/display.c nh343dump/src/display.c
656 --- nethack-3.4.3/src/display.c 2003-12-08 01:39:13.000000000 +0200
657 +++ nh343dump/src/display.c 2006-06-26 09:53:58.000000000 +0300
658 @@ -1370,6 +1370,106 @@
660 /* ========================================================================= */
662 +#ifdef DUMP_LOG
663 +/* D: Added to dump screen to output file */
664 +STATIC_PTR uchar get_glyph_char(glyph)
665 +int glyph;
667 + uchar ch;
668 + register int offset;
670 + if (glyph >= NO_GLYPH)
671 + return ' ';
673 + /*
674 + * Map the glyph back to a character.
676 + * Warning: For speed, this makes an assumption on the order of
677 + * offsets. The order is set in display.h.
678 + */
679 + if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */
680 + ch = def_warnsyms[offset].sym;
681 + } else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) { /* swallow */
682 + /* see swallow_to_glyph() in display.c */
683 + ch = (uchar) defsyms[S_sw_tl + (offset & 0x7)].sym;
684 + } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) { /* zap beam */
685 + /* see zapdir_to_glyph() in display.c */
686 + ch = defsyms[S_vbeam + (offset & 0x3)].sym;
687 + } else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) { /* cmap */
688 + ch = defsyms[offset].sym;
689 + } else if ((offset = (glyph - GLYPH_OBJ_OFF)) >= 0) { /* object */
690 + ch = def_oc_syms[(int)objects[offset].oc_class];
691 + } else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */
692 + ch = def_monsyms[(int)mons[offset].mlet];
693 + } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) { /* a corpse */
694 + ch = def_oc_syms[(int)objects[CORPSE].oc_class];
695 + } else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */
696 + ch = def_monsyms[(int)mons[offset].mlet];
697 + } else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) { /* invisible */
698 + ch = DEF_INVISIBLE;
699 + } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) { /* a pet */
700 + ch = def_monsyms[(int)mons[offset].mlet];
701 + } else { /* a monster */
702 + ch = monsyms[(int)mons[glyph].mlet];
704 + return ch;
707 +#ifdef TTY_GRAPHICS
708 +extern const char * FDECL(compress_str, (const char *));
709 +#else
710 +const char*
711 +compress_str(str) /* copied from win/tty/wintty.c */
712 +const char *str;
714 + static char cbuf[BUFSZ];
715 + /* compress in case line too long */
716 + if((int)strlen(str) >= 80) {
717 + register const char *bp0 = str;
718 + register char *bp1 = cbuf;
720 + do {
721 + if(*bp0 != ' ' || bp0[1] != ' ')
722 + *bp1++ = *bp0;
723 + } while(*bp0++);
724 + } else
725 + return str;
726 + return cbuf;
728 +#endif /* TTY_GRAPHICS */
730 +/* Take a screen dump */
731 +void dump_screen()
733 + register int x,y;
734 + int lastc;
735 + /* D: botl.c has a closer approximation to the size, but we'll go with
736 + * this */
737 + char buf[300], *ptr;
739 + for (y = 0; y < ROWNO; y++) {
740 + lastc = 0;
741 + ptr = buf;
742 + for (x = 1; x < COLNO; x++) {
743 + uchar c = get_glyph_char(gbuf[y][x].glyph);
744 + *ptr++ = c;
745 + if (c != ' ')
746 + lastc = x;
748 + buf[lastc] = '\0';
749 + dump("", buf);
751 + dump("", "");
752 + bot1str(buf);
753 + ptr = (char *) compress_str((const char *) buf);
754 + dump("", ptr);
755 + bot2str(buf);
756 + dump("", buf);
757 + dump("", "");
758 + dump("", "");
760 +#endif /* DUMP_LOG */
763 * back_to_glyph()
765 diff -bNurd nethack-3.4.3/src/end.c nh343dump/src/end.c
766 --- nethack-3.4.3/src/end.c 2003-12-08 01:39:13.000000000 +0200
767 +++ nh343dump/src/end.c 2006-06-26 12:41:46.000000000 +0300
768 @@ -40,7 +40,15 @@
769 STATIC_DCL void FDECL(artifact_score, (struct obj *,BOOLEAN_P,winid));
770 STATIC_DCL void FDECL(savelife, (int));
771 STATIC_DCL void FDECL(list_vanquished, (CHAR_P,BOOLEAN_P));
772 +#ifdef DUMP_LOG
773 +extern char msgs[][BUFSZ];
774 +extern int lastmsg;
775 +extern void NDECL(dump_spells);
776 +void FDECL(do_vanquished, (int, BOOLEAN_P, BOOLEAN_P));
777 +STATIC_DCL void FDECL(list_genocided, (int, BOOLEAN_P, BOOLEAN_P));
778 +#else
779 STATIC_DCL void FDECL(list_genocided, (CHAR_P,BOOLEAN_P));
780 +#endif /* DUMP_LOG */
781 STATIC_DCL boolean FDECL(should_query_disclose_option, (int,char *));
783 #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2)
784 @@ -86,6 +94,62 @@
786 extern const char * const killed_by_prefix[]; /* from topten.c */
788 +#ifdef DUMP_LOG
789 +FILE *dump_fp = (FILE *)0; /* file pointer for dumps */
790 +/* functions dump_init, dump_exit and dump are from the dump patch */
792 +void
793 +dump_init ()
795 + if (dump_fn[0]) {
796 + char *p = (char *) strstr(dump_fn, "%n");
797 + if (p) {
798 + int new_dump_fn_len = strlen(dump_fn)+strlen(plname)-2; /* %n */
799 + char *new_dump_fn = (char *) alloc((unsigned)(new_dump_fn_len+1));
800 + char *q = new_dump_fn;
801 + strncpy(q, dump_fn, p-dump_fn);
802 + q += p-dump_fn;
803 + strncpy(q, plname, strlen(plname) + 1);
804 + regularize(q);
805 + q[strlen(plname)] = '\0';
806 + q += strlen(q);
807 + p += 2; /* skip "%n" */
808 + strncpy(q, p, strlen(p));
809 + new_dump_fn[new_dump_fn_len] = '\0';
811 + dump_fp = fopen(new_dump_fn, "w");
812 + if (!dump_fp) {
813 + pline("Can't open %s for output.", new_dump_fn);
814 + pline("Dump file not created.");
816 + free(new_dump_fn);
818 + } else {
819 + dump_fp = fopen (dump_fn, "w");
821 + if (!dump_fp) {
822 + pline("Can't open %s for output.", dump_fn);
823 + pline("Dump file not created.");
829 +void
830 +dump_exit ()
832 + if (dump_fp)
833 + fclose (dump_fp);
836 +void dump (pre, str)
837 + char *pre, *str;
839 + if (dump_fp)
840 + fprintf (dump_fp, "%s%s\n", pre, str);
842 +#endif /* DUMP_LOG */
844 /*ARGSUSED*/
845 void
846 done1(sig_unused) /* called as signal() handler, so sent at least one arg */
847 @@ -366,18 +430,30 @@
848 ask = should_query_disclose_option('i', &defquery);
849 if (!done_stopprint) {
850 c = ask ? yn_function(qbuf, ynqchars, defquery) : defquery;
851 - if (c == 'y') {
852 + } else {
853 + c = 'n';
856 +#ifdef DUMP_LOG
857 + boolean want_disp = (c == 'y')? TRUE: FALSE;
858 +#endif
859 struct obj *obj;
861 for (obj = invent; obj; obj = obj->nobj) {
862 makeknown(obj->otyp);
863 obj->known = obj->bknown = obj->dknown = obj->rknown = 1;
865 +#ifdef DUMP_LOG
866 + (void) dump_inventory((char *)0, TRUE, want_disp);
867 + do_containerconts(invent, TRUE, TRUE, TRUE, want_disp);
868 +#else
869 + if (c == 'y') {
870 (void) display_inventory((char *)0, TRUE);
871 container_contents(invent, TRUE, TRUE);
873 - if (c == 'q') done_stopprint++;
874 +#endif /* DUMP_LOG */
876 + if (c == 'q') done_stopprint++;
879 ask = should_query_disclose_option('a', &defquery);
880 @@ -388,14 +464,28 @@
881 enlightenment(how >= PANICKED ? 1 : 2); /* final */
882 if (c == 'q') done_stopprint++;
884 +#ifdef DUMP_LOG
885 + if (dump_fp) {
886 + dump_enlightenment((int) (how >= PANICKED ? 1 : 2));
887 + dump_spells();
889 +#endif
891 ask = should_query_disclose_option('v', &defquery);
892 +#ifdef DUMP_LOG
893 + do_vanquished(defquery, ask, TRUE);
894 +#else
895 if (!done_stopprint)
896 list_vanquished(defquery, ask);
897 +#endif
899 ask = should_query_disclose_option('g', &defquery);
900 if (!done_stopprint)
901 +#ifdef DUMP_LOG
902 + list_genocided(defquery, ask,TRUE);
903 +#else
904 list_genocided(defquery, ask);
905 +#endif
907 ask = should_query_disclose_option('c', &defquery);
908 if (!done_stopprint) {
909 @@ -405,6 +495,12 @@
910 show_conduct(how >= PANICKED ? 1 : 2);
911 if (c == 'q') done_stopprint++;
913 +#ifdef DUMP_LOG
914 + if (dump_fp) {
915 + dump_conduct(how >= PANICKED ? 1 : 2);
916 + dump_weapon_skill();
918 +#endif
921 /* try to get the player back in a viable state after being killed */
922 @@ -523,6 +619,11 @@
923 otmp->oartifact ? artifact_name(xname(otmp), &dummy) :
924 OBJ_NAME(objects[otmp->otyp]),
925 value, currency(value), points);
926 +#ifdef DUMP_LOG
927 + if (dump_fp)
928 + dump("", pbuf);
929 + if (endwin != WIN_ERR)
930 +#endif
931 putstr(endwin, 0, pbuf);
934 @@ -542,6 +643,7 @@
935 boolean bones_ok, have_windows = iflags.window_inited;
936 struct obj *corpse = (struct obj *)0;
937 long umoney;
938 + int i;
940 if (how == TRICKED) {
941 if (killer) {
942 @@ -614,6 +716,22 @@
943 program_state.gameover = 1;
944 /* in case of a subsequent panic(), there's no point trying to save */
945 program_state.something_worth_saving = 0;
946 +#ifdef DUMP_LOG
947 + /* D: Grab screen dump right here */
948 + if (dump_fn[0]) {
949 + dump_init();
950 + Sprintf(pbuf, "%s, %s %s %s %s", plname,
951 + aligns[1 - u.ualign.type].adj,
952 + genders[flags.female].adj,
953 + urace.adj,
954 + (flags.female && urole.name.f)?
955 + urole.name.f : urole.name.m);
956 + dump("", pbuf);
957 + /* D: Add a line for clearance from the screen dump */
958 + dump("", "");
959 + dump_screen();
961 +#endif /* DUMP_LOG */
962 /* render vision subsystem inoperative */
963 iflags.vision_inited = 0;
964 /* might have been killed while using a disposable item, so make sure
965 @@ -692,8 +810,23 @@
967 if (have_windows) display_nhwindow(WIN_MESSAGE, FALSE);
969 - if (strcmp(flags.end_disclose, "none") && how != PANICKED)
970 + if (strcmp(flags.end_disclose, "none") && how != PANICKED) {
971 disclose(how, taken);
972 +#if defined(DUMP_LOG) && defined(DUMPMSGS)
973 + if (lastmsg >= 0) {
974 + dump ("", "Latest messages");
975 + for (i = lastmsg + 1; i < DUMPMSGS; i++) {
976 + if (msgs[i] && strcmp(msgs[i], "") )
977 + dump (" ", msgs[i]);
978 + }
979 + for (i = 0; i <= lastmsg; i++) {
980 + if (msgs[i] && strcmp(msgs[i], "") )
981 + dump (" ", msgs[i]);
982 + }
983 + dump ("","");
985 +#endif
987 /* finish_paybill should be called after disclosure but before bones */
988 if (bones_ok && taken) finish_paybill();
990 @@ -770,15 +903,18 @@
991 /* don't bother counting to see whether it should be plural */
994 - if (!done_stopprint) {
995 Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname,
996 how != ASCENDED ?
997 (const char *) ((flags.female && urole.name.f) ?
998 urole.name.f : urole.name.m) :
999 (const char *) (flags.female ? "Demigoddess" : "Demigod"));
1000 + if (!done_stopprint) {
1001 putstr(endwin, 0, pbuf);
1002 putstr(endwin, 0, "");
1004 +#ifdef DUMP_LOG
1005 + if (dump_fp) dump("", pbuf);
1006 +#endif
1008 if (how == ESCAPED || how == ASCENDED) {
1009 register struct monst *mtmp;
1010 @@ -805,31 +941,39 @@
1011 keepdogs(TRUE);
1012 viz_array[0][0] |= IN_SIGHT; /* need visibility for naming */
1013 mtmp = mydogs;
1014 - if (!done_stopprint) Strcpy(pbuf, "You");
1015 + Strcpy(pbuf, "You");
1016 if (mtmp) {
1017 while (mtmp) {
1018 - if (!done_stopprint)
1019 Sprintf(eos(pbuf), " and %s", mon_nam(mtmp));
1020 if (mtmp->mtame)
1021 u.urexp += mtmp->mhp;
1022 mtmp = mtmp->nmon;
1024 if (!done_stopprint) putstr(endwin, 0, pbuf);
1025 +#ifdef DUMP_LOG
1026 + if (dump_fp) dump("", pbuf);
1027 +#endif
1028 pbuf[0] = '\0';
1029 } else {
1030 if (!done_stopprint) Strcat(pbuf, " ");
1032 - if (!done_stopprint) {
1033 Sprintf(eos(pbuf), "%s with %ld point%s,",
1034 how==ASCENDED ? "went to your reward" :
1035 "escaped from the dungeon",
1036 u.urexp, plur(u.urexp));
1037 +#ifdef DUMP_LOG
1038 + if (dump_fp) dump("", pbuf);
1039 +#endif
1040 + if (!done_stopprint) {
1041 putstr(endwin, 0, pbuf);
1044 if (!done_stopprint)
1045 artifact_score(invent, FALSE, endwin); /* list artifacts */
1047 +#ifdef DUMP_LOG
1048 + else
1049 + artifact_score(invent, FALSE, WIN_ERR);
1050 +#endif
1051 /* list valuables here */
1052 for (val = valuables; val->list; val++) {
1053 sort_valuables(val->list, val->size);
1054 @@ -855,10 +999,13 @@
1055 count, plur(count));
1057 putstr(endwin, 0, pbuf);
1058 +#ifdef DUMP_LOG
1059 + if (dump_fp) dump("", pbuf);
1060 +#endif
1064 - } else if (!done_stopprint) {
1065 + } else {
1066 /* did not escape or ascend */
1067 if (u.uz.dnum == 0 && u.uz.dlevel <= 0) {
1068 /* level teleported out of the dungeon; `how' is DIED,
1069 @@ -878,21 +1025,32 @@
1071 Sprintf(eos(pbuf), " with %ld point%s,",
1072 u.urexp, plur(u.urexp));
1073 - putstr(endwin, 0, pbuf);
1074 + if (!done_stopprint) putstr(endwin, 0, pbuf);
1075 +#ifdef DUMP_LOG
1076 + if (dump_fp) dump("", pbuf);
1077 +#endif
1080 - if (!done_stopprint) {
1081 Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.",
1082 umoney, plur(umoney), moves, plur(moves));
1083 - putstr(endwin, 0, pbuf);
1084 + if (!done_stopprint) putstr(endwin, 0, pbuf);
1085 +#ifdef DUMP_LOG
1086 + if (dump_fp) {
1087 + dump("", pbuf);
1088 + Sprintf(pbuf, "Killer: %s", killer);
1089 + dump("", pbuf);
1091 - if (!done_stopprint) {
1092 +#endif
1093 Sprintf(pbuf,
1094 "You were level %d with a maximum of %d hit point%s when you %s.",
1095 u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]);
1096 + if (!done_stopprint) {
1097 putstr(endwin, 0, pbuf);
1098 putstr(endwin, 0, "");
1100 +#ifdef DUMP_LOG
1101 + if (dump_fp) dump("", pbuf);
1102 +#endif
1103 if (!done_stopprint)
1104 display_nhwindow(endwin, TRUE);
1105 if (endwin != WIN_ERR)
1106 @@ -909,6 +1067,9 @@
1107 exit_nhwindows((char *)0);
1108 topten(how);
1110 +#ifdef DUMP_LOG
1111 + if (dump_fp) dump_exit();
1112 +#endif
1114 if(done_stopprint) { raw_print(""); raw_print(""); }
1115 terminate(EXIT_SUCCESS);
1116 @@ -919,6 +1080,16 @@
1117 container_contents(list, identified, all_containers)
1118 struct obj *list;
1119 boolean identified, all_containers;
1120 +#ifdef DUMP_LOG
1122 + do_containerconts(list, identified, all_containers, FALSE, TRUE);
1125 +void do_containerconts(list, identified, all_containers, want_dump, want_disp)
1126 +struct obj *list;
1127 +boolean identified, all_containers, want_dump, want_disp;
1128 +#endif
1129 +/* The original container_contents function */
1131 register struct obj *box, *obj;
1132 char buf[BUFSZ];
1133 @@ -928,25 +1099,62 @@
1134 if (box->otyp == BAG_OF_TRICKS) {
1135 continue; /* wrong type of container */
1136 } else if (box->cobj) {
1137 - winid tmpwin = create_nhwindow(NHW_MENU);
1138 + winid tmpwin;
1139 +#ifdef DUMP_LOG
1140 + if (want_disp)
1141 +#endif
1142 + tmpwin = create_nhwindow(NHW_MENU);
1143 Sprintf(buf, "Contents of %s:", the(xname(box)));
1144 +#ifdef DUMP_LOG
1145 + if (want_disp) {
1146 +#endif
1147 putstr(tmpwin, 0, buf);
1148 putstr(tmpwin, 0, "");
1149 +#ifdef DUMP_LOG
1151 + if (dump_fp) dump("", buf);
1152 +#endif
1153 for (obj = box->cobj; obj; obj = obj->nobj) {
1154 if (identified) {
1155 makeknown(obj->otyp);
1156 obj->known = obj->bknown =
1157 obj->dknown = obj->rknown = 1;
1159 +#ifdef DUMP_LOG
1160 + if (want_dump) dump(" ", doname(obj));
1161 + if (want_disp)
1162 +#endif
1163 putstr(tmpwin, 0, doname(obj));
1165 +#ifdef DUMP_LOG
1166 + if (want_dump) dump("","");
1167 + if (want_disp) {
1168 +#endif
1169 display_nhwindow(tmpwin, TRUE);
1170 destroy_nhwindow(tmpwin);
1171 - if (all_containers)
1172 +#ifdef DUMP_LOG
1174 + if (all_containers) {
1175 + do_containerconts(box->cobj, identified, TRUE,
1176 + want_dump, want_disp);
1177 +#else
1178 + if (all_containers) {
1179 container_contents(box->cobj, identified, TRUE);
1180 +#endif /* DUMP_LOG */
1182 } else {
1183 +#ifdef DUMP_LOG
1184 + if (want_disp) {
1185 +#endif
1186 pline("%s empty.", Tobjnam(box, "are"));
1187 display_nhwindow(WIN_MESSAGE, FALSE);
1188 +#ifdef DUMP_LOG
1190 + if (want_dump) {
1191 + dump(The(xname(box)), " is empty.");
1192 + dump("", "");
1194 +#endif
1197 if (!all_containers)
1198 @@ -977,6 +1185,17 @@
1199 list_vanquished(defquery, ask)
1200 char defquery;
1201 boolean ask;
1202 +#ifdef DUMP_LOG
1204 + do_vanquished(defquery, ask, FALSE);
1207 +void
1208 +do_vanquished(defquery, ask, want_dump)
1209 +int defquery;
1210 +boolean ask;
1211 +boolean want_dump;
1212 +#endif
1214 register int i, lev;
1215 int ntypes = 0, max_lev = 0, nkilled;
1216 @@ -996,13 +1215,22 @@
1217 * includes all dead monsters, not just those killed by the player
1219 if (ntypes != 0) {
1220 - c = ask ? yn_function("Do you want an account of creatures vanquished?",
1221 +#ifdef DUMP_LOG
1222 + c = done_stopprint ? 'n': ask ?
1223 +#else
1224 + c = ask ?
1225 +#endif
1226 + yn_function("Do you want an account of creatures vanquished?",
1227 ynqchars, defquery) : defquery;
1228 if (c == 'q') done_stopprint++;
1229 if (c == 'y') {
1230 klwin = create_nhwindow(NHW_MENU);
1231 putstr(klwin, 0, "Vanquished creatures:");
1232 putstr(klwin, 0, "");
1233 +#ifdef DUMP_LOG
1234 + } /* the original end of block removed by the patch */
1235 + if (want_dump) dump("", "Vanquished creatures");
1236 +#endif
1238 /* countdown by monster "toughness" */
1239 for (lev = max_lev; lev >= 0; lev--)
1240 @@ -1030,20 +1258,32 @@
1241 Sprintf(buf, "%d %s",
1242 nkilled, makeplural(mons[i].mname));
1244 - putstr(klwin, 0, buf);
1245 + if (c == 'y') putstr(klwin, 0, buf);
1246 +#ifdef DUMP_LOG
1247 + if (want_dump) dump(" ", buf);
1248 +#endif
1251 * if (Hallucination)
1252 * putstr(klwin, 0, "and a partridge in a pear tree");
1254 if (ntypes > 1) {
1255 - putstr(klwin, 0, "");
1256 + if (c == 'y') putstr(klwin, 0, "");
1257 Sprintf(buf, "%ld creatures vanquished.", total_killed);
1258 - putstr(klwin, 0, buf);
1259 + if (c == 'y') putstr(klwin, 0, buf);
1260 +#ifdef DUMP_LOG
1261 + if (want_dump) dump(" ", buf);
1262 +#endif
1264 + if (c == 'y') {
1265 display_nhwindow(klwin, TRUE);
1266 destroy_nhwindow(klwin);
1268 +#ifdef DUMP_LOG
1269 + if (want_dump) dump("", "");
1270 +#else
1271 + } /* the original end of if (c == 'y') */
1272 +#endif
1276 @@ -1059,10 +1299,18 @@
1277 return n;
1280 +#ifdef DUMP_LOG
1281 +STATIC_OVL void
1282 +list_genocided(defquery, ask, want_dump)
1283 +int defquery;
1284 +boolean ask;
1285 +boolean want_dump;
1286 +#else
1287 STATIC_OVL void
1288 list_genocided(defquery, ask)
1289 char defquery;
1290 boolean ask;
1291 +#endif
1293 register int i;
1294 int ngenocided;
1295 @@ -1079,8 +1327,12 @@
1296 if (c == 'q') done_stopprint++;
1297 if (c == 'y') {
1298 klwin = create_nhwindow(NHW_MENU);
1299 - putstr(klwin, 0, "Genocided species:");
1300 + Sprintf(buf, "Genocided species:");
1301 + putstr(klwin, 0, buf);
1302 putstr(klwin, 0, "");
1303 +#ifdef DUMP_LOG
1304 + if (want_dump) dump("", buf);
1305 +#endif
1307 for (i = LOW_PM; i < NUMMONS; i++)
1308 if (mvitals[i].mvflags & G_GENOD) {
1309 @@ -1091,11 +1343,17 @@
1310 else
1311 Strcpy(buf, makeplural(mons[i].mname));
1312 putstr(klwin, 0, buf);
1313 +#ifdef DUMP_LOG
1314 + if (want_dump) dump(" ", buf);
1315 +#endif
1318 putstr(klwin, 0, "");
1319 Sprintf(buf, "%d species genocided.", ngenocided);
1320 putstr(klwin, 0, buf);
1321 +#ifdef DUMP_LOG
1322 + if (want_dump) dump(" ", buf);
1323 +#endif
1325 display_nhwindow(klwin, TRUE);
1326 destroy_nhwindow(klwin);
1327 diff -bNurd nethack-3.4.3/src/invent.c nh343dump/src/invent.c
1328 --- nethack-3.4.3/src/invent.c 2003-12-08 01:39:13.000000000 +0200
1329 +++ nh343dump/src/invent.c 2006-06-26 09:53:58.000000000 +0300
1330 @@ -19,7 +19,12 @@
1331 STATIC_DCL boolean FDECL(putting_on, (const char *));
1332 STATIC_PTR int FDECL(ckunpaid,(struct obj *));
1333 STATIC_PTR int FDECL(ckvalidcat,(struct obj *));
1334 +#ifdef DUMP_LOG
1335 +static char FDECL(display_pickinv,
1336 + (const char *,BOOLEAN_P, long *, BOOLEAN_P, BOOLEAN_P));
1337 +#else
1338 static char FDECL(display_pickinv, (const char *,BOOLEAN_P, long *));
1339 +#endif /* DUMP_LOG */
1340 #ifdef OVLB
1341 STATIC_DCL boolean FDECL(this_type_only, (struct obj *));
1342 STATIC_DCL void NDECL(dounpaid);
1343 @@ -1017,7 +1022,11 @@
1344 if (ilet == '?' && !*lets && *altlets)
1345 allowed_choices = altlets;
1346 ilet = display_pickinv(allowed_choices, TRUE,
1347 - allowcnt ? &ctmp : (long *)0);
1348 + allowcnt ? &ctmp : (long *)0
1349 +#ifdef DUMP_LOG
1350 + , FALSE, TRUE
1351 +#endif
1352 + );
1353 if(!ilet) continue;
1354 if (allowcnt && ctmp >= 0) {
1355 cnt = ctmp;
1356 @@ -1689,11 +1698,21 @@
1357 * inventory and return a count as well as a letter. If out_cnt is not null,
1358 * any count returned from the menu selection is placed here.
1360 +#ifdef DUMP_LOG
1361 +static char
1362 +display_pickinv(lets, want_reply, out_cnt, want_dump, want_disp)
1363 +register const char *lets;
1364 +boolean want_reply;
1365 +long* out_cnt;
1366 +boolean want_dump;
1367 +boolean want_disp;
1368 +#else
1369 static char
1370 display_pickinv(lets, want_reply, out_cnt)
1371 register const char *lets;
1372 boolean want_reply;
1373 long* out_cnt;
1374 +#endif
1376 struct obj *otmp;
1377 char ilet, ret;
1378 @@ -1704,6 +1723,9 @@
1379 anything any;
1380 menu_item *selected;
1382 +#ifdef DUMP_LOG
1383 + if (want_disp) {
1384 +#endif
1385 /* overriden by global flag */
1386 if (flags.perm_invent) {
1387 win = (lets && *lets) ? local_win : WIN_INVEN;
1388 @@ -1713,6 +1735,11 @@
1389 } else
1390 win = WIN_INVEN;
1392 +#ifdef DUMP_LOG
1394 + if (want_dump) dump("", "Your inventory");
1395 +#endif
1398 Exit early if no inventory -- but keep going if we are doing
1399 a permanent inventory update. We need to keep going so the
1400 @@ -1725,11 +1752,24 @@
1401 to here is short circuited away.
1403 if (!invent && !(flags.perm_invent && !lets && !want_reply)) {
1404 +#ifdef DUMP_LOG
1405 + if (want_disp) {
1406 +#endif
1407 #ifndef GOLDOBJ
1408 pline("Not carrying anything%s.", u.ugold ? " except gold" : "");
1409 #else
1410 pline("Not carrying anything.");
1411 #endif
1412 +#ifdef DUMP_LOG
1414 + if (want_dump) {
1415 +#ifdef GOLDOBJ
1416 + dump(" ", "Not carrying anything");
1417 +#else
1418 + dump(" Not carrying anything", u.ugold ? " except gold." : ".");
1419 +#endif
1421 +#endif
1422 return 0;
1425 @@ -1743,16 +1783,31 @@
1426 ret = '\0';
1427 for (otmp = invent; otmp; otmp = otmp->nobj) {
1428 if (otmp->invlet == lets[0]) {
1429 +#ifdef DUMP_LOG
1430 + if (want_disp) {
1431 +#endif
1432 ret = message_menu(lets[0],
1433 want_reply ? PICK_ONE : PICK_NONE,
1434 xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L));
1435 if (out_cnt) *out_cnt = -1L; /* select all */
1436 +#ifdef DUMP_LOG
1438 + if (want_dump) {
1439 + char letbuf[7];
1440 + sprintf(letbuf, " %c - ", lets[0]);
1441 + dump(letbuf,
1442 + xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L));
1444 +#endif
1445 break;
1448 return ret;
1451 +#ifdef DUMP_LOG
1452 + if (want_disp)
1453 +#endif
1454 start_menu(win);
1455 nextclass:
1456 classcount = 0;
1457 @@ -1763,11 +1818,24 @@
1458 if (!flags.sortpack || otmp->oclass == *invlet) {
1459 if (flags.sortpack && !classcount) {
1460 any.a_void = 0; /* zero */
1461 +#ifdef DUMP_LOG
1462 + if (want_dump)
1463 + dump(" ", let_to_name(*invlet, FALSE));
1464 + if (want_disp)
1465 +#endif
1466 add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
1467 let_to_name(*invlet, FALSE), MENU_UNSELECTED);
1468 classcount++;
1470 any.a_char = ilet;
1471 +#ifdef DUMP_LOG
1472 + if (want_dump) {
1473 + char letbuf[7];
1474 + sprintf(letbuf, " %c - ", ilet);
1475 + dump(letbuf, doname(otmp));
1477 + if (want_disp)
1478 +#endif
1479 add_menu(win, obj_to_glyph(otmp),
1480 &any, ilet, 0, ATR_NONE, doname(otmp),
1481 MENU_UNSELECTED);
1482 @@ -1783,6 +1851,9 @@
1484 #endif
1486 +#ifdef DUMP_LOG
1487 + if (want_disp) {
1488 +#endif
1489 end_menu(win, (char *) 0);
1491 n = select_menu(win, want_reply ? PICK_ONE : PICK_NONE, &selected);
1492 @@ -1792,6 +1863,10 @@
1493 free((genericptr_t)selected);
1494 } else
1495 ret = !n ? '\0' : '\033'; /* cancelled */
1496 +#ifdef DUMP_LOG
1497 + } /* want_disp */
1498 + if (want_dump) dump("", "");
1499 +#endif
1501 return ret;
1503 @@ -1808,9 +1883,24 @@
1504 register const char *lets;
1505 boolean want_reply;
1507 - return display_pickinv(lets, want_reply, (long *)0);
1508 + return display_pickinv(lets, want_reply, (long *)0
1509 +#ifdef DUMP_LOG
1510 + , FALSE , TRUE
1511 +#endif
1512 + );
1515 +#ifdef DUMP_LOG
1516 +/* See display_inventory. This is the same thing WITH dumpfile creation */
1517 +char
1518 +dump_inventory(lets, want_reply, want_disp)
1519 +register const char *lets;
1520 +boolean want_reply, want_disp;
1522 + return display_pickinv(lets, want_reply, (long *)0, TRUE, want_disp);
1524 +#endif
1527 * Returns the number of unpaid items within the given list. This includes
1528 * contained objects.
1529 diff -bNurd nethack-3.4.3/src/options.c nh343dump/src/options.c
1530 --- nethack-3.4.3/src/options.c 2003-12-08 01:39:13.000000000 +0200
1531 +++ nh343dump/src/options.c 2006-06-26 09:53:58.000000000 +0300
1532 @@ -224,6 +224,14 @@
1533 SET_IN_GAME },
1534 { "dogname", "the name of your (first) dog (e.g., dogname:Fang)",
1535 PL_PSIZ, DISP_IN_GAME },
1536 +#ifdef DUMP_LOG
1537 + { "dumpfile", "where to dump data (e.g., dumpfile:/tmp/dump.nh)",
1538 +#ifdef DUMP_FN
1539 + PL_PSIZ, DISP_IN_GAME },
1540 +#else
1541 + PL_PSIZ, SET_IN_GAME },
1542 +#endif
1543 +#endif
1544 { "dungeon", "the symbols to use in drawing the dungeon map",
1545 MAXDCHARS+1, SET_IN_FILE },
1546 { "effects", "the symbols to use in drawing special effects",
1547 @@ -1077,6 +1085,19 @@
1548 return;
1551 +#ifdef DUMP_LOG
1552 + fullname = "dumpfile";
1553 + if (match_optname(opts, fullname, 3, TRUE)) {
1554 +#ifndef DUMP_FN
1555 + if (negated) bad_negation(fullname, FALSE);
1556 + else if ((op = string_for_opt(opts, !tfrom_file)) != 0
1557 + && strlen(op) > 1)
1558 + nmcpy(dump_fn, op, PL_PSIZ);
1559 +#endif
1560 + return;
1562 +#endif
1564 fullname = "horsename";
1565 if (match_optname(opts, fullname, 5, TRUE)) {
1566 if (negated) bad_negation(fullname, FALSE);
1567 @@ -2933,6 +2954,10 @@
1569 else if (!strcmp(optname, "dogname"))
1570 Sprintf(buf, "%s", dogname[0] ? dogname : none );
1571 +#ifdef DUMP_LOG
1572 + else if (!strcmp(optname, "dumpfile"))
1573 + Sprintf(buf, "%s", dump_fn[0] ? dump_fn: none );
1574 +#endif
1575 else if (!strcmp(optname, "dungeon"))
1576 Sprintf(buf, "%s", to_be_done);
1577 else if (!strcmp(optname, "effects"))
1578 diff -bNurd nethack-3.4.3/src/pline.c nh343dump/src/pline.c
1579 --- nethack-3.4.3/src/pline.c 2003-12-08 01:39:13.000000000 +0200
1580 +++ nh343dump/src/pline.c 2006-06-26 12:41:56.000000000 +0300
1581 @@ -15,6 +15,11 @@
1583 static char *FDECL(You_buf, (int));
1585 +#if defined(DUMP_LOG) && defined(DUMPMSGS)
1586 +char msgs[DUMPMSGS][BUFSZ];
1587 +int lastmsg = -1;
1588 +#endif
1590 /*VARARGS1*/
1591 /* Note that these declarations rely on knowledge of the internals
1592 * of the variable argument handling stuff in "tradstdc.h"
1593 @@ -55,6 +60,12 @@
1594 Vsprintf(pbuf,line,VA_ARGS);
1595 line = pbuf;
1597 +#if defined(DUMP_LOG) && defined(DUMPMSGS)
1598 + if (DUMPMSGS > 0) {
1599 + lastmsg = (lastmsg + 1) % DUMPMSGS;
1600 + strncpy(msgs[lastmsg], line, BUFSZ);
1602 +#endif
1603 if (!iflags.window_inited) {
1604 raw_print(line);
1605 return;
1606 diff -bNurd nethack-3.4.3/src/spell.c nh343dump/src/spell.c
1607 --- nethack-3.4.3/src/spell.c 2003-12-08 01:39:13.000000000 +0200
1608 +++ nh343dump/src/spell.c 2006-06-26 09:53:58.000000000 +0300
1609 @@ -1114,6 +1114,35 @@
1610 return FALSE;
1613 +#ifdef DUMP_LOG
1614 +void
1615 +dump_spells()
1617 + int i;
1618 + char buf[BUFSZ];
1620 + if (spellid(0) == NO_SPELL) {
1621 + dump("", "You didn't know any spells.");
1622 + dump("", "");
1623 + return;
1625 + dump("", "Spells known in the end");
1627 + Sprintf(buf, "%-20s Level %-12s Fail", " Name", "Category");
1628 + dump(" ",buf);
1629 + for (i = 0; i < MAXSPELL && spellid(i) != NO_SPELL; i++) {
1630 + Sprintf(buf, "%c - %-20s %2d%s %-12s %3d%%",
1631 + spellet(i), spellname(i), spellev(i),
1632 + spellknow(i) ? " " : "*",
1633 + spelltypemnemonic(spell_skilltype(spellid(i))),
1634 + 100 - percent_success(i));
1635 + dump(" ", buf);
1637 + dump("","");
1639 +} /* dump_spells */
1640 +#endif
1642 /* Integer square root function without using floating point. */
1643 STATIC_OVL int
1644 isqrt(val)
1645 diff -bNurd nethack-3.4.3/src/topten.c nh343dump/src/topten.c
1646 --- nethack-3.4.3/src/topten.c 2003-12-08 01:39:13.000000000 +0200
1647 +++ nh343dump/src/topten.c 2006-06-26 09:53:58.000000000 +0300
1648 @@ -358,6 +358,12 @@
1649 "Since you were in %s mode, the score list will not be checked.",
1650 wizard ? "wizard" : "discover");
1651 topten_print(pbuf);
1652 +#ifdef DUMP_LOG
1653 + if (dump_fn[0]) {
1654 + dump("", pbuf);
1655 + dump("", "");
1657 +#endif
1659 goto showwin;
1661 @@ -378,6 +384,9 @@
1664 HUP topten_print("");
1665 +#ifdef DUMP_LOG
1666 + dump("", "");
1667 +#endif
1669 /* assure minimum number of points */
1670 if(t0->points < POINTSMIN) t0->points = 0;
1671 @@ -422,6 +431,10 @@
1672 t1->points);
1673 topten_print(pbuf);
1674 topten_print("");
1675 +#ifdef DUMP_LOG
1676 + dump("", pbuf);
1677 + dump("", "");
1678 +#endif
1681 if(occ_cnt < 0) {
1682 @@ -452,17 +465,27 @@
1683 goto destroywin;
1685 #endif /* UPDATE_RECORD_IN_PLACE */
1686 - if(!done_stopprint) if(rank0 > 0){
1687 - if(rank0 <= 10)
1688 + if(rank0 > 0){
1689 + if(rank0 <= 10) {
1690 + if(!done_stopprint)
1691 topten_print("You made the top ten list!");
1692 - else {
1693 +#ifdef DUMP_LOG
1694 + dump("", "You made the top ten list!");
1695 +#endif
1696 + } else {
1697 char pbuf[BUFSZ];
1698 Sprintf(pbuf,
1699 "You reached the %d%s place on the top %d list.",
1700 rank0, ordin(rank0), ENTRYMAX);
1701 - topten_print(pbuf);
1702 + if(!done_stopprint) topten_print(pbuf);
1703 +#ifdef DUMP_LOG
1704 + dump("", pbuf);
1705 +#endif
1707 - topten_print("");
1708 + if(!done_stopprint) topten_print("");
1709 +#ifdef DUMP_LOG
1710 + dump("", "");
1711 +#endif
1714 if(rank0 == 0) rank0 = rank1;
1715 @@ -475,7 +498,7 @@
1716 && rank >= rank0
1717 #endif
1718 ) writeentry(rfile, t1);
1719 - if (done_stopprint) continue;
1720 + /* if (done_stopprint) continue; */
1721 if (rank > flags.end_top &&
1722 (rank < rank0 - flags.end_around ||
1723 rank > rank0 + flags.end_around) &&
1724 @@ -488,8 +511,12 @@
1725 )) continue;
1726 if (rank == rank0 - flags.end_around &&
1727 rank0 > flags.end_top + flags.end_around + 1 &&
1728 - !flags.end_own)
1729 - topten_print("");
1730 + !flags.end_own) {
1731 + if(!done_stopprint) topten_print("");
1732 +#ifdef DUMP_LOG
1733 + dump("", "");
1734 +#endif
1736 if(rank != rank0)
1737 outentry(rank, t1, FALSE);
1738 else if(!rank1)
1739 @@ -546,7 +573,10 @@
1740 bp = eos(linebuf);
1741 while(bp < linebuf + COLNO - 9) *bp++ = ' ';
1742 Strcpy(bp, "Hp [max]");
1743 - topten_print(linebuf);
1744 + if(!done_stopprint) topten_print(linebuf);
1745 +#ifdef DUMP_LOG
1746 + dump("", linebuf);
1747 +#endif
1750 /* so>0: standout line; so=0: ordinary line */
1751 @@ -664,9 +694,16 @@
1752 if (so) {
1753 while (bp < linebuf + (COLNO-1)) *bp++ = ' ';
1754 *bp = 0;
1755 - topten_print_bold(linebuf);
1756 - } else
1757 - topten_print(linebuf);
1758 + if(!done_stopprint) topten_print_bold(linebuf);
1759 +#ifdef DUMP_LOG
1760 + dump("*", linebuf[0]==' '? linebuf+1: linebuf);
1761 +#endif
1762 + } else {
1763 + if(!done_stopprint) topten_print(linebuf);
1764 +#ifdef DUMP_LOG
1765 + dump(" ", linebuf[0]==' '? linebuf+1: linebuf);
1766 +#endif
1768 Sprintf(linebuf, "%15s %s", "", linebuf3);
1769 lngr = strlen(linebuf);
1771 @@ -688,9 +725,12 @@
1772 if (so >= COLNO) so = COLNO-1;
1773 while (bp < linebuf + so) *bp++ = ' ';
1774 *bp = 0;
1775 - topten_print_bold(linebuf);
1776 + if(!done_stopprint) topten_print_bold(linebuf);
1777 } else
1778 - topten_print(linebuf);
1779 + if(!done_stopprint) topten_print(linebuf);
1780 +#ifdef DUMP_LOG
1781 + dump(" ", linebuf[0]==' '? linebuf+1: linebuf);
1782 +#endif
1785 STATIC_OVL int
1786 diff -bNurd nethack-3.4.3/src/weapon.c nh343dump/src/weapon.c
1787 --- nethack-3.4.3/src/weapon.c 2003-12-08 01:39:13.000000000 +0200
1788 +++ nh343dump/src/weapon.c 2006-06-26 09:53:58.000000000 +0300
1789 @@ -9,6 +9,10 @@
1791 #include "hack.h"
1793 +#ifdef DUMP_LOG
1794 +STATIC_DCL int FDECL(enhance_skill, (boolean));
1795 +#endif
1797 /* Categories whose names don't come from OBJ_NAME(objects[type])
1799 #define PN_BARE_HANDED (-1) /* includes martial arts */
1800 @@ -851,6 +855,23 @@
1803 enhance_weapon_skill()
1804 +#ifdef DUMP_LOG
1806 + return enhance_skill(FALSE);
1809 +void dump_weapon_skill()
1811 + enhance_skill(TRUE);
1814 +int enhance_skill(boolean want_dump)
1815 +/* This is the original enhance_weapon_skill() function slightly modified
1816 + * to write the skills to the dump file. I added the wrapper functions just
1817 + * because it looked like the easiest way to add a parameter to the
1818 + * function call. - Jukka Lahtinen, August 2001
1819 + */
1820 +#endif
1822 int pass, i, n, len, longest,
1823 to_advance, eventually_advance, maxxed_cnt;
1824 @@ -860,8 +881,15 @@
1825 anything any;
1826 winid win;
1827 boolean speedy = FALSE;
1828 +#ifdef DUMP_LOG
1829 + char buf2[BUFSZ];
1830 + boolean logged;
1831 +#endif
1833 #ifdef WIZARD
1834 +#ifdef DUMP_LOG
1835 + if (!want_dump)
1836 +#endif
1837 if (wizard && yn("Advance skills without practice?") == 'y')
1838 speedy = TRUE;
1839 #endif
1840 @@ -878,6 +906,11 @@
1841 else if (peaked_skill(i)) maxxed_cnt++;
1844 +#ifdef DUMP_LOG
1845 + if (want_dump)
1846 + dump("","Your skills at the end");
1847 + else {
1848 +#endif
1849 win = create_nhwindow(NHW_MENU);
1850 start_menu(win);
1852 @@ -905,6 +938,9 @@
1853 add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE,
1854 "", MENU_UNSELECTED);
1856 +#ifdef DUMP_LOG
1857 + } /* want_dump or not */
1858 +#endif
1860 /* List the skills, making ones that could be advanced
1861 selectable. List the miscellaneous skills first.
1862 @@ -916,8 +952,26 @@
1863 /* Print headings for skill types */
1864 any.a_void = 0;
1865 if (i == skill_ranges[pass].first)
1866 +#ifdef DUMP_LOG
1867 + if (want_dump) {
1868 + dump(" ",(char *)skill_ranges[pass].name);
1869 + logged=FALSE;
1870 + } else
1871 +#endif
1872 add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
1873 skill_ranges[pass].name, MENU_UNSELECTED);
1874 +#ifdef DUMP_LOG
1875 + if (want_dump) {
1876 + if (P_SKILL(i) > P_UNSKILLED) {
1877 + Sprintf(buf2,"%-*s [%s]",
1878 + longest, P_NAME(i),skill_level_name(i, buf));
1879 + dump(" ",buf2);
1880 + logged=TRUE;
1881 + } else if (i == skill_ranges[pass].last && !logged) {
1882 + dump(" ","(none)");
1884 + } else {
1885 +#endif
1887 if (P_RESTRICTED(i)) continue;
1889 @@ -962,6 +1016,9 @@
1890 any.a_int = can_advance(i, speedy) ? i+1 : 0;
1891 add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE,
1892 buf, MENU_UNSELECTED);
1893 +#ifdef DUMP_LOG
1894 + } /* !want_dump */
1895 +#endif
1898 Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:" :
1899 @@ -971,6 +1028,12 @@
1900 Sprintf(eos(buf), " (%d slot%s available)",
1901 u.weapon_slots, plur(u.weapon_slots));
1902 #endif
1903 +#ifdef DUMP_LOG
1904 + if (want_dump) {
1905 + dump("","");
1906 + n=0;
1907 + } else {
1908 +#endif
1909 end_menu(win, buf);
1910 n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected);
1911 destroy_nhwindow(win);
1912 @@ -987,6 +1050,9 @@
1916 +#ifdef DUMP_LOG
1918 +#endif
1919 } while (speedy && n > 0);
1920 return 0;
1922 diff -bNurd nethack-3.4.3/win/tty/wintty.c nh343dump/win/tty/wintty.c
1923 --- nethack-3.4.3/win/tty/wintty.c 2003-12-08 01:39:14.000000000 +0200
1924 +++ nh343dump/win/tty/wintty.c 2006-06-26 09:53:58.000000000 +0300
1925 @@ -162,7 +162,7 @@
1926 STATIC_DCL void FDECL(process_menu_window, (winid,struct WinDesc *));
1927 STATIC_DCL void FDECL(process_text_window, (winid,struct WinDesc *));
1928 STATIC_DCL tty_menu_item *FDECL(reverse, (tty_menu_item *));
1929 -STATIC_DCL const char * FDECL(compress_str, (const char *));
1930 +const char * FDECL(compress_str, (const char *));
1931 STATIC_DCL void FDECL(tty_putsym, (winid, int, int, CHAR_P));
1932 static char *FDECL(copy_of, (const char *));
1933 STATIC_DCL void FDECL(bail, (const char *)); /* __attribute__((noreturn)) */
1934 @@ -1722,7 +1722,7 @@
1938 -STATIC_OVL const char*
1939 +const char*
1940 compress_str(str)
1941 const char *str;