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
6 boulder override the default boulder symbol with another default: [`]
7 disclose the types of information you want offered at the end of the
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)
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 @@
20 Name your starting dog (ex. ``dogname:Fang'').
21 Cannot be set with the `O' command.
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
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.
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
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
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.
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
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
85 E char killer_buf[BUFSZ];
87 +E char dump_fn[]; /* dumpfile name (dump patch) */
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
96 E int FDECL(describe_level, (char *));
97 E const char *FDECL(rank_of, (int,SHORT_P,BOOLEAN_P));
100 +E void FDECL(bot1str, (char *));
101 +E void FDECL(bot2str, (char *));
107 E int NDECL(extcmd_via_menu);
108 E void FDECL(enlightenment, (int));
109 E void FDECL(show_conduct, (int));
111 +E void FDECL(dump_enlightenment, (int));
112 +E void FDECL(dump_conduct, (int));
114 E int FDECL(xytod, (SCHAR_P,SCHAR_P));
115 E void FDECL(dtoxy, (coord *,int));
116 E int FDECL(movecmd, (CHAR_P));
118 E void FDECL(row_refresh, (int,int,int));
120 E void FDECL(flush_screen, (int));
122 +E void NDECL(dump_screen);
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));
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));
132 +E void FDECL(dump, (char *, char *));
133 +E void FDECL(do_containerconts, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P));
135 E void FDECL(terminate, (int));
136 E int NDECL(num_genocides);
139 E char *FDECL(xprname, (struct obj *,const char *,CHAR_P,BOOLEAN_P,long,long));
141 E char FDECL(display_inventory, (const char *,BOOLEAN_P));
143 +E char FDECL(dump_inventory, (const char *,BOOLEAN_P,BOOLEAN_P));
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 @@
151 E int NDECL(enhance_weapon_skill);
153 +E void NDECL(dump_weapon_skill);
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 @@
166 +void bot1str(char *newbot1)
180 Sprintf(nb = eos(nb), " S:%ld", botl_score());
187 + char newbot1[MAXCO];
191 curs(WIN_STATUS, 1, 0);
192 putstr(WIN_STATUS, 0, newbot1);
194 @@ -242,10 +257,17 @@
199 +void bot2str(newbot2)
211 int cap = near_capacity();
213 if(Slimed) Sprintf(nb = eos(nb), " Slime");
214 if(cap > UNENCUMBERED)
215 Sprintf(nb = eos(nb), " %s", enc_stat[cap]);
221 + char newbot2[MAXCO];
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 @@
236 +dump_enlightenment(final)
242 + const char *enc_stat[] = { /* copied from botl.c */
250 + char *youwere = " You were ";
251 + char *youhave = " You have ";
252 + char *youhad = " You had ";
253 + char *youcould = " You could ";
255 + dump("", "Final attributes");
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"
265 + (char *)hofe_titles[u.uevent.uhand_of_elbereth - 1]);
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");
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");
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");
320 + dump(youwere, (u.uburied) ? "buried" : "being strangled");
322 + Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
325 + if (Fumbling) dump(" ", "You fumbled");
331 + Sprintf(buf, "wounded %s", makeplural(body_part(LEG)));
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");
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" :
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 ***/
368 + if(uleft && uleft->otyp == RIN_ADORNMENT) adorn += uleft->spe;
369 + if(uright && uright->otyp == RIN_ADORNMENT) adorn += uright->spe;
371 + dump(youwere, "poorly adorned");
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");
400 + if (u.usteed && (final < 2 || strcmp(killer, "riding accident"))) {
401 + Sprintf(buf, "riding %s", y_monnam(u.usteed));
402 + dump(youwere, buf);
406 + Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck));
408 + if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim);
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 ***/
421 + enlght_combatinc("to hit", u.uhitinc, final, buf));
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) {
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;
436 + dump(youwere, "ineffectively protected");
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);
449 + if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form");
450 + else Sprintf(buf, "polymorphed into %s",
451 + an(youmonst.data->mname));
453 + if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone);
455 + dump(youwere, buf);
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");
464 + dump(" ", "Your life would have been saved");
465 + if (u.twoweap) dump(youwere, "wielding two weapons at once");
467 + /*** Miscellany ***/
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);
476 + else if (wizard) dump(" ", "Your luck was zero");
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);
483 + dump(" ", "Bad luck did not time out for you");
485 + dump(" ", "Good luck did not time out for you");
489 + Sprintf(buf, " %sangry with you",
490 + u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : "");
492 + if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr);
494 + Sprintf(buf2, "%s was %s", u_gname(), buf);
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);
512 + } else { /* game ended in character's death */
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));
523 + Sprintf(buf2, "You %s %s", p, buf);
530 +} /* dump_enlightenment */
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);
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));
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));
575 + Sprintf(buf, "hit with a wielded weapon %ld time%s",
576 + u.uconduct.weaphit, plur(u.uconduct.weaphit));
577 + dump(" You ", buf);
580 + if (!u.uconduct.killer)
581 + dump("", " You were a pacifist");
583 + if (!u.uconduct.literate)
584 + dump("", " You were illiterate");
587 + Sprintf(buf, "read items or engraved %ld time%s",
588 + u.uconduct.literate, plur(u.uconduct.literate));
589 + dump(" You ", buf);
593 + ngenocided = num_genocides();
594 + if (ngenocided == 0) {
595 + dump("", " You never genocided any monsters");
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");
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");
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");
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");
631 +#endif /* DUMP_LOG */
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
641 NEARDATA struct mvitals mvitals[NUMMONS];
643 +/* originally from end.c */
646 +char dump_fn[] = DUMP_FN;
648 +char dump_fn[PL_PSIZ] = DUMMY;
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 /* ========================================================================= */
663 +/* D: Added to dump screen to output file */
664 +STATIC_PTR uchar get_glyph_char(glyph)
668 + register int offset;
670 + if (glyph >= NO_GLYPH)
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.
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];
708 +extern const char * FDECL(compress_str, (const char *));
711 +compress_str(str) /* copied from win/tty/wintty.c */
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;
721 + if(*bp0 != ' ' || bp0[1] != ' ')
728 +#endif /* TTY_GRAPHICS */
730 +/* Take a screen dump */
735 + /* D: botl.c has a closer approximation to the size, but we'll go with
737 + char buf[300], *ptr;
739 + for (y = 0; y < ROWNO; y++) {
742 + for (x = 1; x < COLNO; x++) {
743 + uchar c = get_glyph_char(gbuf[y][x].glyph);
753 + ptr = (char *) compress_str((const char *) buf);
760 +#endif /* DUMP_LOG */
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
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));
773 +extern char msgs[][BUFSZ];
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));
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)
786 extern const char * const killed_by_prefix[]; /* from topten.c */
789 +FILE *dump_fp = (FILE *)0; /* file pointer for dumps */
790 +/* functions dump_init, dump_exit and dump are from the dump patch */
796 + char *p = (char *) strstr(dump_fn, "%n");
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);
803 + strncpy(q, plname, strlen(plname) + 1);
805 + q[strlen(plname)] = '\0';
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");
813 + pline("Can't open %s for output.", new_dump_fn);
814 + pline("Dump file not created.");
819 + dump_fp = fopen (dump_fn, "w");
822 + pline("Can't open %s for output.", dump_fn);
823 + pline("Dump file not created.");
836 +void dump (pre, str)
840 + fprintf (dump_fp, "%s%s\n", pre, str);
842 +#endif /* DUMP_LOG */
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;
857 + boolean want_disp = (c == 'y')? TRUE: FALSE;
861 for (obj = invent; obj; obj = obj->nobj) {
862 makeknown(obj->otyp);
863 obj->known = obj->bknown = obj->dknown = obj->rknown = 1;
866 + (void) dump_inventory((char *)0, TRUE, want_disp);
867 + do_containerconts(invent, TRUE, TRUE, TRUE, want_disp);
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++;
886 + dump_enlightenment((int) (how >= PANICKED ? 1 : 2));
891 ask = should_query_disclose_option('v', &defquery);
893 + do_vanquished(defquery, ask, TRUE);
896 list_vanquished(defquery, ask);
899 ask = should_query_disclose_option('g', &defquery);
902 + list_genocided(defquery, ask,TRUE);
904 list_genocided(defquery, ask);
907 ask = should_query_disclose_option('c', &defquery);
908 if (!done_stopprint) {
910 show_conduct(how >= PANICKED ? 1 : 2);
911 if (c == 'q') done_stopprint++;
915 + dump_conduct(how >= PANICKED ? 1 : 2);
916 + dump_weapon_skill();
921 /* try to get the player back in a viable state after being killed */
923 otmp->oartifact ? artifact_name(xname(otmp), &dummy) :
924 OBJ_NAME(objects[otmp->otyp]),
925 value, currency(value), points);
929 + if (endwin != WIN_ERR)
931 putstr(endwin, 0, pbuf);
935 boolean bones_ok, have_windows = iflags.window_inited;
936 struct obj *corpse = (struct obj *)0;
940 if (how == TRICKED) {
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;
947 + /* D: Grab screen dump right here */
950 + Sprintf(pbuf, "%s, %s %s %s %s", plname,
951 + aligns[1 - u.ualign.type].adj,
952 + genders[flags.female].adj,
954 + (flags.female && urole.name.f)?
955 + urole.name.f : urole.name.m);
957 + /* D: Add a line for clearance from the screen dump */
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
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]);
979 + for (i = 0; i <= lastmsg; i++) {
980 + if (msgs[i] && strcmp(msgs[i], "") )
981 + dump (" ", msgs[i]);
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,
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, "");
1005 + if (dump_fp) dump("", pbuf);
1008 if (how == ESCAPED || how == ASCENDED) {
1009 register struct monst *mtmp;
1010 @@ -805,31 +941,39 @@
1012 viz_array[0][0] |= IN_SIGHT; /* need visibility for naming */
1014 - if (!done_stopprint) Strcpy(pbuf, "You");
1015 + Strcpy(pbuf, "You");
1018 - if (!done_stopprint)
1019 Sprintf(eos(pbuf), " and %s", mon_nam(mtmp));
1021 u.urexp += mtmp->mhp;
1024 if (!done_stopprint) putstr(endwin, 0, pbuf);
1026 + if (dump_fp) dump("", pbuf);
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));
1038 + if (dump_fp) dump("", pbuf);
1040 + if (!done_stopprint) {
1041 putstr(endwin, 0, pbuf);
1044 if (!done_stopprint)
1045 artifact_score(invent, FALSE, endwin); /* list artifacts */
1049 + artifact_score(invent, FALSE, WIN_ERR);
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);
1059 + if (dump_fp) dump("", pbuf);
1064 - } else if (!done_stopprint) {
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);
1076 + if (dump_fp) dump("", pbuf);
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);
1088 + Sprintf(pbuf, "Killer: %s", killer);
1091 - if (!done_stopprint) {
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, "");
1101 + if (dump_fp) dump("", pbuf);
1103 if (!done_stopprint)
1104 display_nhwindow(endwin, TRUE);
1105 if (endwin != WIN_ERR)
1106 @@ -909,6 +1067,9 @@
1107 exit_nhwindows((char *)0);
1111 + if (dump_fp) dump_exit();
1114 if(done_stopprint) { raw_print(""); raw_print(""); }
1115 terminate(EXIT_SUCCESS);
1116 @@ -919,6 +1080,16 @@
1117 container_contents(list, identified, all_containers)
1119 boolean identified, all_containers;
1122 + do_containerconts(list, identified, all_containers, FALSE, TRUE);
1125 +void do_containerconts(list, identified, all_containers, want_dump, want_disp)
1127 +boolean identified, all_containers, want_dump, want_disp;
1129 +/* The original container_contents function */
1131 register struct obj *box, *obj;
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);
1142 + tmpwin = create_nhwindow(NHW_MENU);
1143 Sprintf(buf, "Contents of %s:", the(xname(box)));
1147 putstr(tmpwin, 0, buf);
1148 putstr(tmpwin, 0, "");
1151 + if (dump_fp) dump("", buf);
1153 for (obj = box->cobj; obj; obj = obj->nobj) {
1155 makeknown(obj->otyp);
1156 obj->known = obj->bknown =
1157 obj->dknown = obj->rknown = 1;
1160 + if (want_dump) dump(" ", doname(obj));
1163 putstr(tmpwin, 0, doname(obj));
1166 + if (want_dump) dump("","");
1169 display_nhwindow(tmpwin, TRUE);
1170 destroy_nhwindow(tmpwin);
1171 - if (all_containers)
1174 + if (all_containers) {
1175 + do_containerconts(box->cobj, identified, TRUE,
1176 + want_dump, want_disp);
1178 + if (all_containers) {
1179 container_contents(box->cobj, identified, TRUE);
1180 +#endif /* DUMP_LOG */
1186 pline("%s empty.", Tobjnam(box, "are"));
1187 display_nhwindow(WIN_MESSAGE, FALSE);
1191 + dump(The(xname(box)), " is empty.");
1197 if (!all_containers)
1198 @@ -977,6 +1185,17 @@
1199 list_vanquished(defquery, ask)
1204 + do_vanquished(defquery, ask, FALSE);
1208 +do_vanquished(defquery, ask, want_dump)
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
1220 - c = ask ? yn_function("Do you want an account of creatures vanquished?",
1222 + c = done_stopprint ? 'n': ask ?
1226 + yn_function("Do you want an account of creatures vanquished?",
1227 ynqchars, defquery) : defquery;
1228 if (c == 'q') done_stopprint++;
1230 klwin = create_nhwindow(NHW_MENU);
1231 putstr(klwin, 0, "Vanquished creatures:");
1232 putstr(klwin, 0, "");
1234 + } /* the original end of block removed by the patch */
1235 + if (want_dump) dump("", "Vanquished creatures");
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);
1247 + if (want_dump) dump(" ", buf);
1251 * if (Hallucination)
1252 * putstr(klwin, 0, "and a partridge in a pear tree");
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);
1261 + if (want_dump) dump(" ", buf);
1265 display_nhwindow(klwin, TRUE);
1266 destroy_nhwindow(klwin);
1269 + if (want_dump) dump("", "");
1271 + } /* the original end of if (c == 'y') */
1276 @@ -1059,10 +1299,18 @@
1282 +list_genocided(defquery, ask, want_dump)
1288 list_genocided(defquery, ask)
1295 @@ -1079,8 +1327,12 @@
1296 if (c == 'q') done_stopprint++;
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, "");
1304 + if (want_dump) dump("", buf);
1307 for (i = LOW_PM; i < NUMMONS; i++)
1308 if (mvitals[i].mvflags & G_GENOD) {
1309 @@ -1091,11 +1343,17 @@
1311 Strcpy(buf, makeplural(mons[i].mname));
1312 putstr(klwin, 0, buf);
1314 + if (want_dump) dump(" ", buf);
1318 putstr(klwin, 0, "");
1319 Sprintf(buf, "%d species genocided.", ngenocided);
1320 putstr(klwin, 0, buf);
1322 + if (want_dump) dump(" ", buf);
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
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 *));
1335 +static char FDECL(display_pickinv,
1336 + (const char *,BOOLEAN_P, long *, BOOLEAN_P, BOOLEAN_P));
1338 static char FDECL(display_pickinv, (const char *,BOOLEAN_P, long *));
1339 +#endif /* DUMP_LOG */
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
1354 if (allowcnt && ctmp >= 0) {
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.
1362 +display_pickinv(lets, want_reply, out_cnt, want_dump, want_disp)
1363 +register const char *lets;
1364 +boolean want_reply;
1370 display_pickinv(lets, want_reply, out_cnt)
1371 register const char *lets;
1378 @@ -1704,6 +1723,9 @@
1380 menu_item *selected;
1385 /* overriden by global flag */
1386 if (flags.perm_invent) {
1387 win = (lets && *lets) ? local_win : WIN_INVEN;
1388 @@ -1713,6 +1735,11 @@
1394 + if (want_dump) dump("", "Your inventory");
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)) {
1408 pline("Not carrying anything%s.", u.ugold ? " except gold" : "");
1410 pline("Not carrying anything.");
1416 + dump(" ", "Not carrying anything");
1418 + dump(" Not carrying anything", u.ugold ? " except gold." : ".");
1425 @@ -1743,16 +1783,31 @@
1427 for (otmp = invent; otmp; otmp = otmp->nobj) {
1428 if (otmp->invlet == lets[0]) {
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 */
1440 + sprintf(letbuf, " %c - ", lets[0]);
1442 + xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L));
1457 @@ -1763,11 +1818,24 @@
1458 if (!flags.sortpack || otmp->oclass == *invlet) {
1459 if (flags.sortpack && !classcount) {
1460 any.a_void = 0; /* zero */
1463 + dump(" ", let_to_name(*invlet, FALSE));
1466 add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
1467 let_to_name(*invlet, FALSE), MENU_UNSELECTED);
1474 + sprintf(letbuf, " %c - ", ilet);
1475 + dump(letbuf, doname(otmp));
1479 add_menu(win, obj_to_glyph(otmp),
1480 &any, ilet, 0, ATR_NONE, doname(otmp),
1482 @@ -1783,6 +1851,9 @@
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);
1495 ret = !n ? '\0' : '\033'; /* cancelled */
1498 + if (want_dump) dump("", "");
1503 @@ -1808,9 +1883,24 @@
1504 register const char *lets;
1507 - return display_pickinv(lets, want_reply, (long *)0);
1508 + return display_pickinv(lets, want_reply, (long *)0
1516 +/* See display_inventory. This is the same thing WITH dumpfile creation */
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);
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 @@
1534 { "dogname", "the name of your (first) dog (e.g., dogname:Fang)",
1535 PL_PSIZ, DISP_IN_GAME },
1537 + { "dumpfile", "where to dump data (e.g., dumpfile:/tmp/dump.nh)",
1539 + PL_PSIZ, DISP_IN_GAME },
1541 + PL_PSIZ, SET_IN_GAME },
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 @@
1552 + fullname = "dumpfile";
1553 + if (match_optname(opts, fullname, 3, TRUE)) {
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);
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 );
1572 + else if (!strcmp(optname, "dumpfile"))
1573 + Sprintf(buf, "%s", dump_fn[0] ? dump_fn: none );
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
1583 static char *FDECL(You_buf, (int));
1585 +#if defined(DUMP_LOG) && defined(DUMPMSGS)
1586 +char msgs[DUMPMSGS][BUFSZ];
1591 /* Note that these declarations rely on knowledge of the internals
1592 * of the variable argument handling stuff in "tradstdc.h"
1594 Vsprintf(pbuf,line,VA_ARGS);
1597 +#if defined(DUMP_LOG) && defined(DUMPMSGS)
1598 + if (DUMPMSGS > 0) {
1599 + lastmsg = (lastmsg + 1) % DUMPMSGS;
1600 + strncpy(msgs[lastmsg], line, BUFSZ);
1603 if (!iflags.window_inited) {
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 @@
1620 + if (spellid(0) == NO_SPELL) {
1621 + dump("", "You didn't know any spells.");
1625 + dump("", "Spells known in the end");
1627 + Sprintf(buf, "%-20s Level %-12s Fail", " Name", "Category");
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));
1639 +} /* dump_spells */
1642 /* Integer square root function without using floating point. */
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");
1664 HUP topten_print("");
1669 /* assure minimum number of points */
1670 if(t0->points < POINTSMIN) t0->points = 0;
1671 @@ -422,6 +431,10 @@
1682 @@ -452,17 +465,27 @@
1685 #endif /* UPDATE_RECORD_IN_PLACE */
1686 - if(!done_stopprint) if(rank0 > 0){
1690 + if(!done_stopprint)
1691 topten_print("You made the top ten list!");
1694 + dump("", "You made the top ten list!");
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);
1708 + if(!done_stopprint) topten_print("");
1714 if(rank0 == 0) rank0 = rank1;
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 @@
1726 if (rank == rank0 - flags.end_around &&
1727 rank0 > flags.end_top + flags.end_around + 1 &&
1731 + if(!done_stopprint) topten_print("");
1737 outentry(rank, t1, FALSE);
1739 @@ -546,7 +573,10 @@
1741 while(bp < linebuf + COLNO - 9) *bp++ = ' ';
1742 Strcpy(bp, "Hp [max]");
1743 - topten_print(linebuf);
1744 + if(!done_stopprint) topten_print(linebuf);
1746 + dump("", linebuf);
1750 /* so>0: standout line; so=0: ordinary line */
1751 @@ -664,9 +694,16 @@
1753 while (bp < linebuf + (COLNO-1)) *bp++ = ' ';
1755 - topten_print_bold(linebuf);
1757 - topten_print(linebuf);
1758 + if(!done_stopprint) topten_print_bold(linebuf);
1760 + dump("*", linebuf[0]==' '? linebuf+1: linebuf);
1763 + if(!done_stopprint) topten_print(linebuf);
1765 + dump(" ", linebuf[0]==' '? linebuf+1: linebuf);
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++ = ' ';
1775 - topten_print_bold(linebuf);
1776 + if(!done_stopprint) topten_print_bold(linebuf);
1778 - topten_print(linebuf);
1779 + if(!done_stopprint) topten_print(linebuf);
1781 + dump(" ", linebuf[0]==' '? linebuf+1: linebuf);
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
1794 +STATIC_DCL int FDECL(enhance_skill, (boolean));
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()
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
1822 int pass, i, n, len, longest,
1823 to_advance, eventually_advance, maxxed_cnt;
1824 @@ -860,8 +881,15 @@
1827 boolean speedy = FALSE;
1837 if (wizard && yn("Advance skills without practice?") == 'y')
1840 @@ -878,6 +906,11 @@
1841 else if (peaked_skill(i)) maxxed_cnt++;
1846 + dump("","Your skills at the end");
1849 win = create_nhwindow(NHW_MENU);
1853 add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE,
1854 "", MENU_UNSELECTED);
1857 + } /* want_dump or not */
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 */
1865 if (i == skill_ranges[pass].first)
1868 + dump(" ",(char *)skill_ranges[pass].name);
1872 add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
1873 skill_ranges[pass].name, MENU_UNSELECTED);
1876 + if (P_SKILL(i) > P_UNSKILLED) {
1877 + Sprintf(buf2,"%-*s [%s]",
1878 + longest, P_NAME(i),skill_level_name(i, buf));
1881 + } else if (i == skill_ranges[pass].last && !logged) {
1882 + dump(" ","(none)");
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);
1894 + } /* !want_dump */
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));
1910 n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected);
1911 destroy_nhwindow(win);
1912 @@ -987,6 +1050,9 @@
1919 } while (speedy && n > 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
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*