diff -c -r sl_6e4f6/include/config.h sl_d/include/config.h *** sl_6e4f6/include/config.h Fri Nov 30 05:28:32 2001 --- sl_d/include/config.h Sat Dec 1 13:29:26 2001 *************** *** 404,409 **** --- 404,411 ---- /* Originally added by zaga. */ #define OTHER_SERVICES /* shopkeeper services */ + #define DUMP_LOG + /* #define SHOUT */ /* JRN -- shouting and petcommands - not implemented */ /* #define DEVEL_BRANCH */ /* Include development code */ diff -c -r sl_6e4f6/include/decl.h sl_d/include/decl.h *** sl_6e4f6/include/decl.h Fri Nov 30 05:27:48 2001 --- sl_d/include/decl.h Sat Dec 1 12:43:44 2001 *************** *** 192,197 **** --- 192,198 ---- E const char *configfile; E NEARDATA char plname[PL_NSIZ]; E NEARDATA char dogname[]; + E NEARDATA char dump_fn[]; E NEARDATA char catname[]; E NEARDATA char ghoulname[]; E NEARDATA char horsename[]; diff -c -r sl_6e4f6/include/extern.h sl_d/include/extern.h *** sl_6e4f6/include/extern.h Fri Nov 30 05:27:48 2001 --- sl_d/include/extern.h Sat Dec 1 13:29:26 2001 *************** *** 180,187 **** E void FDECL(rhack, (char *)); E int NDECL(doextlist); E int NDECL(extcmd_via_menu); ! E void FDECL(enlightenment, (int)); ! E void FDECL(show_conduct, (int)); E int FDECL(xytod, (SCHAR_P,SCHAR_P)); E void FDECL(dtoxy, (coord *,int)); E int FDECL(movecmd, (CHAR_P)); --- 180,187 ---- E void FDECL(rhack, (char *)); E int NDECL(doextlist); E int NDECL(extcmd_via_menu); ! E void FDECL(enlightenment, (int, BOOLEAN_P)); ! E void FDECL(show_conduct, (int, BOOLEAN_P)); E int FDECL(xytod, (SCHAR_P,SCHAR_P)); E void FDECL(dtoxy, (coord *,int)); E int FDECL(movecmd, (CHAR_P)); *************** *** 565,571 **** E void VDECL(panic, (const char *,...)) PRINTF_F(1,2); #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) E void FDECL(done, (int)); ! E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P)); E void FDECL(terminate, (int)); E int NDECL(num_genocides); /* KMH, ethics */ --- 565,571 ---- E void VDECL(panic, (const char *,...)) PRINTF_F(1,2); #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) E void FDECL(done, (int)); ! E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P)); E void FDECL(terminate, (int)); E int NDECL(num_genocides); /* KMH, ethics */ *************** *** 803,809 **** E void FDECL(prinv, (const char *,struct obj *,long)); E char *FDECL(xprname, (struct obj *,const char *,CHAR_P,BOOLEAN_P,long)); E int NDECL(ddoinv); ! E char FDECL(display_inventory, (const char *,BOOLEAN_P)); E int FDECL(display_binventory, (int,int,BOOLEAN_P)); E struct obj *FDECL(display_cinventory,(struct obj *)); E struct obj *FDECL(display_minventory,(struct monst *,int)); --- 803,809 ---- E void FDECL(prinv, (const char *,struct obj *,long)); E char *FDECL(xprname, (struct obj *,const char *,CHAR_P,BOOLEAN_P,long)); E int NDECL(ddoinv); ! E char FDECL(display_inventory, (const char *,BOOLEAN_P,BOOLEAN_P)); E int FDECL(display_binventory, (int,int,BOOLEAN_P)); E struct obj *FDECL(display_cinventory,(struct obj *)); E struct obj *FDECL(display_minventory,(struct monst *,int)); *************** *** 2221,2226 **** --- 2221,2229 ---- E int FDECL(mon_wield_item, (struct monst *)); E int NDECL(abon); E int NDECL(dbon); + #ifdef DUMP_LOG + E int NDECL(dump_weapon_skill); + #endif E int NDECL(enhance_weapon_skill); E void FDECL(unrestrict_weapon_skill, (int)); E void FDECL(use_skill, (int,int)); diff -c -r sl_6e4f6/src/artifact.c sl_d/src/artifact.c *** sl_6e4f6/src/artifact.c Fri Nov 30 05:27:54 2001 --- sl_d/src/artifact.c Sat Dec 1 13:23:24 2001 *************** *** 1640,1646 **** break; } case ENLIGHTENING: ! enlightenment(0); break; case CREATE_AMMO: { struct obj *otmp = mksobj(ARROW, TRUE, FALSE); --- 1640,1646 ---- break; } case ENLIGHTENING: ! enlightenment(0, FALSE); break; case CREATE_AMMO: { struct obj *otmp = mksobj(ARROW, TRUE, FALSE); diff -c -r sl_6e4f6/src/cmd.c sl_d/src/cmd.c *** sl_6e4f6/src/cmd.c Fri Nov 30 05:27:54 2001 --- sl_d/src/cmd.c Sat Dec 1 13:08:58 2001 *************** *** 1092,1107 **** /* KMH, intrinsic patch -- several of these are updated */ void ! enlightenment(final) int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */ { int ltmp; ! char buf[BUFSZ]; en_win = create_nhwindow(NHW_MENU); putstr(en_win, 0, final ? "Final Attributes:" : "Current Attributes:"); putstr(en_win, 0, ""); #ifdef ELBERETH if (u.uevent.uhand_of_elbereth) { static const char *hofe_titles[3] = { --- 1092,1119 ---- /* KMH, intrinsic patch -- several of these are updated */ void ! enlightenment(final, want_dump) int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */ + boolean want_dump; { int ltmp; ! char buf[BUFSZ], buf2[BUFSZ]; ! const char *enc_stat[] = { /* copied from botl.c for the dump patch */ ! "", ! "burdened", ! "stressed", ! "strained", ! "overtaxed", ! "overloaded" ! }; en_win = create_nhwindow(NHW_MENU); putstr(en_win, 0, final ? "Final Attributes:" : "Current Attributes:"); putstr(en_win, 0, ""); + if (want_dump) /* This one's safe: final>1 <==> want_dump==TRUE */ + dump("", "Final attributes"); + #ifdef ELBERETH if (u.uevent.uhand_of_elbereth) { static const char *hofe_titles[3] = { *************** *** 1110,1185 **** "the Glory of Arioch" }; you_are(hofe_titles[u.uevent.uhand_of_elbereth - 1]); } #endif /* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */ ! if (u.ualign.record >= 20) you_are("piously aligned"); ! else if (u.ualign.record > 13) you_are("devoutly aligned"); ! else if (u.ualign.record > 8) you_are("fervently aligned"); ! else if (u.ualign.record > 3) you_are("stridently aligned"); ! else if (u.ualign.record == 3) you_are("aligned"); ! else if (u.ualign.record > 0) you_are("haltingly aligned"); ! else if (u.ualign.record == 0) you_are("nominally aligned"); ! else if (u.ualign.record >= -3) you_have("strayed"); ! else if (u.ualign.record >= -8) you_have("sinned"); ! else you_have("transgressed"); #ifdef WIZARD if (wizard) { Sprintf(buf, " %d", u.ualign.record); enl_msg("Your alignment ", "is", "was", buf); } #endif /*** Resistances to troubles ***/ ! if (Fire_resistance) you_are("fire resistant"); ! if (Cold_resistance) you_are("cold resistant"); ! if (Sleep_resistance) you_are("sleep resistant"); ! if (Disint_resistance) you_are("disintegration-resistant"); ! if (Shock_resistance) you_are("shock resistant"); ! if (Poison_resistance) you_are("poison resistant"); ! if (Drain_resistance) you_are("level-drain resistant"); ! if (Sick_resistance) you_are("immune to sickness"); ! if (Antimagic) you_are("magic-protected"); ! if (Acid_resistance) you_are("acid resistant"); ! if (Stone_resistance) ! you_are("petrification resistant"); ! if (Invulnerable) you_are("invulnerable"); /*** Troubles ***/ ! if (Halluc_resistance) ! enl_msg("You resist", "", "ed", " hallucinations"); if (final) { ! if (Hallucination) you_are("hallucinating"); ! if (Stunned) you_are("stunned"); ! if (Confusion) you_are("confused"); ! if (Blinded) you_are("blinded"); ! if (Sick) { ! if (u.usick_type & SICK_VOMITABLE) ! you_are("sick from food poisoning"); ! if (u.usick_type & SICK_NONVOMITABLE) ! you_are("sick from illness"); } } ! if (Stoned) you_are("turning to stone"); ! if (Slimed) you_are("turning into slime"); ! if (Strangled) you_are((u.uburied) ? "buried" : "being strangled"); if (Glib) { Sprintf(buf, "slippery %s", makeplural(body_part(FINGER))); you_have(buf); } ! if (Fumbling) enl_msg("You fumble", "", "d", ""); if (Wounded_legs) { Sprintf(buf, "wounded %s", makeplural(body_part(LEG))); you_have(buf); } ! if (Sleeping) enl_msg("You ", "fall", "fell", " asleep"); ! if (Hunger) enl_msg("You hunger", "", "ed", " rapidly"); /*** Vision and senses ***/ ! if (See_invisible) enl_msg(You_, "see", "saw", " invisible"); ! if (Blind_telepat) you_are("telepathic"); ! if (Warning) you_are("warned"); if (Warn_of_mon && flags.warntype) { /* [ALI] Add support for undead */ int i, nth = 0; --- 1122,1317 ---- "the Glory of Arioch" }; you_are(hofe_titles[u.uevent.uhand_of_elbereth - 1]); + + if (want_dump) + dump(" You were ", + (char *) hofe_titles[u.uevent.uhand_of_elbereth - 1]); } #endif /* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */ ! if (u.ualign.record >= 20) { ! you_are("piously aligned"); ! if (want_dump) dump(" You were ", "piously aligned"); ! } else if (u.ualign.record > 13) { ! you_are("devoutly aligned"); ! if (want_dump) dump(" You were ", "devoutly aligned"); ! } else if (u.ualign.record > 8) { ! you_are("fervently aligned"); ! if (want_dump) dump(" You were ", "fervently aligned"); ! } else if (u.ualign.record > 3) { ! you_are("stridently aligned"); ! if (want_dump) dump(" You were ", "stridently aligned"); ! } else if (u.ualign.record == 3) { ! you_are("aligned"); ! if (want_dump) dump(" You were ", "aligned"); ! } else if (u.ualign.record > 0) { ! you_are("haltingly aligned"); ! if (want_dump) dump(" You were ", "haltingly aligned"); ! } else if (u.ualign.record == 0) { ! you_are("nominally aligned"); ! if (want_dump) dump(" You were ", "nominally aligned"); ! } else if (u.ualign.record >= -3) { ! you_have("strayed"); ! if (want_dump) dump(" You had ", "strayed"); ! } else if (u.ualign.record >= -8) { ! you_have("sinned"); ! if (want_dump) dump(" You had ", "sinned"); ! } else { ! you_have("transgressed"); ! if (want_dump) dump(" You had ", "transgressed"); ! } ! #ifdef WIZARD if (wizard) { Sprintf(buf, " %d", u.ualign.record); enl_msg("Your alignment ", "is", "was", buf); + if (want_dump) + dump(" Your alignment was ", buf); } #endif /*** Resistances to troubles ***/ ! if (Fire_resistance) { ! you_are("fire resistant"); ! if (want_dump) dump(" You were ", "fire resistant"); ! } ! if (Cold_resistance) { ! you_are("cold resistant"); ! if (want_dump) dump(" You were ", "cold resistant"); ! } ! if (Sleep_resistance) { ! you_are("sleep resistant"); ! if (want_dump) dump(" You were ", "sleep resistant"); ! } ! if (Disint_resistance) { ! you_are("disintegration-resistant"); ! if (want_dump) dump(" You were ", "disintegration-resistant"); ! } ! if (Shock_resistance) { ! you_are("shock resistant"); ! if (want_dump) dump(" You were ", "shock resistant"); ! } ! if (Poison_resistance) { ! you_are("poison resistant"); ! if (want_dump) dump(" You were ", "poison resistant"); ! } ! if (Drain_resistance) { ! you_are("level-drain resistant"); ! if (want_dump) dump(" You were ", "level-drain resistant"); ! } ! if (Sick_resistance) { ! you_are("immune to sickness"); ! if (want_dump) dump(" You were ", "immune to sickness"); ! } ! if (Antimagic) { ! you_are("magic-protected"); ! if (want_dump) dump(" You were ", "magic-protected"); ! } ! if (Acid_resistance) { ! you_are("acid resistant"); ! if (want_dump) dump(" You were ", "acid resistant"); ! } ! ! if (Stone_resistance) { ! you_are("petrification resistant"); ! if (want_dump) dump(" You were ", "petrification resistant"); ! } ! if (Invulnerable) { ! you_are("invulnerable"); ! if (want_dump) dump(" You were ", "invulnerable"); ! } /*** Troubles ***/ ! if (Halluc_resistance) { ! enl_msg("You resist", "", "ed", " hallucinations"); ! if (want_dump) dump(" ", "You resisted hallucinations"); ! } if (final) { ! if (Hallucination) { ! you_are("hallucinating"); ! if (want_dump) dump(" You were ", "hallucinating"); ! } ! if (Stunned) { ! you_are("stunned"); ! if (want_dump) dump(" You were ", "stunned"); ! } ! if (Confusion) { ! you_are("confused"); ! if (want_dump) dump(" You were ", "confused"); ! } ! if (Blinded) { ! you_are("blinded"); ! if (want_dump) dump(" You were ", "blinded"); ! } ! if (Sick) { ! if (u.usick_type & SICK_VOMITABLE) { ! you_are("sick from food poisoning"); ! if (want_dump) ! dump(" You were ", ! "sick from food poisoning"); ! } ! if (u.usick_type & SICK_NONVOMITABLE) { ! you_are("sick from illness"); ! if (want_dump) ! dump(" You were ", ! "sick from illness"); ! } } } ! if (Stoned) { ! you_are("turning to stone"); ! if (want_dump) dump(" You were ", "turning to stone"); ! } ! if (Slimed) { ! you_are("turning into slime"); ! if (want_dump) dump(" You were ", "turning to slime"); ! } ! if (Strangled) { ! you_are((u.uburied) ? "buried" : "being strangled"); ! if (want_dump) ! dump(" You were ", (u.uburied)? "buried" : "being strangled"); ! } if (Glib) { Sprintf(buf, "slippery %s", makeplural(body_part(FINGER))); you_have(buf); + if (want_dump) dump(" You had ", buf); } ! if (Fumbling) { ! enl_msg("You fumble", "", "d", ""); ! if (want_dump) dump(" ", "You fumbled"); ! } if (Wounded_legs) { Sprintf(buf, "wounded %s", makeplural(body_part(LEG))); you_have(buf); + if (want_dump) dump(" You had ", buf); } ! if (Sleeping) { ! enl_msg("You ", "fall", "fell", " asleep"); ! if (want_dump) dump(" ", "You fell asleep"); ! } ! if (Hunger) { ! enl_msg("You hunger", "", "ed", " rapidly"); ! if (want_dump) dump(" ", "You hungered rapidly"); ! } ! if (want_dump && near_capacity() > UNENCUMBERED) { ! Sprintf(buf, "You were %s", enc_stat[near_capacity()]); ! dump(" ", buf); ! } /*** Vision and senses ***/ ! if (See_invisible) { ! enl_msg(You_, "see", "saw", " invisible"); ! if (want_dump) dump(" ", "You saw invisible"); ! } ! if (Blind_telepat) { ! you_are("telepathic"); ! if (want_dump) dump(" You were ", "telepathic"); ! } ! if (Warning) { ! you_are("warned"); ! if (want_dump) dump(" You were ", "warned"); ! } if (Warn_of_mon && flags.warntype) { /* [ALI] Add support for undead */ int i, nth = 0; *************** *** 1213,1256 **** strcat(buf, something); } you_are(buf); } #if 0 /* ALI - dealt with under Warn_of_mon */ if (Undead_warning) you_are("warned of undead"); #endif ! if (Searching) you_have("automatic searching"); ! if (Clairvoyant) you_are("clairvoyant"); ! if (Infravision) you_have("infravision"); ! if (Detect_monsters) you_are("sensing the presence of monsters"); /*** Appearance and behavior ***/ ! if (Adornment) you_are("adorned"); ! if (Invisible) you_are("invisible"); ! else if (Invis) you_are("invisible to others"); /* ordinarily "visible" is redundant; this is a special case for the situation when invisibility would be an expected attribute */ ! else if ((HInvis || EInvis || pm_invisible(youmonst.data)) && BInvis) you_are("visible"); ! if (Displaced) you_are("displaced"); ! if (Stealth) you_are("stealthy"); ! if (Aggravate_monster) enl_msg("You aggravate", "", "d", " monsters"); ! if (Conflict) enl_msg("You cause", "", "d", " conflict"); ! ! /*** Transportation ***/ ! if (Jumping) you_can("jump"); ! if (Teleportation) you_can("teleport"); ! if (Teleport_control) you_have("teleport control"); ! if (Lev_at_will) you_are("levitating, at will"); ! else if (Levitation) you_are("levitating"); /* without control */ ! else if (Flying) you_can("fly"); ! if (Wwalking) you_can("walk on water"); ! if (Swimming) you_can("swim"); ! if (Breathless) you_can("survive without air"); ! else if (Amphibious) you_can("breathe water"); ! if (Passes_walls) you_can("walk through walls"); #ifdef STEED if (u.usteed) { Sprintf(buf, "riding %s", y_monnam(u.usteed)); you_are(buf); } #endif if (u.uswallow) { --- 1345,1458 ---- strcat(buf, something); } you_are(buf); + if (want_dump) dump(" You were ", buf); } #if 0 /* ALI - dealt with under Warn_of_mon */ if (Undead_warning) you_are("warned of undead"); #endif ! if (Searching) { ! you_have("automatic searching"); ! if (want_dump) dump(" You had ", "automatic searching"); ! } ! if (Clairvoyant) { ! you_are("clairvoyant"); ! if (want_dump) dump(" You were ", "clairvoyant"); ! } ! if (Infravision) { ! you_have("infravision"); ! if (want_dump) dump(" You had ", "infravision"); ! } ! if (Detect_monsters) { ! you_are("sensing the presence of monsters"); ! if (want_dump) ! dump(" You were ", "sensing the presence of monsters"); ! } /*** Appearance and behavior ***/ ! if (Adornment) { ! you_are("adorned"); ! if (want_dump) dump(" You were ", "adorned"); ! } ! if (Invisible) { ! you_are("invisible"); ! if (want_dump) dump(" You were ", "invisible"); ! } else if (Invis) { ! you_are("invisible to others"); ! if (want_dump) dump(" You were ", "invisible to others"); ! } /* ordinarily "visible" is redundant; this is a special case for the situation when invisibility would be an expected attribute */ ! else if ((HInvis || EInvis || pm_invisible(youmonst.data)) && BInvis) { you_are("visible"); ! if (want_dump) dump(" You were ", "visible"); ! } ! if (Displaced) { ! you_are("displaced"); ! if (want_dump) dump(" You were ", "displaced"); ! } ! if (Stealth) { ! you_are("stealthy"); ! if (want_dump) dump(" You were ", "stealthy"); ! } ! if (Aggravate_monster) { ! enl_msg("You aggravate", "", "d", " monsters"); ! if (want_dump) dump(" ", "You aggravated monsters"); ! } ! if (Conflict) { ! enl_msg("You cause", "", "d", " conflict"); ! if (want_dump) dump(" ", "You caused conflict"); ! } ! ! /*** Transportation ***/ ! if (Jumping) { ! you_can("jump"); ! if (want_dump) dump(" You could ", "jump"); ! } ! if (Teleportation) { ! you_can("teleport"); ! if (want_dump) dump(" You could ", "teleport"); ! } ! if (Teleport_control) { ! you_have("teleport control"); ! if (want_dump) dump(" You had ", "teleport control"); ! } ! if (Lev_at_will) { ! you_are("levitating, at will"); ! if (want_dump) dump(" You were ", "levitating, at will"); ! } ! else if (Levitation) { ! you_are("levitating"); /* without control */ ! if (want_dump) dump(" You were ", "levitating"); ! } ! else if (Flying) { ! you_can("fly"); ! if (want_dump) dump(" You could ", "fly"); ! } ! if (Wwalking) { ! you_can("walk on water"); ! if (want_dump) dump(" You could ", "walk on water"); ! } ! if (Swimming) { ! you_can("swim"); ! if (want_dump) dump(" You could ", "swim"); ! } ! if (Breathless) { ! you_can("survive without air"); ! if (want_dump) dump(" You could ", "survive without air"); ! } ! else if (Amphibious) { ! you_can("breathe water"); ! if (want_dump) dump(" You could ", "breathe water"); ! } ! if (Passes_walls) { ! you_can("walk through walls"); ! if (want_dump) dump(" You could ", "walk through walls"); ! } #ifdef STEED if (u.usteed) { Sprintf(buf, "riding %s", y_monnam(u.usteed)); you_are(buf); + if (want_dump) dump(" You were ", buf); } #endif if (u.uswallow) { *************** *** 1259,1282 **** if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim); #endif you_are(buf); } else if (u.ustuck) { Sprintf(buf, "%s %s", (Upolyd && sticks(youmonst.data)) ? "holding" : "held by", a_monnam(u.ustuck)); you_are(buf); } /*** Physical attributes ***/ ! if (Slow_digestion) you_have("slower digestion"); ! if (Regeneration) enl_msg("You regenerate", "", "d", ""); ! if (u.uspellprot || Protection) you_are("protected"); ! if (Protection_from_shape_changers) you_are("protected from shape changers"); ! if (Polymorph) you_are("polymorphing"); ! if (Polymorph_control) you_have("polymorph control"); if (u.ulycn >= LOW_PM) { Strcpy(buf, an(mons[u.ulycn].mname)); you_are(buf); } if (Upolyd) { if (u.ulycn >= LOW_PM) Strcpy(buf, "in beast form"); --- 1461,1505 ---- if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim); #endif you_are(buf); + if (want_dump) dump(" You were ", buf); } else if (u.ustuck) { Sprintf(buf, "%s %s", (Upolyd && sticks(youmonst.data)) ? "holding" : "held by", a_monnam(u.ustuck)); you_are(buf); + if (want_dump) dump(" You were ", buf); } /*** Physical attributes ***/ ! if (Slow_digestion) { ! you_have("slower digestion"); ! if (want_dump) dump(" You had ", "slower digestion"); ! } ! if (Regeneration) { ! enl_msg("You regenerate", "", "d", ""); ! if (want_dump) dump(" ", "You regenerated"); ! } ! if (u.uspellprot || Protection) { ! you_are("protected"); ! if (want_dump) dump(" You were ", "protected"); ! } ! if (Protection_from_shape_changers) { you_are("protected from shape changers"); ! if (want_dump) dump(" You were ", ! "protected from shape changers"); ! } ! if (Polymorph) { ! you_are("polymorphing"); ! if (want_dump) dump(" You were ", "polymorphing"); ! } ! if (Polymorph_control) { ! you_have("polymorph control"); ! if (want_dump) dump(" You had ", "polymorph control"); ! } if (u.ulycn >= LOW_PM) { Strcpy(buf, an(mons[u.ulycn].mname)); you_are(buf); + if (want_dump) dump(" You were ", buf); } if (Upolyd) { if (u.ulycn >= LOW_PM) Strcpy(buf, "in beast form"); *************** *** 1285,1302 **** if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone); #endif you_are(buf); } ! if (Unchanging) you_can("not change from your current form"); ! if (Fast) you_are(Very_fast ? "very fast" : "fast"); ! if (Reflecting) you_have("reflection"); ! if (Free_action) you_have("free action"); ! if (Fixed_abil) you_have("fixed abilities"); ! if (uamul && uamul->otyp == AMULET_VERSUS_STONE) ! enl_msg("You ", "will be", "would have been", " depetrified"); ! if (Lifesaved) ! enl_msg("Your life ", "will be", "would have been", " saved"); ! if (u.twoweap) you_are("wielding two weapons at once"); ! /*** Miscellany ***/ if (Luck) { ltmp = abs((int)Luck); --- 1508,1547 ---- if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone); #endif you_are(buf); + if (want_dump) dump(" You were ", buf); } ! if (Unchanging) { ! you_can("not change from your current form"); ! if (want_dump) dump(" You could ", ! "not change from your current form"); ! } ! if (Fast) { ! you_are(Very_fast ? "very fast" : "fast"); ! if (want_dump) dump(" You were ", ! Very_fast? "very fast" : "fast"); ! } ! if (Reflecting) { ! you_have("reflection"); ! if (want_dump) dump(" You had ", "reflection"); ! } ! if (Free_action) { ! you_have("free action"); ! if (want_dump) dump(" You had ", "free action"); ! } ! if (Fixed_abil) { ! you_have("fixed abilities"); ! if (want_dump) dump(" You had ", "fixed abilities"); ! } ! if (Lifesaved) { ! enl_msg("Your life ", "will be", "would have been", " saved"); ! if (want_dump) ! dump(" ", "Your life would have been saved"); ! } ! if (u.twoweap) { ! you_are("wielding two weapons at once"); ! if (want_dump) ! dump(" ", "You were wielding two weapons at once"); ! } /*** Miscellany ***/ if (Luck) { ltmp = abs((int)Luck); *************** *** 1307,1324 **** if (wizard) Sprintf(eos(buf), " (%d)", Luck); #endif you_are(buf); } #ifdef WIZARD ! else if (wizard) enl_msg("Your luck ", "is", "was", " zero"); ! #endif ! if (u.moreluck > 0) you_have("extra luck"); ! else if (u.moreluck < 0) you_have("reduced luck"); if (carrying(LUCKSTONE) || stone_luck(TRUE)) { ltmp = stone_luck(FALSE); ! if (ltmp <= 0) enl_msg("Bad luck ", "does", "did", " not time out for you"); ! if (ltmp >= 0) enl_msg("Good luck ", "does", "did", " not time out for you"); } /* KMH, balance patch -- healthstones affect health */ --- 1552,1585 ---- if (wizard) Sprintf(eos(buf), " (%d)", Luck); #endif you_are(buf); + if (want_dump) dump(" You were ", buf); } #ifdef WIZARD ! else if (wizard) { ! enl_msg("Your luck ", "is", "was", " zero"); ! if (want_dump) dump(" ", "Your luck was zero"); ! } ! #endif ! if (u.moreluck > 0) { ! you_have("extra luck"); ! if (want_dump) dump(" You had ", "extra luck"); ! } ! else if (u.moreluck < 0) { ! you_have("reduced luck"); ! if (want_dump) dump(" You had ", "reduced luck"); ! } if (carrying(LUCKSTONE) || stone_luck(TRUE)) { ltmp = stone_luck(FALSE); ! if (ltmp <= 0) { enl_msg("Bad luck ", "does", "did", " not time out for you"); ! if (want_dump) ! dump(" ", "Bad luck did not time out for you"); ! } ! if (ltmp >= 0) { enl_msg("Good luck ", "does", "did", " not time out for you"); + if (want_dump) + dump(" ", "Good luck did not time out for you"); + } } /* KMH, balance patch -- healthstones affect health */ *************** *** 1330,1338 **** if (wizard) Sprintf(eos(buf), " (%d)", u.uhealbonus); #endif you_have(buf); } #ifdef WIZARD ! else if (wizard) enl_msg("Your health bonus ", "is", "was", " zero"); #endif if (u.ugangr) { --- 1591,1603 ---- if (wizard) Sprintf(eos(buf), " (%d)", u.uhealbonus); #endif you_have(buf); + if (want_dump) dump(" You had ", buf); } #ifdef WIZARD ! else if (wizard) { ! enl_msg("Your health bonus ", "is", "was", " zero"); ! if (want_dump) dump(" ", "Your health bonus was zero"); ! } #endif if (u.ugangr) { *************** *** 1342,1347 **** --- 1607,1616 ---- if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr); #endif enl_msg(u_gname(), " is", " was", buf); + if (want_dump) { + Sprintf(buf2, "%s was %s", u_gname(), buf); + dump(" ", buf2); + } } else /* * We need to suppress this when the game is over, because death *************** *** 1395,1405 **** break; } } ! if (p) enl_msg(You_, "have been killed ", p, buf); } display_nhwindow(en_win, TRUE); destroy_nhwindow(en_win); return; } --- 1664,1681 ---- break; } } ! if (p) { ! enl_msg(You_, "have been killed ", p, buf); ! if (want_dump) { ! Sprintf(buf2, "You %s %s", p, buf); ! dump(" ", buf2); ! } ! } } display_nhwindow(en_win, TRUE); destroy_nhwindow(en_win); + if (want_dump) dump("", ""); return; } *************** *** 1495,1501 **** { minimal_enlightenment(); if (wizard || discover) ! enlightenment(0); return 0; } --- 1771,1777 ---- { minimal_enlightenment(); if (wizard || discover) ! enlightenment(0, FALSE); return 0; } *************** *** 1706,1718 **** STATIC_PTR int doconduct() { ! show_conduct(0); return 0; } void ! show_conduct(final) int final; { char buf[BUFSZ]; int ngenocided; --- 1982,1995 ---- STATIC_PTR int doconduct() { ! show_conduct(0, FALSE); return 0; } void ! show_conduct(final, want_dump) int final; + boolean want_dump; { char buf[BUFSZ]; int ngenocided; *************** *** 1722,1804 **** putstr(en_win, 0, "Voluntary challenges:"); putstr(en_win, 0, ""); ! if (!u.uconduct.food) enl_msg(You_, "have gone", "went", " without food"); /* But beverages are okay */ ! else if (!u.uconduct.unvegan) you_have_X("followed a strict vegan diet"); ! else if (!u.uconduct.unvegetarian) you_have_been("vegetarian"); ! if (!u.uconduct.gnostic) you_have_been("an atheist"); ! if (!u.uconduct.weaphit) you_have_never("hit with a wielded weapon"); #ifdef WIZARD else if (wizard) { Sprintf(buf, "used a wielded weapon %ld time%s", u.uconduct.weaphit, plur(u.uconduct.weaphit)); you_have_X(buf); } #endif ! if (!u.uconduct.killer) you_have_been("a pacifist"); ! if (!u.uconduct.literate) you_have_been("illiterate"); #ifdef WIZARD else if (wizard) { Sprintf(buf, "read items or engraved %ld time%s", u.uconduct.literate, plur(u.uconduct.literate)); you_have_X(buf); } #endif ngenocided = num_genocides(); if (ngenocided == 0) { you_have_never("genocided any monsters"); } else { Sprintf(buf, "genocided %d type%s of monster%s", ngenocided, plur(ngenocided), plur(ngenocided)); you_have_X(buf); } ! if (!u.uconduct.polypiles) you_have_never("polymorphed an object"); #ifdef WIZARD ! else if (wizard) { Sprintf(buf, "polymorphed %ld item%s", u.uconduct.polypiles, plur(u.uconduct.polypiles)); you_have_X(buf); } #endif ! if (!u.uconduct.polyselfs) you_have_never("changed form"); #ifdef WIZARD ! else if (wizard) { Sprintf(buf, "changed form %ld time%s", u.uconduct.polyselfs, plur(u.uconduct.polyselfs)); you_have_X(buf); } #endif ! if (!u.uconduct.wishes) you_have_X("used no wishes"); else { Sprintf(buf, "used %ld wish%s", u.uconduct.wishes, (u.uconduct.wishes > 1L) ? "es" : ""); you_have_X(buf); ! if (!u.uconduct.wisharti) enl_msg(You_, "have not wished", "did not wish", " for any artifacts"); } ! if (!u.uconduct.celibacy) you_have_X("remained celibate"); #ifdef WIZARD else if (wizard) { Sprintf(buf, "broken your vow of celibacy %ld time%s.", --- 1999,2114 ---- putstr(en_win, 0, "Voluntary challenges:"); putstr(en_win, 0, ""); ! if (want_dump) ! dump("", "Voluntary challenges"); ! ! if (!u.uconduct.food) { enl_msg(You_, "have gone", "went", " without food"); /* But beverages are okay */ ! if (want_dump) dump("", " You went without food"); ! } else if (!u.uconduct.unvegan) { you_have_X("followed a strict vegan diet"); ! if (want_dump) dump("", " You followed a strict vegan diet"); ! } ! else if (!u.uconduct.unvegetarian) { you_have_been("vegetarian"); + if (want_dump) dump("", " You were vegetarian"); + } ! if (!u.uconduct.gnostic) { you_have_been("an atheist"); + if (want_dump) dump("", " You were an atheist"); + } ! if (!u.uconduct.weaphit) { you_have_never("hit with a wielded weapon"); + if (want_dump) dump("", " You never hit with a wielded weapon"); + } #ifdef WIZARD else if (wizard) { Sprintf(buf, "used a wielded weapon %ld time%s", u.uconduct.weaphit, plur(u.uconduct.weaphit)); you_have_X(buf); + if (want_dump) dump(" You ", buf); } #endif ! if (!u.uconduct.killer) { you_have_been("a pacifist"); + if (want_dump) dump(" ", "You were a pacifist"); + } ! if (!u.uconduct.literate) { you_have_been("illiterate"); + if (want_dump) dump(" ", "You were illiterate"); + } #ifdef WIZARD else if (wizard) { Sprintf(buf, "read items or engraved %ld time%s", u.uconduct.literate, plur(u.uconduct.literate)); you_have_X(buf); + if (want_dump) dump(" You ", buf); } #endif ngenocided = num_genocides(); if (ngenocided == 0) { you_have_never("genocided any monsters"); + if (want_dump) dump(" ", "You never genocided any monsters"); } else { Sprintf(buf, "genocided %d type%s of monster%s", ngenocided, plur(ngenocided), plur(ngenocided)); you_have_X(buf); + if (want_dump) dump(" You ", buf); } ! if (!u.uconduct.polypiles) { you_have_never("polymorphed an object"); + if (want_dump) dump(" ", "You never polymorphed an object"); + } #ifdef WIZARD ! else if (wizard || final) { Sprintf(buf, "polymorphed %ld item%s", u.uconduct.polypiles, plur(u.uconduct.polypiles)); you_have_X(buf); + if (want_dump) dump(" You ", buf); } #endif ! if (!u.uconduct.polyselfs) { you_have_never("changed form"); + if (want_dump) dump(" ", "You never changed form"); + } #ifdef WIZARD ! else if (wizard || final) { Sprintf(buf, "changed form %ld time%s", u.uconduct.polyselfs, plur(u.uconduct.polyselfs)); you_have_X(buf); + if (want_dump) dump(" You ", buf); } #endif ! if (!u.uconduct.wishes) { you_have_X("used no wishes"); + if (want_dump) dump(" ", "You used no wishes"); + } else { Sprintf(buf, "used %ld wish%s", u.uconduct.wishes, (u.uconduct.wishes > 1L) ? "es" : ""); you_have_X(buf); + if (want_dump) dump(" You ", buf); ! if (!u.uconduct.wisharti) { enl_msg(You_, "have not wished", "did not wish", " for any artifacts"); + if (want_dump) dump(" ", "You did not wish for any artifacts"); + } } ! if (!u.uconduct.celibacy) { you_have_X("remained celibate"); + if (want_dump) dump(" ", "You remained celibate"); + } #ifdef WIZARD else if (wizard) { Sprintf(buf, "broken your vow of celibacy %ld time%s.", *************** *** 1810,1815 **** --- 2120,2127 ---- /* Pop up the window and wait for a key */ display_nhwindow(en_win, TRUE); destroy_nhwindow(en_win); + + if (want_dump) dump("", ""); } #endif /* OVLB */ diff -c -r sl_6e4f6/src/decl.c sl_d/src/decl.c *** sl_6e4f6/src/decl.c Fri Nov 30 05:27:54 2001 --- sl_d/src/decl.c Sat Dec 1 12:43:44 2001 *************** *** 196,201 **** --- 196,204 ---- const char *him[3] = { "him", "her", "it" }; const char *his[3] = { "his", "her", "its" }; + /* originally from end.c */ + NEARDATA char dump_fn[PL_PSIZ] = DUMMY; + /* originally from dog.c */ NEARDATA char dogname[PL_PSIZ] = DUMMY; NEARDATA char catname[PL_PSIZ] = DUMMY; diff -c -r sl_6e4f6/src/end.c sl_d/src/end.c *** sl_6e4f6/src/end.c Fri Nov 30 05:27:56 2001 --- sl_d/src/end.c Sat Dec 1 13:29:26 2001 *************** *** 40,47 **** STATIC_DCL void FDECL(add_artifact_score, (struct obj *)); STATIC_DCL void FDECL(display_artifact_score, (struct obj *,winid)); STATIC_DCL void FDECL(savelife, (int)); ! STATIC_DCL void NDECL(list_vanquished); ! STATIC_DCL void NDECL(list_genocided); #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2) extern void FDECL(nethack_exit,(int)); --- 40,47 ---- STATIC_DCL void FDECL(add_artifact_score, (struct obj *)); STATIC_DCL void FDECL(display_artifact_score, (struct obj *,winid)); STATIC_DCL void FDECL(savelife, (int)); ! STATIC_DCL void FDECL(list_vanquished, (BOOLEAN_P)); ! STATIC_DCL void FDECL(list_genocided, (BOOLEAN_P)); #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2) extern void FDECL(nethack_exit,(int)); *************** *** 62,67 **** --- 62,90 ---- # endif #endif + FILE *dump_fp = (FILE *) 0; /* file pointer for dumps */ + + + void + dump_init() + { + dump_fp = fopen(dump_fn, "w"); + } + + void + dump_exit() + { + if (dump_fp) + fclose(dump_fp); + } + + void dump(pre, str) + char *pre, *str; + { + if (dump_fp) + fprintf(dump_fp, "%s%s\n", pre, str); + } + /* * The order of these needs to match the macros in hack.h. */ *************** *** 326,333 **** makeknown(obj->otyp); obj->known = obj->bknown = obj->dknown = obj->rknown = 1; } ! (void) display_inventory((char *)0, TRUE); ! container_contents(invent, TRUE, TRUE); } if (c == 'q') done_stopprint++; } --- 349,356 ---- makeknown(obj->otyp); obj->known = obj->bknown = obj->dknown = obj->rknown = 1; } ! (void) display_inventory((char *)0, TRUE, TRUE); ! container_contents(invent, TRUE, TRUE, TRUE); } if (c == 'q') done_stopprint++; } *************** *** 336,361 **** if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'a'))) { c = yn_function("Do you want to see your attributes?",ynqchars,'y'); ! if (c == 'y') enlightenment(how >= PANICKED ? 1 : 2); /* final */ if (c == 'q') done_stopprint++; } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'v'))) { ! list_vanquished(); } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'g'))) { ! list_genocided(); } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'c'))) { c = yn_function("Do you want to see your conduct?",ynqchars,'y'); ! if (c == 'y') show_conduct(how >= PANICKED ? 1 : 2); if (c == 'q') done_stopprint++; } } /* try to get the player back in a viable state after being killed */ --- 359,389 ---- if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'a'))) { c = yn_function("Do you want to see your attributes?",ynqchars,'y'); ! if (c == 'y') enlightenment(how >= PANICKED ? 1 : 2, TRUE); /* final */ if (c == 'q') done_stopprint++; } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'v'))) { ! list_vanquished(TRUE); } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'g'))) { ! list_genocided(TRUE); } if (!done_stopprint && (!flags.end_disclose[0] || index(flags.end_disclose, 'c'))) { c = yn_function("Do you want to see your conduct?",ynqchars,'y'); ! if (c == 'y') show_conduct(how >= PANICKED ? 1 : 2, TRUE); if (c == 'q') done_stopprint++; } + + #ifdef DUMP_LOG + if (dump_fn) + dump_weapon_skill(); + #endif } /* try to get the player back in a viable state after being killed */ *************** *** 481,486 **** --- 509,517 ---- 100L * (long)objects[otmp->otyp].oc_cost, 250L * (long)objects[otmp->otyp].oc_cost); putstr(endwin, 0, pbuf); + + if (dump_fn) + dump("", pbuf); } if (Has_contents(otmp)) display_artifact_score(otmp->cobj,endwin); *************** *** 663,668 **** --- 694,726 ---- #endif if (have_windows) display_nhwindow(WIN_MESSAGE, FALSE); + if (dump_fn) { + dump_init(); + Sprintf(pbuf, "%s, %s %s %s %s", plname, + aligns[1 - u.ualign.type].adj, + genders[flags.female].adj, + urace.adj, + (flags.female && urole.name.f)? + urole.name.f : urole.name.m); + dump("", pbuf); + Sprintf(pbuf, "St:"); + if (ACURR(A_STR) > 18) { + if (ACURR(A_STR) > STR18(100)) + Sprintf(eos(pbuf), "%2d", ACURR(A_STR) - 100); + else if (ACURR(A_STR) < STR18(100)) + Sprintf(eos(pbuf), "18/%02d", ACURR(A_STR) - 18); + else + Sprintf(eos(pbuf), "18/**"); + } else + Sprintf(eos(pbuf), "%-1d", ACURR(A_STR)); + Sprintf(eos(pbuf), + " Dx:%-1d Co:%-1d In:%-1d Wi:%-1d Ch:%-1d HP:%d(%d) Pw:%d(%d) AC:%-2d Exp:%u\n", + ACURR(A_DEX), ACURR(A_CON), ACURR(A_INT), ACURR(A_WIS), + ACURR(A_CHA), u.uhp, u.uhpmax, u.uen, u.uenmax, u.uac, + u.ulevel); + dump("", pbuf); + } + if (strcmp(flags.end_disclose, "none") && how != PANICKED) disclose(how, taken); /* finish_paybill should be called after disclosure but before bones */ *************** *** 733,738 **** --- 791,799 ---- (const char *) (flags.female ? "Demigoddess" : "Demigod")); putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); + + if (dump_fn) + dump("", pbuf); } if (how == ESCAPED || how == ASCENDED) { *************** *** 769,774 **** --- 830,837 ---- mtmp = mtmp->nmon; } if (!done_stopprint) putstr(endwin, 0, pbuf); + if (dump_fn) + dump("", pbuf); pbuf[0] = '\0'; } else { if (!done_stopprint) Strcat(pbuf, " "); *************** *** 779,784 **** --- 842,849 ---- "escaped from the dungeon", u.urexp, plur(u.urexp)); putstr(endwin, 0, pbuf); + if (dump_fn) + dump("", pbuf); } if (!done_stopprint) *************** *** 809,814 **** --- 874,881 ---- count, plur(count)); } putstr(endwin, 0, pbuf); + if (dump_fn) + dump("", pbuf); } } *************** *** 833,844 **** --- 900,919 ---- Sprintf(eos(pbuf), " with %ld point%s,", u.urexp, plur(u.urexp)); putstr(endwin, 0, pbuf); + if (dump_fn) + dump("", pbuf); } if (!done_stopprint) { Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.", u.ugold, plur(u.ugold), moves, plur(moves)); putstr(endwin, 0, pbuf); + + if (dump_fn) { + dump("", pbuf); + Sprintf(pbuf, "Killer: %s", killer); + dump("", pbuf); + } } if (!done_stopprint) { Sprintf(pbuf, *************** *** 846,857 **** --- 921,937 ---- u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]); putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); + if (dump_fn) + dump("", pbuf); } if (!done_stopprint) display_nhwindow(endwin, TRUE); if (endwin != WIN_ERR) destroy_nhwindow(endwin); + if (dump_fn) + dump_exit(); + /* "So when I die, the first thing I will see in Heaven is a * score list?" */ if (flags.toptenwin) { *************** *** 870,878 **** void ! container_contents(list, identified, all_containers) struct obj *list; ! boolean identified, all_containers; { register struct obj *box, *obj; char buf[BUFSZ]; --- 950,958 ---- void ! container_contents(list, identified, all_containers, want_dump) struct obj *list; ! boolean identified, all_containers, want_dump; { register struct obj *box, *obj; char buf[BUFSZ]; *************** *** 884,889 **** --- 964,973 ---- Sprintf(buf, "Contents of %s:", the(xname(box))); putstr(tmpwin, 0, buf); putstr(tmpwin, 0, ""); + + if (want_dump) + dump("", buf); + for (obj = box->cobj; obj; obj = obj->nobj) { if (identified) { makeknown(obj->otyp); *************** *** 891,909 **** obj->dknown = obj->rknown = 1; } putstr(tmpwin, 0, doname(obj)); } display_nhwindow(tmpwin, TRUE); destroy_nhwindow(tmpwin); if (all_containers) ! container_contents(box->cobj, identified, TRUE); } else { pline("%s is empty.", The(xname(box))); display_nhwindow(WIN_MESSAGE, FALSE); } } if (!all_containers) break; } } /* should be called with either EXIT_SUCCESS or EXIT_FAILURE */ --- 975,1002 ---- obj->dknown = obj->rknown = 1; } putstr(tmpwin, 0, doname(obj)); + + if (want_dump) + dump("", doname(obj)); } display_nhwindow(tmpwin, TRUE); destroy_nhwindow(tmpwin); if (all_containers) ! container_contents(box->cobj, identified, TRUE, ! want_dump); } else { pline("%s is empty.", The(xname(box))); display_nhwindow(WIN_MESSAGE, FALSE); + if (want_dump) + dump(The(xname(box)), " is empty."); } } if (!all_containers) break; } + + if (want_dump) + dump("", ""); } /* should be called with either EXIT_SUCCESS or EXIT_FAILURE */ *************** *** 925,931 **** } STATIC_OVL void ! list_vanquished() { register int i, lev; int ntypes = 0, max_lev = 0, nkilled; --- 1018,1025 ---- } STATIC_OVL void ! list_vanquished(want_dump) ! boolean want_dump; { register int i, lev; int ntypes = 0, max_lev = 0, nkilled; *************** *** 953,958 **** --- 1047,1055 ---- putstr(klwin, 0, "Vanquished creatures:"); putstr(klwin, 0, ""); + if (want_dump) + dump("", "Vanquished creatures"); + /* countdown by monster "toughness" */ for (lev = max_lev; lev >= 0; lev--) for (i = LOW_PM; i < NUMMONS; i++) *************** *** 974,979 **** --- 1071,1078 ---- nkilled, makeplural(mons[i].mname)); } putstr(klwin, 0, buf); + if (want_dump) + dump(" ", buf); } /* * if (Hallucination) *************** *** 983,991 **** --- 1082,1095 ---- putstr(klwin, 0, ""); Sprintf(buf, "%ld creatures vanquished.", total_killed); putstr(klwin, 0, buf); + if (want_dump) + dump(" ", buf); } display_nhwindow(klwin, TRUE); destroy_nhwindow(klwin); + + if (want_dump) + dump("", ""); } } } *************** *** 1003,1009 **** } STATIC_OVL void ! list_genocided() { register int i; int ngenocided; --- 1107,1114 ---- } STATIC_OVL void ! list_genocided(want_dump) ! boolean want_dump; { register int i; int ngenocided; *************** *** 1023,1028 **** --- 1128,1136 ---- putstr(klwin, 0, "Genocided species:"); putstr(klwin, 0, ""); + if (want_dump) + dump("", "Genocided species"); + for (i = LOW_PM; i < NUMMONS; i++) if (mvitals[i].mvflags & G_GENOD) { if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST) *************** *** 1032,1045 **** --- 1140,1161 ---- else Strcpy(buf, makeplural(mons[i].mname)); putstr(klwin, 0, buf); + + if (want_dump) + dump(" ", buf); } putstr(klwin, 0, ""); Sprintf(buf, "%d species genocided.", ngenocided); putstr(klwin, 0, buf); + if (want_dump) + dump("", buf); display_nhwindow(klwin, TRUE); destroy_nhwindow(klwin); + + if (want_dump) + dump("", ""); } } } diff -c -r sl_6e4f6/src/fountain.c sl_d/src/fountain.c *** sl_6e4f6/src/fountain.c Fri Nov 30 05:27:56 2001 --- sl_d/src/fountain.c Sat Dec 1 12:43:44 2001 *************** *** 238,244 **** You_feel("self-knowledgeable..."); display_nhwindow(WIN_MESSAGE, FALSE); ! enlightenment(0); exercise(A_WIS, TRUE); pline_The("feeling subsides."); break; --- 238,244 ---- You_feel("self-knowledgeable..."); display_nhwindow(WIN_MESSAGE, FALSE); ! enlightenment(0, FALSE); exercise(A_WIS, TRUE); pline_The("feeling subsides."); break; diff -c -r sl_6e4f6/src/invent.c sl_d/src/invent.c *** sl_6e4f6/src/invent.c Fri Nov 30 05:27:58 2001 --- sl_d/src/invent.c Sat Dec 1 12:43:44 2001 *************** *** 982,988 **** if (ilet == '?' && !*lets && *altlets) allowed_choices = altlets; ! ilet = display_inventory(allowed_choices, TRUE); if(!ilet) continue; if(ilet == '\033') { if(flags.verbose) --- 982,988 ---- if (ilet == '?' && !*lets && *altlets) allowed_choices = altlets; ! ilet = display_inventory(allowed_choices, TRUE, FALSE); if(!ilet) continue; if(ilet == '\033') { if(flags.verbose) *************** *** 1130,1136 **** getlin(qbuf, buf); if (buf[0] == '\033') return(0); if (index(buf, 'i')) { ! if (display_inventory((char *)0, TRUE) == '\033') return 0; } else break; } --- 1130,1136 ---- getlin(qbuf, buf); if (buf[0] == '\033') return(0); if (index(buf, 'i')) { ! if (display_inventory((char *)0, TRUE, FALSE) == '\033') return 0; } else break; } *************** *** 1476,1482 **** int ddoinv() { ! (void) display_inventory((char *)0, FALSE); return 0; } --- 1476,1482 ---- int ddoinv() { ! (void) display_inventory((char *)0, FALSE, FALSE); return 0; } *************** *** 1521,1529 **** * was selected. */ char ! display_inventory(lets, want_reply) register const char *lets; ! boolean want_reply; { struct obj *otmp; char ilet, ret; --- 1521,1529 ---- * was selected. */ char ! display_inventory(lets, want_reply, want_dump) register const char *lets; ! boolean want_reply, want_dump; { struct obj *otmp; char ilet, ret; *************** *** 1543,1548 **** --- 1543,1551 ---- } else win = WIN_INVEN; + if (want_dump) + dump("", "Your inventory"); + /* Exit early if no inventory -- but keep going if we are doing a permanent inventory update. We need to keep going so the *************** *** 1556,1561 **** --- 1559,1566 ---- */ if (!invent && !(flags.perm_invent && !lets && !want_reply)) { pline("Not carrying anything%s.", u.ugold ? " except gold" : ""); + if (want_dump) + dump(" Not carrying anything", u.ugold? " except gold" : "."); return 0; } *************** *** 1572,1577 **** --- 1577,1584 ---- ret = message_menu(lets[0], want_reply ? PICK_ONE : PICK_NONE, xprname(otmp, (char *)0, lets[0], TRUE, 0L)); + if (want_dump) + dump(" ", xprname(otmp, (char *)0, lets[0], TRUE, 0L)); break; } } *************** *** 1590,1601 **** --- 1597,1612 ---- any.a_void = 0; /* zero */ add_menu(win, NO_GLYPH, &any, 0, 0, ATR_INVERSE, let_to_name(*invlet, FALSE), MENU_UNSELECTED); + if (want_dump) + dump(" ", let_to_name(*invlet, FALSE)); classcount++; } any.a_char = ilet; add_menu(win, obj_to_glyph(otmp), &any, ilet, 0, ATR_NONE, doname(otmp), MENU_UNSELECTED); + if (want_dump) + dump(" ", doname(otmp)); } } } *************** *** 1617,1622 **** --- 1628,1636 ---- } else ret = !n ? '\0' : '\033'; /* cancelled */ + if (want_dump) + dump("", ""); + return ret; } *************** *** 2200,2206 **** if(uarmg) lets[ct++] = obj_to_let(uarmg); if(uarmf) lets[ct++] = obj_to_let(uarmf); lets[ct] = 0; ! (void) display_inventory(lets, FALSE); } return 0; } --- 2214,2220 ---- if(uarmg) lets[ct++] = obj_to_let(uarmg); if(uarmf) lets[ct++] = obj_to_let(uarmf); lets[ct] = 0; ! (void) display_inventory(lets, FALSE, FALSE); } return 0; } *************** *** 2217,2223 **** if(uleft) lets[ct++] = obj_to_let(uleft); if(uright) lets[ct++] = obj_to_let(uright); lets[ct] = 0; ! (void) display_inventory(lets, FALSE); } return 0; } --- 2231,2237 ---- if(uleft) lets[ct++] = obj_to_let(uleft); if(uright) lets[ct++] = obj_to_let(uright); lets[ct] = 0; ! (void) display_inventory(lets, FALSE, FALSE); } return 0; } *************** *** 2258,2264 **** lets[ct++] = obj_to_let(otmp); lets[ct] = '\0'; if (!ct) You("are not using any tools."); ! else (void) display_inventory(lets, FALSE); return 0; } --- 2272,2278 ---- lets[ct++] = obj_to_let(otmp); lets[ct] = '\0'; if (!ct) You("are not using any tools."); ! else (void) display_inventory(lets, FALSE, FALSE); return 0; } *************** *** 2276,2282 **** lets[ct++] = obj_to_let(otmp); lets[ct] = '\0'; if (!ct) You("are not wearing or wielding anything."); ! else (void) display_inventory(lets, FALSE); return 0; } --- 2290,2296 ---- lets[ct++] = obj_to_let(otmp); lets[ct] = '\0'; if (!ct) You("are not wearing or wielding anything."); ! else (void) display_inventory(lets, FALSE, FALSE); return 0; } diff -c -r sl_6e4f6/src/options.c sl_d/src/options.c *** sl_6e4f6/src/options.c Fri Nov 30 05:27:52 2001 --- sl_d/src/options.c Sat Dec 1 12:43:44 2001 *************** *** 241,246 **** --- 241,248 ---- SET_IN_GAME }, { "dogname", "the name of your (first) dog (e.g., dogname:Fang)", PL_PSIZ, DISP_IN_GAME }, + { "dumpfile", "where to dump data (e.g. dumpfile:/tmp/nh.dump)", + PL_PSIZ, SET_IN_GAME }, { "dungeon", "the symbols to use in drawing the dungeon map", MAXDCHARS+1, SET_IN_FILE }, { "effects", "the symbols to use in drawing special effects", *************** *** 1089,1094 **** --- 1091,1105 ---- return; } + fullname = "dumpfile"; + if (match_optname(opts, fullname, 3, TRUE)) { + if (negated) bad_negation(fullname, FALSE); + else if ((op = string_for_opt(opts, !tfrom_file)) != 0 + && strlen(op) > 1) + nmcpy(dump_fn, op, PL_PSIZ); + return ; + } + fullname = "horsename"; if (match_optname(opts, fullname, 5, TRUE)) { if (negated) bad_negation(fullname, FALSE); *************** *** 2325,2330 **** --- 2336,2343 ---- flags.end_disclose[0] ? flags.end_disclose : "all" ); else if (!strcmp(optname, "dogname")) Sprintf(buf, "%s", dogname[0] ? dogname : none ); + else if (!strcmp(optname, "dumpfile")) + Sprintf(buf, "%s", dump_fn[0]? dump_fn : none ); else if (!strcmp(optname, "dungeon")) Sprintf(buf, "%s", to_be_done); else if (!strcmp(optname, "effects")) diff -c -r sl_6e4f6/src/pickup.c sl_d/src/pickup.c *** sl_6e4f6/src/pickup.c Fri Nov 30 05:28:02 2001 --- sl_d/src/pickup.c Sat Dec 1 12:43:44 2001 *************** *** 172,178 **** simple_look(objs, here); /* dumb if objs==invent */ goto ask_again; } else if (sym == 'i') { ! (void) display_inventory((char *)0, TRUE); goto ask_again; } else if (sym == 'm') { m_seen = TRUE; --- 172,178 ---- simple_look(objs, here); /* dumb if objs==invent */ goto ask_again; } else if (sym == 'i') { ! (void) display_inventory((char *)0, TRUE, FALSE); goto ask_again; } else if (sym == 'm') { m_seen = TRUE; *************** *** 1814,1820 **** add_valid_menu_class(0); /* reset */ switch (yn_function(qbuf, ":ynq", 'n')) { case ':': ! container_contents(current_container, FALSE, FALSE); goto ask_again2; case 'y': if (query_classes(select, &one_by_one, &allflag, --- 1814,1820 ---- add_valid_menu_class(0); /* reset */ switch (yn_function(qbuf, ":ynq", 'n')) { case ':': ! container_contents(current_container, FALSE, FALSE, FALSE); goto ask_again2; case 'y': if (query_classes(select, &one_by_one, &allflag, diff -c -r sl_6e4f6/src/potion.c sl_d/src/potion.c *** sl_6e4f6/src/potion.c Fri Nov 30 05:28:04 2001 --- sl_d/src/potion.c Sat Dec 1 12:43:44 2001 *************** *** 539,545 **** } You_feel("self-knowledgeable..."); display_nhwindow(WIN_MESSAGE, FALSE); ! enlightenment(0); pline_The("feeling subsides."); exercise(A_WIS, TRUE); } --- 539,545 ---- } You_feel("self-knowledgeable..."); display_nhwindow(WIN_MESSAGE, FALSE); ! enlightenment(0, FALSE); pline_The("feeling subsides."); exercise(A_WIS, TRUE); } diff -c -r sl_6e4f6/src/spell.c sl_d/src/spell.c *** sl_6e4f6/src/spell.c Fri Nov 30 05:28:06 2001 --- sl_d/src/spell.c Sat Dec 1 12:43:44 2001 *************** *** 1002,1008 **** case SPE_ENLIGHTEN: You("feel self-knowledgeable..."); display_nhwindow(WIN_MESSAGE, FALSE); ! enlightenment(FALSE); pline("The feeling subsides."); exercise(A_WIS, TRUE); break; --- 1002,1008 ---- case SPE_ENLIGHTEN: You("feel self-knowledgeable..."); display_nhwindow(WIN_MESSAGE, FALSE); ! enlightenment(FALSE, FALSE); pline("The feeling subsides."); exercise(A_WIS, TRUE); break; diff -c -r sl_6e4f6/src/weapon.c sl_d/src/weapon.c *** sl_6e4f6/src/weapon.c Fri Nov 30 05:28:06 2001 --- sl_d/src/weapon.c Sat Dec 1 12:43:44 2001 *************** *** 9,14 **** --- 9,18 ---- */ #include "hack.h" + #ifdef DUMP_LOG + STATIC_DCL int FDECL(enhance_skill, (BOOLEAN_P)); + #endif + /* categories whose names don't come from OBJ_NAME(objects[type]) */ #define PN_POLEARMS (-1) #define PN_SABER (-2) *************** *** 1037,1042 **** --- 1041,1063 ---- */ int enhance_weapon_skill() + #ifdef DUMP_LOG + { + return enhance_skill(FALSE); + } + + int dump_weapon_skill() + { + return enhance_skill(TRUE); + } + + int enhance_skill(int want_dump) + #endif + /* This is the original enhance_weapon_skill() function slightly modified + * to write the skills to the dump file. I added the wrapper functions just + * because it looked like the easiest way to add a parameter to the + * function call. - Jukka Lahtinen, August 2001 + */ { int pass, i, n, len, longest, to_advance; char buf[BUFSZ], buf2[BUFSZ]; *************** *** 1044,1052 **** anything any; winid win; boolean speedy = FALSE; ! #ifdef WIZARD if (wizard && yn("Advance skills without practice?") == 'y') speedy = TRUE; #endif --- 1065,1076 ---- anything any; winid win; boolean speedy = FALSE; ! boolean logged; #ifdef WIZARD + #ifdef DUMP_LOG + if (!want_dump) + #endif if (wizard && yn("Advance skills without practice?") == 'y') speedy = TRUE; #endif *************** *** 1059,1067 **** if (can_advance(i, speedy)) to_advance++; } win = create_nhwindow(NHW_MENU); start_menu(win); ! /* List the skills, making ones that could be advanced selectable. List the miscellaneous skills first. Possible future enhancement: list spell skills before --- 1083,1098 ---- if (can_advance(i, speedy)) to_advance++; } + #ifdef DUMP_LOG + if (want_dump) + dump("", "Your skills"); + else { + #endif win = create_nhwindow(NHW_MENU); start_menu(win); ! #ifdef DUMP_LOG ! } ! #endif /* List the skills, making ones that could be advanced selectable. List the miscellaneous skills first. Possible future enhancement: list spell skills before *************** *** 1072,1080 **** --- 1103,1129 ---- /* Print headings for skill types */ any.a_void = 0; if (i == skill_ranges[pass].first) + #ifdef DUMP_LOG + if (want_dump) { + dump(" ", skill_ranges[pass].name); + logged = FALSE; + } else + #endif add_menu(win, NO_GLYPH, &any, 0, 0, ATR_BOLD, skill_ranges[pass].name, MENU_UNSELECTED); + #ifdef DUMP_LOG + if (want_dump) { + if (P_SKILL(i) > P_UNSKILLED) { + Sprintf(buf2, "%-*s [%s]", longest, P_NAME(i), + skill_level_name(i, buf)); + dump(" ", buf2); + logged = TRUE; + } else if (i == skill_ranges[pass].last && !logged) { + dump(" ", "(none)"); + } + } else { + #endif if (P_RESTRICTED(i)) continue; /* * Sigh, this assumes a monospaced font. *************** *** 1097,1102 **** --- 1146,1154 ---- any.a_int = can_advance(i, speedy) ? i+1 : 0; add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, buf2, MENU_UNSELECTED); + #ifdef DUMP_LOG + } + #endif } Strcpy(buf, to_advance ? "Pick a skill to advance:" : "Current skills:"); *************** *** 1104,1109 **** --- 1156,1167 ---- if (wizard && !speedy) Sprintf(eos(buf), " (%d slot%s available)", u.weapon_slots, plur(u.weapon_slots)); #endif + #ifdef DUMP_LOG + if (want_dump) { + dump("", ""); + n = 0; + } else { + #endif end_menu(win, buf); n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected); destroy_nhwindow(win); *************** *** 1120,1125 **** --- 1178,1186 ---- } } } + #ifdef DUMP_LOG + } + #endif } while (speedy && n > 0); return 0; } diff -c -r sl_6e4f6/src/zap.c sl_d/src/zap.c *** sl_6e4f6/src/zap.c Fri Nov 30 05:28:08 2001 --- sl_d/src/zap.c Sat Dec 1 12:43:44 2001 *************** *** 1886,1892 **** known = TRUE; You_feel("self-knowledgeable..."); display_nhwindow(WIN_MESSAGE, FALSE); ! enlightenment(FALSE); pline_The("feeling subsides."); exercise(A_WIS, TRUE); break; --- 1886,1892 ---- known = TRUE; You_feel("self-knowledgeable..."); display_nhwindow(WIN_MESSAGE, FALSE); ! enlightenment(FALSE, FALSE); pline_The("feeling subsides."); exercise(A_WIS, TRUE); break; diff -c -r sl_6e4f6/win/gtk/gtk.c sl_d/win/gtk/gtk.c *** sl_6e4f6/win/gtk/gtk.c Fri Nov 30 05:28:28 2001 --- sl_d/win/gtk/gtk.c Sat Dec 1 12:43:44 2001 *************** *** 2078,2084 **** if (!initialized2) return; if (flags.perm_invent) ! (void) display_inventory((char *)0, FALSE); else if (WIN_INVEN != WIN_ERR) GTK_unmap_menu_window(>kWindows[WIN_INVEN]); } --- 2078,2084 ---- if (!initialized2) return; if (flags.perm_invent) ! (void) display_inventory((char *)0, FALSE, FALSE); else if (WIN_INVEN != WIN_ERR) GTK_unmap_menu_window(>kWindows[WIN_INVEN]); } diff -c -r sl_6e4f6/win/x11/winx.c sl_d/win/x11/winx.c *** sl_6e4f6/win/x11/winx.c Fri Nov 30 05:28:26 2001 --- sl_d/win/x11/winx.c Sat Dec 1 12:43:44 2001 *************** *** 798,804 **** { if (x_inited && window_list[WIN_INVEN].menu_information->is_up) { updated_inventory = 1; /* hack to avoid mapping&raising window */ ! (void) display_inventory((char *)0, FALSE); updated_inventory = 0; } } --- 798,804 ---- { if (x_inited && window_list[WIN_INVEN].menu_information->is_up) { updated_inventory = 1; /* hack to avoid mapping&raising window */ ! (void) display_inventory((char *)0, FALSE, FALSE); updated_inventory = 0; } }