Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site cmu-cs-cad.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!rochester!cmu-cs-pt!cmu-cs-cad!mlm From: mlm@cmu-cs-cad.ARPA (Michael Mauldin) Newsgroups: net.sources.bugs Subject: Rog-O-Matic XIV bugs fixes #2 (ed scripts) Message-ID: <296@cmu-cs-cad.ARPA> Date: Sun, 17-Feb-85 00:07:15 EST Article-I.D.: cmu-cs-c.296 Posted: Sun Feb 17 00:07:15 1985 Date-Received: Wed, 20-Feb-85 08:56:28 EST Organization: Carnegie-Mellon University, CS/RI Lines: 787 #!/bin/sh # # This is a shell archive. Use the "unshar" command to unpack it, or # remove the mail header and pipe the body of the message through "sh". # # Seems like more bugs have cropped up. Thanks to everyone who sent them # in. This version has been better tested against 3.6 and 5.2 (cheat # mode still works, in 10 games against 3.6 it got another total winner). # # This message contains three files: # # Bugreport A new Bugreport file # mod.1.sh a diff -e script (Feb 5 mods, already posted) # mod.2.sh another diff -e script (Feb 16 mods) # # If you have your original distribution and haven't changed anything # except install.h, then just make a copy the original directory and type # # % sh mod.1.sh # % sh mod.2.sh # % make # # If you have already installed the first mods, then type # # % sh mod.2.sh # % make # # If you have changed any files, then you should obtain the file # "mod.2.context" (posted in another message) and make the changes # manually. # # Changes: # # mod.1 fixed the armor bug # fixed the ancilliary commands (rplot and histplot) # documented the ancilliary commands (rplot, histplot, gene) # # mod.2 fixed another armor handling bug # fixed plunge mode when coming back up # fixed replay command to include version number # fixed invisible stalker fighting code # numerous tactics changed # (see Bugreport for gory details) # # Share and Enjoy! # # Michael Mauldin (Fuzzy) Department of Computer Science # (412) 578-3065 Carnegie-Mellon University # mauldin@cmu-cs-a.arpa Pittsburgh, PA 15213 # echo 'Start of Rgm XIV mods 02/16/85 - ed scripts:' echo 'x - Bugreport' sed 's/^X//' > Bugreport << '/' X/* X * Bugreport: Rog-O-Matic XIV (CMU) Sat Feb 16 22:53:04 1985 - mlm X * Copyright (C) 1985 by A. Appel, G. Jacobson, L. Hamey, and M. Mauldin X */ X X1. fails to wear any armor below level 7. X X things.c:willrust() changed itemis(PROTECTED) X tactics.c:handlearmor() dont worry about cursed armor X X X2. histplot and rplot are flaky (reported by AEB (play@turing)). X X rplot removed file name X gene.c fixed "Usage" message X histplot.c fixed bugs X README documented ancilliary functions X X3. utility.c uses "getpw (getuid (), name)", which according to X Rick Adams @ Seismo is obsolete. no fix made here. Caveat Emptor! X X4. Armor handling again. Fails to track current armor under Rogue 3.6 X and Rogue 5.2 (bug reported by Dennis Ritchie). X X things.c:wear(),takeoff() added usesynch=0 (ie: get new invent) X tactics.c:handlearmor() new strategy, includes 3rd best X X5. Failed to handle "cursed armor" message in Rogue 3.6 / 5.2. Fixed. X X mess.c:terpmes() modified cursed mesage pattern X X6. Drops good, known items rather than quaffing/reading them X X things.c:drop() read/quaff some things X X7. Too often throws good armor away to keep mediocre scrolls. X X worth.c:worth() values armor more highly. X X8. Peter Wan reports problems with screen handling on terminals with X no tabs. Problem unknown. X X9. Fixed reply command to understand version messages at start of X log files. Modifiekd to send version command when starting a X log in the middle of the game. X X io.c:getrogver() look for version string in log X io.c:toggleecho() send version command X mess.c:terpmes() ignore version commands X X10. Fails to fight invisible stalkers properly X X strategy.c:fightinvisible() fixed old conversion bug X search.c:followmap() don't call fmove when beingstalked X X11. Doesn't recognize scrolls/wands of light in corridors X X mess.c:terpmes() added message about "corridor glows" X X12. Added debugging command about rustproof armor X X arms.c:havearmor() new flag 'rustproof' X main.c:main() new command ']' X X13. Fails to properly print message about genocided monsters. X X io.c:statusline() added missing %s to printf format X X14. Updated version message to take replaying into account X X main.c:main() new message X X15. Makefile does not include several dependencies on install.h X X makefile io, ltm, tactics, utility X X16. Sometimes gives extra message when doing an inventory. Modified X inventory to return true if it printed a message because an item X listed has a remembered value substituted by the database routine. X X pack.c:inventory() now returns true is msg printed X mess.c:terpmes() uses value returned X X17. Reduced time groping when blind X X strategy.c:stragize() cut from 100 turns to 50 X X18. Modified scroll handling, now reads scrolls even when in plunge X mode. Also fixed a bug with the 'aggravate monsters' check. X X tactics.c:readscroll() added missing s to "aggravate monster" X X19. If it finds a trap door when on the way back up between 26 and 18, X it runs DOWN the trap door (stupid, stupid!). X X tactics.c:plunge() dont if have(amulet) X X20. Modified sanity check for identify scrolls. Don't have to plan X ahead in Rogue 5.3, so sanity check doesn't apply. X X mess.c:readident() change 'version <= RV53A' to '<' X X21. Remember that leather armor rusts in Rogue 3.6. X X things.c:willrust() check for Rogue 3.6 X / echo 'x - mod.1.sh' sed 's/^X//' > mod.1.sh << '/' Xed - README << '-*-END-*-' X124a X X4.1 SCOREFILES X XFor each version of Rogue the systems has played, their are 2 score Xfiles: $RGMDIR/rgmdelta and $RGMDIR/rgmscore. As Xeach game is played, the score is appended to the DELTA file. Whenever Xthe -s option is given, a check is made for the DELTA file. If new Xscores exist, they are sorted and a new SCORE file is created. Then Xthe score file is printed on stdout. X X4.2 READING THE SOURCE X. X123a X Options: -i Initial a new gene pool X -f Full listing, shows gene values and scores X -mNN Max gene pool size (limit of 100, learn.c:MAXM) X -s Random number seed for new gene pool (-i option) X -v Version to list/initial (one of 361,362,521,522,531) X X. X122c X "gene" summarizes and initializes the current gene pool. X X Usage: gene [ -f ] [ -v ] Read gene pool X or gene -i [ -msv ] Create new gene pool X. X119a X Usage: rogomatic -s [ version ] | histplot [ -acl ] X X Options: -aNNNN Include only scores above NNNN X -c Include cheating games ( 3.6 only ) X -l Plot level instead of score X X. X113a X Usage: rogomatic -s [ version ] | rplot [ -ac ] [ minimum ] X X Options: -a Include rolling average X -c Include scores obtained by cheating ( 3.6 only ) X [ min ] Include only scores above min. X X. X107a X Usage: rogomatic [-ceuw] Play a game X of rogomatic -f game_file Play against game_file X or rogomatic -r [ rogue_save_file ] Start saved game X or rogomatic -p [ game_log ] Replay game log X or rogomatic -s [ version ] Show scores X X -c Cheat (look for magic arrows, version 3.6 only) X -e Echo, log the game into a file X -u Start up in user (transparent mode) X -w Watched (Rog-O-Matic can ask user for help when stuck -- rare) X -f next argument is the location of the Rogue game, eg: X rogomatic -f /usr/games/rogue X -r Start a saved game, if next argument is given, it is the X location of the Rogue save file. X -p Replay a Rog-O-Matic log file (created using the -e X option). If next argument is given it is the name of X the log file. The default is "roguelog". Eg: X rogomatic -p drag.24.7361 X -s List Rog-O_Matic's scorefile. Version must be one X of (3.6, 5.2, 5.3). Defaults to install.h:DEFVER. X X. X2c X* README: Rog-O-Matic XIV (CMU) Tue Feb 5 14:04:02 1985 - mlm X. Xw Xq X-*-END-*- Xed - gene.c << '-*-END-*-' X34c X otherwise: quit (1, "Usage: gene [-if] [-msv]\n"); X. X2c X * gene.c: Rog-O-Matic XIV (CMU) Tue Feb 5 14:10:05 1985 - mlm X. Xw Xq X-*-END-*- Xed - histplot.c << '-*-END-*-' X165,166c X !stlmatch ("saved", killer) && X (*score > 2000 || !stlmatch ("user", killer))) X. X161c X mmstr, &dd, &yy, player, score, &cheated, killer); X. X69,82c X if (stlmatch ("arrow", killer)) killnum = 1; X else if (stlmatch ("black unicorn", killer)) killnum = 'u'-'a'+2; X else if (stlmatch ("bolt", killer)) killnum = 1; X else if (stlmatch ("dart", killer)) killnum = 1; X else if (stlmatch ("fatal error trap", killer)) killnum = 0; X else if (stlmatch ("floating eye", killer)) killnum = 'e'-'a'+2; X else if (stlmatch ("gave", killer)) killnum = 0; X else if (stlmatch ("giant ant", killer)) killnum = 'a'-'a'+2; X else if (stlmatch ("hypothermia", killer)) killnum = 'i'-'a'+2; X else if (stlmatch ("quit", killer)) killnum = 28; X else if (stlmatch ("starvation", killer)) killnum = 'e'-'a'+2; X else if (stlmatch ("user", killer)) killnum = 0; X else if (stlmatch ("venus flytrap", killer)) killnum = 'f'-'a'+2; X else if (stlmatch ("violet fungi", killer)) killnum = 'f'-'a'+2; X. X45c X default: printf ("Usage: histplot [-cl] [-aNNNN]\n"); X. X6a X * X * HISTORY X * 05-Feb-85 Michael Mauldin (mlm) at Carnegie-Mellon University X * Added bugs fixes found by AEB (play@turing). X. X2c X * histplot.c: Rog-O-Matic XIV (CMU) Tue Feb 5 13:55:16 1985 - mlm X. Xw Xq X-*-END-*- Xed - main.c << '-*-END-*-' X607a X X case ']': clear (); havearmor (1, DOPRINT, RUSTPROOF); X pauserogue (); break; X. X2c X * main.c: Rog-O-Matic XIV (CMU) Sun Feb 3 17:00:25 1985 - mlm X. Xw Xq X-*-END-*- Xed - rgmplot.c << '-*-END-*-' X105,106c X printf ("\t\t|----+----|----+----|----+----|----+----|----+----|\n"); X printf ("\t\t0 2000 4000 6000 8000 10000\n"); X. X101c X lastday = dd; lastmon = mm; lastyy = yy; X. X84c X printf ("%3s %2d %4d\t%s\n", month[lastmon-1], lastday, lastyy, plot); X. X61c X if ((dd != lastday || mm != lastmon || yy != lastyy) && lastday > 0) X. X49,51c X printf ("\t\t Scores greater than %d\n\n", min); X printf ("\t\t0 2000 4000 6000 8000 10000\n"); X printf ("\t\t|----+----|----+----|----+----|----+----|----+----|\n"); X. X47c X printf ("\t\t Scatter Plot of Rog-O-Matic Scores versus time\n\n"); X. X24c X{ int mm, dd, yy, score = 0, lastday = -1, lastmon = -1, lastyy = -1, h; X. X2c X * rgmplot.c: Rog-O-Matic XIV (CMU) Tue Feb 5 15:00:59 1985 - mlm X. Xw Xq X-*-END-*- Xed - rplot << '-*-END-*-' X1c X#!/bin/sh X# X# rplot: Rog-O-Matic XIV (CMU) Tue Feb 5 13:52:48 1985 - mlm X# Copyright (C) 1985 by A. Appel, G. Jacobson, L. Hamey, and M. Mauldin X# Xcolrm 48 | datesub | sort -u +2n +0n +1n +4n +5 | rgmplot $* X. Xw Xq X-*-END-*- Xed - tactics.c << '-*-END-*-' X55,59c X if (obj != NONE && armorclass (obj) > 9) X. X2c X * tactics.c: Rog-O-Matic XIV (CMU) Sat Feb 2 13:01:25 1985 - mlm X. Xw Xq X-*-END-*- Xed - things.c << '-*-END-*-' X484c X{ return (! (protected || X armorclass (obj) > 8 || armorclass (obj) < -5 || X. X2c X * things.c: Rog-O-Matic XIV (CMU) Sat Feb 2 13:02:28 1985 - mlm X. Xw Xq X-*-END-*- / echo 'x - mod.2.sh' sed 's/^X//' > mod.2.sh << '/' Xed - arms.c << '-*-END-*-' X61d X56,59d X52c X { mvprintw (1,0, "Current %sArmor Rankings", rustproof ? "Rustproof " : ""); X. X41,50d X2c X * arms.c: Rog-O-Matic XIV (CMU) Sat Feb 16 09:47:34 1985 - mlm X. Xw Xq X-*-END-*- Xed - io.c << '-*-END-*-' X1121c X if (*genocided) sprintf (s, "%sgenocided '%s', ", s, genocided); X. X871a X if (*versionstr) command (T_OTHER, "v"); X. X801,802c X rewind (logfile); /* Put log file back to start */ X } X. X799c X{ register char *vstr = versionstr, *m = VERMSG; X register int cnt = 2000, ch; X X if (replaying) /* Look for version string in log */ X { while (cnt-- > 0 && *m) X { if (fgetc (logfile) == *m) m++; else m = VERMSG;} X X if (*m == '\0') /* Found VERMSG, get version string */ X { while ((ch = fgetc (logfile)) != ' ') *(vstr++) = ch; X *--vstr = '\0'; X } X else /* Use default version */ X { sprintf (versionstr, DEFVER); } X. X797a X# define VERMSG "ersion " X X. X795a X * X * Get version from first 2000 chars of a log file Feb 9, 1985 - mlm X. X759,760c X "Wizard: [=weapstat, ]=rustproof armor, r=resetinv, &=object count [?]", X "Wizard: *=toggle blind, C=toggle cosmic, M=mazedoor, A=attempt, {=flags", X. X757c X "Wizard: ~=version, ^=bowrank, %%=armorrank, $=weaponrank, ==ringrank [?]", X. X754a X "Rgm commands: m=long term memory display, G=display gene settings [?]", X. X2c X * io.c: Rog-O-Matic XIV (CMU) Sat Feb 16 23:03:48 1985 - mlm X. Xw Xq X-*-END-*- Xed - main.c << '-*-END-*-' X555,557c X case '~': if (replaying) X saynow ("Replaying log file %s, version %s.", X logfilename, versionstr); X else X saynow (" %s: version %s, genotype %d, quit at %d.", X roguename, versionstr, geneid, quitat); X. X404,405c X if (replaying) X sprintf (msg, " Replaying log file %s, version %s.", X logfilename, versionstr); X else X sprintf (msg, " %s: version %s, genotype %d, quit at %d.", X roguename, versionstr, geneid, quitat); X. X354c X strcpy (logfilename, argv[4]); X. X339a X sprintf (versionstr, ""); X. X113c Xchar logfilename[100]; /* Name of log file */ X. X2c X * main.c: Rog-O-Matic XIV (CMU) Fri Feb 15 18:27:27 1985 - mlm X. Xw Xq X-*-END-*- Xed - makefile << '-*-END-*-' X107c Xutility.o: install.h X. X97c Xtactics.o: types.h globals.h install.h X. X61c Xltm.o: types.h globals.h install.h X. X55c Xio.o: types.h globals.h install.h termtokens.h X. X5,6c XBINDIR= /usr/mlm/bin/ XPUBDIR= /usr/mlm/rgm/src14a X. X1c X# makefile: Rog-O-Matic XIV (CMU) Wed Feb 6 18:34:24 1985 - mlm X. Xw Xq X-*-END-*- Xed - mess.c << '-*-END-*-' X523c X usesynch = 0; justreadid=1; /* Must reset inventory */ X. X479c X if (!replaying && version < RV53A && X. X417a X else if (MATCH("(mctesq was here)")) echoit=0; X. X369,370c X { infer ("remove curse"); X if (cursedarmor) {forget (currentarmor, CURSED); cursedarmor=0;} X if (cursedweapon) {forget (currentweapon, CURSED); cursedweapon=0;} X newarmor = newweapon = 1; } X. X349c X else if (MATCH("your nose tingles*")) infer ("food detection"); X. X343a X else if (MATCH("you feel a wrenching sensation in your gut")) ; X. X338a X else if (MATCH("you begin to feel greedy*")) infer ("gold detection"); X. X337c X else if (MATCH("you*cursed*")) {echoit=0; curseditem ();} X. X312c X else if (MATCH("wait*that's a *")) ; X. X302c X if (MATCH("version *")) echoit=0; X else unknown++; X. X274a X else if (MATCH("the corridor glows*")) { infer ("light"); } X. X247a X else if (MATCH("rogue version *")) echoit=0; X. X90c X { echoit = !inventory (mess, mend); identifying = justreadid = 0; } X. X64c X s 7) command (T_FIGHTING, "hjlk"); X else command (T_FIGHTING, "%c%c%c", keydir[dir], X keydir[dir], keydir[(dir+4)&7]); X. X1055,1059c X for (dir=0; dir<8; dir += 2) X if ((onrc(CANGO, atdrow(dir), atdcol(dir))) && X (onrc(CANGO, atrow+2*deltr[dir], atcol+2*deltc[dir]))) X break; X. X1048c X { command (T_FIGHTING, "%c%c", keydir[lastdir], keydir[(lastdir+4)&7]); X return (1); X } X. X987,990d X508d X501c X if (beingstalked > INVPRES) { turns = 0; danger += INVDAM; } X. X183c X return (grope (10)); X. X132c X if (findroom ()) /* Look for another room */ X. X96c X if (blinded && grope (50)) /* Who turned out the lights */ X. X2c X * strategy.c: Rog-O-Matic XIV (CMU) Sat Feb 16 10:03:16 1985 - mlm X. Xw Xq X-*-END-*- Xed - survival.c << '-*-END-*-' X122,124c X return (goupstairs (RUNNING) || godownstairs (RUNNING)); X. X2c X * survival.c: Rog-O-Matic XIV (CMU) Sun Feb 10 21:09:58 1985 - mlm X. Xw Xq X-*-END-*- Xed - tactics.c << '-*-END-*-' X828c X if ((obj = unknown (wand)) == NONE) X. X796c X if ((obj = havemissile ()) == NONE) return (0); X. X629,630c X ((obj = havearrow ()) != NONE || (obj = haveminus ()) != NONE) && X throw (obj, 0)) X { return (1); } X. X620c X if (stairrow == NONE || have(amulet) == NONE || X. X545a X if (have (amulet) != NONE) return (0); X X. X544c X if (stairrow == NONE && !foundtrapdoor) return (0); X. X364c X if ((obj = havenamed (ring, name)) == NONE || X. X280c X if (version <= RV36B && !know ("create monster") && gotocorner ()) X. X275c X (exploredlevel || Level > 18 || know ("aggravate monsters")) && X. X189c X else if (wearing ("sustain strength") == NONE && X. X93,95c X if (obj == currentweapon) { newweapon = 0; return (0); } X else if (obj != NONE) { return (wield (obj)); } X else { newweapon = 0; return (0); } X. X90c X if ((obj = haveweapon (1, NOPRINT)) == NONE) return (0); X. X55c X if (obj != NONE && armorclass (obj) > 9 && itemis (obj, KNOWN)) X. X48,51c X { obj = NONE; X if (Level<13) obj = havearmor (1, NOPRINT, RUSTPROOF); X if (Level<13 && obj==NONE) obj = havearmor (3, NOPRINT, ANY); X if (obj==NONE) obj = havearmor (2, NOPRINT, ANY); X. X44c X if (Level > (version < RV52A ? 8 : 7) && Level < 19 && X. X2c X * tactics.c: Rog-O-Matic XIV (CMU) Sat Feb 16 23:27:48 1985 - mlm X. Xw Xq X-*-END-*- Xed - things.c << '-*-END-*-' X487c X stlmatch (inven[obj].str, "leather") && version > RV36B)); X. X270a X return (nextid >= 'a' && afterid >= 'a'); X. X88,90d X84,86c X /* quaff unknown potions or good potions rather than dropping them */ X if (inven[obj].type == potion && X (!itemis (obj, KNOWN) || X stlmatch (inven[obj].str, "extra healing") || X stlmatch (inven[obj].str, "gain strength") || X stlmatch (inven[obj].str, "haste self") && !hasted || X stlmatch (inven[obj].str, "healing") || X stlmatch (inven[obj].str, "magic detection") || X stlmatch (inven[obj].str, "monster detection") || X stlmatch (inven[obj].str, "raise level") || X stlmatch (inven[obj].str, "restore strength")) && X quaff (obj)) X { return (1); } X. X78,82c X /* read unknown scrolls or good scrolls rather than dropping them */ X if (inven[obj].type == scroll && X (!itemis (obj, KNOWN) || X stlmatch (inven[obj].str, "identify") && X prepareident (pickident (), obj) || X stlmatch (inven[obj].str, "enchant") || X stlmatch (inven[obj].str, "genocide") || X stlmatch (inven[obj].str, "gold detection") || X stlmatch (inven[obj].str, "hold monster") || X stlmatch (inven[obj].str, "light") || X stlmatch (inven[obj].str, "magic mapping") || X stlmatch (inven[obj].str, "monster confusion") || X stlmatch (inven[obj].str, "remove curse")) && X reads (obj)) X { return (1); } X. X75,76c X /* Cant if not there, in use, or on something else */ X if (inven[obj].count < 1 || X itemis (obj, INUSE) || X on (STUFF | TRAP | STAIRS | DOOR)) X return (0); X. X44a X usesynch = 0; X. X27c X command (T_HANDLING, "W%c", LETTER (obj)); X usesynch = 0; X. X2c X * things.c: Rog-O-Matic XIV (CMU) Sat Feb 16 12:16:57 1985 - mlm X. Xw Xq X-*-END-*- Xed - types.h << '-*-END-*-' X44a X# define INVPRES (INVHIT-100) X# define INVLURK (INVPRES-200) X. X43a X# define INVDAM (16) X. X2c X * types.h: Rog-O-Matic XIV (CMU) Sat Feb 16 09:44:54 1985 - mlm X. Xw Xq X-*-END-*- Xed - worth.c << '-*-END-*-' X109a X else if (stlmatch (inven[obj].str, "extra healing")) value = 900; X else if (stlmatch (inven[obj].str, "healing")) value = 750; X else if (stlmatch (inven[obj].str, "protect") && !protected) value = 1000; X. X106a X else if (stlmatch (inven[obj].str, "gain strength")) value = 700; X. X80,81c X if (obj == haveweapon (1, NOPRINT)) value += 2500; X else if (obj == haveweapon (2, NOPRINT)) value += 1500; X. X72,73c X if (obj == havebow (1, NOPRINT)) value += 1500; X else if (obj == havebow (2, NOPRINT)) value += 300; X. X70c X { value = (bowclass (obj)); X. X61c X if (stlmatch (inven[obj].str, "leather")) value += 300; X. X59a X else if (obj == havearmor (3, NOPRINT, ANY)) value += 800; X. X56c X { value = (11 - armorclass (obj)) * 120; X. X51,52c X * Armor values are based on armor class, bonus for best, second X * best, third best, or leather armor (leather doesnt rust) X. X2c X * worth.c: Rog-O-Matic XIV (CMU) Sun Feb 10 23:16:40 1985 - mlm X. Xw Xq X-*-END-*- / echo 'Rgm XIV mods 02/16/85 - ed scripts complete.' exit