From: Arun Thomas Date: Tue, 26 Jul 2011 09:37:18 +0000 (+0200) Subject: Remove advent and ttt X-Git-Tag: v3.2.0~412 X-Git-Url: http://zhaoyanbai.com/repos/%22../static/icons/mandoc.1.ps?a=commitdiff_plain;h=2a9322a117bcb0de4b9a2e26355fb45e39be0564;p=minix.git Remove advent and ttt --- diff --git a/commands/Makefile b/commands/Makefile index 14adf8075..4bf944ce1 100644 --- a/commands/Makefile +++ b/commands/Makefile @@ -2,7 +2,7 @@ .include -SUBDIR= aal add_route adduser advent arp ash at autil awk \ +SUBDIR= aal add_route adduser arp ash at autil awk \ backup badblocks banner basename bigmake binpackage \ binpackages binsizes bzip2 bzip2recover cal calendar \ cat cawf cd cdprobe checkhier chmem \ @@ -29,7 +29,7 @@ SUBDIR= aal add_route adduser advent arp ash at autil awk \ stty su sum svclog swapfs swifi sync synctree sysenv \ syslogd tail tar tcpd tcpdp tcpstat tee telnet \ telnetd term termcap tget time tinyhalt touch tr \ - truncate tsort ttt tty udpstat umount uname unexpand \ + truncate tsort tty udpstat umount uname unexpand \ unstack update uud uue version vol wc \ whereis which who write writeisofs fetch \ xargs yacc yes zdump zic zmodem pkgin_cd \ diff --git a/commands/advent/Makefile b/commands/advent/Makefile deleted file mode 100644 index 7d843623d..000000000 --- a/commands/advent/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# Makefile for advent - -PROG= advent -SRCS= advent.c database.c english.c initial.c itverb.c score.c \ - travel.c turn.c utility.c verb.c vocab.c - -# Where to put the adventure text files -# Need the trailing "/" on TEXTDIR -TEXTDIR= /usr/lib/advent/ -FILESDIR= ${TEXTDIR} -DATFILES= advent1.dat advent2.dat advent3.dat advent4.dat -FILES= ${DATFILES} -MAN= - -database.o: advtext.h - -setup: setup.c advent.h - ${CC} ${CPPFLAGS} ${LDFLAGS} -o $@ ${.CURDIR}/setup.c - -advtext.h advent1.dat advent2.dat advent3.dat advent4.dat: \ - setup advent1.txt advent2.txt advent3.txt advent4.txt - ./setup ${.CURDIR} - -database.d: touch-genfiles - -touch-genfiles: - [ -e advtext.h ] || touch -t 197001010000.00 advtext.h - -CPPFLAGS.advent.c= -DTEXTDIR='"${TEXTDIR}"' - -CLEANFILES+= ${DATFILES} advtext.h setup - -.include - diff --git a/commands/advent/advcave.h b/commands/advent/advcave.h deleted file mode 100644 index cedb392e7..000000000 --- a/commands/advent/advcave.h +++ /dev/null @@ -1,1357 +0,0 @@ -/* header ADVCAVE.H */ - - -/** WARNING: the travel array for the cave is stored as an - * array of 1.. LONG INTEGERS. This requires 32 bit LONG INTEGERS. - * These values are used in database.c "gettrav". - * tcond*1000000 + tdest*1000 + tverb = value stored - */ - -static long room1[] = { - 2002, 2044, 2029, 2056, - 3003, 3012, 3019, 3043, - 4005, 4013, 4014, 4046, 4030, - 5006, 5045, 5043, - 8063, - 147081, - 157052, 157084, - 0}; -static long room2[] = { - 1002, 1012, 1007, 1043, 1045, 1030, - 30146006, - 5006, 5045, 5046, - 146044, - 0}; -static long room3[] = { - 1011, 1032, 1044, - 11062, - 33065, - 467785085, - 202085, - 79005, 79014, - 238057, 238003, 238019, - 0}; -static long room4[] = { - 1004, 1012, 1045, - 5006, 5043, 5044, 5029, - 7005, 7046, 7030, - 8063, - 0}; -static long room5[] = { - 4009, 4043, 4030, - 50005006, 50005007, 50005045, - 6006, - 5044, 5046, - 0}; -static long room6[] = { - 1002, 1045, - 4009, 4043, 4044, 4030, - 5006, 5046, - 0}; -static long room7[] = { - 1012, - 4004, 4045, - 5006, 5043, 5044, - 8005, 8015, 8016, 8046, - 595060, 595014, 595030, - 0}; -static long room8[] = { - 5006, 5043, 5044, 5046, - 1012, - 7004, 7013, 7045, - 303009003, 303009019, 303009030, - 593003, - 0}; -static long room9[] = { - 303008011, 303008029, - 593011, - 10017, 10018, 10019, 10044, - 14031, - 11051, - 0}; -static long room10[] = { - 9011, 9020, 9021, 9043, - 11019, 11022, 11044, 11051, - 14031, - 0}; -static long room11[] = { - 303008063, - 9064, - 10017, 10018, 10023, 10024, 10043, - 12025, 12019, 12029, 12044, - 3062, - 14031, - 0}; -static long room12[] = { - 303008063, - 9064, - 11030, 11043, 11051, - 13019, 13029, 13044, - 14031, - 0}; -static long room13[] = { - 303008063, - 9064, - 11051, - 12025, 12043, - 14023, 14031, 14044, - 0}; -static long room14[] = { - 303008063, - 9064, - 11051, - 13023, 13043, - 150020030, 150020031, 150020034, - 15030, - 16033, 16044, - 0}; -static long room15[] = { - 18036, 18046, - 17007, 17038, 17044, - 19010, 19030, 19045, - 150022029, 150022031, 150022034, 150022035, - 150022023, 150022043, 150022056, 150022010, - 14029, - 33055, - 0}; -static long room16[] = { - 14001, - 0}; -static long room17[] = { - 15038, 15043, - 312596039, - 412021007, - 412597041, 412597042, 412597044, 412597069, 412597089, - 27041, - 0}; -static long room18[] = { - 15038, 15011, 15045, - 0}; -static long room19[] = { - 150237029, 150237031, 150237034, 150237035, - 150237043, 150237056, 150237010, - 15025, - 15010, 15029, 15043, - 75556047, - 311143047, - 311028045, 311028036, - 311029046, 311029037, - 311030044, 311030007, - 32045, - 15074049, - 211032049, - 74066, - 0}; -static long room20[] = { - 1, - 0}; -static long room21[] = { - 1, - 0}; -static long room22[] = { - 15001, - 0}; -static long room23[] = { - 67043, 67042, - 68044, 68061, - 25030, 25031, - 648052, - 0}; -static long room24[] = { - 67029, 67011, - 92027, - 0}; -static long room25[] = { - 23029, 23011, - 724031056, - 26056, - 0}; -static long room26[] = { - 88001, - 0}; -static long room27[] = { - 312596039, - 412021007, - 412597041, 412597042, 412597043, 412597069, 412597089, - 17041, - 40045, - 41044, - 0}; -static long room28[] = { - 19038, 19011, 19046, - 33045, 33055, - 36030, 36052, - 0}; -static long room29[] = { - 19038, 19011, 19045, - 0}; -static long room30[] = { - 19038, 19011, 19043, - 62044, 62029, - 0}; -static long room31[] = { - 524089001, - 90001, - 0}; -static long room32[] = { - 19001, - 0}; -static long room33[] = { - 3065, - 28046, - 34043, 34053, 34054, - 35044, - 159302071, - 100071, - 0}; -static long room34[] = { - 33030, 33055, - 15029, - 0}; -static long room35[] = { - 33043, 33055, - 20039, - 0}; -static long room36[] = { - 37043, 37017, - 28029, 28052, - 39044, - 65070, - 0}; -static long room37[] = { - 36044, 36017, - 38030, 38031, 38056, - 0}; -static long room38[] = { - 37056, 37029, 37011, - 595060, 595014, 595030, 595004, 595005, - 0}; -static long room39[] = { - 36043, 36023, - 64030, 64052, 64058, - 65070, - 0}; -static long room40[] = { - 41001, - 0}; -static long room41[] = { - 42046, 42029, 42023, 42056, - 27043, - 59045, - 60044, 60017, - 0}; -static long room42[] = { - 41029, - 42045, - 43043, - 45046, - 80044, - 0}; -static long room43[] = { - 42044, - 44046, - 45043, - 0}; -static long room44[] = { - 43043, - 48030, - 50046, - 82045, - 0}; -static long room45[] = { - 42044, - 43045, - 46043, - 47046, - 87029, 87030, - 0}; -static long room46[] = { - 45044, 45011, - 0}; -static long room47[] = { - 45043, 45011, - 0}; -static long room48[] = { - 44029, 44011, - 0}; -static long room49[] = { - 50043, - 51044, - 0}; -static long room50[] = { - 44043, - 49044, - 51030, - 52046, - 0}; -static long room51[] = { - 49044, - 50029, - 52043, - 53046, - 0}; -static long room52[] = { - 50044, - 51043, - 52046, - 53029, - 55045, - 86030, - 0}; -static long room53[] = { - 51044, - 52045, - 54046, - 0}; -static long room54[] = { - 53044, 53011, - 0}; -static long room55[] = { - 52044, - 55045, - 56030, - 57043, - 0}; -static long room56[] = { - 55029, 55011, - 0}; -static long room57[] = { - 13030, 13056, - 55044, - 58046, - 83045, - 84043, - 0}; -static long room58[] = { - 57043, 57011, - 0}; -static long room59[] = { - 27001, - 0}; -static long room60[] = { - 41043, 41029, 41017, - 61044, - 62045, 62030, 62052, - 50191046, 50191033, - 392173046, 392173033, - 172046, 172033, - 648056, - 0}; -static long room61[] = { - 60043, - 62045, - 100107046, - 0}; -static long room62[] = { - 60044, - 63045, - 30043, - 61046, - 0}; -static long room63[] = { - 62046, 62011, - 0}; -static long room64[] = { - 39029, 39056, 39059, - 65044, 65070, - 103045, 103074, - 106043, - 0}; -static long room65[] = { - 64043, - 66044, - 40556046, - 68061, - 40556029, - 50070029, - 39029, - 40556045, - 50072045, - 71045, - 50556030, - 106030, - 71025, - 0}; -static long room66[] = { - 65047, - 67044, - 80556046, - 77025, - 96043, - 50556050, - 97072, - 0}; -static long room67[] = { - 66043, - 23044, 23042, - 24030, 24031, - 0}; -static long room68[] = { - 23046, - 69029, 69056, - 65045, - 0}; -static long room69[] = { - 68030, 68061, - 331120046, - 119046, - 109045, - 113075, - 0}; -static long room70[] = { - 71045, - 65030, 65023, - 111046, - 0}; -static long room71[] = { - 65048, - 70046, - 110045, - 0}; -static long room72[] = { - 65070, - 118047, - 73045, - 97049, 97072, - 0}; -static long room73[] = { - 72046, 72017, 72011, - 0}; -static long room74[] = { - 19043, - 331120044, - 121044, - 75030, - 0}; -static long room75[] = { - 76046, - 77045, - 0}; -static long room76[] = { - 75045, - 0}; -static long room77[] = { - 75043, - 78044, - 66045, 66017, - 0}; -static long room78[] = { - 77046, - 0}; -static long room79[] = { - 3001, - 0}; -static long room80[] = { - 42045, - 80044, 80046, - 81043, - 0}; -static long room81[] = { - 80044, 80011, - 0}; -static long room82[] = { - 44046, 44011, - 0}; -static long room83[] = { - 57046, - 84043, - 85044, - 0}; -static long room84[] = { - 57045, - 83044, - 114050, - 0}; -static long room85[] = { - 83043, 83011, - 0}; -static long room86[] = { - 52029, 52011, - 0}; -static long room87[] = { - 45029, 45030, - 0}; -static long room88[] = { - 25030, 25056, 25043, - 20039, - 92044, 92027, - 0}; -static long room89[] = { - 25001, - 0}; -static long room90[] = { - 23001, - 0}; -static long room91[] = { - 95045, 95073, 95023, - 72030, 72056, - 0}; -static long room92[] = { - 88046, - 93043, - 94045, - 0}; -static long room93[] = { - 92046, 92027, 92011, - 0}; -static long room94[] = { - 92046, 92027, 92023, - 341095045, 341095003, 341095073, - 611045, - 0}; -static long room95[] = { - 94046, 94011, - 92027, - 91044, - 145030, 145039, 145080, 145052, - 0}; -static long room96[] = { - 66044, 66011, - 0}; -static long room97[] = { - 66048, - 72043, 72017, - 98029, 98045, 98073, - 0}; -static long room98[] = { - 235047, - 97046, 97072, - 99044, - 3142029, 3142049, 3142056, 3142079, - 75702029, 75702049, 75702056, 75702079, - 703029, 703049, 703056, 703079, - 141078, - 0}; -static long room99[] = { - 98050, 98073, - 301043, 301023, - 100043, - 0}; -static long room100[] = { - 301044, 301023, 301011, - 99044, - 159302071, 159302055, - 33071, 33055, - 101047, 101022, - 0}; -static long room101[] = { - 100046, 100071, 100011, - 0}; -static long room102[] = { - 103030, 103074, 103011, - 0}; -static long room103[] = { - 388196029, 388196038, - 102029, 102038, - 104030, - 114618046, - 115619046, - 64046, - 0}; -static long room104[] = { - 103029, 103074, - 105030, - 0}; -static long room105[] = { - 104029, 104011, - 103074, - 0}; -static long room106[] = { - 64029, - 65044, - 108043, - 0}; -static long room107[] = { - 131046, - 132049, - 133047, - 134048, - 135029, - 136050, - 137043, - 138044, - 139045, - 61030, - 0}; -static long room108[] = { - 90556043, 90556045, 90556046, 90556047, - 90556048, 90556049, 90556050, 90556029, - 90556030, - 106043, - 626044, - 0}; -static long room109[] = { - 69046, - 113045, 113075, - 0}; -static long room110[] = { - 71044, - 20039, - 0}; -static long room111[] = { - 70045, - 40050030, 40050039, 40050056, - 50053030, - 45030, - 0}; -static long room112[] = { - 131049, - 132045, - 133043, - 134050, - 135048, - 136047, - 137044, - 138030, - 139029, - 140046, - 0}; -static long room113[] = { - 109046, 109011, - 0}; -static long room114[] = { - 84048, - 0}; -static long room115[] = { - 116049, 116042, 116069, - 212019, 212003, 212045, - 0}; -static long room116[] = { - 115047, 115042, 115069, - 212019, 212003, - 593030, - 0}; -static long room117[] = { - 118049, - 233660041, 233660042, 233660069, 233660047, 233660089, - 332661041, - 303041, - 332021039, - 596039, - 0}; -static long room118[] = { - 72030, - 117029, - 0}; -static long room119[] = { - 69045, 69011, - 653043, 65307, - 0}; -static long room120[] = { - 69045, - 74043, - 0}; -static long room121[] = { - 74043, 74011, - 653045, 653007, - 0}; -static long room122[] = { - 123047, - 233660041, 233660042, 233660069, 233660049, 233660089, - 303041, - 596039, - 124077, - 126028, - 129040, - 0}; -static long room123[] = { - 122044, - 124043, 124077, - 126028, - 129040, - 0}; -static long room124[] = { - 123044, - 125047, 125036, - 128048, 128037, 128030, - 126028, - 129040, - 0}; -static long room125[] = { - 124046, 124077, - 126045, 126028, - 127043, 127017, - 0}; -static long room126[] = { - 125046, 125023, 125011, - 124077, - 610030, 610039, - 0}; -static long room127[] = { - 125044, 125011, 125017, - 124077, - 126028, - 0}; -static long room128[] = { - 124045, 124029, 124077, - 129046, 129030, 129040, - 126028, - 0}; -static long room129[] = { - 128044, 128029, - 124077, - 130043, 130019, 130040, 130003, - 126028, - 0}; -static long room130[] = { - 129044, 129011, - 124077, - 126028, - 0}; -static long room131[] = { - 107044, - 132048, - 133050, - 134049, - 135047, - 136029, - 137030, - 138045, - 139046, - 112043, - 0}; -static long room132[] = { - 107050, - 131029, - 133045, - 134046, - 135044, - 136049, - 137047, - 138043, - 139030, - 112048, - 0}; -static long room133[] = { - 107029, - 131030, - 132044, - 134047, - 135049, - 136043, - 137045, - 138050, - 139048, - 112046, - 0}; -static long room134[] = { - 107047, - 131045, - 132050, - 133048, - 135043, - 136030, - 137046, - 138029, - 139044, - 112049, - 0}; -static long room135[] = { - 107045, - 131048, - 132030, - 133046, - 134043, - 136044, - 137049, - 138047, - 139050, - 112029, - 0}; -static long room136[] = { - 107043, - 131044, - 132029, - 133049, - 134030, - 135046, - 137050, - 138048, - 139047, - 112045, - 0}; -static long room137[] = { - 107048, - 131047, - 132046, - 133030, - 134029, - 135050, - 136045, - 138049, - 139043, - 112044, - 0}; -static long room138[] = { - 107030, - 131043, - 132047, - 133029, - 134044, - 135045, - 136046, - 137048, - 139049, - 112050, - 0}; -static long room139[] = { - 107049, - 131050, - 132043, - 133044, - 134045, - 135030, - 136048, - 137029, - 138046, - 112047, - 0}; -static long room140[] = { - 112045, 112011, - 0}; -static long room141[] = { - 142029, 142043, 142056, 142078, 142079, - 0}; -static long room142[] = { - 98043, 98030, 98007, 98079, - 141008, 141044, 141078, - 0}; -static long room143[] = { - 19044, 19011, - 144043, - 0}; -static long room144[] = { - 143044, 143008, - 19011, - 0}; -static long room145[] = { - 141001, - 0}; -static long room146[] = { - 2043, 2029, 2002, 2056, - 50006046, 50006006, - 146046, 146006, - 147044, - 148045, - 0}; -static long room147[] = { - 146043, 146046, - 148045, - 153044, - 157052, - 3012, - 157084, - 0}; -static long room148[] = { - 50147046, - 146046, - 149043, 149044, 149045, - 3012, - 166091, - 0}; -static long room149[] = { - 149046, - 151043, - 150044, - 152045, - 0}; -static long room150[] = { - 151045, 151046, - 149043, 149044, - 0}; -static long room151[] = { - 148043, - 152044, - 150045, - 149046, - 0}; -static long room152[] = { - 151043, - 150046, - 0}; -static long room153[] = { - 154045, - 239046, - 147043, - 3012, - 0}; -static long room154[] = { - 50155045, - 157045, 157030, - 155029, - 153046, - 3012, - 0}; -static long room155[] = { - 154030, 154008, 154046, - 156039, - 3012, - 0}; -static long room156[] = { - 1, - 0}; -static long room157[] = { - 227019, 227043, - 154011, 154046, 154029, - 3012, - 0}; -static long room158[] = { - 229044, 229034, 229030, - 157011, - 161082, - 725056, 725029, - 726083, - 747003, 747019, 747043, 747064, - 0}; -static long room159[] = { - 732011, 732044, 732034, - 0}; -static long room160[] = { - 343167043, 343167019, 343167003, - 738043, - 162082, - 723044, 723056, 723030, - 165039, - 0}; -static long room161[] = { - 304001, - 0}; -static long room162[] = { - 304001, - 0}; -static long room163[] = { - 304001, - 0}; -static long room164[] = { - 304001, - 0}; -static long room165[] = { - 1, - 0}; -static long room166[] = { - 747003, 747011, 747019, 747044, - 148232043, 148232069, 148232041, 148232042, - 148169047, - 148233046, - 148234045, - 717043, 717069, 717041, 717042, 717047, - 448164082, - 720082, - 0}; -static long room167[] = { - 163082, - 343160044, 343160011, 343160003, 343160019, - 738044, - 722043, 722069, 722041, 722042, - 0}; -static long room168[] = { - 448170048, 448170029, 448170023, - 719048, 719029, 719023, - 148169045, - 148192046, - 148166044, 148166069, 148166041, 148166042, - 717044, 717045, 717046, - 0}; -static long room169[] = { - 148168046, - 148166049, - 717049, 717046, - 448179023, 448179043, 448179029, - 719023, 719029, - 0}; -static long room170[] = { - 171043, 171029, - 168044, 168030, - 0}; -static long room171[] = { - 170050, 170030, - 180043, 180029, - 0}; -static long room172[] = { - 60045, - 174046, - 0}; -static long room173[] = { - 60045, - 0}; -static long room174[] = { - 392178047, - 172047, 172033, - 175050, - 0}; -static long room175[] = { - 177045, - 174043, - 176031, 176030, 176056, - 0}; -static long room176[] = { - 175029, 175056, 175011, 175008, - 0}; -static long room177[] = { - 60030, 60056, 60039, - 175046, 175008, - 0}; -static long room178[] = { - 174001, - 0}; -static long room179[] = { - 169030, 169044, - 198029, 198043, 198014, - 0}; -static long room180[] = { - 171044, - 182029, 182056, - 213043, - 0}; -static long room181[] = { - 227001, - 0}; -static long room182[] = { - 180044, - 183043, - 0}; -static long room183[] = { - 182044, - 50184043, - 186043, - 185046, - 187045, - 0}; -static long room184[] = { - 183049, - 188048, - 0}; -static long room185[] = { - 183045, - 0}; -static long room186[] = { - 183050, - 188047, - 0}; -static long room187[] = { - 183044, - 188043, - 0}; -static long room188[] = { - 187045, - 184044, - 65190049, 65190030, - 186049, - 305019, 305003, - 0}; -static long room189[] = { - 188011, 188008, - 0}; -static long room190[] = { - 422306069, 422306045, 422306042, 422306089, - 661069, - 188029, 188008, - 0}; -static long room191[] = { - 60045, - 0}; -static long room192[] = { - 148166045, - 148168047, - 717045, 717047, - 448197043, - 720043, - 0}; -static long room193[] = { - 197044, - 0}; -static long room194[] = { - 224044, - 0}; -static long room195[] = { - 196052, 196053, 196046, 196069, 196036, - 224044, - 0}; -static long room196[] = { - 103030, 103074, - 114618052, 114618053, 114618045, 114618069, - 195052, - 0}; -static long room197[] = { - 193043, - 192044, - 0}; -static long room198[] = { - 179049, 179014, 179005, 179023, - 203030, 203043, - 402200046, 402200029, - 772046, 772029, - 0}; -static long room199[] = { - 198001, - 0}; -static long room200[] = { - 198044, - 201043, 201029, - 0}; -static long room201[] = { - 402200044, 402200030, - 772044, 772030, - 202043, - 230045, - 0}; -static long room202[] = { - 201044, - 467785085, - 205085, - 206043, - 0}; -static long room203[] = { - 447199030, 447199043, 447199088, - 204030, 204043, 204088, - 198029, 198044, - 0}; -static long room204[] = { - 203029, 203044, 203008, 203011, - 0}; -static long room205[] = { - 219045, - 467785085, - 202085, - 226039, - 0}; -static long room206[] = { - 207045, 207017, - 202044, - 648029, 648052, - 0}; -static long room207[] = { - 208045, - 206046, - 0}; -static long room208[] = { - 236043, - 207046, 207017, - 209044, - 793069, 793042, 793045, - 0}; -static long room209[] = { - 208043, - 210029, 210056, - 0}; -static long room210[] = { - 211030, 211043, - 209044, - 0}; -static long room211[] = { - 210029, 210008, 210044, - 72030, 72043, - 0}; -static long room212[] = { - 115011, 115008, 115046, - 0}; -static long room213[] = { - 206030, 206052, - 180044, 180008, - 0}; -static long room214[] = { - 148166046, - 148169048, - 717046, 717048, - 448215047, - 720047, - 0}; -static long room215[] = { - 214049, - 216029, - 0}; -static long room216[] = { - 215030, - 217043, 217029, - 0}; -static long room217[] = { - 216044, 216030, 216011, - 218043, 218031, - 0}; -static long room218[] = { - 217008, 217044, - 230029, 230056, - 0}; -static long room219[] = { - 205046, 205089, - 222045, 222090, - 220043, - 221044, - 3092, - 0}; -static long room220[] = { - 219044, - 225043, - 0}; -static long room221[] = { - 219043, - 0}; -static long room222[] = { - 219046, - 223029, - 3092, - 0}; -static long room223[] = { - 222030, - 224029, - 0}; -static long room224[] = { - 223030, 223052, - 338195043, - 194043, - 0}; -static long room225[] = { - 220044, - 0}; -static long room226[] = { - 1, - 0}; -static long room227[] = { - 157044, 157011, 157029, - 398228043, 398228019, 398228030, - 181043, 181019, 181030, - 0}; -static long room228[] = { - 792045, 792046, 792004, 792005, 792033, - 227029, 227044, 227011, - 229039, - 786043, 786019, 786042, 786069, 786041, - 0}; -static long room229[] = { - 792045, 792046, 792004, 792005, 792033, - 228039, - 786044, 786011, 786042, 786069, 796041, - 158043, 158019, 158034, - 0}; -static long room230[] = { - 65218030, 65218039, - 231030, 231039, - 201046, 201017, - 0}; -static long room231[] = { - 1, - 0}; -static long room232[] = { - 168001, - 0}; -static long room233[] = { - 192001, - 0}; -static long room234[] = { - 214001, - 0}; -static long room235[] = { - 422306069, 422306046, 422306042, 422306089, - 661069, - 98044, - 0}; -static long room236[] = { - 208044, - 0}; -static long room237[] = { - 19001, - 0}; -static long room238[] = { - 3011, 3064, - 0}; -static long room239[] = { - 153045, 153047, - 240093, - 0}; -static long room240[] = { - 239047, 239042, 239069, 239093, - 241030, - 0}; -static long room241[] = { - 240029, - 242044, - 0}; -static long room242[] = { - 241043, - 243049, - 244044, - 246050, - 0}; -static long room243[] = { - 242047, - 244045, - 247050, - 0}; -static long room244[] = { - 242043, - 243046, - 245044, - 246045, - 0}; -static long room245[] = { - 243046, - 244043, - 246045, - 247044, - 0}; -static long room246[] = { - 242048, - 245046, - 247049, - 0}; -static long room247[] = { - 243048, - 245043, - 246047, - 307044, - 0}; -static long room248[] = { - 247043, - 0}; - -static long *cave[MAXLOC] = { - room1, room2, room3, room4, - room5, room6, room7, room8, room9, - room10, room11, room12, room13, room14, - room15, room16, room17, room18, room19, - room20, room21, room22, room23, room24, - room25, room26, room27, room28, room29, - room30, room31, room32, room33, room34, - room35, room36, room37, room38, room39, - room40, room41, room42, room43, room44, - room45, room46, room47, room48, room49, - room50, room51, room52, room53, room54, - room55, room56, room57, room58, room59, - room60, room61, room62, room63, room64, - room65, room66, room67, room68, room69, - room70, room71, room72, room73, room74, - room75, room76, room77, room78, room79, - room80, room81, room82, room83, room84, - room85, room86, room87, room88, room89, - room90, room91, room92, room93, room94, - room95, room96, room97, room98, room99, - room100, room101, room102, room103, room104, - room105, room106, room107, room108, room109, - room110, room111, room112, room113, room114, - room115, room116, room117, room118, room119, - room120, room121, room122, room123, room124, - room125, room126, room127, room128, room129, - room130, room131, room132, room133, room134, - room135, room136, room137, room138, room139, - room140, room141, room142, room143, room144, - room145, room146, room147, room148, room149, - room150, room151, room152, room153, room154, - room155, room156, room157, room158, room159, - room160, room161, room162, room163, room164, - room165, room166, room167, room168, room169, - room170, room171, room172, room173, room174, - room175, room176, room177, room178, room179, - room180, room181, room182, room183, room184, - room185, room186, room187, room188, room189, - room190, room191, room192, room193, room194, - room195, room196, room197, room198, room199, - room200, room201, room202, room203, room204, - room205, room206, room207, room208, room209, - room210, room211, room212, room213, room214, - room215, room216, room217, room218, room219, - room220, room221, room222, room223, room224, - room225, room226, room227, room228, room229, - room230, room231, room232, room233, room234, - room235, room236, room237, room238, room239, - room240, room241, room242, room243, room244, - room245, room246, room247, room248}; diff --git a/commands/advent/advdec.h b/commands/advent/advdec.h deleted file mode 100644 index c2c144fe0..000000000 --- a/commands/advent/advdec.h +++ /dev/null @@ -1,71 +0,0 @@ -/* header ADVDEC.H * - * WARNING: GLOBAL (EXTERNAL) declarations for adventure */ - -#ifndef EXTERN /* #define as '' to define the variables */ -#define EXTERN extern -#endif - -EXTERN boolean gaveup; /* TRUE if he quits early */ -EXTERN FILE *fd1, *fd2, *fd3, *fd4; - -/* - English variables -*/ -EXTERN char *vtxt[MAXWORDS], *iotxt[MAXITEMS], *otxt[MAXITEMS]; -EXTERN int verbs[MAXWORDS], objs[MAXITEMS], iobjs[MAXITEMS]; -EXTERN int vrbx, objx, iobx; -EXTERN int verb, object, motion, iobj, prep; -EXTERN boolean newtravel, is_wiz; - -/* - Play variables -*/ -extern int plac[MAXOBJ]; /* initial location */ -extern int fixd[MAXOBJ]; -struct playinfo { - int turns; - int loc, oldloc, oldloc2, newloc; /* location variables */ - long loc_attrib[MAXLOC+1]; /* location status */ - int place[MAXOBJ]; /* object location */ - int fixed[MAXOBJ]; /* second object loc */ - int weight[MAXOBJ]; - int atloc[MAXLOC+1]; - int link[MAXOBJ * 2]; - int holder[MAXOBJ]; - int hlink[MAXOBJ]; - int visited[MAXLOC+1]; /* >0 if has been here */ - int prop[MAXOBJ]; /* status of object */ - long obj_state[MAXOBJ]; - long points[MAXOBJ]; - int hinted[HNTMAX+1]; - int hints[HNTMAX+1][5]; - int hintlc[HNTMAX+1]; - int tally, tally2; /* item counts */ - int limit; /* time limit */ - int lmwarn; /* lamp warning flag */ - int wzdark, closing, closed; /* game state flags */ - int holding; /* count of held items */ - int detail; /* LOOK count */ - int knfloc; /* knife location */ - int clock, clock2, panic; /* timing variables */ - int dloc[DWARFMAX+1]; /* dwarf locations */ - int dflag; /* dwarf flag */ - int dseen[DWARFMAX+1]; /* dwarf seen flag */ - int odloc[DWARFMAX+1]; /* dwarf old locations */ - int daltloc; /* alternate appearance */ - int dkill; /* dwarves killed */ - int chloc, chloc2; /* chest locations */ - int bonus; /* to pass to end */ - int numdie; /* number of deaths */ - int foobar; /* fee fie foe foo... */ - int combo; /* combination for safe */ - boolean terse; - int abbnum; - int health; - int chase; - boolean flg239; - - - int lastglob; /* to get space req. */ -}; -extern struct playinfo g; diff --git a/commands/advent/advent.c b/commands/advent/advent.c deleted file mode 100644 index 34145ef94..000000000 --- a/commands/advent/advent.c +++ /dev/null @@ -1,136 +0,0 @@ -/** Adventure translated from Fortran to "C" - and ported to Minix by: - Robert R. Hall - San Diego, Calif 92115 - hall@crash.cts.com - */ - -/** program ADVENT.C * - * "advent.c" allocates GLOBAL storage space by * - * #defining EXTERN before #including "advdec.h". */ - - -#include -#include -#include -#include -#include -#include -#include "advent.h" /* #define preprocessor equates */ -#include "advdec.h" - -#ifndef TEXTDIR -#define TEXTDIR "" -#endif - -char textdir[] = TEXTDIR; /* directory where text files - live. */ - -_PROTOTYPE(int main, (int, char **)); -_PROTOTYPE(static void opentxt, (void)); -_PROTOTYPE(static void file_error, (char *)); - -int main(argc, argv) -int argc; -char **argv; -{ - opentxt(); - initialize(); - rspeak(325); - if (argc == 2) - restore(argv[1]); - else { - g.hinted[3] = yes(65, 1, 0); - g.limit = (g.hinted[3] ? 800 : 550); - } - gaveup = FALSE; - srand((unsigned) time(NULL)); /* seed random */ - while (!gaveup) - turn(); - fclose(fd1); - fclose(fd2); - fclose(fd3); - fclose(fd4); - return (EXIT_SUCCESS); /* exit = ok */ -} /* main */ - -/* - Open advent?.txt files -*/ -static void opentxt() -{ - static char filename[sizeof(textdir) + 16]; - static FILE **fp[] = {0, &fd1, &fd2, &fd3, &fd4}; - int i; - for (i = 1; i <= 4; i++) { - sprintf(filename, "%sadvent%d.dat", textdir, i); - *fp[i] = fopen(filename, "r"); - if (!*fp[i]) - file_error(filename); - } -} - -/* - save adventure game -*/ -void saveadv(username) -char *username; -{ - int cnt; - FILE *savefd; - - savefd = fopen(username, "wb"); - if (savefd == NULL) { - perror(username); - return; - } - cnt = fwrite((void *) &g, 1, sizeof(struct playinfo), savefd); - if (cnt != sizeof(struct playinfo)) { - fprintf(stderr, "wrote %d of %u bytes\n", - cnt, (unsigned) sizeof(struct playinfo)); - if (ferror(savefd)) { - fprintf(stderr, "errno is: 0x%.4x\n", errno); - perror(username); - } - } - if (fclose(savefd) == -1) { - perror(username); - } - printf("Saved in %s.\n", username); - return; -} - -/* - restore saved game handler -*/ -void restore(username) -char *username; -{ - int cnt; - FILE *restfd; - - restfd = fopen(username, "rb"); - if (restfd == NULL) - file_error(username); - cnt = fread((void *) &g, 1, sizeof(struct playinfo), restfd); - if (cnt != sizeof(struct playinfo)) { - fprintf(stderr, "read %d bytes, expected %u\n", - cnt, (unsigned) sizeof(struct playinfo)); - if (ferror(restfd)) { - fprintf(stderr, "errno is: 0x%.4x\n", errno); - perror(username); - } - } - if (fclose(restfd) == -1) { - perror(username); - } - printf("Restored from %s.\n", username); - return; -} - -static void file_error(filename) -char *filename; -{ - perror(filename); - exit(EXIT_FAILURE); -} diff --git a/commands/advent/advent.h b/commands/advent/advent.h deleted file mode 100644 index 5e7abb419..000000000 --- a/commands/advent/advent.h +++ /dev/null @@ -1,405 +0,0 @@ -/* header ADVENT.H * - * WARNING: HEADER file for all adventure modules */ - -#ifndef EXIT_FAILURE -#define EXIT_FAILURE 1 -#define EXIT_SUCCESS (!(EXIT_FAILURE)) -#endif - -#define INPUTBUFLEN 80 /* Max input line length */ - -typedef int boolean; -#define FALSE (0) -#define TRUE (!FALSE) - -#define MAXOBJ 123 /* max # of objects in cave */ -#define MAXLOC 248 /* max # of cave locations */ -#define WORDSIZE 20 /* max # of chars in commands */ -#define MAXMSG 408 /* max # of long location descr */ -#define HNTMAX 18 /* max # of hints */ -#define HNTMIN 7 /* hints starting count */ - -#define MAXWORDS 25 -#define MAXITEMS 45 - -#define CLASS(word) ((word)<0 ? -((-(word)) / 1000) : (word) / 1000) -#define VAL(word) ((word)<0 ? -((-(word)) % 1000) : (word) % 1000) -#define MAXTRAV (23+1) /* max # of travel directions from loc */ - /* +1 for terminator travel[x].tdest=-1 */ -#define DWARFMAX 6 /* max # of nasty dwarves */ -#define MAXDIE 3 /* max # of deaths before close */ -#define MAXTRS 79 /* max # of */ - -#define Y2 33 -/* - Object definitions -*/ -#define ANVIL 91 -#define AXE 28 -#define BATTERIES 39 -#define BEAR 35 -#define BEES 87 -#define BILLBD 116 -#define BIRD 101 -#define BOAT 48 -#define BOOK 110 -#define BOOK2 BOOK + 1 -#define BOOTH 93 -#define BOTTLE 20 -#define BRUSH 114 -#define CAGE 4 -#define CAKES 107 -#define CARVNG 115 -#define CASK 71 -#define CHAIN 64 -#define CHASM 21 -#define CHASM2 CHASM + 1 -#define CHEST 55 -#define CLAM 14 -#define CLOAK 47 -#define COINS 54 -#define CROWN 66 -#define DOG 98 -#define DOOR 41 /* giant door */ -#define DRAGON 31 -#define DWARF 17 -#define EGGS 56 -#define EMERALD 59 -#define FISSURE 12 -#define FLOWER 46 -#define FLY 69 -#define FOOD 19 -#define GNOME 105 -#define GRAIL 70 -#define GRATE 3 -#define HIVE 97 -#define HONEY 96 -#define HORN 52 -#define JEWELS 53 -#define KEYS 102 -#define KNIFE 18 -#define LAMP 2 -#define LYRE 68 -#define MAGAZINE 16 -#define MESSAGE 36 -#define MIRROR 23 -#define MUSHRM 106 -#define NUGGET 50 -#define OIL 83 -#define OIL2 OIL + 1 -#define OYSTER 15 -#define PLAGUE 125 -#define PEARL 61 -#define PHONE 94 -#define PILLOW 10 -#define PLANT 24 -#define PLANT2 PLANT + 1 -#define POLE 9 -#define POSTER 113 -#define PYRAMID 60 -#define RADIUM 119 -#define RING 72 -#define ROCKS 92 -#define ROD 5 -#define ROD2 ROD + 1 -#define RUG 62 -#define SAFE 112 -#define SAPPHIRE 69 -#define SHIELD 118 -#define SHOES 67 -#define SKEY 90 -#define SLUGS 95 -#define SNAKE 11 -#define SPHERE 120 -#define SPICES 63 -#define SPIDER 121 -#define STEPS 7 -#define STICKS 49 -#define SWORD 65 -#define TABLET 13 -#define TDOOR 42 /* tiny door */ -#define TDOOR2 TDOOR + 1 /* wrought-iron door */ -#define PDOOR TDOOR2 + 1 /* door to phone booth */ -#define TRIDENT 57 -#define TROLL 33 -#define TROLL2 TROLL + 1 -#define VASE 58 -#define VEND 38 -#define WALL 88 -#define WALL2 WALL + 1 -#define WATER 81 /* in bottle */ -#define WATER2 WATER + 1 /* in cask */ -#define WINE 85 /* in bottle */ -#define WINE2 WINE + 1 /* in cask */ -#define WUMPUS 99 - -/* - Verb definitions -*/ -#define BACK 8 -#define CAVE 67 -#define DEPRESSION 63 -#define ENTRANCE 64 -#define EXIT 11 -#define NULLX 21 - -/* - Action verb definitions -*/ -#define TAKE 1 -#define DROP 2 -#define SAY 3 -#define OPEN 4 -#define NOTHING 5 -#define CLOSE 6 -#define ON 7 -#define OFF 8 -#define WAVE 9 -#define CALM 10 -#define WALK 11 -#define KILL 12 -#define POUR 13 -#define EAT 14 -#define DRINK 15 -#define RUB 16 -#define THROW 17 -#define QUIT 18 -#define FIND 19 -#define INVENTORY 20 -#define FEED 21 -#define FILL 22 -#define BLAST 23 -#define SCORE 24 -#define FOO 25 -#define BRIEF 26 -#define READ 27 -#define BREAK 28 -#define WAKE 29 -#define SUSPEND 30 -#define RESTORE 31 -#define YANK 32 -#define WEAR 33 -#define HIT 34 -#define ANSWER 35 -#define BLOW 36 -#define LEAVE 37 -#define YELL 38 -#define DIAL 39 -#define PLAY 40 -#define PICK 41 -#define PUT 42 -#define TURN 43 -#define GET 44 -#define INSRT 45 -#define REMOVE 46 -#define BURN 47 -#define GRIPE 48 -#define LOCK 49 -#define UNLOCK 50 -#define HEALTH 51 -#define LOOK 52 -#define COMBO 53 -#define SWEEP 54 -#define TERSE 55 -#define WIZ 56 -#define MAP 57 -#define GATE 58 -#define PIRLOC 59 - -#define GO 11 -#define SHUT 6 -#define LOG 33 - -#define MOTION 0 /* CLASSD */ -#define NOUN 1 /* CLASSN */ -#define ACTION 2 /* CLASSA */ -#define MISC 3 /* CLASSM */ -#define PREPOSITION 4 /* CLASSP */ -#define ADJACTIVE 5 /* CLASSJ */ -#define CONJUNCTION 6 /* CLASSC */ - -/* - and a few preposition. prefix PREP to distinguish them from - verbs or nouns - */ -#define PREPAT 9 -#define PREPDN 8 -#define PREPIN 1 -#define PREPFR 5 -#define PREPOF 6 -#define PREPOFF 6 -#define PREPON 2 - -/* - BIT mapping of "cond" array which indicates location status -*/ -#define LIGHT 1 -#define WATOIL 2 -#define LIQUID 4 -#define NOPIRAT 16 - -/* Object condition bit functions */ -#define OPENBT 2 -#define LOCKBT 4 -#define BURNBT 6 -#define DEADBT 10 -#define WEARBT 12 -/* - Structure definitions -*/ -struct wac { - char *aword; - int acode; -}; - -struct trav { - int tdest; - int tverb; - int tcond; -}; - -/* Function prototypes. - "#if (__STDC__)" should have been be enough, - but some compilers are stupid, so allow Makefile to say -DHAS_STDC=whatever. -*/ -#if defined(HAS_STDC) ? (HAS_STDC) : (__STDC__) -#undef HAS_STDC -#define HAS_STDC 1 -#define _PROTOTYPE(function, params) function params -#define _CONST const -#else -#define _PROTOTYPE(function, params) function () -#define _CONST -#endif - -/* Advent.c */ - -_PROTOTYPE(void saveadv, (char *username)); -_PROTOTYPE(void restore, (char *username)); - -/* Initialize.c */ - -_PROTOTYPE(void initialize, (void)); - -/* Database.c */ - -_PROTOTYPE(int yes, (int msg1, int msg2, int msg3)); -_PROTOTYPE(void rspeak, (int msg)); -_PROTOTYPE(void pspeak, (int item, int state)); -_PROTOTYPE(void desclg, (int loc)); -_PROTOTYPE(void descsh, (int loc)); - -/* English.c */ - -_PROTOTYPE(int english, (void)); -_PROTOTYPE(int analyze, (char *word, int *type, int *value)); - -/* Itverb.c */ - -_PROTOTYPE(void itverb, (void)); -_PROTOTYPE(void ivblast, (void)); -_PROTOTYPE(void ivlook, (void)); - -/* Turn.c */ - -_PROTOTYPE(void turn, (void)); -_PROTOTYPE(void describe, (void)); -_PROTOTYPE(void descitem, (void)); -_PROTOTYPE(void dwarfend, (void)); -_PROTOTYPE(void normend, (void)); -_PROTOTYPE(void score, (int)); -_PROTOTYPE(void death, (void)); -_PROTOTYPE(char *probj, (void)); -_PROTOTYPE(void trobj, (void)); -_PROTOTYPE(void dwarves, (void)); -_PROTOTYPE(void dopirate, (void)); -_PROTOTYPE(int stimer, (void)); - -/* Verb.c */ - -_PROTOTYPE(void trverb, (void)); -_PROTOTYPE(void vtake, (void)); -_PROTOTYPE(void vdrop, (void)); -_PROTOTYPE(void vopen, (void)); -_PROTOTYPE(void vsay, (void)); -_PROTOTYPE(void von, (void)); -_PROTOTYPE(void voff, (void)); -_PROTOTYPE(void vwave, (void)); -_PROTOTYPE(void vkill, (void)); -_PROTOTYPE(void vpour, (void)); -_PROTOTYPE(void veat, (void)); -_PROTOTYPE(void vdrink, (void)); -_PROTOTYPE(void vthrow, (void)); -_PROTOTYPE(void vfind, (void)); -_PROTOTYPE(void vfill, (void)); -_PROTOTYPE(void vfeed, (void)); -_PROTOTYPE(void vread, (void)); -_PROTOTYPE(void vbreak, (void)); -_PROTOTYPE(void vwake, (void)); -_PROTOTYPE(void actspk, (int verb)); -_PROTOTYPE(void vyank, (void)); -_PROTOTYPE(void vwear, (void)); -_PROTOTYPE(void vlock, (void)); -_PROTOTYPE(void vunlock, (void)); -_PROTOTYPE(void vclose, (void)); - -/* Utility.c */ - -_PROTOTYPE(boolean ajar, (int)); -_PROTOTYPE(boolean at, (int item)); -_PROTOTYPE(boolean athand, (int)); -_PROTOTYPE(void bitoff, (int, int)); -_PROTOTYPE(void biton, (int, int)); -_PROTOTYPE(boolean bitset, (long, int)); -_PROTOTYPE(boolean blind, (void)); -_PROTOTYPE(int burden, (int)); -_PROTOTYPE(void carry, (int obj, int where)); -_PROTOTYPE(int confuz, (void)); -_PROTOTYPE(boolean dark, (void)); -_PROTOTYPE(boolean dcheck, (void)); -_PROTOTYPE(boolean dead, (int)); -_PROTOTYPE(void drop, (int obj, int where)); -_PROTOTYPE(void destroy, (int obj)); -_PROTOTYPE(boolean edible, (int)); -_PROTOTYPE(boolean enclosed, (int)); -_PROTOTYPE(void extract, (int)); -_PROTOTYPE(boolean forced, (int atloc)); -_PROTOTYPE(boolean here, (int item)); -_PROTOTYPE(boolean hinged, (int)); -_PROTOTYPE(boolean holding, (int)); -_PROTOTYPE(void insert, (int, int)); -_PROTOTYPE(boolean inside, (int)); -_PROTOTYPE(void juggle, (int loc)); -_PROTOTYPE(int liq, (int)); -_PROTOTYPE(int liqloc, (int loc)); -_PROTOTYPE(int liq2, (int pbottle)); -_PROTOTYPE(boolean living, (int)); -_PROTOTYPE(boolean locked, (int)); -_PROTOTYPE(boolean locks, (int)); -_PROTOTYPE(void lookin, (int)); -_PROTOTYPE(void move, (int obj, int where)); -_PROTOTYPE(int noway, (void)); -_PROTOTYPE(boolean opaque, (int)); -_PROTOTYPE(boolean outside, (int)); -_PROTOTYPE(boolean pct, (int x)); -_PROTOTYPE(boolean plural, (int)); -_PROTOTYPE(boolean portal, (int)); -_PROTOTYPE(boolean printed, (int)); -_PROTOTYPE(int put, (int obj, int where, int pval)); -_PROTOTYPE(int ranz, (int)); -_PROTOTYPE(boolean small, (int)); -_PROTOTYPE(boolean toting, (int item)); -_PROTOTYPE(boolean treasr, (int)); -_PROTOTYPE(boolean vessel, (int)); -_PROTOTYPE(boolean wearng, (int)); -_PROTOTYPE(boolean worn, (int)); -_PROTOTYPE(void bug, (unsigned int n)); -_PROTOTYPE(char *ask, (char *prompt, char *buf, int buflen)); -_PROTOTYPE(void panic, (char *msg, boolean save)); - -/* travel.c */ -_PROTOTYPE(void domove, (void)); -_PROTOTYPE(void gettrav, (int loc, struct trav *travel)); - -/* vocab.c */ -_PROTOTYPE(int vocab, (char *word, int val)); diff --git a/commands/advent/advent1.txt b/commands/advent/advent1.txt deleted file mode 100644 index e69fea14f..000000000 --- a/commands/advent/advent1.txt +++ /dev/null @@ -1,827 +0,0 @@ -#1 -You are standing at the end of a road before a small brick building. -Around you is a forest. A small stream flows out of the building and -down a gully. -#2 -You have walked up a hill, still in the forest. The road slopes back -down the other side of the hill. There is a building in the distance. -#3 -You are inside a building, a well house for a large spring. Off -to one side is a small pantry. -#4 -You are in a valley in the forest beside a stream tumbling along a -rocky bed. -#5 -You are in open forest, with a deep valley to one side. Not far -is a large billboard. -#6 -You are in open forest near both a valley and a road. -#7 -At your feet all the water of the stream splashes into a 2-inch slit -in the rock. Downstream the stream bed is bare rock. -#8 -You are in a 20-foot depression floored with bare dirt. Set into the -dirt is a strong steel grate mounted in concrete. A dry stream bed -leads into the depression. -#9 -You are in a small chamber beneath a 3x3 steel grate to the surface. -A low crawl over cobbles leads inward to the west. -#10 -You are crawling over cobbles in a low passage. There is a dim light -at the east end of the passage. -#11 -You are in a debris room filled with stuff washed in from the surface. -A low wide passage with cobbles becomes plugged with mud and debris -here, but an awkward canyon leads upward and west. A note on the wall -says "Magic Word XYZZY". -#12 -You are in an awkward sloping east/west canyon. -#13 -You are in a splendid chamber thirty feet high. The walls are frozen -rivers of orange stone. An awkward canyon and a good passage exit -from east and west sides of the chamber. -#14 -At your feet is a small pit breathing traces of white mist. An east -passage ends here except for a small crack leading on. -#15 -You are at one end of a vast hall stretching forward out of sight to -the west. There are openings to either side. Nearby, a wide stone -staircase leads downward. The hall is filled with wisps of white mist -swaying to and fro almost as if alive. A cold wind blows up the -staircase. There is a passage at the top of a dome behind you. -#16 -The crack is far too small for you to follow. -#17 -You are on the east bank of a fissure slicing clear across the hall. -The mist is quite thick here, and the fissure is too wide to jump. -#18 -This is a low room with a crude note on the wall. The note says, -"You won't get it up the steps". -#19 -You are in the Hall of the Mountain King, with passages off in all -directions. -#20 -You are at the bottom of the pit with a broken neck. -#21 -You didn't make it. -#22 -The dome is unclimbable. -#23 -You are at the west end of the Twopit Room. There is a large hole in -the wall above the pit at this end of the room. -#24 -You are at the bottom of the eastern pit in the Twopit Room. There is -a small pool of oil in one corner of the pit. -#25 -You are at the bottom of the western pit in the Twopit Room. There is -a large hole in the wall about 25 feet above you. -#26 -You clamber up the plant and scurry through the hole at the top. -#27 -You are on the west side of the fissure in the Hall of Mists. -#28 -You are in a low N/S passage at a hole in the floor. The hole goes -down to an E/W passage. -#29 -You are in the South Side Chamber. -#30 -You are in the West Side Chamber of the Hall of the Mountain King. -A passage continues west and up here. -#31 -<$$< -#32 -You can't get by the snake. -#33 -You are in a large room, with a passage to the south, a passage to the -west, and a wall of broken rock to the east. There is a large "Y2" on -a rock in the room's center. -#34 -You are in a jumble of rock, with cracks everywhere. -#35 -You're at a low window overlooking a huge pit, which extends up out of -sight. A floor is indistinctly visible over 50 feet below. Traces of -white mist cover the floor of the pit, becoming thicker to the right. -Marks in the dust around the window would seem to indicate that -someone has been here recently. Directly across the pit from you and -25 feet away there is a similar window looking into a lighted room. A -shadowy figure can be seen there peering back at you. -#36 -You are in a dirty broken passage. To the east is a crawl. To the -west is a large passage. Above you is a hole to another passage. -#37 -You are on the brink of a small clean climbable pit. A crawl leads -west. -#38 -You are in the bottom of a small pit with a little stream, which -enters and exits through tiny slits. -#39 -You are in a large room full of dusty rocks. There is a big hole in -the floor. There are cracks everywhere, and a passage leading east. -#40 -You have crawled through a very low wide passage parallel to and north -of the Hall of Mists. -#41 -You are at the west end of Hall of Mists. A low wide crawl continues -west and another goes north. To the south is a little passage 6 feet -off the floor. -#42 -You are in a maze of twisty little passages, all alike. -#43 -You are in a maze of twisty little passages, all alike. -#44 -You are in a maze of twisty little passages, all alike. -#45 -You are in a maze of twisty little passages, all alike. -#46 -Dead end. -#47 -Dead end. -#48 -Dead end. -#49 -You are in a maze of twisty little passages, all alike. -#50 -You are in a maze of twisty little passages, all alike. -#51 -You are in a maze of twisty little passages, all alike. -#52 -You are in a maze of twisty little passages, all alike. -#53 -You are in a maze of twisty little passages, all alike. -#54 -Dead end. -#55 -You are in a maze of twisty little passages, all alike. -#56 -Dead end. -#57 -You are on the brink of a thirty foot pit with a massive orange column -down one wall. You could climb down here but you could not get back -up. The maze continues at this level. -#58 -Dead end. -#59 -You have crawled through a very low wide passage parallel to and north -of the Hall of Mists. -#60 -You are at the east end of a very long hall apparently without side -chambers. In the south wall are several wide cracks and a high -hole, but the hole is far above your head. To the east a wide -crawl slants up. To the north a round two foot hole slants down. -#61 -You are at the west end of a very long featureless hall. The hall -joins up with a narrow north/south passage. -#62 -You are at a crossover of a high N/S passage and a low E/W one. -#63 -Dead end. -#64 -You are at a complex junction. A low hands and knees passage from the -north joins a higher crawl from the east to make a walking passage -going west. There is also a large room above. The air is damp here. -#65 -You are in Bedquilt, a long east/west passage with holes everywhere. -To explore at random select north, south, up, or down. -#66 -You are in a room whose walls resemble swiss cheese. Obvious passages -go west, east, NE, and NW. Part of the room is occupied by a large -bedrock block. -#67 -You are at the east end of the Twopit Room. The floor here is -littered with thin rock slabs, which make it easy to descend the pits. -There is a path here bypassing the pits to connect passages from east -and west. There are holes all over, but the only big one is on the -wall directly over the west pit where you can't get to it. -#68 -You are in a large low circular chamber whose floor is an immense slab -fallen from the ceiling (Slab Room). East and west there once were -large passages, but they are now filled with boulders. Low small -passages go north and south, and the south one quickly bends west -around the boulders. -#69 -You are in a secret N/S canyon above a large room. -#70 -You are in a secret N/S canyon above a sizable passage. -#71 -You are in a secret canyon at a junction of three canyons, bearing -north, south, and SE. The north one is as tall as the other two -combined. -#72 -You are in a large low room. Crawls lead north, NE, and SW. -#73 -Dead end crawl. -#74 -You are in a secret canyon which here runs E/W. It crosses over a -very tight canyon 15 feet below. If you go down you may not be able -to get back up. -#75 -You are at a wide place in a very tight N/S canyon. -#76 -The canyon here becomes too tight to go further south. -#77 -You are in a tall E/W canyon. A low tight crawl goes 3 feet north and -seems to open up. -#78 -The canyon runs into a mass of boulders -- dead end. -#79 -The stream flows out through a pair of 1 foot diameter sewer pipes. -It would be advisable to use the exit. -#80 -You are in a maze of twisty little passages, all alike. -#81 -Dead end. -#82 -Dead end. -#83 -You are in a maze of twisty little passages, all alike. -#84 -You are in a maze of twisty little passages, all alike. -#85 -Dead end. -#86 -Dead end. -#87 -You are in a maze of twisty little passages, all alike. -#88 -You are in a long, narrow corridor stretching out of sight to the -west. At the eastern end is a hole through which you can see a -profusion of leaves. -#89 -There is nothing here to climb. Use "up" or "out" to leave the pit. -#90 -You have climbed up the plant and out of the pit. -#91 -You are at the top of a steep incline above a large room. You could -climb down here, but you would not be able to climb up. There is a -passage leading back to the north. -#92 -You are in the Giant Room. The ceiling here is too high up for your -lamp to show it. Cavernous passages lead east, north, and south. On -the west wall is scrawled the inscription, "FEE FIE FOE FOO" [sic]. -#93 -The passage here is blocked by a recent cave-in. -#94 -You are at one end of an immense north/south passage. -#95 -You are in a magnificent cavern with a rushing stream, which cascades -over a sparkling waterfall into a roaring whirlpool which disappears -through a hole in the floor. Passages exit to the south and west. -#96 -You are in the Soft Room. The walls are covered with heavy curtains, -the floor with a thick pile carpet. Moss covers the ceiling. -#97 -This is the Oriental Room. Ancient oriental cave drawings cover the -walls. A gently sloping passage leads upward to the north, another -passage leads SE, and a hands and knees crawl leads east. -#98 -You are following a wide path around the outer edge of a large cavern. -Far below, through a heavy white mist, strange splashing noises can be -heard. The mist rises up through a fissure in the ceiling. The path -hugs the cavern's rim to the NE and south, while another branch forks -west. A round chute with extremely smooth walls angles sharply up -to the southwest. -#99 -You are in an alcove. A small NW path seems to widen after a short -distance. An extremely tight tunnel leads east. It looks like a very -tight squeeze. An eerie light can be seen at the other end. -#100 -You're in a small chamber lit by an eerie green light. An extremely -narrow tunnel exits to the west, and a dark corridor leads NE. -#101 -You're in the Dark-Room. A corridor leading south is the only exit. -#102 -You are in an arched hall. A coral passage once continued up and east -from here, but is now blocked by debris. The air smells of sea water. -#103 -You're in a large room carved out of sedimentary rock. The floor and -walls are littered with bits of shells imbedded in the stone. A -shallow passage proceeds downward, and a somewhat steeper one leads -up. A low hands and knees passage enters from the south. -#104 -You are in a long sloping corridor with ragged sharp walls. -#105 -You are in a cul-de-sac about eight feet across. -#106 -You are in an anteroom leading to a large passage to the east. Small -passages go west and up. The remnants of recent digging are evident. -A sign in midair here says "Cave under construction beyond this point. -Proceed at own risk. [Witt Construction Company]". -#107 -You are in a maze of twisty little passages, all different. -#108 -You are at Witt's End. Passages lead off in *ALL* directions. -#109 -You are in a north/south canyon about 25 feet across. The floor is -covered by white mist seeping in from the north. The walls extend -upward for well over 100 feet. Suspended from some unseen point far -above you, an enormous two-sided mirror is hanging parallel to and -midway between the canyon walls. (The mirror is obviously provided -for the use of the dwarves, who as you know, are extremely vain.) A -small window can be seen in either wall, some fifty feet up. -#110 -You're at a low window overlooking a huge pit, which extends up out of -sight. A floor is indistinctly visible over 50 feet below. Traces of -white mist cover the floor of the pit, becoming thicker to the left. -Marks in the dust around the window would seem to indicate that -someone has been here recently. Directly across the pit from you and -25 feet away there is a similar window looking into a lighted room. A -shadowy figure can be seen there peering back at you. -#111 -A large stalactite extends from the roof and almost reaches the floor -below. You could climb down it, and jump from it to the floor, but -having done so you would be unable to reach it to climb back up. -#112 -You are in a little maze of twisting passages, all different. -#113 -You are at the edge of a large underground reservoir. An opaque cloud -of white mist fills the room and rises rapidly upward. The lake is -fed by a stream, which tumbles out of a hole in the wall about 10 feet -overhead and splashes noisily into the water somewhere within the -mist. The indistinct shape of the opposite shore can be dimly seen -through the mist. The only passage goes back toward the south. -#114 -Dead end. -#115 -You are at the northeast end of an immense room, even larger than the -Giant Room. It appears to be a repository for the "ADVENTURE" -program. Massive torches far overhead bathe the room with smoky -yellow light. Scattered about you can be seen a pile of bottles (all -of them empty), a nursery of young beanstalks murmuring quietly, a bed -of oysters, a bundle of black rods with rusty stars on their ends, and -a collection of brass lanterns. Off to one side a great many dwarves -are sleeping on the floor, snoring loudly. A sign nearby reads: "Do -not disturb the dwarves!" An immense mirror is hanging against one -wall, and stretches to the other end of the room, where various other -sundry objects can be glimpsed dimly in the distance. An unoccupied -telephone booth stands against the north wall. -#116 -You are at the southwest end of the repository. To one side is a pit -full of fierce green snakes. On the other side is a row of small -wicker cages, each of which contains a little sulking bird. In one -corner is a bundle of black rods with rusty marks on their ends. A -large number of velvet pillows are scattered about on the floor. -Beside one of the pillows is a large, dusty, leather-bound volume -with the title "History of Adventure" embossed in pure gold. -A vast mirror stretches off to the northeast, almost reaching the -phone booth. At your feet is a large steel grate, next to which is -a sign which reads, "Treasure Vault. Keys in Main Office." -#117 -You are on one side of a large, deep chasm. A heavy white mist rising -up from below obscures all view of the far side. A SW path leads away -from the chasm into a winding corridor. -#118 -You are in a long winding corridor sloping out of sight in both -directions. -#119 -You are in a secret canyon which exits to the north and east. -#120 -You are in a secret canyon which exits to the north and east. -#121 -You are in a secret canyon which exits to the north and east. -#122 -You are on the northeast side of a deep chasm. A NE path leads away -from the chasm on this side. -#123 -You're in a long east/west corridor. A faint rumbling noise can be -heard in the distance. -#124 -The path forks here. The left fork leads northeast. A dull rumbling -seems to get louder in that direction. The right fork leads southeast -down a gentle slope. The main corridor enters from the west. -#125 -The walls are quite warm here. From the north can be heard a steady -roar, so loud that the entire cave seems to be trembling. Another -passage leads south, and a low crawl goes east. -#126 -You are on the edge of a breathtaking view. Far below you is an -active volcano, from which great gouts of molten lava come surging -out, cascading back down into the depths. The glowing rock fills the -farthest reaches of the cavern with a blood-red glare, giving every- -thing an eerie, macabre appearance. The air is filled with flickering -sparks of ash and a heavy smell of brimstone. The walls are hot to -the touch, and the thundering of the volcano drowns out all other -sounds. Embedded in the jagged roof far overhead are myriad twisted -formations composed of pure white alabaster, which scatter the murky -light into sinister apparitions upon the walls. To one side is a deep -gorge, filled with a bizarre chaos of tortured rock which seems to -have been crafted by the devil himself. An immense river of fire -crashes out from the depths of the volcano, burns its way through the -gorge, and plummets into a bottomless pit far off to your left. To -the right, an immense geyser of blistering steam erupts continuously -from a barren island in the center of a sulfurous lake, which bubbles -ominously. The far right wall is aflame with an incandescence of its -own, which lends an additional infernal splendor to the already -hellish scene. A dark, foreboding passage exits to the south. -#127 -You are in a small chamber filled with large boulders. The walls are -very warm, causing the air in the room to be almost stifling from the -heat. The only exit is a crawl heading west, through which is coming -a low rumbling. -#128 -You are walking along a gently sloping north/south passage lined with -oddly shaped limestone formations. -#129 -You are standing at the entrance to a large, barren room. A sign -posted above the entrance reads: "Caution! Bear in room!" -#130 -You are inside a barren room. The center of the room is completely -empty except for some dust. Marks in the dust lead away toward the -far end of the room. The only exit is the way you came in. -#131 -You are in a maze of twisting little passages, all different. -#132 -You are in a little maze of twisty passages, all different. -#133 -You are in a twisting maze of little passages, all different. -#134 -You are in a twisting little maze of passages, all different. -#135 -You are in a twisty little maze of passages, all different. -#136 -You are in a twisty maze of little passages, all different. -#137 -You are in a little twisty maze of passages, all different. -#138 -You are in a maze of little twisting passages, all different. -#139 -You are in a maze of little twisty passages, all different. -#140 -Dead end. -#141 -You are on a narrow promontory at the foot of a waterfall, which -spurts from an overhead hole in the rock wall and splashes into a -large reservoir, sending up clouds of mist and spray. -Through the thick white mist looms a polished marble slab, to -which is affixed an enormous rusty iron anvil. In golden letters -are written the words: "Whoso Pulleth Out This Sword of This -Stone and Anvil, is Right wise King-Born of All This Mountain." -There is a narrow chimney on the east side of the promontory. -#142 -You are on a narrow shelf above and east of the top of a very steep -chimney. A long smooth granite slide curves down out of sight -to the east. If you go down the slide, you may not be able to -climb back up. -#143 -You are in the private chamber of the Mountain King. Hewn into the -solid rock of the east wall of the chamber is an intricately-wrought -throne of elvish design. There is an exit to the west. -#144 -You are on the east side of the throne room. On the arm of the throne -has been hung a sign which reads "Gone for the day: visiting -sick snake. --M.K." -#145 -You are dragged down, down, into the depths of the whirlpool. -Just as you can no longer hold your breath, you are shot out over -a waterfall into the shallow end of a large reservoir. Gasping -and sputtering, you crawl weakly towards the shore.... -#146 -You are in dense forest, with a hill to one side. The trees appear -to thin out towards the north and east. -#147 -You are at the high point of a wide grassy knoll, partially surrounded -by dense forest. The land rises to the south and east, and drops off -sharply to the north and west. The air smells of sea water. -#148 -You are at the edge of a trackless salt marsh. Tall reeds obscure -the view. -#149 -You're in salt marsh. -#150 -You're in salty marsh. -#151 -You are in salt marsh. -#152 -Dead end. -#153 -You're on a sandy beach at the edge of the open sea. The beach -ends a short distance south and the land rises to a point. To -the north, the beach ends cliffs and broken rocks. -#154 -You are at a jumble of large broken rocks. A gentle path leads up -to the top of the nearby cliffs. A narrow treacherous path -disappears among the rocks at the foot of the cliff. -#155 -You are on a high cliff overlooking the sea. Far below the -rolling breakers smash into a jumble of large broken rocks. -The thunder of the surf is deafening. -#156 -You're at the bottom of the cliff, smashed to smithereens by the -pounding surf. -#157 -You are at Thunder Hole, a funnel shaped cavern opening onto the sea. -The noise of the surf pounding against the outer rocks of the cave is -amplified by the peculiar shape of the cave, causing a thunder-like -booming sound to reverberate throughout the cave. Outside, a narrow -path leads south towards some large rocks. -#158 -You are at the top of some arched steps. On one side is a blank wall -with a tiny door at the base and a shelf overhead. On the other side -a westward passage leads to the sea. -#159 -You are in a low cramped chamber at the back of a small cave. -There is a shelf in the rock wall at about the height of your -shoulder. -#160 -You are on a wide ledge, bounded on one side by a rock wall, -and on the other by a sheer cliff. The only way past is through -a large wrought-iron door. -#161 -You feel dizzy...Everything around you is spinning, expanding, -growing larger.... Dear me! Is the cave bigger or are you smaller? -#162 -You are again overcome by a sickening vertigo, but this time -everything around you is shrinking...Shrinking... -#163 -You are again overcome by a sickening vertigo, but this time -everything is shrinking... I mean, you are growing. This is -terribly confusing! -#164 -You feel dizzy...Everything around you is spinning, expanding, -growing larger.... -#165 -You're at the bottom of the cliff with a broken neck. -#166 -You are at the western tip of the Blue Grotto. A large lake almost -covers the cavern floor, except for where you are standing. Small -holes high in the rock wall to the east admit a dim light. The -reflection of the light from the water suffuses the cavern with -a hazy bluish glow. -#167 -You are on the shore of an underground sea. A high wooden -structure of vast proportions extends out into the water to the -east. The way west is through a wrought-iron door. -#168 -You are on the eastern shore of the Blue Grotto. An ascending -tunnel disappears into the darkness to the SE. -#169 -You are at a high rock on the NE side of a watery chamber at the mouth -of a small brook. An unknown gas bubbles up through the water from -the chamber floor. A bluish light can be seen to the southwest. -#170 -You are in a windy tunnel between two large rooms. -#171 -You are in the Bat Cave. The walls and ceiling are covered with -sleeping bats. The floor is buried by a mass of dry, foul-smelling -guano. The stench is overpowering. Exits to the NW and east. -#172 -You are in a very tight N/S crack. The passage seems to widen to -the south. -#173 -You are in a very tight N/S crack. The passage south is blocked -by a recent cave-in. -#174 -You're in the Cloakroom. This is where the dreaded Wumpus repairs -to sleep off heavy meals. (Adventurers are his favorite dinner!) -Two very narrow passages exit NW and NE. -#175 -You're in a room containing several small climbable pits. Passages -exit to the east and north. -#176 -You are at the bottom of a small featureless pit. -#177 -You are at a high hole in a rock wall. -#178 -The NE passage is blocked by a recent cave-in. -#179 -You are in a sloping muddy defile, next to a tumbling brook. -#180 -You are in a level E/W passage partially blocked by an overhanging -tongue of rock. A steep scramble would take you up over the tongue, -whence continues an upward crawl. -#181 -The dog won't let you pass. -#182 -You're in the Upper Passage, a long level E/W tunnel. -#183 -You are in a star-shaped chamber. Passages exit north, east, south, -and west. -#184 -You are at an elbow in a winding E/W passage. -#185 -Dead end. -#186 -You're at the intersection of two long tunnels. One goes NW, -the other NE. -#187 -You're in a long narrow east-west passage which curves out of sight -at both ends. -#188 -You're in the Rotunda. Corridors radiate in all directions. -There is a telephone booth standing against the north wall. -#189 -You are standing in a telephone booth at the side of a large chamber. -Hung on the wall is a banged-up pay telephone of ancient design. -#190 -You're at the Devil's Chair, a large crystallization shaped like a -seat, at the edge of a black abyss. You can't see the bottom. -An upward path leads away from the abyss. -#191 -You're in a dead-end crack. -#192 -You're on a small gravel beach at the south wall of the Blue Grotto. -A gravelly path leads east. -#193 -You are in the Flower Room. The walls are covered with colorful, -intricate, flowerlike patterns of crystallized gypsum. A hole leads -to the west. -#194 -You are at the end of a short E/W corridor. -#195 -You are looking west from the end of a short E/W corridor. At your -feet is a pile of loose rubble. On your left is a hole into another -chamber. -#196 -You are in an arched hall. The remnants of a now-plugged coral -passage lie to the east. The north wall has partially crumbled, -exposing a large connecting hole to another room. -#197 -You're in the Vestibule, a short east-west passage between two rooms. -#198 -You are in the Fairy Grotto. All around you innumerable stalactites, -arranged in immense colonnades, form elegant arches. On every side -you hear the dripping of water, like the footsteps of a thousand -fairies. A small stream runs from the SW corner. A bright glow -emanates from the south side of the grotto, and a steep passage -descends to the east. -#199 -You have approached the lower end of a steep passage, but it is -just too cold here to hang around, and you aren't properly equipped -to continue. With teeth chattering, you climb back up.... -#200 -You are in the Crystal Palace. An overhead vein of phosphorescent -quartz casts a luminous glow which is reflected by countless chips of -mica embedded in both walls, which consist of some sort of highly -reflective glass, apparently of volcanic origin. A winding path -of yellow sandstone leads west and rises steeply to the east. -#201 -You are following a yellow sandstone path. There is a glow -to the west. -#202 -You are in a very tall chamber whose walls are comprised of many -different rock strata. Layers of red and yellow sandstone -intertwine with bright bands of calcareous limestone in a rainbow- -like profusion of color. The rainbow effect is so real, you -are almost tempted to look for a pot of gold! Poised far over -your head, a gigantic slab, wedged tightly between the north and -south walls, forms a natural bridge across the roof of the chamber. -A trail leads east and west. -#203 -You're in a steeply sloping passage. It is very cold here. -#204 -You are in the Hall of Ice, in the deepest part of the caverns. -During winter, frigid outside air settles here, making this room -extremely cold all year round. The walls and ceilings are covered -with a thick coating of ice. An upward passage exits to the west. -#205 -You are standing on a natural bridge far above the floor of a circular -chamber whose walls are a rainbow of multicolored rock. The bridge -was formed eons ago by a huge slab which fell from the ceiling and -is now jammed between the north and south walls of the chamber. -#206 -You are in a low, wide room below another chamber. A small green -pond fills the center of the room. The lake is apparently spring -fed. A small stream exits through a narrow passage to the north. -A larger passage continues west. -#207 -You are in a tight north/south crawl through a stratum of red -colored rock. The air is damp with mist. -#208 -You are in a tall canyon on the south side of a swift, wide river. -Written in the mud in crude letters are the words: "You Have Found -Lost River." A wide path leads east and west along the bank. A tight -crawl way would take you south out of the canyon. -#209 -You are standing on a large flat rock table at the western end of -Lost River Canyon. Beneath your feet, the river disappears amidst -foam and spray into a large sinkhole. A gentle path leads east -along the river's south shore. Another leads sharply upward along -the river's north side. -#210 -You are at a niche in the canyon wall, far above a raging river. -The air is filled with mist and spray, making it difficult to see -ahead. A downward sloping ledge narrows to the east. The path -to the west is easier. -#211 -The ledge is growing very narrow and treacherous, and falls off almost -vertically. You could go down, but you won't be able to climb back. -#212 -You are standing in a telephone booth at the side of the Repository. -#213 -You're at the east end of a level passage at a hole in the floor. -#214 -You're at the north edge of a dark cove. -#215 -You are in a dry granite basin, worn smooth eons ago by water -swirling down from a now-dry spillway. -#216 -You're in a dry spillway east of and above a smooth rock basin. -#217 -You are in the Winery, a cool dark room which extends some -distance off to the east. -#218 -You are to the east of the Winery, where the room ends in a thicket -of high, sharp, pointed, climbable limestone pinnacles. There is a -narrow ledge just above the top of the spires. If you go up, it -might be difficult to get back down. -#219 -You are in a high-vaulted cavern whose roof rises over fifty -meters to culminate in a series of pointed arches directly over -your head. There are also two low arches to either side, forming -side portals. The whole effect is that of a gothic cathedral. -You can proceed north, south, east, or west. -#220 -You're at the east portal of the Gothic Cathedral. The path leads -east and west. -#221 -You're at the west portal of the Gothic Cathedral. -#222 -You are at the foot of the Altar, an immense, broad stalagmite. -An opening leads south. -#223 -You're on top of an enormous, broad stalagmite. There is a hole -in the ceiling overhead. -#224 -You are in a room the size and shape of a small crypt. A narrow -cut exits east. There is a hole in the floor. -#225 -You are in the Gothic Chapel, a small chamber adjoining the Gothic -Cathedral. A path leads west. -#226 -You are on the floor of the Rainbow Room. In fact, you are spread -*ALL OVER* the floor of the Rainbow Room. -#227 -You are in a dimly lit passage behind Thunder Hole. Etched into -the rock wall are the ominous words: -* "You are approaching the River Styx. * -* Laciate Ogni Speranza Voi Ch'Entrate." * -#228 -You are at the River Styx, a narrow little stream cutting directly -across the passageway. The edge of the stream is littered with sticks -and other debris washed in by a recent rainfall. On the far side -of the river, the passage continues east. -#229 -You're on the east side of the river's sticks. -#230 -You are on a ledge at the northern end of a long N/S crawl. The -ledge is above a large number of sharp vertical limestone spires. -An attempt to climb down could be dangerous, if you get my *point*! -#231 -You are very neatly skewered on the point of a sharp rock. -#232 -You have poled your boat across the calm water. -#233 -You have poled your boat across the dark water. -#234 -You have poled your boat across the Blue Grotto. -#235 -You're at Dante's Rest, on the north side of a yawning dark chasm. -A passage continues west along the chasm's edge. -#236 -You are at the east end of a river bank path in Lost River Canyon. -#237 -The staircase is now unclimbable. -#238 -You're in the caretaker's pantry. -#239 -You are on a small rise overlooking a beautiful bay. In the center -of the bay is the castle of the elves. -#240 -You are on the highest pinnacle of the castle in the bay. -Steps lead down into the garden. -#241 -You are in the outer courtyard of the garden of the elves. -Steps lead up to the tower, and to the west, separating you -from the inner courtyard, is a maze of hedges, living things, -but almost crystalline in their multicolored splendor. -#242 -From the inside the maze looks like a kaleidoscope, with -swatches of color dancing as you move. In this part the colors -are produced by shining red berries on the branches. -#243 -You are surrounded by a tall hedge with sharp iridescent leaves -and metallic orange flowers. -#244 -You are in the center of the living maze. The plants here are -dormant this season, but still carry brilliant yellow leaves. -#245 -Unlike the other areas of the hedge system, this area seems to -have no metallic gleam; nevertheless it is still breathtaking. -The trees and bushes are all variegated shades of green, the -evergreens being a rich dark shade while the seasonal bushes -are a lighter yellowish green, making a startling contrast. -#246 -You are near the edge of the maze. You sample the blueberries -on the bushes. They are delicious. -#247 -You are at the western end of the living maze. Beside the -shrubs forming the walls are tastefully planted beds of -violets and brilliant purple pansies. -To the west is the inner garden. -#248 -You are in the inner garden of the elves. In the center is -a living tree, with shimmering silvery bark, glistening metallic -green leaves, and flowers ripe with nectar. As the nectar falls -to the ground it forms droplets of silver. Around the tree is -a hedge of briars which cannot be crossed. Unfortunately for -adventurers such as you, most of the nectar falls inside the hedge. -The exit is to the east. diff --git a/commands/advent/advent2.txt b/commands/advent/advent2.txt deleted file mode 100644 index 5480fc9a1..000000000 --- a/commands/advent/advent2.txt +++ /dev/null @@ -1,514 +0,0 @@ -#1 -You're at end of road again. -#2 -You're at hill in road. -#3 -You're inside building. -#4 -You're in valley. -#5 -You're in forest. -#6 -You're in forest. -#7 -You're at slit in streambed. -#8 -You're outside grate. -#9 -You're below the grate. -#10 -You're in cobble crawl. -#11 -You're in Debris Room. -#12 -You are in an awkward sloping east/west canyon. -#13 -You're in Bird Chamber. -#14 -You're at top of small pit. -#15 -You're in Hall of Mists. -#16 -The crack is far too small for you to follow. -#17 -You're on east bank of fissure. -#18 -You're in Nugget of Gold Room. -#19 -You're in Hall of Mt King. -#20 -You are at the bottom of the pit with a broken neck. -#21 -You didn't make it. -#22 -The dome is unclimbable. -#23 -You're at west end of Twopit Room. -#24 -You're in east pit. -#25 -You're in west pit. -#26 -You clamber up the plant and scurry through the hole at the top. -#27 -You are on the west side of the fissure in the Hall of Mists. -#28 -You are in a low N/S passage at a hole in the floor. The hole goes -down to an E/W passage. -#29 -You are in the South Side Chamber. -#30 -You are in the West Side Chamber of the Hall of the Mountain King. -#31 -<$$< -#32 -You can't get by the snake. -#33 -You're at "Y2". -#34 -You are in a jumble of rock, with cracks everywhere. -#35 -You're at window on pit. -#36 -You're in dirty passage. -#37 -You are on the brink of a small clean climbable pit. -#38 -You are in the bottom of a small pit with a little stream. -#39 -You're in dusty rock room. -#40 -You have crawled through a very low wide passage parallel. -#41 -You're at west end of Hall of Mists. -#42 -You are in a maze of twisty little passages, all alike. -#43 -You are in a maze of twisty little passages, all alike. -#44 -You are in a maze of twisty little passages, all alike. -#45 -You are in a maze of twisty little passages, all alike. -#46 -Dead end. -#47 -Dead end. -#48 -Dead end. -#49 -You are in a maze of twisty little passages, all alike. -#50 -You are in a maze of twisty little passages, all alike. -#51 -You are in a maze of twisty little passages, all alike. -#52 -You are in a maze of twisty little passages, all alike. -#53 -You are in a maze of twisty little passages, all alike. -#54 -Dead end. -#55 -You are in a maze of twisty little passages, all alike. -#56 -Dead end. -#57 -You're at brink of pit. -#58 -Dead end. -#59 -You have crawled through a very low wide passage. -#60 -You're at east end of Long Hall. -#61 -You're at west end of Long Hall. -#62 -You are at a crossover of a high N/S passage and a low E/W one. -#63 -Dead end. -#64 -You're at Complex Junction. -#65 -You are in Bedquilt. -#66 -You're in Swiss Cheese Room. -#67 -You're at east end of Twopit Room. -#68 -You're in Slab Room. -#69 -You are in a secret N/S canyon above a large room. -#70 -You are in a secret N/S canyon above a sizable passage. -#71 -You're at junction of three secret canyons. -#72 -You are in a large low room. Crawls lead north, NE, and SW. -#73 -Dead end crawl. -#74 -You're in secret E/W canyon above tight canyon. -#75 -You are at a wide place in a very tight N/S canyon. -#76 -The canyon here becomes too tight to go further south. -#77 -You are in a tall E/W canyon. -#78 -The canyon runs into a mass of boulders -- dead end. -#79 -The stream flows out through a pair of 1 foot diameter sewer pipes. -#80 -You are in a maze of twisty little passages, all alike. -#81 -Dead end. -#82 -Dead end. -#83 -You are in a maze of twisty little passages, all alike. -#84 -You are in a maze of twisty little passages, all alike. -#85 -Dead end. -#86 -Dead end. -#87 -You are in a maze of twisty little passages, all alike. -#88 -You're in narrow corridor. -#89 -There is nothing here to climb. Use "up" or "out" to leave the pit. -#90 -You have climbed up the plant and out of the pit. -#91 -You're at steep incline above large room. -#92 -You're in Giant Room. -#93 -The passage here is blocked by a recent cave-in. -#94 -You are at one end of an immense north/south passage. -#95 -You're in cavern with waterfall. -#96 -You're in Soft Room. -#97 -You're in Oriental Room. -#98 -You're in Misty Cavern. -#99 -You're in Alcove. -#100 -You're in Plover Room. -#101 -You're in Dark-Room. -#102 -You're in Arched Hall. -#103 -You're in Shell Room. -#104 -You are in a long sloping corridor with ragged sharp walls. -#105 -You are in a cul-de-sac about eight feet across. -#106 -You're in Anteroom. -#107 -You are in a maze of twisty little passages, all different. -#108 -You're at Witt's End. -#109 -You're in Mirror Canyon. -#110 -You're at window on pit. -#111 -You're at top of stalactite. -#112 -You are in a little maze of twisting passages, all different. -#113 -You're at Reservoir. -#114 -Dead end. -#115 -You're at NE end. -#116 -You're at SW end. -#117 -You're on SW side of chasm. -#118 -You're in sloping corridor. -#119 -You are in a secret canyon which exits to the north and east. -#120 -You are in a secret canyon which exits to the north and east. -#121 -You are in a secret canyon which exits to the north and east. -#122 -You're on NE side of chasm. -#123 -You're in corridor. -#124 -You're at fork in path. -#125 -You're at junction with warm walls. -#126 -You're at breath-taking view. -#127 -You're in Chamber of Boulders. -#128 -You're in Limestone Passage. -#129 -You're in front of Barren Room. -#130 -You're in Barren Room. -#131 -You are in a maze of twisting little passages, all different. -#132 -You are in a little maze of twisty passages, all different. -#133 -You are in a twisting maze of little passages, all different. -#134 -You are in a twisting little maze of passages, all different. -#135 -You are in a twisty little maze of passages, all different. -#136 -You are in a twisty maze of little passages, all different. -#137 -You are in a little twisty maze of passages, all different. -#138 -You are in a maze of little twisting passages, all different. -#139 -You are in a maze of little twisty passages, all different. -#140 -Dead end. -#141 -You're at Sword Point. -#142 -You're at top of slide. -#143 -You're at entrance to Throne Room. -#144 -You're on east side of Throne Room. -#145 -<$$< -#146 -You're in forest. -#147 -You're on grassy knoll. -#148 -You are at the edge of a trackless salt marsh. Tall reeds obscure -the view. -#149 -You're in salt marsh. -#150 -You're in salty marsh. -#151 -You are in salt marsh. -#152 -Dead end. -#153 -You're on sandy beach. -#154 -You're at broken rocks. -#155 -You're at Ocean Vista. -#156 -You're at the bottom of the cliff. -#157 -You're at Thunder Hole. -#158 -You're at top of steps in back of Thunder Hole. -#159 -You're in cramped chamber. -#160 -You're at ledge by wrought-iron door. -#161 -You feel dizzy...Everything around you is spinning, expanding, -growing larger.... Dear me! Is the cave bigger or are you smaller? -#162 -You are again overcome by a sickening vertigo, but this time -everything around you is shrinking...Shrinking... -#163 -You are again overcome by a sickening vertigo, but this time -everything is shrinking... I mean, you are growing. This is -terribly confusing! -#164 -You feel dizzy...Everything around you is spinning, expanding, -growing larger.... -#165 -You're at the bottom of the cliff with a broken neck. -#166 -You're at west wall of Blue Grotto. -#167 -You're at underground sea. -#168 -You're on east side of the Blue Grotto. -#169 -You're in Bubble Chamber. -#170 -You are in a windy tunnel between two large rooms. -#171 -You're in Bat Cave. -#172 -You are in a very tight N/S crack. -#173 -You are in a very tight N/S crack. -#174 -You're in the Cloakroom. -#175 -You're in a room containing several small climbable pits. -#176 -You are at the bottom of a small featureless pit. -#177 -You are at a high hole in a rock wall. -#178 -The NE passage is blocked by a recent cave-in. -#179 -You are in a sloping muddy defile, next to a tumbling brook. -#180 -You're at Tongue of Rock. -#181 -The dog won't let you pass. -#182 -You're in the Upper Passage, a long level E/W tunnel. -#183 -You're in Star Chamber. -#184 -You are at an elbow in a winding E/W passage. -#185 -Dead end. -#186 -You're at the intersection of two long tunnels. -#187 -You're in a long narrow east-west passage. -#188 -You're in Rotunda. -#189 -You're in phone booth. -#190 -You're at Devil's Chair. -#191 -You're in a dead-end crack. -#192 -You're on gravel beach. -#193 -You're in Flower Room. -#194 -You are at east end of short E/W corridor. -#195 -You are at east end of short E/W corridor. -#196 -You're in Arched Hall. -#197 -You're in the Vestibule, a short east-west passage between two rooms. -#198 -You're in the Fairy Grotto. -#199 -You have approached the lower end of a steep passage. -#200 -You're in the Crystal Palace. -#201 -You are following a yellow sandstone path. -#202 -You're in the Rainbow Room. -#203 -You're in a steeply sloping passage. It is very cold here. -#204 -You're in the Hall of Ice. -#205 -You are over the Rainbow (Room). -#206 -You're in Green Lake Room. -#207 -You're in red rock crawl. -#208 -You're on south side of Lost River Canyon. -#209 -You're at end of Lost River Canyon. -#210 -You're at niche in ledge above Lost River. -#211 -A very narrow and treacherous ledge. -#212 -You're in phone booth. -#213 -You're at the east end of a level passage at a hole in the floor. -#214 -You're in dark cove. -#215 -You're in dry basin. -#216 -You're in old spillway. -#217 -You're in the Winery. -#218 -You're at limestone pinnacles. -#219 -You're in Gothic Cathedral. -#220 -You're at the east portal of the Gothic Cathedral. -#221 -You're at the west portal of the Gothic Cathedral. -#222 -You are at the foot of the Altar, an immense, broad stalagmite. -#223 -You're on top of stalagmite. -#224 -You're in the Crypt. -#225 -You're in Gothic Chapel. -#226 -You are on the floor of the Rainbow Room. -#227 -You are at approach to River Styx. -#228 -You're at the River Styx. -#229 -You're on the east side of the river's sticks. -#230 -You're on ledge above limestone pinnacles. -#231 -You are very neatly skewered on the point of a sharp rock. -#232 -You have poled your boat across the calm water. -#233 -You have poled your boat across the dark water. -#234 -You have poled your boat across the Blue Grotto. -#235 -You're at Dante's Rest. -#236 -You're at east end of Lost River Canyon. -#237 -The staircase is now unclimbable. -#238 -You're in the caretaker's pantry. -#239 -You're on a small rise over the bay. -#240 -You are on the highest pinnacle of the castle in the bay. -Steps lead down into the garden. -#241 -You are in the outer courtyard of the elves. -#242 -You are in the living maze. There are red berries here. -#243 -You are surrounded by a tall hedge with sharp iridescent leaves -and metallic orange flowers. -#244 -You are in the center of the living maze. The plants here are -dormant this season, but still carry brilliant yellow leaves. -#245 -Unlike the other areas of the hedge system, this area seems to -have no metallic gleam; nevertheless it is still breathtaking. -The trees and bushes are all variegated shades of green, the -evergreens being a rich dark shade while the seasonal bushes -are a lighter yellowish green, making a startling contrast. -#246 -You are near the edge of the maze. You sample the blueberries -on the bushes. They are delicious. -#247 -You are at the western end of the living maze. Beside the -shrubs forming the walls are tastefully planted beds of -violets and brilliant purple pansies. -To the west is the inner garden. -#248 -You're in the inner courtyard of the elves. diff --git a/commands/advent/advent3.txt b/commands/advent/advent3.txt deleted file mode 100644 index b31aca634..000000000 --- a/commands/advent/advent3.txt +++ /dev/null @@ -1,539 +0,0 @@ -#1 -#2 -/Brass lantern -/There is a shiny brass lamp nearby. -/There is a lamp shining nearby. -/ -#3 -/*Grate -/The grate is locked. -/The grate is open. -/ -#4 -/Wicker cage -/There is a small wicker cage discarded nearby. -/ -#5 -/Black rod -/A three foot black rod with a rusty star on an end lies nearby. -/ -#6 -/Black rod -/A three foot black rod with a rusty mark on an end lies nearby. -/ -#7 -/*Steps -/Rough stone steps lead down the pit. -/Rough stone steps lead up the dome. -/ -#8 -#9 -/Wooden pole -/A wooden pole is lying nearby. -/A wooden pole has been stuck in the mud here. -/ -#10 -/Velvet pillow -/A small velvet pillow lies on the floor. -/ -#11 -/*Snake -/A huge green fierce snake bars the way! -/<$$< (Chased away) -/ -#12 -/*Fissure -/<$$< -/A crystal bridge now spans the fissure. -/The crystal bridge has vanished! -/ -#13 -/*Stone tablet -/A massive stone tablet imbedded in the wall reads: -"Congratulations on bringing light into the Dark-Room!" -/ -#14 -/Giant clam >grunt!< -/There is an enormous clam here with its shell tightly closed. -/ -#15 -/Giant oyster >groan!< -/There is an enormous oyster here with its shell tightly closed. -/Interesting. There seems to be something written on the underside of -the oyster. -/ -#16 -/"Spelunker Today" -/There are a few recent issues of "Spelunker Today" magazine here. -/ -#17 -#18 -#19 -/Tasty food -/There is food here. -/ -#20 -/Small bottle -/There is a small bottle here. -/There is an empty bottle here. -/There is a small bottle here. -/There is a broken bottle here. -/There is a small bottle here. -/ -#21 -/*Chasm - troll bridge -/A rickety wooden bridge extends across the chasm, vanishing into the -mist. A sign posted on the bridge reads, "Stop! Pay troll!" -/The wreckage of a bridge (and a dead bear) can be seen at the bottom -of the chasm. -/ -#22 -/*Chasm2 & decrepit natural bridge -/A decrepit natural bridge spans the chasm. A message scrawled into -the rock wall reads: "Bridge out of repair. Maximum load: 35 Foonts." -/The remnants of a natural bridge partially overhang the chasm. -/ -#23 -/*Mirror -/<$$< -/ -#24 -/*plant -/There is a tiny little plant in the pit, murmuring "Water, water, ..." -/The plant spurts into furious growth for a few seconds. -/There is a 12-foot-tall beanstalk stretching up out of the pit, -bellowing "Water!! Water!!" -/The plant grows explosively, almost filling the bottom of the pit. -/There is a gigantic beanstalk stretching all the way up to the hole. -/You've over-watered the plant! It's shriveling up! It's, it's... -/ -#25 -/*Phony plant (seen in twopit room only when tall enough) -/<$$< -/The top of a 12-foot-tall beanstalk is poking out of the west pit. -/There is a huge beanstalk growing out of the west pit up to the hole. -/ -#26 -/*Stalactite -/<$$< -/ -#27 -/*shadowy figure -/The shadowy figure seems to be trying to attract your attention. -/ -#28 -/Dwarf's axe -/There is a little axe here. -/There is a little axe lying beside the bear. -/There is a little axe lying beside the Wumpus. -/There is a little axe lying beside the dog. -/ -#29 -/*Cave drawings -/<$$< -/ -#30 -/*pirate -/<$$< -/ -#31 -/*dragon -/A huge green fierce dragon bars the way! -/Congratulations! You have just vanquished a dragon with your bare -hands! (Unbelievable, isn't it?) -/The body of a huge green dead dragon is lying off to one side. -/ -#32 -#33 -/*Troll -/A burly troll stands by the bridge and insists you throw him a -treasure before you may cross. -/The troll steps out from beneath the bridge and blocks your way. -/<$$< (Chased away) -/ -#34 -/*phony troll -/The troll is nowhere to be seen. -/ -#35 -/<$$< (Bear uses rtext 141) -/There is a ferocious cave bear eying you from the far end of the room! -/There is a gentle cave bear sitting placidly in one corner. -/There is a contented-looking bear wandering about nearby. -/<$$< (Dead) -/ -#36 -/*Message in second maze -/There is a message scrawled in the dust in a flowery script, reading: -"This is not the maze where the pirate leaves his treasure chest." -/ -#37 -/*Volcano and/or geyser -/<$$< -/ -#38 -/*Vending machine -/There is a massive vending machine here. The instructions on it -read: "Insert coins to receive fresh batteries." -/There is a massive vending machine here. -/ -#39 -/Batteries -/There are fresh batteries here. -/Some worn-out batteries have been discarded nearby. -/Some worn-out batteries have been discarded nearby. -/ -#40 -/*Carpet and/or moss -/<$$< -/ -#41 -/*Rusty door -/The way north is barred by a massive, rusty, iron door. -/The way north leads through a massive, rusty, iron door. -/ -#42 -/*Tiny door -/The only way past the wall is through a tiny locked door. -/The only way past the wall is through a tiny open door. -/ -#43 -/*Tiny door-2 -/The door is locked. -/The door is open. -/ -#44 -/*Phone booth door -/<$$< -/ -#45 -#46 -/Beautiful flowers -/There are some beautiful flowers here! -/On the other side of the room a swarm of bees eagerly buzzes over -a bunch of fresh flowers. -/ -#47 -/Silken cloak -/There is a silken cloak here! -/<$$< (wearing cloak) -/A lovely silken cloak lies partially buried under a pile of -loose rocks. -/ -#48 -/Wooden boat -/There is a small wooden boat here. -/You are in a wooden boat. -/ -#49 -/*Sticks at Styx -/<$$< -/ -#50 -/Large gold nugget -/There is a large sparkling nugget of gold here! -/ -#51 -/Several diamonds -/There are diamonds here! -/ -#52 -/Silver horn -/There is a silver horn here! -/ -#53 -/Precious jewelry -/There is precious jewelry here! -/<$$< (wearing jewelry) -/ -#54 -/Rare coins -/There are many coins here! -/ -#55 -/Treasure chest -/The pirate's treasure chest is here! -/ -#56 -/Golden eggs -/There is a large nest here, full of golden eggs! -/The nest of golden eggs has vanished! -/Done! -/ -#57 -/Jeweled trident -/There is a jewel-encrusted trident here! -/ -#58 -/Ming vase -/There is a delicate, precious, ming vase here! -/The vase is now resting, delicately, on a velvet pillow. -/The floor is littered with worthless shards of pottery. -/The ming vase drops with a delicate crash. -/ -#59 -/Egg-sized emerald -/There is an emerald here the size of a plover's egg! -/ -#60 -/Platinum pyramid -/There is a platinum pyramid here, 8 inches on a side! -/ -#61 -/Glistening pearl -/Off to one side lies a glistening pearl! -/ -#62 -/Persian rug -/There is a persian rug spread out on the floor! -/The dragon is sprawled out on a persian rug!! -/ -#63 -/Rare spices -/There are rare spices here! -/ -#64 -/Golden chain -/There is a golden chain lying in a heap on the floor! -/The bear is locked to the wall with a golden chain! -/There is a golden chain locked to the wall! -/ -#65 -/Gleaming sword -/There is a gleaming sword here! -/A gleaming sword is stuck into the anvil! -/You grasp the sword's handle and give a mighty heave, but with a -loud clang the sword blade shatters into several fragments. -/Rusty shards of a elven sword lie scattered about. -/A very clean sword is stuck into the anvil! -/An oily sword is stuck into the anvil. -/ -#66 -/Elfin crown -/An ancient crown of elfin kings lies here! -/<$$< (wearing crown) -/ -#67 -/Ruby slippers -/There is a pair of ruby slippers here. -/<$$< (wearing slippers) -/There is a pair of ruby slippers here. -/ -#68 -/Delicate lyre -/There is a delicate lyre here! -/ -#69 -/Star sapphire -/There is a star sapphire here! -/ -#70 -/Holy Grail -/There is an ornate silver chalice here! -/ -#71 -/Oaken cask -/There is an oaken cask here. -/There is an empty oaken cask here. -/There is an oaken cask here. -/<$$< (Unused) -/There is an oaken cask here. -/ -#72 -/Golden ring -/There is a small gold ring here. -/<$$< (wearing ring) -/On the Wumpus' finger is a small gold ring. -/ -#73 -/Four-leafed clover -/There is a four-leafed clover here! -/<$$< (wearing clover) -/ -#74 -/Gold tree -/There is a gold statue of a tree here. -/ -#75 -/Silver droplet -/There is a single droplet of silver on the ground here. -/ -#76 -#77 -#78 -#79 -#80 -#81 -/Clear water -/ -#82 -/Cool water -/ -#83 -/Thick, black oil -/ -#84 -/Thick, black oil -/ -#85 -/Vintage wine -/ -#86 -/Vintage wine -/ -#87 -/*Bumblebees -/<$$< -/Some bumblebees are swarming around a bunch of fresh flowers. -/ -#88 -/*Hollow wall -/Your footsteps echo hollowly throughout the chamber. -/<$$< -/ -#89 -/*Wall with safe -/A steel safe is embedded in the wall. -/ -#90 -/Tiny brass key -/There is a tiny brass key here. -/There is a tiny brass key on the shelf. -/ -#91 -/*Anvil -/<$$< -/ -#92 -/*rocks on cloak -/<$$< (ON CLOAK) -/<$$< (AFTER ROCK SLIDE) -/ -#93 -/*telephone booth -/The telephone booth is empty. - -The phone is ringing. -/The phone booth is occupied by a gnome. He is talking excitedly -to someone at the other end. -/The telephone booth is empty. -/<$$< -/ -#94 -/*Telephone -/The phone is ringing. -/The telephone is out of order. -/The telephone is out of order. It is badly dented. -/<$$< -/ -#95 -/Lead slugs -/There are some lead slugs here! -/ -#96 -/Sweet honeycomb -/There is a sweet honeycomb here! -/ -#97 -/*Beehive -/There is an active beehive nearby. The bees hum protectively -around the hive. -/There is an empty beehive nearby. -/ -#98 -/*Black dog -/A hideous black dog bares his teeth and growls at your approach. -/Nearby, a large black dog is in a deep slumber. -/ -#99 -/*Dreaded Wumpus -/In the corner, a Wumpus is sleeping peacefully. -/A sleepy Wumpus is ambling towards you. He wants to invite you to -dinner. He wants you to *be* the dinner! -/The Wumpus is still on your trail! And he's getting closer!! -/The Wumpus is only a few steps behind you! All this exercise is -making him veerrrrry hungry! -/The Wumpus almost has you in his grasp! You can feel his hot breath -on your neck! -/"Chomp, chomp." Crunch! Chew! Slurp! Smack! Yum!!! -/Nearby is the smashed body of a defunct Wumpus. -/ -#100 -#101 -/Little bird in cage -/A cheerful little bird is sitting here singing. -/There is a little bird in the cage. -/ -#102 -/Set of keys -/There are some keys on the ground here. -/ -#103 -/*Fountain -/There is a fountain of sparkling vintage wine here! -/ -#104 -/*Bats & guano in bat-cave -/<$$< -/ -#105 -/*gnome in phone booth -/<$$< -/ -#106 -/Colored mushrooms -/There are some oddly-colored mushrooms here. -/ -#107 -/Tiny cakes -/There are some tiny cakes on the shelf. -/ -#108 -/Leather Sack -/There is a leather sack here. -/ -#109 -#110 -/Rare book -/There is a dusty, leather-bound volume here. -/ -#111 -/Rare book -/There is a dusty, leather-bound volume here. -/ -#112 -/Steel wall-safe -/The safe door is locked. -/The safe door is open. -/ -#113 -/Faded poster -/Taped to the wall is a faded poster. -/There is a faded poster here. -/ -#114 -/Whiskbroom -/There is a small whiskbroom here. -/ -#115 -/*Carving on dusty rocks -/<$$< -/<$$< -/ -#116 -/*Billboard -/ -/ -#117 -#118 -/Small metal canister -/There is a heavy, grey, metal canister here. -/ -#119 -/Glowing stone -/Nearby, a strange, greenish stone is glowing brightly. -/ -#120 -/Quartz sphere -/There is a polished sphere of pure quartz here! -/ diff --git a/commands/advent/advent4.txt b/commands/advent/advent4.txt deleted file mode 100644 index 0900374fb..000000000 --- a/commands/advent/advent4.txt +++ /dev/null @@ -1,1068 +0,0 @@ -#1 -Somewhere nearby is Colossal Cave, where others have found fortunes in -treasure and gold, though it is rumored that some who enter are never -seen again. Magic is said to work in the cave. I will be your eyes -and hands. Direct me with natural English commands. I should warn -you that I look at all the letters of each word. Also you -should enter "Northeast" as "NE" to distinguish it from "North". -(Should you get stuck, type "HELP" or "?" for some general hints.) -Good Luck! -- - - - -#2 -A little dwarf with a big knife blocks your way. -#3 -A little dwarf just walked around a corner, saw you, threw a little -axe at you which missed, cursed, and ran away. -#4 -There is a threatening little dwarf in the room with you! -#5 -One sharp nasty knife is thrown at you! -#6 -None of them hit you! -#7 -One of them gets you! -#8 -A hollow voice says "Plugh". -#9 -There is no way to go that direction. -#10 -I am unsure how you are facing. Use compass points or nearby objects. -#11 -I don't know in from out here. Use compass points or name something -in the general direction you want to go. -#12 -I don't know how to apply that word here. -#13 -I don't understand that! -#14 -I'm game. Would you care to explain how? -#15 -Sorry, but I am not allowed to give more detail. I will repeat the -long description of your location. -#16 -It is now pitch dark. If you proceed you will likely fall into a pit. -#17 -If you prefer, simply type "W" rather than "West". -#18 -Are you trying to catch the bird? -#19 -The bird is frightened right now and you cannot catch it no matter -what you try. Perhaps you might try later. -#20 -Are you trying to somehow deal with the snake? -#21 -You can't kill the snake, or drive it away, or avoid it, or anything -like that. There is a way to get by, but you don't have the necessary -resources right now. -#22 -Do you really want to quit now? -#23 -You fell into a pit and broke every bone in your body! -#24 -You are already carrying it! -#25 -You can't be serious! -#26 -The bird was unafraid when you entered, but as you approach it becomes -disturbed and you cannot catch it. -#27 -You can catch the bird, but you cannot carry it. -#28 -There is nothing here with a lock! -#29 -You aren't carrying it! -#30 -The little bird attacks the green snake, and in an astounding flurry -drives the snake away. -#31 -You have no keys! -#32 -It has no lock. -#33 -I don't know how to lock or unlock such a thing. -#34 -It was already locked. -#35 -The grate is now locked. -#36 -The grate is now unlocked. -#37 -It was already unlocked. -#38 -You have no source of light. -#39 -Your lamp is now on. -#40 -Your lamp is now off. -#41 -There is no way to get past the bear to unlock the chain, which is -probably just as well. -#42 -Nothing happens. -#43 -Where? -#44 -There is nothing here to attack. -#45 -The little bird is now dead. Its body disappears. -#46 -Attacking the snake both doesn't work and is very dangerous. -#47 -You killed a little dwarf. -#48 -You attack a little dwarf, but he dodges out of the way. -#49 -With what? Your bare hands? -#50 -Good try, but that is an old worn-out magic word. -#51 -To move, try words like FOREST, BUILDING, DOWNSTREAM, IN, EAST, NORTH, -UP, OR DOWN. Saying a place name may take you there, as may some -magic words. You can say TAKE LAMP or DROP LAMP or PUT LAMP IN SACK. -Some objects have side effects; for instance, the rod scares the bird. -You can take or drop multiple objects by saying TAKE BOOK AND LAMP, -etc. To list what you are currently holding, say INVENTORY, or just I. -To reprint the detailed description of where you are, say LOOK -or L. You can also LOOK IN or LOOK AT appropriate objects. Other -useful commands are HEALTH, QUIT, SCORE, BRIEF, TERSE, UNBRIEF, -UNTERSE, SAVE, and RESTORE. The latter two save or restore your -current position. To get full credit for a treasure, you must have -left it **safely** in the building. Some non-treasure items are best -left near where you find them. There are clues for various problems -lying about the cave: look and listen. If you seem to have found -all the treasures, keep looking around a while, something else -may happen to you (for a bonus!) -(The word "give" doesn't exist, but you can say FEED BONE TO DOG or -THROW BONE AT DOG. Also, you can use conveyances or animals(!) -by TAKEing and DROPing them.) -#52 -It misses! -#53 -It gets you! -#54 -Ok -#55 -You can't unlock the keys. -#56 -You have crawled around in some little holes and wound up back in the -main passage. -#57 -I don't know where the cave is, but hereabouts no stream can run on -the surface for long. I would try the stream. -#58 -I need more detailed instructions to do that. -#59 -I can only tell you what you see as you move about and manipulate -things. I cannot tell you where remote things are. -#60 -I can't make any sense out of that. -#61 -What? -#62 -Are you trying to get into the cave? -#63 -The grate is very solid and has a hardened steel lock. You cannot -enter without a key, and there are no keys nearby. I would recommend -looking elsewhere for the keys. -#64 -The trees of the forest are large hardwood oak and maple, with an -occasional grove of pine or spruce. There is quite a bit of under- -growth, largely birch and ash saplings plus nondescript bushes of -various sorts. This time of year visibility is quite restricted by -all the leaves, but travel is quite easy if you detour around the -spruce and berry bushes. -#65 - - - Welcome to ADVENTURE! - - - Original development by Willie Crowther. - - Conversion to BDS C by J. R. Jaeger - - Unix standardization by Jerry D. Pohl. - - Upgraded to version 6.6 by Robert R. Hall. - - - Would you like instructions? - -#66 -Digging without a shovel is quite impractical. Even with a shovel -progress is unlikely. -#67 -Blasting requires dynamite. -#68 -I'm as confused as you are. -#69 -Mist is a white vapor, usually water, seen from time to time in -caverns. It can be found anywhere but is frequently a sign of a deep -pit leading down to water. -#70 -Your feet are now wet. -#71 -I think I just lost my appetite. -#72 -Thank you, it was delicious! -#73 -You have taken a drink from the stream. The water tastes strongly of -minerals, but is not unpleasant. It is extremely cold. -#74 -The bottle is now empty. -#75 -Rubbing the electric lamp is not particularly rewarding. Anyway, -nothing exciting happens. -#76 -Peculiar. Nothing unexpected happens. -#77 -Your bottle is empty and the ground is wet. -#78 -You can't pour that. -#79 -Watch it! -#80 -Which way? -#81 -Oh dear, you seem to have gotten yourself killed. I might be able to -help you out, but I've never really done this before. Do you want me -to try to reincarnate you? -#82 -All right. But don't blame me if something goes wr...... -* --- POOF!! --- * -You are engulfed in a cloud of orange smoke. Coughing and gasping, -you emerge from the smoke and find.... - -#83 -You clumsy oaf, you've done it again! I don't know how long I can -keep this up. Do you want me to try reincarnating you again? -#84 -Okay, now where did I put my orange smoke?.... >POOF!< -Everything disappears in a dense cloud of orange smoke. - -#85 -Now you've really done it! I'm out of orange smoke! You don't expect -me to do a decent reincarnation without any orange smoke, do you? -#86 -Okay, if you're so smart, do it yourself! I'm leaving! -#87 -#88 -#89 -#90 ->>> Messages 81 thru 90 are reserved for "Obituaries". <<< -#91 -Sorry, but I no longer seem to remember how it was you got here. -#92 -It's too heavy. You'll have to drop something first. -#93 -You can't go through a locked steel grate! -#94 -I believe what you want is right here with you. -#95 -You don't fit through a two-inch slit! -#96 -I respectfully suggest you go across the bridge instead of jumping. -#97 -There is no way across the fissure. -#98 -You're not carrying anything. -#99 -You are currently holding the following: -#100 -It's not hungry (it's merely pining' for the fjords). Besides, you -have no bird seed. -#101 -The snake has now devoured your bird. -#102 -There's nothing here it wants to eat (except perhaps you). -#103 -You fool, dwarves eat only coal! Now you've made him *REALLY* mad!! -#104 -Your cask is empty and the ground is soaked. -#105 -You aren't carrying them! -#106 -I don't need to, thank you. -#107 -The ground is wet and the air is smelly. -#108 -Your lamp is now on, but the glare from the walls is absolutely -blinding. If you proceed you are likely to fall into a pit. -#109 -You haven't any matches. -#110 -Don't be ridiculous! -#111 -The door is extremely rusty and refuses to open. -#112 -The plant indignantly shakes dry its leaves and asks, "Water?" -#113 -The hinges are quite thoroughly rusted now and won't budge. -#114 -The oil has freed up the hinges so that the door will now move, -although it requires some effort. -#115 -The plant has exceptionally deep roots and cannot be pulled free. -#116 -The dwarves' knives vanish as they strike the walls of the cave. -#117 -Something you're carrying won't fit through the tunnel with you. -You'd best take inventory and drop something. -#118 -You can't fit this five-foot clam through that little passage! -#119 -You can't fit this five-foot oyster through that little passage! -#120 -I advise you to put down the clam before opening it. >Strain!< -#121 -I advise you to put down the oyster before opening it. >Wrench!< -#122 -You don't have anything strong enough to open the clam. -#123 -You don't have anything strong enough to open the oyster. -#124 -A glistening pearl falls out of the clam and rolls away. Goodness, -this must really be an oyster. (I never was very good at identifying -bivalves.) Whatever it is, it has now snapped shut again. -#125 -The oyster creaks open, revealing nothing but oyster inside. It -promptly snaps shut again. -#126 -You have crawled around in some little holes and found your way -blocked by a recent cave-in. You are now back in the main passage. -#127 -There are faint rustling noises from the darkness behind you. -#128 -Out from the shadows behind you pounces a bearded pirate! "Har, har," -he chortles, "I'll just take all this booty and hide it away with me -chest deep in the maze!" He snatches your treasure and vanishes into -the gloom. -#129 -A sepulchral voice reverberating through the cave, says, "Cave closing -soon. All adventurers exit immediately through Main Office." -#130 -A mysterious recorded voice groans into life and announces: - "This exit is closed. Please leave via Main Office." - -#131 -It looks as though you're dead. Well, seeing as how it's so close to -closing time anyway, I think we'll just call it a day. - -#132 -The sepulchral voice intones, "The cave is now closed." As the echoes -fade, there is a blinding flash of light (and a small puff of orange -smoke). . . . As your eyes refocus, you look around and find... - -#133 -There is a loud explosion, and a twenty-foot hole appears in the far -wall, burying the dwarves in the rubble. You march through the hole -and find yourself in the Main Office, where a cheering band of -friendly elves carry the conquering adventurer off into the sunset. - -#134 -There is a loud explosion, and a twenty-foot hole appears in the far -wall, burying the snakes in the rubble. A river of molten lava pours -in through the hole, destroying everything in its path, including you! - -#135 -There is a loud explosion, and you are suddenly splashed across the -walls of the room. - -#136 -The resulting ruckus has awakened the dwarves. There are now several -threatening little dwarves in the room with you! Most of them throw -knives at you! All of them get you! - -#137 -Oh, leave the poor unhappy bird alone. -#138 -I dare say whatever you want is around here somewhere. -#139 -I'm not sure what you mean by "Stop". Use "Quit" if you want to give -up. -#140 -You can't get there from here. -#141 -You are being followed by a very large, tame bear. -#142 -- *** THE HISTORY OF ADVENTURE (ABRIDGED) *** - -- ** By Ima Wimp ** - -ADVENTURE was originally developed by William Crowther, and later -substantially rewritten and expanded by Don Woods at Stanford Univ. -According to legend, Crowther's original version was modelled on an -a real cavern, called Colossal Cave, which is a part of Kentucky's -Mammoth Caverns. That version of the game included the main maze -and a portion of the third-level (Complex Junction - Bedquilt - -Swiss Cheese rooms, etc.), but not much more. -Don Woods and some others at Stanford later rewrote portions of -the original program, and greatly expanded the cave. That version -of the game is recognizable by the maximum score of 350 points. -Some major additions were done by David Long while at the University -of Chicago, Graduate School of Business. Long's additions include the -seaside entrance and all of the cave on the "far side" of Lost River -(Rainbow Room - Crystal Palace - Blue Grotto, etc.). -The castle problem was added in late 1984 by an anonymous writer. -Thanks are owed to Roger Matus and David Feldman, both of U. of C., -for several suggestions, including the Rainbow Room, the telephone -booth and the fearsome Wumpus. Most thanks (and apologies) -go to Thomas Malory, Charles Dodgson, the Grimm Brothers, Dante, -Homer, Frank Baum and especially Anon., the real authors of ADVENTURE. -#143 -Do you indeed wish to quit now? -#144 -There is nothing here with which to fill the vase. -#145 -The sudden change in temperature has delicately shattered the vase. -#146 -It is beyond your power to do that. -#147 -I don't know how. -#148 -It is too far up for you to reach. -#149 -You killed a little dwarf. The body vanishes in a cloud of greasy -black smoke. -#150 -The shell is very strong and is impervious to attack. -#151 -What's the matter, can't you read? Now you'd best start over. -#152 -The axe bounces harmlessly off the dragon's thick scales. -#153 -The dragon looks rather nasty. You'd best not try to get by. -#154 -The little bird attacks the green dragon, and in an astounding flurry -gets burnt to a cinder. The ashes blow away. -#155 -On what? -#156 -Okay, from now on I'll only describe a place in full the first time -you come to it. To get the full description, say "LOOK". -#157 -Trolls are close relatives with the rocks and have skin as tough as -that of a rhinoceros. The troll fends off your blows effortlessly. -#158 -The troll deftly catches the axe, examines it carefully, and tosses it -back, declaring, "Good workmanship, but it's not valuable enough." -#159 -The troll catches your treasure and scurries away out of sight. -#160 -The troll refuses to let you cross. -#161 -There is no longer any way across the chasm. -#162 -Just as you reach the other side, the bridge buckles beneath the -weight of the bear, which was still following you around. You -scrabble desperately for support, but as the bridge collapses you -stumble back and fall into the chasm. -#163 -The bear lumbers toward the troll, who lets out a startled shriek and -scurries away. The bear soon gives up the pursuit and wanders back. -#164 -The axe misses and lands near the bear where you can't get at it. -#165 -With what? Your bare hands? Against *HIS* bear hands?? -#166 -The bear is confused; he only wants to be your friend. -#167 -For crying out loud, the poor thing is already dead! -#168 -The bear eagerly licks up the honeycomb, after which he seems to calm -down considerably and even becomes rather friendly. -#169 -The bear is still chained to the wall. -#170 -The chain is still locked. -#171 -The chain is now unlocked. -#172 -The chain is now locked. -#173 -There is nothing here to which the chain can be locked. -#174 -There is nothing here to eat. -#175 -Do you want the hint? -#176 -Do you need help getting out of the maze? -#177 -You can make the passages look less alike by dropping things. -#178 -Are you trying to explore beyond the Plover Room? -#179 -There is a way to explore that region without having to worry about -falling into a pit. None of the objects available is immediately -useful in discovering the secret. -#180 -Do you need help getting out of here? -#181 -Don't go west. -#182 -Gluttony is not one of the troll's vices. Avarice, however, is. -#183 -Your lamp is getting dim. You'd best start wrapping this up, unless -you can find some fresh batteries. I seem to recall there's a vending -machine in the maze. Bring some coins with you. -#184 -Your lamp has run out of power. -#185 -There's not much point in wandering around out here, and you can't -explore the cave without a lamp. So let's just call it a day. -#186 -There are faint rustling noises from the darkness behind you. As you -turn toward them, the beam of your lamp falls across a bearded pirate. -He is carrying a large chest. "Shiver me timbers!", he cries, "I've -been spotted! I'd best hie meself off to the maze to hide me chest!" -With that, he vanishes into the gloom. -#187 -Your lamp is getting dim. You'd best replace those batteries. -#188 -Your lamp is now shining with renewed strength. -#189 -Your lamp is getting dim, and you haven't any more coins. You'd -best start wrapping this up. -#190 -I'm afraid the magazine is written in dwarvish. -#191 -"This is not the maze where the pirate leaves his treasure chest." -#192 -Hmmm, this looks like a clue, which means it'll cost you 10 points to -read it. Should I go ahead and read it anyway? -#193 -It says, "Not all black rods are magic wands. Some are useful for -other cave construction purposes. There might be some around here." -#194 -It says the same thing it did before. -#195 -I'm afraid I don't understand. -#196 -"Congratulations on bringing light into the dark-room!" -#197 -You strike the mirror a resounding blow, whereupon it shatters into a -myriad tiny fragments. -#198 -You have taken the vase and hurled it delicately to the ground. -#199 -You prod the nearest dwarf, who wakes up grumpily, takes one look at -you, curses, and grabs for his axe. -#200 -Is this acceptable? -#201 -There's no point in suspending a demonstration game. -#202 -You managed to climb about halfway up before losing your hold and -sliding back. -#203 -You were only a few yards from the top when you slipped and tumbled -all the way back down. -#204 -Ok, ok. No need to be grabby. -#205 -Pulling an angry bear around is a good way to get your arm ripped off. -#206 -The sword is now very clean. -#207 -The sword is now covered with oil. -#208 -The handle is now too slippery to grasp. -#209 -You have no scabbard! -#210 -You are already wearing it! -#211 -Do you want to extract the sword from the anvil? -#212 -If you could convince me of your royal blood, you might get somewhere. -#213 -Are you trying to go up the slide? -#214 -Maybe you'd better look for another way into the cave. -#215 -You grasp the sword's handle and pull, but the sword won't budge. -Do you want to try yanking it out? -#216 -A tiny elf runs straight at you, shouts "Phuce!", and -disappears into the forest. -#217 -You can't swim. You'd best go by boat. -#218 -The boat's oars were stolen by the dwarves to play bing-bong. -(That's dwarvish ping-pong -- with rocks!). You have no way -to propel the boat. -#219 -You are still in the boat. It is too heavy to carry. -#220 -You had better leave the boat first. -#221 -You are now sitting in a small boat. -#222 -You couldn't possibly cross this sea without a large ship. -#223 -The cliff is unscalable. -#224 -Your keys are all too large for the lock. -#225 -The wall is too smooth to climb. -#226 -The shelf is beyond your reach. -#227 -You are already wearing them! -#228 -You thought maybe these were peyote?? You feel a little dizzy, -but nothing happens. -#229 -You are growing taller, expanding like a telescope! Just before -your head strikes the top of the chamber, the mysterious process -stops as suddenly as it began. -#230 -You are closing up like an accordion....shrinking..shrinking. You -are now your normal size. -#231 -You have smashed your bottle all over the ground. -#232 -You are now too big to leave the way you came in. -#233 -This is obviously an elfin entrance. Unless you can squeeze -yourself through a six-inch door, you'll have to find another -way into the cave. -#234 -The wrought-iron door is now locked. -#235 -The tiny door is now locked. -#236 -The wrought-iron door is now unlocked. -#237 -The tiny door is now unlocked. -#238 -You are blocked by the wrought-iron door. -#239 -<$$< -#240 -The Wumpus looks at the food with distaste. He looks at *YOU* with -relish! -#241 -You have jerked the cloak free of the rocks. However, in doing -so you have caused a small rock slide, blocking the entrance -and making an unholy din. -#242 -The cloak is stuck tight under the rocks. You'll probably have to -yank it out. -#243 -The Wumpus grabs the axe, stops and picks his teeth with it for a few -moments while looking thoughtfully at you. When he finishes picking -his teeth, he eats the axe, belches, farts... and starts after -you again! -#244 -As the bridge disappears, the Wumpus scrambles frantically to reach -your side of the fissure. He misses by inches, and with a horrible -shriek plunges to his death in the depths of the fissure! -#245 -You can't even hit a sleeping Wumpus! The axe is now lying too near -the Wumpus for you to retrieve it. -#246 -The Wumpus is between you and the axe. You can't reach it. -#247 -You can't fit through a six-inch door! -#248 -The dog easily dodges the axe, which lands beyond him where you can't -get at it. -#249 -The dog woofs (natch) down the food and looks around hungrily for -more. However, he does not appear to be any better disposed towards -your presence. -#250 -You've got to be kidding! -#251 -It's attached to the wall! -#252 -You can't put a thing into itself! -#253 -The gnome firmly blocks the door of the booth. You can't enter. -#254 -The constant ringing has awakened the dwarves! -There are now several threatening little dwarves in the room with -you! Most of them throw knives at you! All of them get you! -#255 -The telephone is out of order. -#256 -The telephone is out of order and your hand is sore. -#257 -A couple of lead slugs drop from the coin box. (Gnomes are -notoriously cheap....) But you've broken the phone beyond -all hope. -#258 -He wants treasure, not gab. -#259 -He didn't say anything! -#260 -It isn't a parrot. He didn't say anything. -#261 -No one replies. The line goes dead with a faint "Click". -#262 -I think you are a little confused! -#263 -As you move towards the phone booth, a gnome suddenly streaks -around the corner, jumps into the booth and rudely slams the door -in your face. You can't get in. -#264 -He isn't hungry. -#265 -As the blast of the horn reverberates through the chamber, the -seemingly solid rock wall crumbles away, revealing another room just -beyond. The wall was most likely worn thin by an ancient watercourse -which dried up just before completely wearing away the rock. -#266 -The chamber reverberates to the blast of the horn. -(Satchmo you ain't!) -#267 -The bees swarm over the fresh flowers, leaving the hive unguarded -and revealing a sweet honeycomb. -#268 -You are now out of breath. -#269 -It isn't ringing! -#270 -A hairy paw reaches out of the darkness and.... -#271 -You don't have the correct change. -#272 -You go a short way down the bright passage, but the light -grows to blinding intensity. You can't continue. -#273 -You know, if you type "BRIEF", I won't have to keep repeating these -long descriptions of each room. -#274 -Are you trying to reach the natural bridge? -#275 -You can't get to it by climbing the walls or jumping or anything -like that. You could always put in a telephone call to the local -spelunking club for advice, if you could find a phone. -#276 -You turkey!!! Now you've done it! It took some effort, but you -woke up the Wumpus. He slowly opens one red eye, and then another, -and then one more (!!), and looks at you sleepily. He had been -dreaming of a late snack. If you don't act quickly, you'll -be a *late* adventurer! -#277 -The blast of your horn echoes throughout hill and dale. -#278 -All you have are watercress sandwiches. The bear is less than -interested. -#279 -You have smashed your sword to smithereens against a rock. -#280 -Setting yourself adrift in the boat with no way to propel it would -not be very smart. Best to keep the pole. -#281 -You're already in it! -#282 -You've hit the jackpot!! Hundreds of coins and slugs cascade from -the telephone's coin return slot and spill all over the floor of -the booth. -#283 -Whoops! The floor has opened out from under you! It seems you -have fallen into a bottomless pit. As a matter of fact, you're -still falling! Well, I have better things to do than wait around -for you to strike bottom, so let's just assume you're dead. -Sorry about that, Chief. -#284 -The telephone in the booth has begun to ring. -#285 -I don't understand what you are trying to do! -#286 -How do you propose to cross the river? -#287 -The air is filled with beautiful music. -#288 -The air fills with beautiful music. The dog gradually becomes -less fierce, and after a short while he lies down by the side of -the cavern and falls into a deep sleep. -#289 -Are you trying to get past the dog? -#290 -The only person I can remember who managed to get past the dog -was that singer, ummm, what's his name... Eurydice's friend.... -#291 -That wouldn't be wise. It is best to let sleeping dogs lie. -#292 -The stream flows out of one very small crack and into another. -You can't go that way. -#293 -The river is too wide and deep to cross. -#294 -The glare is absolutely blinding. If you proceed you are likely -to fall into a pit. -#295 -The hum of the bees rises to an angry buzz as you move towards -the hive. -#296 -The sticks and branches are all in a tangle and are stuck in the -mud. You'd need a shovel to dig them out. -#297 -You're already carrying them! -#298 -The chalice is slightly cracked. It won't hold any liquids. -#299 -The cask is now empty. -#300 -The wine goes right to your head. You reel around in a drunken -stupor and finally pass out. You awaken with a splitting headache, -and try to focus your eyes.... -#301 -Yeeeecchhh!! -#302 -Your bottle is already full. -#303 -The cask is already full. -#304 -There is nothing here with which to fill the bottle. -#305 -There is nothing here which you would want to put into the cask. -#306 -Your bottle is now full of water. -#307 -The cask is now full of water. -#308 -Your bottle is now full of oil. -#309 -The cask is now full of oil. -#310 -The bottle is now full of wine. -#311 -The cask is now full of wine. -#312 -You have nothing in which to carry it. -#313 -You can't fill that. -#314 -Do you want it in the bottle or the cask? -#315 -Your containers are both full. -#316 -It's empty. -#317 -Hmmm, I see you have already gone through an extra set of batteries. -I'll get rid of the trash for you. -#318 -The bridge shakes as you cross. Large hunks of clay and rock near -the edge break off and hurtle far down into the chasm. Several of -the cracks on the bridge surface widen perceptibly. -#319 -The load is too much for the bridge! With a roar, the entire -structure gives way, plunging you headlong into the raging river at -the bottom of the chasm and scattering all your holdings. As the -icy waters close over your head, you flail and thrash with all your -might, and with your last ounce of strength pull yourself onto the -south bank of the river. -#320 -You can't get at him. He is inside the phone booth. -#321 -Your lamp is already on. -#322 -Your lamp is already off. -#323 -Your lamp is again growing dim. You'd better get some more batteries. -#324 -You know, you are wasting your batteries by wandering around out -here with your light on. -#325 - -#326 -Dead wumpi, as a rule, are light eaters. Nothing happens. -#327 -How do expect to feed a sleeping Wumpus? -#328 -You aren't holding it! -#329 -It won't fit! -#330 -The coin drops into the slot with a dull "clunk". There is no -dial tone. -#331 -It's already there. -#332 -Please read the supplied documentation files to find out where to -send complaints, suggestions, and bug reports. -#333 -The chest is now unlocked. -#334 -The chest is now locked. -#335 -You can't get at it. -#336 -It's already open. -#337 -It's locked. -#338 -It's already closed. -#339 -You can't fill that. It would leak all over the place. -#340 -It's not inside anything. -#341 -It isn't there! -#342 -How? -#343 -Taken. -#344 -Dropped. -#345 -I don't think I can. -#346 -Interesting. How? -#347 -Huh? -#348 -You are in perfect health. -#349 -You are fit as a fiddle. -#350 -Only wizards can do that! -#351 -Are you kidding? Do you want to suffocate the poor thing? -#352 -Thrown. -#353 -Left. -#354 -You can't get close enough for a clean thrust. -#355 -As you move in for the kill, the dwarf neatly slips a knife -between your ribs. -#356 -As you approach, the dwarf slashes out with his knife! -#357 -It's too dark to see anything! -#358 -It's not open. -#359 -There's nothing inside. -#360 -It contains: -#361 -The billboard reads: -"Visit Beautiful Colossal Cave. Open Year Around. Fun for -the entire family, or at least for those who survive." -Below the headline is an impossibly complicated map showing how -to find Colossal Cave. Not that it matters, because all the -directions are written in Elvish. -#362 -Hidden behind the poster is a steel safe, embedded in the wall. -#363 -Brushing the dust from one of the larger rocks reveals some carved -characters. -#364 -Enough dusting, already! You're making me sneeze. -#365 -The safe door smoothly swings open. -#366 -Maybe if you rubbed your fingertips with sandpaper.... -#367 -The safe's door clicks shut. -#368 -This is a combination safe. The keys won't help. -#369 -I certainly can't read in this light. -#370 -The poster has a picture of a thin man with a long white beard. -He is wearing a high pointed cap embroidered with strange symbols, -and he is pointing a finger at you. Below the picture are the words: -"I want you!--To report all good ideas for extensions to this game -to me without delay. Remember: ask not what ADVENTURE can do to -you; ask what you can do for ADVENTURE." -- * * * - -"A public service of the John Dillinger Died for You Society." -#371 -"Click." -#372 -In the rock is carved the message "7-22-34". -#373 -You can't get at them. -#374 -Ok, I'll give you the full description whenever you enter a room -for the first time. -#375 -You don't have the right key. -#376 -That's not strong enough to open the clam. -#377 -That's not strong enough to open the oyster. -#378 -Game suspension is no longer permitted! -#379 -** Unused ** -#380 ->>> Messages 381 thru 389 are reserved for "Diagnoses". <<< -#381 -You are a bit off top form, but nothing to worry about. -#382 -You are weaker than usual. Better avoid fights. -#383 -You really ought to take a break. You're in tough shape. -#384 -You are on the edge of collapse. Lots of sun and fresh air will -speed your recovery. -#385 -Your strength is nearly gone. Only a miracle can save you now. -#386 -** Unused ** -#387 -** Unused ** -#388 -** Unused ** -#389 -** Unused ** -#390 ->>> Messages 391 thru 399 are reserved for Radium Poisoning. <<< -#391 -Is it hot in here? You are flushed and sweating. -#392 -You are feeling definitely peculiar, weak.... -#393 -You're dizzy, nauseous. You can barely stand. -#394 -You are really ill. If you don't find an antidote soon, it's -curtains. -#395 -You are a walking wound. You are very weak. You'd better find out -what's wrong before it's too late. -#396 -Sheeesh! What a mess! Your hair has fallen out and your skin is -covered with blisters. And not an aspirin in sight! -#397 -Well, you tried, but your strength is gone. The agony is finally -over. -#398 -** Unused ** -#399 -** Unused ** -#400 -You feel rather disembodied, as if you were suddenly somewhere -else entirely. -#401 -You sense that you are in a dark place. The only thing in sight -appears to be a companion to the crystal ball which holds your -gaze. It seems to be searching the gloom for something to -show you, but all it can see is itself: a brilliant blue -six-pointed star suspended in space. -#402 -Your gaze withdraws from the crystal ball, and you are now back -in your normal senses. -#403 -A large, stately elf walks up the rise, says the word -"Saint-Michel", and is instantly transported to the castle. -#404 -Are you trying to get to the castle? -#405 -It's easy to get there if you know how. The elves cross over -from here so perhaps you might watch an elf to see how. -Of course they are a bit shy, so keep a good way off while you -watch. -#406 -You get a tingling feeling as you walk through the gate, and ... -#407 -Fiddling with the bird in its cage is not useful. -If you had it in your hand it would make a mess. -#408 -Would you like a map? diff --git a/commands/advent/database.c b/commands/advent/database.c deleted file mode 100644 index d4c55d1b9..000000000 --- a/commands/advent/database.c +++ /dev/null @@ -1,141 +0,0 @@ -/* program DATABASE.C */ - -#include -#include -#include "advent.h" -#include "advdec.h" -#include "advtext.h" - -static char oline[256]; - -_PROTOTYPE(void rdupto, (FILE *, int, int, char *)); -_PROTOTYPE(void rdskip, (FILE *, int, int)); - -/* - Function to scan a file up to a specified - point and either print or return a string. -*/ -void rdupto(fdi, uptoc, print, string) -FILE *fdi; -int uptoc, print; -char *string; -{ - int c, i; - static _CONST unsigned char key[4] = {'c' | 0x80, 'L' | 0x80, - 'y' | 0x80, 'D' | 0x80}; - - i = 1; - while ((c = getc(fdi)) != uptoc && c != EOF) { - if (c == '\n') - i = 1; - if (c >= 0x80) - c ^= key[i++ & 3]; - if (c == '\r') - continue; - if (print) - putchar(c); - else - *string++ = (char) c; - } - if (!print) - *string = '\0'; - return; -} - -/* - Function to read a file skipping - a given character a specified number - of times, with or without repositioning - the file. -*/ -void rdskip(fdi, skipc, n) -FILE *fdi; -int skipc, n; -{ - int c; - - while (n--) - while ((c = getc(fdi)) != skipc) - if (c == EOF) - bug(32); - return; -} - -/* - Routine to request a yes or no answer to a question. -*/ -boolean yes(msg1, msg2, msg3) -int msg1, msg2, msg3; -{ - char answer[INPUTBUFLEN]; - - if (msg1) - rspeak(msg1); - do { - switch (*ask("\n> ", answer, sizeof(answer))) { - case 'n': - case 'N': - if (msg3) - rspeak(msg3); - return (FALSE); - case 'y': - case 'Y': - if (msg2) - rspeak(msg2); - return (TRUE); - default: - fputs("Please answer Y (yes) or N (no).", stdout); - } - } while (TRUE); -} - -/* - Print a location description from "advent4.txt" -*/ -void rspeak(msg) -int msg; -{ - if (msg == 54) - printf("ok.\n"); - else { - fseek(fd4, idx4[msg - 1], 0); - rdupto(fd4, '#', 1, 0); - } - return; -} - -/* - Print an item message for a given state from "advent3.txt" -*/ -void pspeak(item, state) -int item, state; -{ - fseek(fd3, idx3[item - 1], 0); - rdskip(fd3, '/', state + 2); - rdupto(fd3, '/', FALSE, oline); - if (strncmp(oline, "<$$<", 4) != 0) - printf("%s", oline); - return; -} - -/* - Print a long location description from "advent1.txt" -*/ -void desclg(loc) -int loc; -{ - fseek(fd1, idx1[loc - 1], 0); - rdupto(fd1, '#', 1, 0); - return; -} - -/* - Print a short location description from "advent2.txt" -*/ -void descsh(loc) -int loc; -{ - fseek(fd2, idx2[loc - 1], 0); - rdupto(fd2, '#', 1, 0); - return; -} diff --git a/commands/advent/english.c b/commands/advent/english.c deleted file mode 100644 index a0134bbfe..000000000 --- a/commands/advent/english.c +++ /dev/null @@ -1,676 +0,0 @@ -/* program ENGLISH.C */ - - -#include -#include -#include -#include -#include "advent.h" -#include "advdec.h" - -#define ALL 109 - -#define ENTER 3 -#define CRAWL 17 -#define JUMP 39 -#define CLIMB 56 -#define XYZZY 62 -#define PLUGH 65 -#define PLOVER 71 -#define PHUCE 82 - -_PROTOTYPE(static void getwords, (void)); -_PROTOTYPE(static void clrlin, (void)); -_PROTOTYPE(static void doobj, (int *)); -_PROTOTYPE(static boolean doiobj, (void)); -_PROTOTYPE(static boolean do_scoop_up, (void)); -_PROTOTYPE(static boolean check_next, (void)); - -static char buffer[INPUTBUFLEN] = {'\0', '\0', '\0', '\0'}; -static char *txt[MAXWORDS] = {buffer, buffer, buffer, buffer}; -static char *cindex = buffer; -static boolean pflag; -static int vrbkey, words[MAXWORDS] = {0, 0, 0, 0}, word, wdx = 0; -static int takdir[20] = {2, 6, 9, 10, 11, 13, 14, 17, 23, 25, - 33, 34, 36, 37, 39, 78, 79, 80, 89, -1}; - -static int vkey[60] = { - 0, 199, 9, 0, 130, 0, 197, 0, 0, 243, - 0, 0, 89, 140, 0, 5, 0, 227, 0, 0, - 0, 31, 42, 0, 0, 0, 0, 172, 1, 0, - 0, 0, 254, 0, 69, 0, 0, 92, 0, 0, - 138, 137, 149, 239, 45, 74, 183, 0, 0, 112, - 241, 0, 114, 0, 30, 0, 0, 0, 0, 0 -}; - -static int ptab[260] = { - 0, 3028, 3065, 3009, -3005, 5071, 5070, 5058, -5020, 19055, - 19108, 19038, 19020, 19071, 19070, 19058, 19004, 19048, 19091, 19094, - 19112, 19002, 19118, 2062, 2066, 2047, 2067, 2053, 2065, -2010, - -3114, 4034, 4011, 4101, 4035, 4099, 4098, 4017, 4104, 4014, - 4015, -4087, 3083, 3085, -3081, 5055, 5108, 5020, 5071, 5070, - 5058, 5004, 5048, 5091, 5112, 5099, 5118, 19055, 19108, 19020, - 19071, 19070, 19058, 19004, 19048, 19091, 19112, 19099,-19118, 3028, - 3065, 3009, 3005, -3018, 19055, 19108, 19038, 19020, 19071, 19070, - 19058, 19004, 19004, 19048, 19091, 19094, 19112, 19002,-19118, 3028, - 3065, -3018, 19055, 19108, 19038, 19020, 19071, 19070, 19058, 19004, - 19048, 19091, 19094, 19112, 19118, 2062, 2066, 2047, 2067, 2053, - 2065, -2010, 3102, -3090, 19055, 19108, 19020, 19071, 19070, 19058, - 19004, 19048, 19091, 19014, 19015, 19112, 19118, 19120, 19120, -9999, - 3090, 3102, 3028, 3057, 3065, 3009, -3005,-29999, 2052, -2068, - 2024, 2065, 2091, 2042, 2073, 5071, 5070, 5058, -5020, 30999, - 2062, 2066, 2047, 2067, 2053, 2065, 2010, 2073, 19055, 19108, - 19038, 19020, 19071, 19070, 19058, 19004, 19048, 19091, 19094, 19112, - 19002,-19118, 2014, 2015, 2013, 2999, 5014, 5015, 5013, 5999, - 5110, 5113, -5999, 5055, 5108, 5020, 5071, 5070, 5058, 5004, - 5048, 5091, 5014, 5015, 5112, 5099, -5118, 3102, -3090, 6066, - 6047, 6067, 6053, 6072, 6073, 5055, 5108, 5020, 5071, 5070, - 5004, 5004, 5048, 5091, 5112, 5099, 5118, 19055, 19108, 19020, - 19071, 19070, 19058, 19004, 19048, 19091,-19118, 4034, 4011, 4101, - 4035, 4099, 4098, 4017, 4104, 4027, 4087, 9999,-30999, 2002, - -6002, 3102, -3090, 9999, 4034, 4011, 4101, 4035, 4099, 4087, - 4098, 4017, 4104, -4027, -5999, 0, 0, 0, 0, 0, -}; - -static int adjkey[40] = { - 0, 15, 38, 64, 4, 63, 1, 61, 62, 67, - 9, 27, 53, 46, 47, 60, 31, 39, 40, 6, - 43, 26, 32, 28, 34, 50, 49, 45, 44, 10, - 20, 25, 21, 36, 37, 30, 33, 0, 0, 0 -}; - -static int adjtab[70] = { - 0, 5, 98, -83, 2, -90, 66, 41, -90, -39, - 41, 14, 15, 50, -11, 50, 64, 56, 72, -74, - -19, 119, 59, 73, -118, -119, -70, -41, 95, -118, - -118, -58, -71, -120, 110, -108, -120, -73, -62, -60, - 110, 54, -63, -67, -41, -27, -47, 52, -75, -69, - 65, 112, -3, 41, 72, 90, 20, 101, 107, -118, - -55, -10, -38, -4, 48, 9, -71, -39, 0, 0 -}; - -/* - Analyze a two word sentence -*/ -int english() -{ - - char *ch_ptr, *word1, *word2; - int type, val, type2, val2, adj, k, kk; - static int iwest = 0; - - if (!(words[++wdx])) { - getwords(); - wdx = 0; - } - pflag = FALSE; - word = words[wdx]; - if (word < 0) { /* check first word */ - printf("I didn't understand the word \"%s\"\n", txt[wdx]); - words[wdx+1] = 0; - return (FALSE); /* didn't know it */ - } - type2 = val2 = -1; - type = CLASS(word); - clrlin(); - val = VAL(word); - if (words[wdx + 1] && CLASS(words[wdx + 1]) != CONJUNCTION) { - - /* 'SAY' or 'CALL'. If no next word, pass on to higher powers. */ - if (type == ACTION && (val == SAY || val == YELL)) { - word = words[++wdx]; - if (!(word == XYZZY || word == PLUGH - || word == PLOVER || word == PHUCE)) { - if (val == SAY) - printf("Okay, \"%s\".\n", txt[wdx]); - else { - for (ch_ptr = txt[wdx]; *ch_ptr; ch_ptr++) - if (islower(*ch_ptr)) - *ch_ptr = toupper(*ch_ptr); - printf("Okay, \"%s\"!!!!!\n", txt[wdx]); - } - return (FALSE); - } - } else { - word1 = txt[wdx]; - word2 = txt[wdx + 1]; - - /* Special stuff for 'ENTER'. Can't go into water. 'ENTER - BOAT' means 'TAKE BOAT' */ - if (word == ENTER) { - if (CLASS(words[wdx + 1]) == NOUN && VAL(words[wdx + 1]) == BOAT) - word = TAKE + 2000; - else if ((strcmp(word2, "stream") == 0) - || (strcmp(word2, "water") == 0) - || (strcmp(word2, "reservoir") == 0) - || (strcmp(word2, "ocean") == 0) - || (strcmp(word2, "sea") == 0) - || (strcmp(word2, "pool") == 0)) { - rspeak(liqloc(g.loc) == WATER ? 70 : 43); - wdx++; - return (FALSE); - } - } else { - type2 = CLASS(words[wdx + 1]); - val2 = VAL(words[wdx + 1]); - - /* 'LEAVE' is motion verb, unsless leaving an object. - E.G., 'LEAVE BOAT' or 'LEAVE BOTTLE'. BUt make sure - to leave ('DROP') only totable objects. */ - if (strcmp(word1, "leave") == 0 && type2 == NOUN) { - if (!hinged(val2) || g.fixed[val2]) - word = LEAVE + 2000; - - /* IF 'LIGHT LAMP', Light must be taken as an - action verb, not a noun. */ - } else if (strcmp(word1, "light") == 0 - && VAL(words[wdx + 1]) == LAMP) { - word = ON + 2000; - - /* 'WATER PLANT' becomes 'POUR WATER', If we are at - plant. 'OIL DOOR' becomes 'POUR OIL', etc., etc. */ - } else if ((strcmp(word1, "water") == 0 || strcmp(word1, "oil") == 0) - && (strcmp(word2, "plant") == 0 || strcmp(word2, "door") == 0 - || strcmp(word2, "sword") == 0 || strcmp(word2, "anvil") == 0) - && at(val2)) { - words[wdx + 1] = word; - txt[wdx + 1] = txt[wdx]; - word = POUR + 2000; - } - } - } - - } - /* This is the 'inner' loop. Dispatching of all word in a clause - after the first comes through here. */ - do { - switch (CLASS(word)) { - case MOTION: - { - boolean do_part2; - int i; - - do_part2 = FALSE; - type = CLASS(verbs[vrbx]); - val = VAL(verbs[vrbx]); - if (!vrbx) - do_part2 = TRUE; - else { - if (type > ACTION) { - rspeak(confuz()); - return (FALSE); - } - } - if (type == ACTION) { - if (val == GO) - do_part2 = TRUE; - else { - if (val == TAKE) { - for (i = 0; i < 20; i++) - if (takdir[i] == val) - do_part2 = TRUE; - } - if (!do_part2) { - word = vocab(txt[wdx], 1); - if (word) - words[wdx--] = word; - } - } - } else if (type != CRAWL && type != JUMP - && type != CLIMB) - do_part2 = TRUE; - if (do_part2) { - verbs[1] = word; - vrbx = 1; - if (strcmp(txt[wdx], "west") == 0) { - iwest++; - if (iwest == 10) - rspeak(17); - } - } - break; - } - case NOUN: - if (pflag) { - if (!doiobj()) - return (FALSE); - } else { - word = VAL(word); - if (word == ALL) { - if (!do_scoop_up()) - return (FALSE); - } else { - doobj(&word); - if (word > 0) { - objs[++objx] = word; - otxt[objx] = txt[wdx]; - } else { - clrlin(); - pflag = FALSE; - wdx++; - while (words[wdx]) { - if (CLASS(words[wdx]) == CONJUNCTION) - break; - wdx++; - } - if (words[wdx] == 0) - return (FALSE); - } - } - } - break; - case ACTION: - if (vrbx == 0) - vrbx++; - else { - if (VAL(verbs[vrbx]) == TAKE) { - val = VAL(word); - if (val == DRINK || val == INVENTORY - || val == SCORE || val == NOTHING - || val == LOOK); - else if (val == GO && ( - strcmp(txt[wdx], "walk") == 0 - || strcmp(txt[wdx], "run") == 0 - || strcmp(txt[wdx], "hike") == 0)); - else { - rspeak(confuz()); - return (FALSE); - } - } else if (objx || CLASS(words[wdx - 1]) == CONJUNCTION) { - rspeak(confuz()); - return (FALSE); - } - } - verbs[vrbx] = word; - vtxt[vrbx] = txt[wdx]; - break; - case MISC: - if (vrbx) { - rspeak(confuz()); - return (FALSE); - } - verbs[1] = word; - vrbx = 1; - break; - case PREPOSITION: - if (CLASS(verbs[vrbx]) != ACTION || iobx) { - rspeak(confuz()); - return (FALSE); - } - vrbkey = vkey[VAL(verbs[vrbx])]; - if (!vrbkey) { - rspeak(confuz()); - return (FALSE); - } - prep = VAL(word); - pflag = TRUE; - break; - case ADJACTIVE: - /* Adjective handler. Scarf the next word, make sure it is - a valid object for this object. Then call getobj to see - if it is really there, Then link into object code. */ - adj = VAL(word); - if (!check_next()) - return (FALSE); - else if (CLASS(word) == CONJUNCTION) { - printf("%s what?\n", txt[wdx - 1]); - return (FALSE); - } else { - if (CLASS(word) != NOUN) - word = vocab(txt[wdx], NOUN); - if (word == -1 || CLASS(word) != NOUN || VAL(word) == ALL) { - rspeak(confuz()); - return (FALSE); - } - words[wdx] = word; - kk = VAL(word); - for (k = adjkey[adj]; adjtab[k] >= 0; k++) { - if (kk == abs(adjtab[k])) - break; - } - if (adjtab[k] < 0) { - rspeak(confuz()); - return (FALSE); - } - } - break; - case CONJUNCTION: - if (!check_next()) - return (FALSE); - switch (CLASS(word)) { - case MOTION: - case ACTION: - case MISC: - words[wdx--] = 0; - break; - case NOUN: - case ADJACTIVE: - break; - case PREPOSITION: - case CONJUNCTION: - rspeak(confuz()); - return (FALSE); - default: - bug(33); - } - break; - default: - bug(33); - } - word = words[++wdx]; - if (word < 0) { - if (pct(50)) - printf("I don't understand the word %s?\n", txt[wdx]); - else - printf("Mumble ? %s\n", txt[wdx]); - - words[wdx+1] = 0; - return (FALSE); - } - type = CLASS(word); - if (type == NOUN) { - /* It's not the first: Make sure he included a comma or - 'and'. Differenctiate between direct & indirect objects. - Check for special case of multiple ofjects: 'feed bear - honey' or 'throw troll nugget'. */ - if ((pflag ? iobx : objx) - && CLASS(words[wdx - 1]) != CONJUNCTION) { - val = VAL(verbs[vrbx]); - if (!living(objs[objx]) || (val != THROW && val != FEED)) { - rspeak(confuz()); - return (FALSE); - } - iobx++; - iobjs[iobx] = objs[objx]; - objs[objx] = 0; - objx++; - } - } - } while (word); - - if (verbs[1] == 0) { - if (objs[1] == 0) { - rspeak(confuz()); - clrlin(); - } else if (objs[2]) - printf("What do you want to do with them?\n"); - else - printf("What do you want to do with %s?\n", otxt[1]); - return (FALSE); - } else if (objx > 1 && iobx > 1) { - rspeak(confuz()); - return (FALSE); - } - return (TRUE); - -} - -/* - retrieve input line (max INPUTBUFLEN chars), convert to lower case - & rescan for first two words (max. WORDSIZE-1 chars). -*/ -static void getwords() -{ - static int wdx = 0; - int i, term_loc; - char terminator; - - if (*cindex == '\0') { - while (!*ask("\n> ", buffer, sizeof(buffer))) ; - for (cindex = buffer; *cindex; cindex++) - if (isupper(*cindex)) - *cindex = tolower(*cindex); - cindex = buffer; - } - wdx = 0; - buffer[sizeof(buffer)-1] = '\0'; - for (i = 0; i < MAXWORDS; i++) { - txt[i] = &buffer[sizeof(buffer)-1]; - words[i] = 0; - } - do { - while (*cindex == ' ') - cindex++; - txt[wdx] = cindex; - term_loc = strcspn(cindex, " ,.;\n"); - cindex += term_loc; - terminator = *cindex; - *cindex++ = '\0'; - if ((strcmp(txt[wdx], "a") != 0) - && (strcmp(txt[wdx], "the") != 0) - && (strcmp(txt[wdx], "an") != 0)) { - words[wdx] = vocab(txt[wdx], 0); - wdx++; - } - if (terminator == ',') { - txt[wdx] = "and"; - words[wdx] = vocab(txt[wdx], 0); - wdx++; - } - } - while ((terminator != ';') && (terminator != '.') - && (terminator != '\0') && (terminator != '\n')); - if (terminator == '\0') - cindex--; - return; -} - -/* CLRIN, clears out all surrent syntax args in preparation for - * new input line - */ - -static void clrlin() -{ - int i; - - for (i = 0; i < MAXWORDS; i++) { - verbs[i] = 0; - vtxt[i] = &buffer[sizeof(buffer)-1]; - } - - for (i = 0; i < MAXITEMS; i++) { - objs[i] = 0; - otxt[i] = &buffer[sizeof(buffer)-1]; - iobjs[i] = 0; - iotxt[i] = &buffer[sizeof(buffer)-1]; - } - vrbx = 0; - objx = 0; - iobx = 0; - prep = 0; -} - -/* - Routine to process an object. -*/ -static void doobj(object) -int *object; -{ - int msg; - - if (holding(*object)) - return; - if (blind()) { - printf("I see no %s here.\n", txt[wdx]); - *object = 0; - return; - } - /* Is object here? if so, transitive */ - if (g.fixed[*object] == g.loc || athand(*object)) - return; - else if (here(*object)) { - msg = plural(*object) ? 373 : 335; - *object = 0; - rspeak(msg); - } - /* Did he give grate as destination? */ - else if (*object == GRATE) { - if (g.loc == 1 || g.loc == 4 || g.loc == 7) { - verbs[1] = DEPRESSION; - vrbx = 1; - return; - } else if (g.loc > 9 && g.loc < 15) { - verbs[1] = ENTRANCE; - vrbx = 1; - return; - } - } - /* Is it a dwarf he is after? */ - else if (dcheck() && g.dflag >= 2) { - *object = DWARF; - } - /* Is he trying to get/use a liquid? */ - else if (liqloc(g.loc) == *object - || (liq(BOTTLE) == *object && athand(BOTTLE)) - || (liq(CASK) == *object && athand(CASK))); - else if (*object == PLANT && at(PLANT2) && - g.prop[PLANT2] == 0) { - *object = PLANT2; - } else if (*object == ROCKS && at(CARVNG)) { - *object = CARVNG; - } - /* Is he trying to grab a knife? */ - else if (*object == KNIFE && g.knfloc == g.loc) { - rspeak(116); - g.knfloc = -1; - } - /* Is he trying to get at dynamite? */ - else if (*object == ROD && athand(ROD2)) { - *object = ROD2; - } else if (*object == DOOR && (at(SAFE) || at(TDOOR) - || at(TDOOR2) || at(PDOOR))) { - if (at(TDOOR2)) - *object = TDOOR2; - else if (at(PDOOR)) - *object = PDOOR; - else if (at(SAFE)) - *object = SAFE; - else - *object = TDOOR; - } else if (*object == BOOK && athand(BOOK2)) { - *object = BOOK2; - } else if (!(verbs[vrbx] == FIND || verbs[vrbx] == INVENTORY)) { - *object = 0; - printf("I see no %s here.\n", txt[wdx]); - } - return; -} - -static boolean doiobj() -{ - char dk[INPUTBUFLEN], dkk[INPUTBUFLEN]; - int kk; - boolean ok; - - /* checks object is valid for this preposition */ - ok = TRUE; - word = VAL(word); - if (word != ALL) { - doobj(&word); - if (word > 0) { - iobjs[++iobx] = word; - iotxt[iobx] = txt[wdx]; - } else - ok = FALSE; - } - kk = abs(ptab[vrbkey]) / 1000; - if (kk == prep) { - /* preprosition is valid with this verb now check object of - preprosition */ - - if (word == 0 || CLASS(word) == CONJUNCTION) { - /* no object following prepresition: check special cases */ - - pflag = FALSE; - strcpy(dk, txt[--wdx]); - strcpy(dkk, vtxt[vrbx]); - ok = FALSE; - if ((strcmp(dk, "on") == 0 - || strcmp(dk, "off") == 0) - && (strcmp(dkk, "turn") == 0 - || objs[objx] == LAMP)) - ok = TRUE; - if (strcmp(dkk, "take") == 0 - || strcmp(dkk, "put") == 0) - ok = TRUE; - if (strcmp(dk, "up") == 0 - && strcmp(dkk, "pick") == 0) - ok = TRUE; - if (strcmp(dk, "down") == 0 - && (strcmp(dkk, "put") == 0 || verbs[vrbx] == THROW) ) - ok = TRUE; - } else { - /* object follows preposition See if it's plausible. */ - - kk = abs(ptab[vrbkey]) % 1000; - if (kk == word && kk == ALL) { - if (!do_scoop_up()) - return (FALSE); - } else if (!(kk == word || kk == 999)) { - vrbkey++; - ok = ptab[vrbkey - 1] < 0 ? FALSE : TRUE; - } - } - } - return (ok); -} - -static boolean do_scoop_up() -{ - int i, val; - - val = VAL(verbs[vrbx]); - if (val == DROP || val == PUT || val == LEAVE) { - for (i = 1; i < MAXOBJ; i++) { - if (!athand(i) || g.fixed[i]) - continue; - if (i > WATER && i <= WINE + 1) - continue; - if (toting(i)) { - objs[++objx] = i; - otxt[objx] = "BUG???"; - if (objx >= 44) - break; - } - } - } - if (val == TAKE || val == PICK || val == GET) { - if (blind()) { - rspeak(357); - return (FALSE); - } else { - for (i = 1; i < MAXOBJ; i++) { - if (!athand(i) || g.fixed[i]) - continue; - if (i > WATER && i <= WINE + 1) - continue; - if (!toting(i)) { - objs[++objx] = i; - otxt[objx] = "BUG???"; - if (objx >= 44) - break; - } - } - } - } - return (TRUE); -} - -static boolean check_next() -{ - - word = words[wdx + 1]; - if (word > 0) - return (TRUE); - else if (word == 0) - rspeak(confuz()); - else { - if (pct(50)) - printf("I don't understand the word %s?\n", txt[wdx]); - else - printf("Mumble ? %s\n", txt[wdx]); - words[wdx+1] = 0; - } - - return (FALSE); -} diff --git a/commands/advent/initial.c b/commands/advent/initial.c deleted file mode 100644 index 24963acd9..000000000 --- a/commands/advent/initial.c +++ /dev/null @@ -1,264 +0,0 @@ -/* - Initialization of adventure play variables -*/ -#include -#include -#include "advent.h" /* #define preprocessor equates */ -#define EXTERN /* define, not declare, in advdec.h */ -#include "advdec.h" - -int plac[MAXOBJ] = { - 0, 0, 3, 8, 10, 11, 0, 14, 0, 148, /* 0 - 9 */ - 96, 19, 17, 101, 103, 0, 106, 0, 0, 238, /* 10 - 19 */ - 238, 117, 190, 109, 25, 23, 111, 35, 0, 97, /* 20 - 29 */ - 0, 119, 0, 117, 0, 130, 0, 126, 140, 0, /* 30 - 39 */ - 96, 94, 158, 160, 188, 0, 155, 174, 166, 228, /* 40 - 49 */ - 18, 204, 27, 29, 30, 0, 92, 168, 97, 100, /* 50 - 59 */ - 101, 0, 119, 127, 130, 141, 144, 205, 28, 182, /* 60 - 69 */ - 225, 230, 0, 147, 241, 248, 0, 0, 0, 0, /* 70 - 79 */ - 0, 0, 0, 0, 0, 0, 0, 193, 102, 0, /* 80 - 89 */ - 159, 141, 172, 188, 189, 0, 0, 193, 227, 174, /* 90 - 99 */ - 0, 13, 238, 217, 171, 0, 146, 159, 3, 0, /* 100 - 109 */ - 0, 0, 0, 3, 180, 39, 5, 0, 110, 169, /* 110 - 119 */ - 200 -}; - -int fixd[MAXOBJ] = { - 0, 0, 0, 9, 0, 0, 0, 15, 0, 0, /* 0 - 9 */ - 0, -1, 27, -1, 0, 0, 0, -1, 0, 0, /* 10 - 19 */ - 0, 122, 235, -1, -1, 67, -1, 110, 0, -1, /* 20 - 29 */ - -1, 121, 0, 122, 0, -1, -1, -1, -1, 0, /* 30 - 39 */ - -1, -1, 166, 167, 189, 0, 0, -1, 0, 229, /* 40 - 49 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 50 - 59 */ - 0, 0, 121, 0, -1, 0, 0, 0, 0, 0, /* 60 - 69 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 70 - 79 */ - 0, 0, 0, 0, 0, 0, 0, -1, 194, -1, /* 80 - 89 */ - 0, -1, 174, -1, -1, 0, 0, -1, -1, -1, /* 90 - 99 */ - 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, /* 100 - 109 */ - 0, 0, -1, 0, 0, -1, -1, 0, 0, 0, /* 110 - 119 */ - 0 -}; - -struct playinfo g = { - 0, /* turns */ - 1, /* loc */ - 1, /* oldloc */ - 1, /* oldloc2 */ - 1, /* newloc */ - { /* loc_attrib[MAXLOC] */ - 0, 73, 65, 73, 73, /* 0 - 4 */ - 65, 65, 73, 1601, 33, /* 5 - 9 */ - 32, 32, 32, 1824, 32, /* 10 - 14 */ - 0, 2, 0, 0, 2816, /* 15 - 19 */ - 2, 2, 2, 0, 10, /* 20 - 24 */ - 0, 2, 0, 0, 0, /* 25 - 29 */ - 0, 2, 2, 8, 0, /* 30 - 34 */ - 0, 0, 0, 8, 0, /* 35 - 39 */ - 2, 0, 256, 256, 256, /* 40 - 44 */ - 256, 272, 272, 272, 256, /* 45 - 49 */ - 256, 0, 256, 256, 272, /* 50 - 54 */ - 256, 272, 0, 16, 2, /* 55 - 59 */ - 0, 0, 0, 0, 0, /* 60 - 64 */ - 0, 0, 0, 0, 0, /* 65 - 69 */ - 0, 0, 0, 0, 0, /* 70 - 74 */ - 0, 0, 0, 0, 2, /* 75 - 79 */ - 256, 256, 272, 0, 0, /* 80 - 84 */ - 16, 272, 0, 0, 2, /* 85 - 89 */ - 2, 0, 0, 0, 0, /* 90 - 94 */ - 8, 0, 0, 1280, 513, /* 95 - 99 */ - 513, 512, 0, 0, 0, /* 00 - 04 */ - 0, 0, 0, 768, 0, /* 105 - 109 */ - 0, 0, 0, 8, 0, /* 110 - 114 */ - 1, 1, 0, 0, 0, /* 115 - 119 */ - 0, 0, 16, 16, 16, /* 120 - 124 */ - 16, 17, 16, 16, 16, /* 125 - 129 */ - 16, 0, 0, 0, 0, /* 130 - 134 */ - 0, 0, 0, 0, 0, /* 135 - 139 */ - 0, 1040, 16, 0, 0, /* 140 - 144 */ - 2, 65, 65, 65, 65, /* 145 - 149 */ - 65, 65, 65, 65, 65, /* 150 - 154 */ - 65, 3, 2625, 2113, 65, /* 155 - 159 */ - 65, 3, 3, 3, 3, /* 160 - 164 */ - 3, 41, 41, 9, 9, /* 165 - 169 */ - 0, 0, 0, 0, 0, /* 170 - 174 */ - 0, 0, 0, 2, 0, /* 175 - 179 */ - 0, 2, 0, 0, 0, /* 180 - 184 */ - 0, 0, 0, 0, 16, /* 185 - 189 */ - 0, 0, 9, 0, 0, /* 190 - 194 */ - 0, 0, 0, 9, 2, /* 195 - 199 */ - 1, 1, 2304, 0, 0, /* 200 - 204 */ - 0, 8, 8, 8, 0, /* 205 - 209 */ - 0, 0, 1, 0, 9, /* 210 - 214 */ - 0, 0, 12, 0, 0, /* 215 - 219 */ - 0, 0, 0, 0, 0, /* 220 - 224 */ - 0, 2, 2625, 73, 73, /* 225 - 229 */ - 0, 2, 2, 2, 2, /* 230 - 234 */ - 0, 0, 2, 65, 3137, /* 235 - 239 */ - 65, 65, 65, 65, 65, /* 240 - 244 */ - 65, 65, 65, 65 /* 245 - 249 */ - }, /* loc_attrib[MAXLOC] */ - {0 }, /* place[MAXOBJ] */ - {0 }, /* fixed[MAXOBJ] */ - { /* weight[MAXOBJ] */ - 0, 0, 1, 0, 1, 2, 2, 0, 0, 2, /* 0 - 9 */ - 1, 0, 0, 0, 7, 7, 1, 0, 0, 2, /* 10 - 19 */ - 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* 20 - 29 */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, /* 30 - 39 */ - 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, /* 40 - 49 */ - 6, 1, 2, 2, 3, 5, 4, 3, 2, 3, /* 50 - 59 */ - 4, 1, 3, 1, 3, 2, 1, 1, 2, 2, /* 60 - 69 */ - 2, 3, 1, 1, 3, 1, 0, 0, 0, 0, /* 70 - 79 */ - 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, /* 70 - 79 */ - 1, 0, 0, 0, 0, 3, 2, 0, 0, 0, /* 80 - 89 */ - 0, 2, 1, 0, 0, 0, 1, 1, 2, 0, /* 100 - 109 */ - 3, 3, 0, 1, 1, 0, 0, 0, 3, 1, /* 110 - 119 */ - 2, 0, 0 /* 120 - 129 */ - }, /* weight[MAXOBJ] */ - {0 }, /* atloc[MAXLOC] */ - {0 }, /* link[MAXOBJ * 2] */ - {0 }, /* holder[MAXOBJ] */ - {0 }, /* hlink[MAXOBJ] */ - {0 }, /* visited[MAXLOC] */ - {0 }, /* prop[MAXOBJ] */ - { /* obj_state[MAXOBJ] */ - 0, 0, 32800, 26, 32770, /* 0 - 4 */ - 32, 32, 8192, 0, 0, /* 5 - 9 */ - 32, 512, 0, 256, 770, /* 10 - 14 */ - 770, 288, 512, 0, 160, /* 15 - 19 */ - 32802, 0, 0, 0, 128, /* 20 - 24 */ - 0, 0, 0, 32, 8192, /* 25 - 29 */ - 512, 512, 0, 512, 0, /* 30 - 34 */ - 512, 256, 0, 32768, 8224, /* 35 - 39 */ - 0, 18, 26, 26, 2, /* 40 - 44 */ - 0, 8320, 18464, 32768, 0, /* 45 - 49 */ - 16384, 16416, 16416, 26656, 24608, /* 50 - 54 */ - 49240, 24608, 16384, 49184, 16416, /* 55 - 59 */ - 16416, 16416, 16384, 16544, 16442, /* 60 - 64 */ - 16416, 18464, 26656, 16416, 16416, /* 65 - 69 */ - 49184, 49154, 18464, 18464, 16416, /* 70 - 74 */ - 16416, 0, 0, 0, 0, /* 75 - 79 */ - 0, 0, 0, 0, 0, /* 80 - 84 */ - 0, 0, 8704, 0, 0, /* 85 - 89 */ - 0, 0, 0, 0, 32768, /* 90 - 94 */ - 0, 128, 0, 0, 0, /* 95 - 99 */ - 0, 160, 8224, 0, 0, /* 100 - 104 */ - 0, 8352, 8352, 32870, 0, /* 105 - 109 */ - 16674, 258, 32858, 288, 32, /* 110 - 114 */ - 256, 0, 0, 32866, 16416, /* 115 - 119 */ - 16416, 0, 0 /* 120 - 123 */ - }, /* obj_state[MAXOBJ] */ - { /* points[MAXOBJ] */ - 0, 0, 0, 0, 0, /* 0 - 4 */ - 0, 0, 0, 0, 0, /* 5 - 9 */ - 0, 0, 0, 0, 0, /* 10 - 14 */ - 0, 1000108, 0, 0, 0, /* 15 - 19 */ - 0, 0, 0, 0, 0, /* 20 - 24 */ - 0, 0, 0, 0, 0, /* 25 - 29 */ - 0, 0, 0, 0, 0, /* 30 - 34 */ - 0, 0, 0, 0, 0, /* 35 - 39 */ - 0, 0, 0, 0, 0, /* 40 - 44 */ - 0, 0, -3000112, 0, 0, /* 45 - 49 */ - -2000055, -2000112, -2000112, -1000112, -5000112, /* 50 - 54 */ - 5000003, -3000112, -2000055, 2000003, -3000112, /* 55 - 59 */ - -4000112, -4000112, 3000003, -1000112, -4000112, /* 60 - 64 */ - -4000112, -2000112, -3000112, -1000112, -1000112, /* 65 - 69 */ - -2000112, -3012055, -4000112, -1000112, -5000112, /* 70 - 74 */ - -5000112, 0, 0, 0, 0, /* 75 - 79 */ - 0, 0, 0, 0, 0, /* 80 - 84 */ - 0, 0, 0, 0, 0, /* 85 - 89 */ - 0, 0, 0, 0, 0, /* 90 - 94 */ - 0, 0, 0, 0, 0, /* 95 - 99 */ - 0, 0, 0, 0, 0, /* 100 - 104 */ - 0, 0, 0, 0, 0, /* 105 - 109 */ - -2000112, 0, 0, 0, 0, /* 110 - 114 */ - 0, 0, 0, 0, -4000118, /* 115 - 119 */ - -2000112, 0 /* 120 - 122 */ - }, /* points[MAXOBJ] */ - {0 }, /* hinted[HNTMAX+1] */ - { /* hints[HNTMAX+1][5] */ - { 0, 0, 0, 0, 0 }, /* 0 */ - { 0, 9999, 4, 0, 0 }, /* 1 */ - { 0, 9999, 10, 0, 0 }, /* 2 */ - { 0, 9999, 5, 0, 0 }, /* 3 */ - { 0, 0, 0, 0, 0 }, /* 4 */ - { 0, 0, 0, 0, 0 }, /* 5 */ - { 0, 0, 0, 0, 0 }, /* 6 */ - { 0, 15, 4, 176, 177 }, /* 7 */ - { 0, 8, 5, 178, 179 }, /* 8 */ - { 0, 13, 3, 180, 181 }, /* 9 */ - { 0, 6, 10, 211, 212 }, /* 10 */ - { 0, 6, 5, 213, 214 }, /* 11 */ - { 0, 4, 2, 62, 63 }, /* 12 */ - { 0, 5, 2, 18, 19 }, /* 13 */ - { 0, 4, 2, 62, 233 }, /* 14 */ - { 0, 6, 5, 274, 275 }, /* 15 */ - { 0, 10, 5, 289, 290 }, /* 16 */ - { 0, 8, 2, 20, 21 }, /* 17 */ - { 0, 5, 2, 404, 405 } /* 18 */ - }, /* hints[HNTMAX+1][5] */ - {0 }, /* hintlc[HNTMAX+1] */ - 0, /* tally */ - 0, /* tally2 */ - 0, /* limit */ - 0, /* lmwarn */ - 0, /* wzdark */ - 0, /* closing */ - 0, /* closed */ - 0, /* holding */ - 0, /* detail */ - 0, /* knfloc */ - 30, /* clock */ - 50, /* clock2 */ - 0, /* panic */ - { 0, 19, 27, 33, 44, 64, 114 }, /* dloc[DWARFMAX+1] */ - 0, /* dflag */ - { 0, 0, 0, 0, 0, 0, 0 }, /* dseen[DWARFMAX+1] */ - { 0, 0, 0, 0, 0, 0, 0 }, /* odloc[DWARFMAX+1] */ - 18, /* daltloc */ - 0, /* dkill */ - 114, /* chloc */ - 140, /* chloc2 */ - 0, /* bonus */ - 0, /* numdie */ - 0, /* foobar */ - 0, /* combo */ - 0, /* terse */ - 5, /* abbnum */ - 100, /* health */ - 0, /* chase */ - FALSE, /* flg239 */ - 0 /* lastglob */ -}; - -/* - Initialization of adventure play variables -*/ -void initialize() -{ - int i; - - for (i = MAXOBJ; i > 0; i--) { - g.fixed[i] = fixd[i]; - if (fixd[i] > 0) { - drop(i + MAXOBJ, fixd[i]); - drop(i, plac[i]); - } - if ((plac[i] != 0) && (fixd[i] <= 0)) - drop(i, plac[i]); - } - - for (i = 1; i <= MAXOBJ; i++) { - if (treasr(i)) { - g.prop[i] = -1; - g.tally++; - } - } - - newtravel = TRUE; - g.place[BOOK] = -1; - insert(BOOK, SAFE); - g.place[WATER] = -1; - insert(WATER, BOTTLE); - g.prop[BOTTLE] = 8; - return; -} diff --git a/commands/advent/itverb.c b/commands/advent/itverb.c deleted file mode 100644 index 1af23157d..000000000 --- a/commands/advent/itverb.c +++ /dev/null @@ -1,597 +0,0 @@ -/* program ITVERB.C */ - - -#include -#include "advent.h" -#include "advdec.h" - -_PROTOTYPE(void needobj, (void)); -_PROTOTYPE(void ivtake, (void)); -_PROTOTYPE(void ivopen, (void)); -_PROTOTYPE(void ivkill, (void)); -_PROTOTYPE(void ivdrink, (void)); -_PROTOTYPE(void ivquit, (void)); -_PROTOTYPE(void ivfoo, (void)); -_PROTOTYPE(void inventory, (void)); -_PROTOTYPE(void addobj, (int obj)); -_PROTOTYPE(void ivpour, (void)); -_PROTOTYPE(void ivfill, (void)); -_PROTOTYPE(void ivbrief, (void)); -_PROTOTYPE(void ivread, (void)); -_PROTOTYPE(void ivcombo, (void)); -_PROTOTYPE(void iveat, (void)); -/* - Routines to process intransitive verbs -*/ -void itverb() -{ - int i; - - newtravel = FALSE; - switch (verb) { - case DROP: - case SAY: - case WAVE: - case CALM: - case RUB: - case THROW: - case FIND: - case FEED: - case BREAK: - case WAKE: - case WEAR: - case HIT: - case DIAL: - case PLAY: - case PICK: - case PUT: - case TURN: needobj(); break; - case TAKE: - case YANK: - case GET: - case INSRT: - case REMOVE: - case BURN: ivtake(); break; - case OPEN: - case CLOSE: - case LOCK: - case UNLOCK: ivopen(); break; - case NOTHING: rspeak(54); break; - case ON: - case OFF: trverb(); break; - case WALK: actspk(verb); break; - case KILL: ivkill(); break; - case POUR: ivpour(); break; - case EAT: iveat(); break; - case DRINK: ivdrink(); break; - case QUIT: ivquit(); break; - case INVENTORY: inventory(); break; - case FILL: ivfill(); break; - case BLAST: ivblast(); break; - case SCORE: score(TRUE); break; - case FOO: ivfoo(); break; - case BRIEF: ivbrief(); break; - case READ: ivread(); break; - case SUSPEND: - if (g.closing) - rspeak(378); - else - saveadv("advent.sav"); - break; - case RESTORE: restore("advent.sav"); break; - case ANSWER: - if ((g.loc != 189) || (g.prop[PHONE] != 0)) - needobj(); - else { - object = PHONE; - itverb(); - } - break; - case BLOW: rspeak(268); break; - /* Action verb 'LEAVE' has no object */ - case LEAVE: bug(29); break; - /* Call if no phone is handy, yell. */ - case YELL: - if (!here(PHONE)) - needobj(); - else if (!g.closed) - rspeak(271); - else { - rspeak(283); - normend(); - } - break; - /* Health. give him a diagnosis. */ - case HEALTH: - if (g.numdie) - fprintf(stdout, "You have been killed %d times otherwise\n", - g.numdie); - if (g.health >= 95) { - if (pct(50)) - rspeak(348); - else - rspeak(349); - } else { - fprintf(stdout, - "Your health rating is %2d out of a possible 100.\n", - g.health); - rspeak(381 + (100 - g.health) / 20); - } - break; - case LOOK: ivlook(); break; - case COMBO: - if (at(SAFE)) - ivcombo(); - break; - case SWEEP: - /* Dust/sweep */ - if (!at(CARVNG) || !athand(BRUSH) || (g.prop[CARVNG] == 1)) - rspeak(342); - else { - g.prop[CARVNG] = 1; - rspeak(363); - rspeak(372); - } - break; - case TERSE: - /* Terse/unterse. supress all long_form descriptions. */ - g.terse = !g.terse; - g.detail = 3; - rspeak(54); - break; - case WIZ: - is_wiz = !is_wiz; - case MAP: - rspeak(54); - break; - case GATE: - if (is_wiz) { - static char buf[INPUTBUFLEN]; - sscanf(ask("Location ? ", buf, sizeof(buf)), "%d", &g.loc); - } - rspeak(54); - break; - case PIRLOC: - if (is_wiz) { - fprintf(stdout, "The dwarfs are at locations:\n"); - for (i = 1; i < DWARFMAX; i++) - fprintf(stdout, " %4d", g.dloc[i]); - fprintf(stdout, "\nThe pirate is at location %4d\n", - g.dloc[DWARFMAX]); - } - rspeak(54); - break; - default: - printf("This intransitive not implemented yet\n"); - } - return; -} - -/* - Routine to indicate no reasonable - object for verb found. Used mostly by - intransitive verbs. -*/ -void needobj() -{ - printf("%s what?\n", vtxt[vrbx]); - return; -} - -/* - CARRY, TAKE etc. -*/ -void ivtake() -{ - int anobj, item; - - anobj = 0; - for (item = 1; item < MAXOBJ; ++item) - if (g.place[item] == g.loc) - if (anobj == 0) - anobj = item; - else { - needobj(); - return; - } - - if (anobj == 0 || (dcheck() && g.dflag >= 2) || blind()) - needobj(); - else { - object = anobj; - if (verb == YANK) - vyank(); - else if (verb == WEAR) - vwear(); - else - vtake(); - } - return; -} - -/* - OPEN, LOCK, UNLOCK -*/ -void ivopen() -{ - int obj_cnt, item; - - for (item = 1, obj_cnt = 0; item < MAXOBJ; item++) { - if ((g.place[item] == g.loc) && (hinged(item))) { - object = item; - obj_cnt++; - } - } - if (obj_cnt != 1) - needobj(); - else if (verb == LOCK) - vlock(); - else if (verb == UNLOCK) - vunlock(); - else if (verb == SHUT) - vclose(); - else - vopen(); -} - -/* - ATTACK, KILL etc -*/ -boolean previous_obj; - -void ivkill() -{ - previous_obj = FALSE; - if (dcheck() && g.dflag >= 2) - object = DWARF; - if (here(SNAKE)) - addobj(SNAKE); - if (at(DRAGON) && g.prop[DRAGON] == 0) - addobj(DRAGON); - if (at(TROLL)) - addobj(TROLL); - if (here(GNOME)) - addobj(GNOME); - if (here(BEAR) && g.prop[BEAR] == 0) - addobj(BEAR); - if (here(WUMPUS) && g.prop[WUMPUS] == 0) - addobj(WUMPUS); - /* Can't attack bird by throwing axe */ - if (here(BIRD) && verb != THROW) - addobj(BIRD); - /* Clam and oyster both treated as clam for intransitive case; no - harm done. */ - if (here(CLAM) || here(OYSTER)) - addobj(CLAM); - - if ((previous_obj) || (object == 0)) - rspeak(44); - else - vkill(); - return; -} - -/* - POUR if no object, assume liq in container, if holding one. -*/ -void ivpour() -{ - if ((holding(BOTTLE)) && (liq(BOTTLE) != 0) && !holding(CASK)) - object = BOTTLE; - if ((holding(CASK)) && (liq(CASK) != 0) && !holding(BOTTLE)) - object = CASK; - - if (object == 0) - needobj(); - else - trverb(); -} - -/* - EAT. intransitive: assume edible if present, else ask what. - If he as more than one edible, or none, 'EAT' is ambiguous - without an explicit object. -*/ -void iveat() -{ - int i; - - previous_obj = FALSE; - for (i = 1; i < MAXOBJ; i++) { - if ((here(i)) && (edible(i))) - addobj(i); - } - if ((previous_obj) || (object == 0)) - needobj(); - else - trverb(); -} - -/* - DRINK. If no object, assume water or wine and look for them here. - If potable is in bottle or cask, drink that. If not, see if there - is something drinkable nearby (stream, lake, wine fountain, etc.), - and drink that. If he has stuff in both containers, ask which. -*/ -void ivdrink() -{ - int ll; - - previous_obj = FALSE; - ll = liqloc(g.loc); - if ((ll == WATER) || (ll == WINE)) { - object = ll; - iobj = -1; - } - ll = liq(BOTTLE); - if ((athand(BOTTLE)) && ((ll == WATER) || (ll == WINE))) { - object = ll; - iobj = BOTTLE; - } - ll = liq(CASK); - if ((athand(CASK)) && ((ll == WATER) || (ll == WINE)) - && iobj != BOTTLE) { - object = ll; - iobj = CASK; - } else - object = 0; - - if (object == 0) - needobj(); - else - trverb(); -} - -/* - QUIT intransitive only. Verify intent and exit if that's what he wants -*/ -void ivquit() -{ - gaveup = yes(22, 54, 54); - if (gaveup) - normend(); - return; -} - -/* - INVENTORY -*/ -void inventory() -{ - int i, msg; - boolean init_msg; - - init_msg = TRUE; - msg = 98; - for (i = 1; i < MAXOBJ; i++) { - if (!holding(i) || wearng(i) || i == BEAR || i == BOAT) - continue; - if (init_msg) - rspeak(99); - pspeak(i, -1); - init_msg = FALSE; - msg = 0; - lookin(i); - } - - /* Tell him what he is wearing */ - init_msg = TRUE; - for (i = 1; i < MAXOBJ; i++) { - if (wearng(i)) { - if (init_msg) - fprintf(stdout, "\nYou are wearing:\n"); - fprintf(stdout, " "); - pspeak(i, -1); - msg = 0; - init_msg = FALSE; - } - } - - if (holding(BOAT)) { - rspeak(221); - lookin(BOAT); - } - if (holding(BEAR)) - msg = 141; - - if (msg) - rspeak(msg); - return; -} - -/* - FILL bottle or cask must be empty, and some liquid avaible -*/ -void ivfill() -{ - if ((g.prop[CASK] == 1) && !here(CASK)) - object = CASK; - if ((g.prop[BOTTLE] == 1) && !here(BOTTLE)) - object = BOTTLE; - - if ((here(BOTTLE) && here(CASK)) || (object == 0)) - needobj(); - else - trverb(); -} - -/* - BLAST etc. -*/ -void ivblast() -{ - if (!g.closed) - actspk(verb); - else { - g.bonus = 135; - if (g.place[ROD2] == 212 && g.loc == 116) - g.bonus = 133; - if (g.place[ROD2] == 116 && g.loc != 116) - g.bonus = 134; - rspeak(g.bonus); - normend(); - } - return; -} - -/* - Handle fee fie foe foo... -*/ -void ivfoo() -{ - int k; - int msg; - - k = VAL(vocab(vtxt[vrbx], MISC)); - if (g.foobar != 1 - k) { - if (g.foobar == 0) - msg = 42; - else - msg = 151; - rspeak(msg); - return; - } - g.foobar = k; - if (k != 4) - return; - g.foobar = 0; - if (g.place[EGGS] == plac[EGGS] || - (toting(EGGS) && g.loc == plac[EGGS])) { - rspeak(42); - return; - } - /* Bring back troll if we steal the eggs back from him before - crossing */ - if (g.place[EGGS] == 0 && g.place[TROLL] == 0 && g.prop[TROLL] == 0) - g.prop[TROLL] = 1; - - if (here(EGGS)) - k = 1; - else if (g.loc == plac[EGGS]) - k = 0; - else - k = 2; - move(EGGS, plac[EGGS]); - pspeak(EGGS, k); - return; -} - -/* - brief/unbrief. intransitive only. - suppress long descriptions after first time. -*/ -void ivbrief() -{ - int msg; - - g.detail = 3; - g.terse = FALSE; - if (g.abbnum != 10000) { - msg = 156; - g.abbnum = 10000; - } else { - msg = 374; - g.abbnum = 5; - } - rspeak(msg); -} - -/* - read etc... -*/ -void ivread() -{ - previous_obj = FALSE; - if (here(BOOK)) - object = BOOK; - if (here(BOOK2)) - addobj(BOOK2); - if (here(BILLBD)) - addobj(BILLBD); - if (here(CARVNG)) - addobj(CARVNG); - if (here(MAGAZINE)) - addobj(MAGAZINE); - if (here(MESSAGE)) - addobj(MESSAGE); - if (here(OYSTER)) - addobj(OYSTER); - if (here(POSTER)) - addobj(POSTER); - if (here(TABLET)) - addobj(TABLET); - - if (previous_obj || object == 0 || dark()) - needobj(); - else - vread(); - return; -} - -/* - LOOK. can't give more detail. Pretend it wasn't dark (though it may "now" - be dark) so he won't fall into a pit staring into the gloom. -*/ -void ivlook() -{ - if (g.detail++ < 3) - rspeak(15); - g.wzdark = FALSE; - g.visited[g.loc] = 0; - g.newloc = g.loc; - newtravel = TRUE; - return; -} - -/* - COMBO: trying to open safe. (see comments for fee fie foe foo) -*/ -void ivcombo() -{ - int k, msg; - - k = VAL(vocab(vtxt[vrbx], MISC)) - 10; - msg = 42; - if (g.combo != 1 - k) { - if (g.combo != 0) - msg = 366; - rspeak(msg); - return; - } - g.combo = k; - if (k != 3) - rspeak(371); - else { - g.combo = 0; - bitoff(SAFE, LOCKBT); - biton(SAFE, OPENBT); - g.prop[SAFE] = 1; - if (g.prop[BOOK] < 0) { - g.tally--; - g.prop[BOOK] = 0; - /* If remaining treasures too elusive, zap his lamp. this - duplicates some code, must be done here since book is - contained ins safe & tally stuff only works for thing - deposited at a location. */ - if ((g.tally == g.tally2) && (g.tally != 0)) - g.limit = (g.limit < 35) ? g.limit : 35; - } - rspeak(365); - } -} - -/* - ensure uniqueness as objects are searched - out for an intransitive verb -*/ -void addobj(obj) -int obj; -{ - if (!previous_obj) { - if (object != 0) - previous_obj = TRUE; - else - object = obj; - } - return; -} diff --git a/commands/advent/score.c b/commands/advent/score.c deleted file mode 100644 index f04416359..000000000 --- a/commands/advent/score.c +++ /dev/null @@ -1,199 +0,0 @@ -/** - SCORE - - Calculate what the player's score would be if he quit now. - This may be the end of the game, or he may just be wondering - how he is doing. - - The present scoring algorithm is as follows: - (treasure points are explained in a following comment) - objective: points: present total possible: - getting well into cave 25 25 - total possible for treasures (+mag) 426 - reaching "closing" 20 20 - "closed": quit/killed 10 - klutzed 20 - wrong way 25 - success 30 30 - total: 501 - (points can also be deducted for using hints or deaths.) - -*/ - -#include -#include "advent.h" -#include "advdec.h" - -void score(scorng) -boolean scorng; -{ - int cur_score, max_score, qk[3]; - int obj, num_treas, k, i; - long t; - char *kk2c; - - cur_score = 0; - max_score = 0; - num_treas = 0; - -/** First tally up the treasures. Must be in building and not broken. - give the poor guy partial score just for finding each treasure. - Gets full score, qk[3], for obj if: - obj is at loc qk[1], and - obj has prop value of qk[2] - - weight total possible - magazine 1 (absolute) 1 - - all the following are multiplied by 5 (range 5-25): - book 2 - cask 3 (with wine only) - chain 4 (must enter via styx) - chest 5 - cloak 3 - clover 1 - coins 5 - crown 2 - crystal-ball 2 - diamonds 2 - eggs 3 - emerald 3 - grail 2 - horn 2 - jewels 1 - lyre 1 - nugget 2 - pearl 4 - pyramid 4 - radium 4 - ring 4 - rug 3 - sapphire 1 - shoes 3 - spices 1 - sword 4 - trident 2 - vase 2 - droplet 5 - tree 5 - total: 85 * 5 = 425 + 1 ==> 426 -*/ - - for (obj = 1; obj < MAXOBJ; obj++) { - if (g.points[obj] == 0) - continue; - t = g.points[obj]; - qk[0] = (int) (t < 0L ? -((t = -t) % 1000) : (t % 1000)); - t /= 1000; - qk[1] = (int) (t % 1000); - qk[2] = (int) (t / 1000); - k = 0; - if (treasr(obj)) { - num_treas++; - k = qk[2] * 2; - if (g.prop[obj] >= 0) - cur_score += k; - qk[2] *= 5; - } - if ((g.place[obj] == qk[0]) && (g.prop[obj] == qk[1]) - && ((g.place[obj] != -CHEST) || (g.place[CHEST] == 3)) - && ((g.place[obj] != -SHIELD) || (g.place[SHIELD] == -SAFE)) - ) - cur_score += qk[2] - k; - max_score += qk[2]; - } - - -/** - Now look at how he finished and how far he got. Maxdie and numdie tell us - how well he survived. Gaveup says whether he exited via quit. Dflag will - tell us if he ever got suitably deep into the cave. Closing still indicates - whether he reached the endgame. And if he got as far as "cave closed" - (indicated by "closed"), then bonus is zero for mundane exits or 133, 134, - 135 if he blew it (so to speak). -*/ - - if (g.dflag) - cur_score += 25; - max_score += 25; - if (g.closing) - cur_score += 20; - max_score += 20; - if (g.closed) { - if (g.bonus == 0) - cur_score += 10; - else if (g.bonus == 135) - cur_score += 20; - else if (g.bonus == 134) - cur_score += 25; - else if (g.bonus == 133) - cur_score += 30; - } - max_score += 30; - -/* Deduct points for hints, deaths and quiting. - hints < hntmin are special; see database description -*/ - for (i = 1; i <= HNTMAX; i++) - if (g.hinted[i]) - cur_score -= g.hints[i][2]; - cur_score -= g.numdie * 10; - if (gaveup) - cur_score -= 4; - - fprintf(stdout, "You have found %3d out of %3d Treasures,", - num_treas - g.tally, num_treas); - fprintf(stdout, " using %4d turns\n", g.turns); - fprintf(stdout, "For a score of: %4d", cur_score); - fprintf(stdout, " out of a possible %4d\n", max_score); - - if (cur_score < 110) { - fprintf(stdout, "You are obviously a rank amateur."); - if (!scorng) - fprintf(stdout, " Better luck next time."); - fputc('\n', stdout); - k = 110 - cur_score; - } else if (cur_score < 152) { - fprintf(stdout, - "Your score qualifies you as a Novice Class Adventurer.\n"); - k = 152 - cur_score; - } else if (cur_score < 200) { - fprintf(stdout, - "You have achieved the rating: \"Experienced Adventurer\".\n"); - k = 200 - cur_score; - } else if (cur_score < 277) { - fprintf(stdout, - "You may now consider yourself a \"Seasoned Adventurer\".\n"); - k = 277 - cur_score; - } else if (cur_score < 345) { - fprintf(stdout, - "You have reached \"Junior Master\" status.\n"); - k = 345 - cur_score; - } else if (cur_score < 451) { - fprintf(stdout, - "Your score puts you in Master Adventurer Class C.\n"); - k = 451 - cur_score; - } else if (cur_score < 471) { - fprintf(stdout, - "Your score puts you in Master Adventurer Class B.\n"); - k = 471 - cur_score; - } else if (cur_score < 501) { - fprintf(stdout, - "Your score puts you in Master Adventurer Class A.\n"); - k = 501 - cur_score; - } else { - fprintf(stdout, - "All of Adventuredom gives tribute to you, Adventurer Grandmaster!\n"); - k = 0; - } - - if (!scorng) { - kk2c = (k == 1) ? "." : "s."; - printf("\nTo acheive the next higher rating,"); - if (cur_score == 501) - printf(" would be a neat trick!\n\n CONGRATULATIONS!!\n"); - else - printf(" you need %3d more point%s\n", k, kk2c); - } - return; -} diff --git a/commands/advent/setup.c b/commands/advent/setup.c deleted file mode 100644 index dc15f37f6..000000000 --- a/commands/advent/setup.c +++ /dev/null @@ -1,105 +0,0 @@ -/** program SETUP.C * - * execution will read the four adventure text files * - * files; "advent1.txt", "advent2.txt", "advent3.txt" & * - * "advent4.txt". it will create the file "advtext.h" * - * which is an Index Sequential Access Method (ISAM) * - * header to be #included into "advent.c" before the * - * header "advdec.h" is #included. */ - - -#include -#include -#include "advent.h" - -_PROTOTYPE(void file_error, (char *)); -_PROTOTYPE(void encode, (unsigned char *)); - -int main(int argc, char *argv[]) -{ - - FILE *isam, *src, *dest; - char itxt[255]; - int cnt, i; - long llen; - char filename[100]; - char *inputprefix = "."; - static char *headername[] = { - "idx1[MAXLOC]", "idx2[MAXLOC]", "idx3[MAXOBJ]", "idx4[MAXMSG]", - }; - - long x29 = (1L << 29), x30 = (1L << 30); - - if(argc > 1) { - inputprefix=argv[1]; - } - - if (!(x30 / 2 == x29 && 0L < x30 && x29 < x30)) { - fprintf(stderr, "Sorry, advent needs 32-bit `long int's.\n"); - exit(EXIT_FAILURE); - } - sprintf(filename, "%s/advtext.h", inputprefix); - isam = fopen(filename, "w"); - if (!isam) { - fprintf(stderr, "Sorry, I can't open advtext.h...\n"); - exit(EXIT_FAILURE); - } - fprintf(isam, "\n/*\theader: ADVTEXT.H\t\t\t\t\t*/\n\n\n"); - - for (i = 1; i <= 4; i++) { - cnt = -1; - llen = 0L; - sprintf(filename, "%s/advent%d.txt", inputprefix, i); - src = fopen(filename, "r"); - if (!src) - file_error(filename); - sprintf(filename, "advent%d.dat", i); - dest = fopen(filename, "w"); - if (!dest) - file_error(filename); - fprintf(isam, "long\t%s = {\n\t", headername[i - 1]); - while (fgets(itxt, 255, src)) { - encode((unsigned char *) itxt); - if (fprintf(dest, "%s\n", itxt) == EOF) - file_error(filename); - if (itxt[0] == '#') { - if (llen) - fprintf(isam, "%ld,%s\t", llen, - &"\0\0\0\0\0\0\0\n"[++cnt & 7]); - llen = ftell(dest); - if (llen <= 0) { - fprintf(stderr, "ftell err in %s\n", filename); - exit(EXIT_FAILURE); - } /* if (!llen) */ - } /* if (itxt[0]) */ - } /* while fgets */ - if (fprintf(isam, "%ld\n\t};\n\n", llen) == EOF) - file_error("advtext.h"); - fclose(src); - if (fclose(dest) == EOF) - file_error(filename); - } - - if (fclose(isam) == EOF) - file_error("advtext.h"); - return EXIT_SUCCESS; -} /* main */ - -void file_error(filename) -char *filename; -{ - perror(filename); - exit(EXIT_FAILURE); -} - -_CONST unsigned char key[4] = {'c' | 0x80, 'L' | 0x80, 'y' | 0x80, 'D' | 0x80}; - -void encode(msg) -unsigned char *msg; -{ - register int i; - - for (i = 1; msg[i]; i++) - msg[i] ^= key[i & 3]; - msg[--i] = '\0'; - return; -} diff --git a/commands/advent/travel.c b/commands/advent/travel.c deleted file mode 100644 index 3adf7de12..000000000 --- a/commands/advent/travel.c +++ /dev/null @@ -1,336 +0,0 @@ -/* module TRAVEL.C * - * Routine to handle motion requests */ - - -#include -#include -#include "advent.h" -#include "advdec.h" -#include "advcave.h" - -struct trav travel[MAXTRAV]; -static int kalflg; -static int bcrossing = 0; -static int phuce[2][4] = {158, 160, 167, 166, - 160, 158, 166, 167}; - -_PROTOTYPE(static void goback, (void)); -_PROTOTYPE(static void ck_kal, (void)); -_PROTOTYPE(static void dotrav, (void)); -_PROTOTYPE(static void badmove, (void)); -_PROTOTYPE(static void spcmove, (int rdest)); - -void domove() -{ - gettrav(g.loc, travel); - switch (motion) { - case NULLX: - break; - case BACK: - goback(); - break; - case CAVE: - if (outside(g.loc)) - rspeak(57); - else - rspeak(58); - break; - default: - g.oldloc2 = g.oldloc; - g.oldloc = g.loc; - dotrav(); - } - newtravel = TRUE; - return; -} - -/* - Routine to handle request to return - from whence we came! -*/ -static void goback() -{ - int kk, k2, want, temp; - struct trav strav[MAXTRAV]; - - want = forced(g.oldloc) ? g.oldloc2 : g.oldloc; - g.oldloc2 = g.oldloc; - g.oldloc = g.loc; - k2 = 0; - if (want == g.loc) { - rspeak(91); - ck_kal(); - return; - } - for (kk = 0; travel[kk].tdest != -1; ++kk) { - if (!travel[kk].tcond && travel[kk].tdest == want) { - motion = travel[kk].tverb; - dotrav(); - return; - } - if (!travel[kk].tcond) { - temp = travel[kk].tdest; - gettrav(temp, strav); - if (forced(temp) && strav[0].tdest == want) - k2 = temp; - } - } - if (k2) { - motion = travel[k2].tverb; - dotrav(); - } else - rspeak(140); - ck_kal(); - return; -} - -static void ck_kal() -{ - if (g.newloc >= 242 && g.newloc <= 247) { - if (g.newloc == 242) - kalflg = 0; - else if (g.newloc == (g.oldloc + 1)) - kalflg++; - else - kalflg = -10; - } -} - -/* - Routine to figure out a new location - given current location and a motion. -*/ -static void dotrav() -{ - unsigned char mvflag, hitflag, kk; - int rdest, rverb, rcond, robject; - int pctt; - - g.newloc = g.loc; - mvflag = hitflag = 0; - pctt = ranz(100); - - for (kk = 0; travel[kk].tdest >= 0 && !mvflag; ++kk) { - rdest = travel[kk].tdest; - rverb = travel[kk].tverb; - rcond = travel[kk].tcond; - robject = rcond % 100; - - if ((rverb != 1) && (rverb != motion) && !hitflag) - continue; - ++hitflag; - switch (rcond / 100) { - case 0: - if ((rcond == 0) || (pctt < rcond)) - ++mvflag; - break; - case 1: - if (robject == 0) - ++mvflag; - else if (toting(robject)) - ++mvflag; - break; - case 2: - if (toting(robject) || at(robject)) - ++mvflag; - break; - case 3: - case 4: - case 5: - case 7: - if (g.prop[robject] != (rcond / 100) - 3) - ++mvflag; - break; - default: - bug(37); - } - } - if (!mvflag) - badmove(); - else if (rdest > 500) - rspeak(rdest - 500); - else if (rdest > 300) - spcmove(rdest); - else { - g.newloc = rdest; - ck_kal(); - } - newtravel = TRUE; - return; -} - -/* - The player tried a poor move option. -*/ -static void badmove() -{ - int msg; - - msg = 12; - if (motion >= 43 && motion <= 50) - msg = 9; - if (motion == 29 || motion == 30) - msg = 9; - if (motion == 7 || motion == 36 || motion == 37) - msg = 10; - if (motion == 11 || motion == 19) - msg = 11; - if (motion == 62 || motion == 65 || motion == 82) - msg = 42; - if (motion == 17) - msg = 80; - rspeak(msg); - return; -} - -/* - Routine to handle very special movement. -*/ -static void spcmove(rdest) -int rdest; -{ - int load, obj, k; - - switch (rdest - 300) { - case 1: /* plover movement via alcove */ - load = burden(0); - if (!load || (load == burden(EMERALD) && holding(EMERALD))) - g.newloc = (99 + 100) - g.loc; - else - rspeak(117); - break; - case 2: /* trying to remove plover, bad - route */ - if (enclosed(EMERALD)) - extract(EMERALD); - drop(EMERALD, g.loc); - g.newloc = 33; - break; - case 3: /* troll bridge */ - if (g.prop[TROLL] == 1) { - pspeak(TROLL, 1); - g.prop[TROLL] = 0; - move(TROLL2, 0); - move((TROLL2 + MAXOBJ), 0); - move(TROLL, plac[TROLL]); - move((TROLL + MAXOBJ), fixd[TROLL]); - juggle(CHASM); - g.newloc = g.loc; - } else { - g.newloc = plac[TROLL] + fixd[TROLL] - g.loc; - if (g.prop[TROLL] == 0) - g.prop[TROLL] = 1; - if (toting(BEAR)) { - rspeak(162); - g.prop[CHASM] = 1; - g.prop[TROLL] = 2; - drop(BEAR, g.newloc); - g.fixed[BEAR] = -1; - g.prop[BEAR] = 3; - if (g.prop[SPICES] < 0) - ++g.tally2; - g.oldloc2 = g.newloc; - death(); - } - } - break; - case 4: - /* Growing or shrinking in area of tiny door. Each time he - does this, everything must be moved to the new loc. - Presumably, all his possesions are shrunk or streched along - with him. Phuce[2][4] is an array containg four pairs of - "here" (K) and "there" (KK) locations. */ - k = phuce[0][g.loc - 161]; - g.newloc = phuce[1][g.loc - 161]; - for (obj = 1; obj < MAXOBJ; obj++) { - if (obj == BOAT) - continue; - if (g.place[obj] == k && (g.fixed[obj] == 0 || g.fixed[obj] == -1)) - move(obj, g.newloc); - } - break; - case 5: - /* Phone booth in rotunda. Trying to shove past gnome, to get - into phone booth. */ - if ((g.prop[BOOTH] == 0 && pct(35)) || g.visited[g.loc] == 1) { - rspeak(263); - g.prop[BOOTH] = 1; - move(GNOME, 188); - } else { - if (g.prop[BOOTH] == 1) - rspeak(253); - else - g.newloc = 189; - } - break; - case 6: - /* Collapsing clay bridge. He can cross with three (or fewer) - thing. If more, of if carrying obviously heavy things, he - may end up in the drink. */ - g.newloc = g.loc == 235 ? 190 : 235; - bcrossing++; - load = burden(0); - if (load > 4) { - k = (load + bcrossing) * 6 - 10; - if (!pct(k)) - rspeak(318); - else { - rspeak(319); - g.newloc = 236; - if (holding(LAMP)) - move(LAMP, 236); - if (toting(AXE) && enclosed(AXE)) - extract(AXE); - if (holding(AXE)) - move(AXE, 208); - for (obj = 1; obj < MAXOBJ; obj++) - if (toting(obj)) - destroy(obj); - g.prop[CHASM2] = 1; - } - } - break; - case 7: - /* Kaleidoscope code is here. */ - if (kalflg == 5) { - g.newloc = 248; - g.oldloc = 247; - } else { - g.newloc = 242 + ranz(5); - g.oldloc = g.newloc - 1; - kalflg = g.newloc == 242 ? 0 : -10; - } - break; - default: - bug(38); - } - return; -} - -/* - Routine to fill travel array for a given location -*/ -void gettrav(loc, travel) -int loc; -struct trav *travel; -{ - int i; - long t, *lptr; - - lptr = cave[loc - 1]; - for (i = 0; i < MAXTRAV; i++) { - t = *lptr++; - if (!(t)) { - travel->tdest = -1; /* end of array */ - return; /* terminate for loop */ - } - travel->tverb = (int) (t % 1000); - t /= 1000; - travel->tdest = (int) (t % 1000); - t /= 1000; - travel->tcond = (int) (t % 1000); - travel++; - } - bug(25); - return; -} diff --git a/commands/advent/turn.c b/commands/advent/turn.c deleted file mode 100644 index 2e2d63835..000000000 --- a/commands/advent/turn.c +++ /dev/null @@ -1,729 +0,0 @@ -/* program TURN.C */ - - -#include -#include -#include "advent.h" -#include "advdec.h" - -_PROTOTYPE(void descitem, (void)); -_PROTOTYPE(void domove, (void)); -_PROTOTYPE(void goback, (void)); -_PROTOTYPE(void copytrv, (struct trav *, struct trav *)); -_PROTOTYPE(void dotrav, (void)); -_PROTOTYPE(void badmove, (void)); -_PROTOTYPE(void spcmove, (int)); -_PROTOTYPE(void death, (void)); -_PROTOTYPE(void dwarves, (void)); -_PROTOTYPE(void dopirate, (void)); -_PROTOTYPE(int stimer, (void)); -_PROTOTYPE(void do_hint, (int)); - - -/* - Routine to take 1 turn -*/ -void turn() -{ - int i, hint; - static int waste = 0; - - if (newtravel) { - /* If closing, then he can't leave except via the main office. */ - if (outside(g.newloc) && g.newloc != 0 && g.closing) { - rspeak(130); - g.newloc = g.loc; - if (!g.panic) - g.clock2 = 15; - g.panic = TRUE; - } - /* See if a dwarf has seen him and has come from where he wants - to go. */ - if (g.newloc != g.loc && !forced(g.loc) && g.loc_attrib[g.loc] & NOPIRAT == 0) - for (i = 1; i < (DWARFMAX - 1); ++i) - if (g.odloc[i] == g.newloc && g.dseen[i]) { - g.newloc = g.loc; - rspeak(2); - break; - } - - g.loc = g.newloc; - dwarves(); /* & special dwarf(pirate who - steals) */ - - /* Check for death */ - if (g.loc == 0) { - death(); - return; - } - /* Check for forced move */ - if (forced(g.loc)) { - desclg(g.loc); - ++g.visited[g.loc]; - domove(); - return; - } - /* Check for wandering in dark */ - if (g.wzdark && dark() && pct(35)) { - rspeak(23); - g.oldloc2 = g.loc; - death(); - return; - } - /* see if he is wasting his batteies out in the open */ - if (outside(g.loc) && g.prop[LAMP]) { - waste++; - if (waste > 11) { - rspeak(324); - waste = 0; - } - } else - waste = 0; - - /* If wumpus is chasing stooge, see if wumpus gets him */ - if (g.chase) { - g.chase++; - g.prop[WUMPUS] = g.chase / 2; - move(WUMPUS, g.loc); - if (g.chase >= 10) { - if (dark()) - rspeak(270); - pspeak(WUMPUS, 5); - death(); - return; - } - } - /* check for radiation poisoning. */ - g.health += (outside(g.loc)) ? 3 : 1; - if (g.health > 100) - g.health = 100; - if (here(RADIUM) && (g.place[RADIUM] != -SHIELD || ajar(SHIELD))) - g.health -= 7; - if (g.health < 60) { - rspeak(391 + (60 - g.health) / 10); - if (g.health < 0) { - death(); - return; - } - } - if ((g.oldloc == 188) && (g.loc != 188 && g.loc != 189) - && (g.prop[BOOTH] == 1)) { - move(GNOME, 0); - g.prop[BOOTH] = 0; - } - /* Describe his situation */ - describe(); - if (!blind()) { - ++g.visited[g.loc]; - descitem(); - } - } /* end of newtravel start for - second entry point */ - /* Check if this location is eligible for any hints. If been here - long enough, branch to help section. Ignore "hints" < HNTMIN - (special stuff, see database notes. */ - for (hint = HNTMIN; hint <= HNTMAX; hint++) { - if (g.hinted[hint]) - continue; - if (g.loc_attrib[g.loc] / 256 != hint - 6) - g.hintlc[hint] = -1; - g.hintlc[hint]++; - if (g.hintlc[hint] >= g.hints[hint][1]) - do_hint(hint); - } - - if (g.closed) { - if (g.prop[OYSTER] < 0 && toting(OYSTER)) - pspeak(OYSTER, 1); - for (i = 1; i < MAXOBJ; ++i) - if (toting(i) && g.prop[i] < 0) - g.prop[i] = -1 - g.prop[i]; - } - g.wzdark = dark(); - if (g.knfloc > 0 && g.knfloc != g.loc) - g.knfloc = 0; - ++g.turns; - i = rand(); - - if (stimer()) /* as the grains of sand slip - by */ - return; - - while (!english()) /* retrieve player instructions */ - ; - - vrbx = 1; - objx = objs[1] ? 1 : 0; - iobx = iobjs[1] ? 1 : 0; - verb = VAL(verbs[vrbx]); - do { - object = objx ? objs[objx] : 0; - iobj = iobx ? iobjs[iobx] : 0; - if (object && (objs[2] || iobjs[2])) { - pspeak(object, -1); - printf(" "); - } - switch (CLASS(verbs[vrbx])) { - case MOTION: - motion = verb; - domove(); - break; - case NOUN: - bug(22); - case ACTION: - if (object || iobj) - trverb(); - else - itverb(); - break; - case MISC: - rspeak(verb); - if (verb == 51) - g.hinted[1] = TRUE; - break; - default: - bug(22); - } - if (objx) { - objx++; - if (objs[objx] == 0) - objx = 0; - } - if ((!objx || !objs[objx]) && iobx) { - iobx++; - if (iobjs[iobx] == 0) - iobx = 0; - if (iobx && iobjs[1]) - objx = 1; - } - } while (objx || iobx); - return; -} - -/* - Routine to describe current location -*/ -void describe() -{ - if (toting(BEAR)) - rspeak(141); - if (dark()) - rspeak(16); - else if ((g.terse && verb != LOOK) || g.visited[g.loc] % g.abbnum) - descsh(g.loc); - else - desclg(g.loc); - if (g.loc == 33 && pct(25) && !g.closing) - rspeak(8); - if (g.loc == 147 && !g.visited[g.loc]) - rspeak(216); - return; -} - -/* - Routine to describe visible items -*/ -void descitem() -{ - int i, state; - - for (i = 1; i < MAXOBJ; ++i) { - if (at(i)) { - if (i == STEPS && toting(NUGGET)) - continue; - if (g.prop[i] < 0) { - if (g.closed) - continue; - else { - g.prop[i] = 0; - if (i == RUG || i == CHAIN - || i == SWORD || i == CASK) - g.prop[i] = 1; - if (i == CLOAK || i == RING) - g.prop[i] = 2; - --g.tally; - } - } - if (i == STEPS && g.loc == g.fixed[STEPS]) - state = 1; - else - state = g.prop[i] % 8; - pspeak(i, state); - lookin(i); - } - } - /* If remaining treasures too elusive, zap his lamp */ - if (g.tally == g.tally2 && g.tally != 0 && g.limit > 35) - g.limit = 35; - return; -} - -/* - Routine to handle player's demise via - waking up the dwarves... -*/ -void dwarfend() -{ - rspeak(136); - normend(); - return; -} - -/* - normal end of game -*/ -void normend() -{ - score(FALSE); - gaveup = TRUE; - return; -} - -/* - Routine to handle the passing on of one - of the player's incarnations... -*/ -void death() -{ - int yea, j; - - if (!g.closing) { - if (g.limit < 0) { - rspeak(185); - normend(); - return; - } - yea = yes(81 + g.numdie * 2, 82 + g.numdie * 2, 54); - if (++g.numdie >= MAXDIE || !yea) - normend(); - if (g.chase) { - g.chase = FALSE; - g.prop[WUMPUS] = 0; - move(WUMPUS, 174); - } - if (toting(LAMP)) - g.prop[LAMP] = 0; - for (j = 1; j < MAXOBJ; ++j) { - if (toting(j)) - drop(j, j == LAMP ? 1 : g.oldloc2); - if (wearng(j)) { - g.prop[j] = 0; - bitoff(j, WEARBT); - } - } - g.newloc = 3; - g.oldloc = g.loc; - g.health = 100; - return; - } - /* Closing -- no resurrection... */ - rspeak(131); - ++g.numdie; - normend(); - return; -} - -/* - dwarf stuff. -*/ -void dwarves() -{ - int i, j, k, attack, stick, dtotal; - - /* See if dwarves allowed here */ - if (g.newloc == 0 || forced(g.newloc) || g.loc_attrib[g.newloc] & NOPIRAT) - return; - - /* See if dwarves are active. */ - if (!g.dflag) { - if (inside(g.newloc)) - ++g.dflag; - return; - } - /* If first close encounter (of 3rd kind) */ - if (g.dflag == 1) { - if (!inside(g.newloc) || pct(85)) - return; - ++g.dflag; - - /* kill 0, 1 or 2 of the dwarfs */ - for (i = 1; i < 3; ++i) - if (pct(50)) - g.dloc[(ranz(DWARFMAX - 1)) + 1] = 0; - - /* If any of the survivors is at location, use alternate choise */ - for (i = 1; i <= DWARFMAX; ++i) { - if (g.dloc[i] == g.newloc) - g.dloc[i] = g.daltloc; - g.odloc[i] = g.dloc[i]; - } - rspeak(3); - drop(AXE, g.newloc); - return; - } - /* Things are in full swing. Move each dwarf at random, except if - he's seen us then he sticks with us. Dwarfs never go to - locations outside or meet the bear or following him into dead - end in maze. And of couse, dead dwarves don't do much of - anything. */ - - dtotal = attack = stick = 0; - for (i = 1; i <= DWARFMAX; ++i) { - if (g.dloc[i] == 0) - continue; - /* Move a dwarf at random. we don't have a matrix around to do - it as in the original version... */ - do - j = ranz(106) + 15; - /* allowed area */ - while (j == g.odloc[i] || j == g.dloc[i] - || g.loc_attrib[j] & NOPIRAT); - - if (j == 0) - bug(36); - g.odloc[i] = g.dloc[i]; - g.dloc[i] = j; - - g.dseen[i] = ((g.dseen[i] && inside(g.newloc)) - || g.dloc[i] == g.newloc - || g.odloc[i] == g.newloc); - - if (g.dseen[i]) { - g.dloc[i] = g.newloc; - if (i == DWARFMAX) - dopirate(); - else { - ++dtotal; - if (g.odloc[i] == g.dloc[i]) { - ++attack; - if (g.knfloc >= 0) - g.knfloc = g.newloc; - if (ranz(1000) < (45 * (g.dflag - 2))) - ++stick; - } - } - } - } - - /* Now we know shat's happing, let's tell the poor sucker about it */ - if (dtotal == 0) - return; - if (dtotal > 1) - printf("There are %d threatening little dwarves in the room with you!\n", dtotal); - else - rspeak(4); - if (attack == 0) - return; - if (g.dflag == 2) - ++g.dflag; - if (attack > 1) { - printf("%d of them throw knives at you!!\n", attack); - k = 6; - } else { - rspeak(5); - k = 52; - } - if (stick <= 1) { - rspeak(stick + k); - if (stick == 0) - return; - } else - printf("%d of them get you !!!\n", stick); - g.oldloc2 = g.newloc; - death(); - return; -} - -/* - pirate stuff -*/ -void dopirate() -{ - int j; - boolean k; - - if (g.newloc == g.chloc || g.prop[CHEST] >= 0) - return; - k = FALSE; - /* Pirate won't take pyramid from plover room or dark room (too - easy! ) */ - for (j = 1; j < MAXOBJ; ++j) - if (treasr(j) && !(j == CASK && liq(CASK) == WINE) - && !(j == PYRAMID && (g.newloc == g.place[PYRAMID] - || g.newloc == g.place[EMERALD]))) { - if (toting(j) && athand(j)) - goto stealit; - if (here(j)) - k = TRUE; - } - if (g.tally == g.tally2 + 1 && k == FALSE && g.place[CHEST] == 0 && - athand(LAMP) && g.prop[LAMP] == 1) { - rspeak(186); - move(CHEST, g.chloc); - move(MESSAGE, g.chloc2); - g.dloc[DWARFMAX] = g.chloc; - g.odloc[DWARFMAX] = g.chloc; - g.dseen[DWARFMAX] = 0; - return; - } - if (g.odloc[DWARFMAX] != g.dloc[DWARFMAX] && pct(30)) - rspeak(127); - return; - -stealit: - - rspeak(128); - /* don't steal chest back from troll! */ - if (g.place[MESSAGE] == 0) - move(CHEST, g.chloc); - move(MESSAGE, g.chloc2); - for (j = 1; j < MAXOBJ; ++j) { - if (!treasr(j) || !athand(j) - || (j == PYRAMID && - (g.newloc == plac[PYRAMID] || g.newloc == plac[EMERALD])) - || (j == CASK && (liq(CASK) != WINE))) - continue; - if (enclosed(j)) - extract(j); - if (wearng(j)) { - g.prop[j] = 0; - bitoff(j, WEARBT); - } - insert(j, CHEST); - } - g.dloc[DWARFMAX] = g.chloc; - g.odloc[DWARFMAX] = g.chloc; - g.dseen[DWARFMAX] = FALSE; - return; -} - -/* - special time limit stuff... -*/ -int stimer() -{ - int i, spk; - static int clock3; - - g.foobar = g.foobar > 0 ? -g.foobar : 0; - g.combo = g.combo > 0 ? -g.combo : 0; - if (g.turns > 310 && g.abbnum != 10000 && !g.terse) - rspeak(273); - - /* Bump all the right clocks for reconning battery life and closing */ - if (g.closed) { - clock3--; - if (clock3 == 0) { - g.prop[PHONE] = 0; - g.prop[BOOTH] = 0; - rspeak(284); - } else if (clock3 < -7) { - rspeak(254); - normend(); - return (TRUE); - } - } - if (g.tally == 0 && inside(g.loc) && g.loc != Y2) - --g.clock; - if (g.clock == 0) { - /* Start closing the cave */ - g.prop[GRATE] = 0; - biton(GRATE, LOCKBT); - bitoff(GRATE, OPENBT); - g.prop[FISSURE] = 0; - g.prop[TDOOR] = 0; - biton(TDOOR, LOCKBT); - bitoff(TDOOR, OPENBT); - g.prop[TDOOR2] = 0; - biton(TDOOR2, LOCKBT); - bitoff(TDOOR2, OPENBT); - for (i = 1; i <= DWARFMAX; ++i) { - g.dseen[i] = FALSE; - g.dloc[i] = 0; - } - move(TROLL, 0); - move((TROLL + MAXOBJ), 0); - move(TROLL2, plac[TROLL]); - move((TROLL2 + MAXOBJ), fixd[TROLL]); - juggle(CHASM); - if (g.prop[BEAR] != 3) - destroy(BEAR); - g.prop[CHAIN] = 0; - g.fixed[CHAIN] = 0; - g.prop[AXE] = 0; - g.fixed[AXE] = 0; - rspeak(129); - g.clock = -1; - g.closing = TRUE; - return (FALSE); - } - if (g.clock < 0) - --g.clock2; - if (g.clock2 == 0) { - /* Set up storage room... and close the cave... */ - g.prop[BOTTLE] = put(BOTTLE, 115, 8); - g.holder[BOTTLE] = WATER; - g.place[WATER] = -BOTTLE; - g.hlink[WATER] = 0; - bitoff(BOTTLE, OPENBT); - g.prop[PLANT] = put(PLANT, 115, 0); - g.prop[OYSTER] = put(OYSTER, 115, 0); - g.prop[LAMP] = put(LAMP, 115, 0); - g.prop[ROD] = put(ROD, 115, 0); - g.prop[DWARF] = put(DWARF, 115, 0); - g.loc = 115; - g.oldloc = 115; - g.newloc = 115; - /* Leave the grate with normal (non-negative property). */ - put(GRATE, 116, 0); - biton(GRATE, LOCKBT); - bitoff(GRATE, OPENBT); - g.prop[SNAKE] = put(SNAKE, 116, 1); - g.prop[BIRD] = put(BIRD, 116, 1); - g.prop[CAGE] = put(CAGE, 116, 0); - g.prop[ROD2] = put(ROD2, 116, 0); - g.prop[PILLOW] = put(PILLOW, 116, 0); - - g.prop[BOOTH] = put(BOOTH, 116, -3); - g.fixed[BOOTH] = 115; - g.prop[PHONE] = put(PHONE, 212, -4); - - g.prop[MIRROR] = put(MIRROR, 115, 0); - g.fixed[MIRROR] = 116; - g.prop[BOOK2] = put(BOOK2, 115, 0); - - for (i = 1; i < MAXOBJ; ++i) { - if (toting(i) && enclosed(i)) - extract(i); - if (toting(i)) - destroy(i); - } - rspeak(132); - g.closed = TRUE; - clock3 = 20 + ranz(20); - newtravel = TRUE; - return (TRUE); - } - if (g.prop[LAMP] == 1) - --g.limit; - if (g.limit == 0) { - --g.limit; - g.prop[LAMP] = 0; - if (here(LAMP)) - rspeak(184); - return (FALSE); - } - if (g.limit < 0 && outside(g.loc)) { - rspeak(185); - normend(); - return (TRUE); - } - if (g.limit <= 40) { - if (g.lmwarn || !here(LAMP)) - return (FALSE); - g.lmwarn = TRUE; - spk = 187; - if (g.prop[BATTERIES] == 1) - spk = 323; - if (g.place[BATTERIES] == 0) - spk = 183; - if (g.prop[VEND] == 1) - spk = 189; - rspeak(spk); - return (FALSE); - } - return (FALSE); -} - -/* HINTS - come here if he's been long enough at required location(s) - for some unused hint, hint number is in variable "hint". - Branch to quick test for additional conditions, then - do neet stuff. If conditions are met and we want to offer - hint. Clear hintlc if no action is taken. - */ - -#define MASE 1 -#define DARK 2 -#define WITT 3 -#define H_SWORD 4 -#define SLIDE 5 -#define H_GRATE 6 -#define H_BIRD 7 -#define H_ELFIN 8 -#define RNBOW 9 -#define STYX 10 -#define H_SNAKE 11 -#define CASTLE 12 - -void do_hint(hint) -int hint; -{ - g.hintlc[hint] = 0; - switch (hint + 1 - HNTMIN) { - case MASE: - if (!at(g.loc) && !at(g.oldloc) - && !at(g.loc) && burden(0) > 1) - break; - else - return; - case DARK: - if (g.prop[EMERALD] != -1 && g.prop[PYRAMID] == -1) - break; - else - return; - case WITT: - break; - case H_SWORD: - if ((g.prop[SWORD] == 1 || g.prop[SWORD] == 5) - && !toting(CROWN)) - break; - else - return; - case SLIDE: - break; - case H_GRATE: - if (g.prop[GRATE] == 0 && !athand(KEYS)) - break; - else - return; - case H_BIRD: - if (here(BIRD) && athand(ROD) && object == BIRD) - break; - else - return; - case H_ELFIN: - if (!g.visited[159]) - break; - else - return; - case RNBOW: - if (!toting(SHOES) || g.visited[205]) - break; - else - return; - case STYX: - if (!athand(LYRE) && g.prop[DOG] != 1) - break; - else - return; - case H_SNAKE: - if (here(SNAKE) && !here(BIRD)) - break; - else - return; - case CASTLE: - break; - default: - printf(" TRYING TO PRINT HINT # %d\n", hint); - bug(27); - } - if (!yes(g.hints[hint][3], 0, 54)) - return; - printf("\nI am prepared to give you a hint,"); - printf(" but it will cost you %2d points\n", g.hints[hint][2]); - g.hinted[hint] = yes(175, g.hints[hint][4], 54); - if (g.hinted[hint] && g.limit > 30) - g.limit += 30 * g.hints[hint][2]; - return; -} diff --git a/commands/advent/utility.c b/commands/advent/utility.c deleted file mode 100644 index 40b768616..000000000 --- a/commands/advent/utility.c +++ /dev/null @@ -1,749 +0,0 @@ -/* - Utility Routines - the next logical funtions describe attributes of objects. - (ajar, hinged, opaque, printd, treasr, vessel, wearng) -*/ - -#include -#include -#include -#include -#include "advent.h" -#include "advdec.h" - -/* - ajar .TRUE. if item is container and is open or unhinged -*/ -boolean ajar(item) -int item; -{ - return ((bitset(g.obj_state[item], OPENBT)) - || (vessel(item) && !hinged(item))); -} - -/* - at .TRUE. To tell if player is on either side of a two sided object. -*/ -boolean at(item) -int item; -{ - if (item < 1 || item > MAXOBJ) - return (FALSE); - else - return (g.place[item] == g.loc || g.fixed[item] == g.loc); -} - -/* - athand .TRUE. if item readily reachable - it can be lying here, in hand or in open container. -*/ -boolean athand(item) -int item; -{ - int contnr; - boolean aaa; - - contnr = -g.place[item]; - aaa = enclosed(item) && ajar(contnr); - - return ((g.place[item] == g.loc) || holding(item) - || (aaa && ((g.place[contnr] == g.loc) - || (toting(item) && holding(contnr))))); -} - -/* - bitoff turns off (sets to 0) a bit in obj_state word -*/ -void bitoff(obj, bit) -int obj, bit; -{ - long val; - - val = 1L << bit; - g.obj_state[obj] &= ~val; -} - -/* - biton turns on (sets to 1) a bit in obj_state word -*/ -void biton(obj, bit) -int obj, bit; -{ - long val; - - val = 1L << bit; - g.obj_state[obj] |= val; -} - -/* - bitset .TRUE. if object_state has bit N set -*/ -boolean bitset(state, bit) -long state; -int bit; -{ - return (((state >> bit) & 1) == 1); -} - -/* - blind .TRUE. if you can't see at this loc, (darkness of glare) -*/ -boolean blind() -{ - return (dark() || (g.loc == 200 - && athand(LAMP) && (g.prop[LAMP] == 1))); -} - -/* - burden .. returns weight of items being carried - - if obj=0, burden calculates the total weight of the adventurer's burden - including everything in all containers (except the boat) that he is - carring. - - if object is a container, calculate the weight of everything inside - the container (including the container itself). Since donkey FORTRAN - isn't recursive, we will only calculate weight of contained containers - one level down. The only serious contained container would be the sack - The only thing we'll miss will be filled VS empty bottle or cage. - - If object isn't a container, return its weight. -*/ -int burden(obj) -int obj; -{ - int i, sum, temp; - - sum = 0; - if (obj == 0) { - for (i = 1; i < MAXOBJ; i++) { - if (toting(i) && (g.place[i] != -BOAT)) - sum += g.weight[i]; - } - } else { - if (obj != BOAT) { - sum = g.weight[obj]; - temp = g.holder[obj]; - while (temp != 0) { - sum += g.weight[temp]; - temp = g.hlink[temp]; - } - } - } - return (sum); -} - -/* - Routine to carry an object - start toting an object, removing it from the list of things - at its former location. If object > MAXOBJ ( moving "FIXED" - or second loc), then don't change place. -*/ -void carry(obj, where) -int obj, where; -{ - int temp; - - if (obj < MAXOBJ) { - if (g.place[obj] == -1) - return; - g.place[obj] = -1; - } - if (g.atloc[where] == obj) - g.atloc[where] = g.link[obj]; - else { - temp = g.atloc[where]; - while (g.link[temp] != obj) { - temp = g.link[temp]; - if (temp == 0) - bug(35); - } - g.link[temp] = g.link[obj]; - } - return; -} - -/* - confuz generates some variant of "Don't understand that" message. -*/ -int confuz() -{ - int msg; - - msg = 60; - if (pct(50)) - msg = 61; - if (pct(33)) - msg = 13; - if (pct(25)) - msg = 347; - if (pct(20)) - msg = 195; - return (msg); -} - -/* - dark .TRUE. if there is no light here -*/ -boolean dark() -{ - return (!(g.loc_attrib[g.loc] & LIGHT) && - (!g.prop[LAMP] || !athand(LAMP))); -} - -/* - Routine to check for presence - of dwarves.. -*/ -int dcheck() -{ - int i; - - for (i = 1; i < (DWARFMAX); ++i) - if (g.dloc[i] == g.loc) - return (i); - return (0); -} - -/* - dead .TRUE. if object is now dead -*/ -boolean dead(obj) -int obj; -{ - return (bitset(g.obj_state[obj], 10)); -} - -/* - drop Place an object at a given loc, prefixing it onto the atloc list. -*/ -void drop(obj, where) -int obj, where; -{ - if (obj > MAXOBJ) - g.fixed[obj - MAXOBJ] = where; - else - g.place[obj] = where; - if (where > 0) { - g.link[obj] = g.atloc[where]; - g.atloc[where] = obj; - } - return; -} - -/* - destroy Permanently eliminate "object" by moving it to - a non-existent location. -*/ -void destroy(obj) -int obj; -{ - move(obj, 0); - return; -} - -/* - edible .TRUE. if obj can be eaten. -*/ -boolean edible(obj) -int obj; -{ - return (bitset(g.obj_state[obj], 7)); -} - -/* - enclosed .TRUE. If object is inside a container. -*/ -boolean enclosed(item) -int item; -{ - if (item < 1 || item > MAXOBJ) - return (FALSE); - else - return (g.place[item] < -1); -} - -/* - extract remove "object" from a container. - origionally name "remove" but rename to avoid conflict with stdio.h -*/ -void extract(obj) -int obj; -{ - int contnr, temp; - - contnr = -g.place[obj]; - g.place[obj] = -1; - if (g.holder[contnr] == obj) - g.holder[contnr] = g.hlink[obj]; - else { - temp = g.holder[contnr]; - while (g.hlink[temp] != obj) { - temp = g.hlink[temp]; - if (temp == 0) - bug(35); - } - g.hlink[temp] = g.hlink[obj]; - } - return; -} - -/* - forced To tell if a location will causes a forced move. - A forced location is one from which he is immediately bounced - to another. Normal use is for death (forced to location zero) - and for description of journey from on place to another. -*/ -int forced(at_loc) -int at_loc; -{ - return ((g.loc_attrib[at_loc] & 10) == 2); -} - -/* - here .TRUE. If an item is at location or is being carried. -*/ -boolean here(item) -int item; -{ - return (g.place[item] == g.loc || toting(item)); -} - -/* - hinged .TRUE. If object can be opened or shut. -*/ -boolean hinged(object) -int object; -{ - return (bitset(g.obj_state[object], 1)); -} - -/* - holding .TRUE. If the object is being carried in hand. -*/ -boolean holding(item) -int item; -{ - if (item < 1 || item > MAXOBJ) - return (FALSE); - else - return (g.place[item] == -1); -} - -/* - insert -*/ -void insert(obj, contnr) -int obj, contnr; -{ - int temp; - - if (contnr == obj) - bug(32); - carry(obj, g.loc); - - temp = g.holder[contnr]; - g.holder[contnr] = obj; - g.hlink[obj] = temp; - g.place[obj] = -contnr; -} - -/* - inside = .TRUE. If location is well within cave -*/ -boolean inside(loc) -int loc; -{ - return (!outside(loc) && !portal(loc)); -} - -/* - Juggle an object by picking it up and putting it down again, - The purpose being to get the object to the front of the chain - at its loc. -*/ -void juggle(obj) -int obj; -{ - int i, j; - - i = g.place[obj]; - j = g.fixed[obj]; - move(obj, i); - move(obj + MAXOBJ, j); - return; -} - -/* - Determine liquid in the vessel -*/ -int liq(item) -int item; -{ - int liquid; - - if ((item == BOTTLE) || (item == CASK)) - liquid = liq2(((int) g.prop[item] >> 1) & 7); - else - liquid = 0; - - return (liquid); -} - -/* - Determine type of liquid in vessel -*/ -int liq2(liquid) -int liquid; -{ - switch (liquid) { - case 4: - return (WATER); - case 5: - return (OIL); - case 6: - return (WINE); - default: - return (0); /* empty */ - } -} - -/* - Determine liquid at a location -*/ -int liqloc(loc) -int loc; -{ - return (liq2((int) ((g.loc_attrib[loc] >> 1) & 7))); -} - -/* - living .TRUE. If object is living, bear for example -*/ -boolean living(obj) -int obj; -{ - return (bitset(g.obj_state[obj], 9)); -} - -/* - locked .TRUE. if lockable object is locked -*/ -boolean locked(item) -int item; -{ - return (bitset(g.obj_state[item], 4)); -} - -/* - locks .TRUE. if you can lock this object -*/ -boolean locks(item) -int item; -{ - return (bitset(g.obj_state[item], 3)); -} - -/* - LOOKIN list contents if obj is a container and is open or transparent. -*/ -void lookin(contnr) -int contnr; -{ - int temp; - boolean first_time; - - if (vessel(contnr) && (ajar(contnr) || !opaque(contnr))) { - temp = g.holder[contnr]; - first_time = TRUE; - while (temp != 0) { - if (first_time) - rspeak(360); - printf(" "); - pspeak(temp, -1); - temp = g.hlink[temp]; - first_time = FALSE; - } - } - return; -} - -/* - Routine to move an object -*/ -void move(obj, where) -int obj, where; -{ - int from; - - if (obj > MAXOBJ) - from = g.fixed[obj - MAXOBJ]; - else { - if (enclosed(obj)) - extract(obj); - from = g.place[obj]; - } - if ((from > 0) && (from < MAXOBJ * 2)) - carry(obj, from); - drop(obj, where); - return; -} - -/* - noway, generate's some variant of "can't do that" message. -*/ -int noway() -{ - int msg; - - msg = 14; - if (pct(50)) - msg = 110; - if (pct(33)) - msg = 147; - if (pct(25)) - msg = 250; - if (pct(20)) - msg = 262; - if (pct(17)) - msg = 25; - if (pct(14)) - msg = 345; - if (pct(12)) - msg = 346; - return (msg); -} - -/* - opaque .TRUE. If obj is non-transparent container -*/ -boolean opaque(obj) -int obj; -{ - return (bitset(g.obj_state[obj], 6)); -} - -/* - outsid .TRUE. If location is outside the cave -*/ -boolean outside(loc) -int loc; -{ - return (bitset(g.loc_attrib[loc], 6)); -} - -/* - Routine true x% of the time. (x an integer from 0 to 100) -*/ -int pct(x) -int x; -{ - return (ranz(100) < x); -} - -/* - plural .TRUE. if object is multiple objects -*/ -boolean plural(obj) -int obj; -{ - return (bitset(g.obj_state[obj], 13)); -} - -/* - portal .TRUE. If location is a cave entrance -*/ -boolean portal(loc) -int loc; -{ - return (bitset(g.loc_attrib[loc], 5)); -} - -/* - printed .TRUE. If object can be read. -*/ -boolean printed(obj) -int obj; -{ - return (bitset(g.obj_state[obj], 8)); -} - -/* - put is the same as move, except it returns a - value used to set the negated prop values - for the repository objects. -*/ -int put(obj, where, pval) -int obj, where, pval; -{ - move(obj, where); - return ((-1) - pval); -} - -/* - RANZ -*/ -int ranz(range) -int range; -{ - return (rand() % range); -} - -/* - small .TRUE. If object fits in sack or small container -*/ -boolean small(obj) -int obj; -{ - return (bitset(g.obj_state[obj], 5)); -} - -/* - toting .TRUE. If an item is being caried. -*/ -int toting(item) -int item; -{ - boolean aaa, bbb, ccc; - int contnr, outer, outer2; - - contnr = -g.place[item]; - outer = -g.place[contnr]; - outer2 = -g.place[outer]; - - aaa = holding(contnr); - bbb = enclosed(contnr) && holding(outer); - ccc = enclosed(outer) && holding(outer2); - - return (holding(item) || (enclosed(item) && (aaa || bbb || ccc))); -} - -/* - treasr .TRUE. If object is valuable for points -*/ -boolean treasr(obj) -int obj; -{ - return (bitset(g.obj_state[obj], 14)); -} - -/* - vessel .TRUE. if object can hold a liquid -*/ -boolean vessel(obj) -int obj; -{ - return (bitset(g.obj_state[obj], 15)); -} - -/* - wearng .TRUE. If wearing obj -*/ -boolean wearng(item) -int item; -{ - return (bitset(g.obj_state[item], WEARBT)); -} - -/* - worn .TRUE. if object is being worn -*/ -boolean worn(obj) -int obj; -{ - return (bitset(g.obj_state[obj], 11)); -} - -static char *e_msg[] = { - "message line > 70 characters", /* 00 */ - "null line in message", /* 01 */ - "too many words of messages", /* 02 */ - "too many travel options", /* 03 */ - "too many vocabulary words", /* 04 */ - "required vocabulary word not found", /* 05 */ - "too many rtext or mtext messages", /* 06 */ - "too many hints", /* 07 */ - "location has loc_attrib bit being set twice", /* 08 */ - "invalid section number in database", /* 09 */ - "out of order locs or rspeak entries.", /* 10 */ - "illegal motion word in travel table", /* 11 */ - "** unused **.",/* 12 */ - "unknown or illegal word in adjective table.", /* 13 */ - "illegal word in prep/obj table", /* 14 */ - "too many entries in prep/obj table", /* 15 */ - "object has condition bit set twice", /* 16 */ - "object number too large", /* 17 */ - "too many entries in adjective/noun table.", /* 18 */ - "** unused **.",/* 19 */ - "special travel (500>l>300) exceeds goto list", /* 20 */ - "ran off end of vocabulary table", /* 21 */ - "verb class (n/1000) not between 1 and 3", /* 22 */ - "intransitive action verb exceeds goto list", /* 23 */ - "transitive action verb exceeds goto list", /* 24 */ - "conditional travel entry with no alternative", /* 25 */ - "location has no travel entries", /* 26 */ - "hint number exceeds goto list", /* 27 */ - "invalid month returned by date function", /* 28 */ - "action verb 'leave' has no object.", /* 29 */ - "preposition found in unexpected table", /* 30 */ - "received an unexpected word terminator from a1toa5", /* 31 */ - "trying to put a container into itself (tricky!)", /* 32 */ - "unknown word class in getwds", /* 33 */ - "** unused **.",/* 34 */ - "trying to carry a non-existent object"}; /* 35 */ - -/* - Fatal error routine -*/ -void bug(n) -unsigned int n; -{ - if (n < 36 && *e_msg[n] != '*') - fprintf(stderr, "Fatal error, probable cause: %s\n", e_msg[n]); - else - fprintf(stderr, "Fatal error number %d - Unused error number!\n", n); - panic((char *) 0, TRUE); -} - -/* - Prompt for input, strip leading and trailing spaces, - return &buf[first non-whitespace]. - Does not return if end of input. -*/ -char * - ask(prompt, buf, buflen) -char *prompt, *buf; -int buflen; -{ - fputs(prompt, stdout); - fflush(stdout); - if (!fgets(buf, buflen, stdin)) - panic("end of input", FALSE); - if (*buf) { - int c; - char *end = buf + strlen(buf); - if (end[-1] != '\n') - /* Skip to end of line */ - while ((c = getchar()) != '\n' && c != EOF); - while (*buf && isspace(*buf)) - buf++; - while (buf <= --end && isspace(*end)) - *end = '\0'; - } - return buf; -} - -/* - save and abort -*/ - -void panic(msg, save) -char *msg; -boolean save; -{ - fprintf(stderr, "\nPANIC: %s%s\n", - msg ? msg : "", save ? ". Save..." : msg ? "" : "aborting."); - if (save) - saveadv("advpanic.sav"); - exit(EXIT_FAILURE); -} diff --git a/commands/advent/verb.c b/commands/advent/verb.c deleted file mode 100644 index c1b46d0c4..000000000 --- a/commands/advent/verb.c +++ /dev/null @@ -1,2142 +0,0 @@ -/* program VERB.C */ - -#include "stdio.h" -#include "advent.h" -#include "advdec.h" - - /* Initialize default verb messages */ -static _CONST int actmsg[56] = { - 0, 24, 29, 0, 33, 0, 33, 38, 38, 42, - 14, 43, 110, 29, 110, 73, 75, 29, 13, 59, - 59, 174, 313, 67, 13, 147, 155, 369, 146, 110, - 13, 13, 24, 25, 110, 262, 14, 29, 271, 14, - 14, 24, 29, 38, 24, 331, 24, 109, 332, 0, - 0, 348, 358, 0, 364, 0}; - -_PROTOTYPE(static int ck_obj, (void)); -_PROTOTYPE(void von, (void)); -_PROTOTYPE(void voff, (void)); -_PROTOTYPE(void vwave, (void)); -_PROTOTYPE(void veat, (void)); -_PROTOTYPE(void vthrow, (void)); -_PROTOTYPE(void vfind, (void)); -_PROTOTYPE(void vfill, (void)); -_PROTOTYPE(void vfeed, (void)); -_PROTOTYPE(void vbreak, (void)); -_PROTOTYPE(void vwake, (void)); -_PROTOTYPE(void vdrop, (void)); -_PROTOTYPE(void vpour, (void)); -_PROTOTYPE(void vput, (void)); -_PROTOTYPE(void vread, (void)); -_PROTOTYPE(void vinsert, (void)); -_PROTOTYPE(void vextract, (void)); -_PROTOTYPE(static boolean do_battle, (int *)); -_PROTOTYPE(void vhit, (void)); -_PROTOTYPE(void vanswer, (void)); -_PROTOTYPE(void vblow, (void)); -_PROTOTYPE(void vdial, (void)); -_PROTOTYPE(void vplay, (void)); -_PROTOTYPE(void vpick, (void)); -_PROTOTYPE(void vput, (void)); -_PROTOTYPE(void vturn, (void)); -_PROTOTYPE(void vget, (void)); -_PROTOTYPE(void vlook, (void)); - - -/* - Routine to process a transitive verb -*/ -void trverb() -{ - newtravel = FALSE; - switch (verb) { - case NOTHING: - case CALM: - case WALK: - case QUIT: - case SCORE: - case FOO: - case SUSPEND: break; - case TAKE: vtake(); break; - case DROP: vdrop(); break; - case SAY: bug(34); break; - case OPEN: vopen(); break; - case CLOSE: vclose(); break; - case LOCK: vlock(); break; - case UNLOCK: vunlock(); break; - case ON: von(); break; - case OFF: voff(); break; - case WAVE: vwave(); break; - case KILL: vkill(); break; - case POUR: vpour(); break; - case EAT: veat(); break; - case DRINK: vdrink(); break; - case RUB: - if (object != LAMP) - rspeak(76); - else - actspk(RUB); - break; - case THROW: - if (prep == PREPDN) - vput(); - else - vthrow(); - break; - case FEED: vfeed(); break; - case FIND: - case INVENTORY: vfind(); break; - case FILL: vfill(); break; - case BLAST: ivblast(); break; - case READ: vread(); break; - case BREAK: vbreak(); break; - case WAKE: vwake(); break; - case REMOVE: vextract(); break; - case YANK: vyank(); break; - case WEAR: vwear(); break; - case HIT: vhit(); break; - case ANSWER: vanswer(); break; - case BLOW: vblow(); break; - case DIAL: vdial(); break; - case PLAY: vplay(); break; - case PICK: vpick(); break; - case PUT: vput(); break; - case TURN: vturn(); break; - case GET: vget(); break; - case INSRT: vinsert(); break; - case LOOK: vlook(); break; - default: - printf("This verb is not implemented yet.\n"); - } - return; -} - -/* - Routine to speak default verb message -*/ -void actspk(verb) -int verb; -{ - int i; - - if (verb < 1 || verb > 55) - bug(39); - i = actmsg[verb]; - if (i) - rspeak(i); - return; -} - -/* - CARRY TAKE etc. -*/ -void vtake() -{ - int msg; - - msg = 0; - if (object == BIRD && !g.closed && athand(BIRD) - && g.place[BIRD] != g.loc) { - rspeak(407); - return; - } - if (prep == PREPOF) { - if (object && iobj) { - rspeak(confuz()); - return; - } else if (!object) { - object = iobj; - iobj = 0; - vdrop(); - return; - } - } - msg = 24; - if (object == BOAT) - msg = 281; - if (plural(object)) - msg = 297; - if (holding(object)) { - rspeak(msg); - return; - } - /* Special case objects and fixed objects */ - msg = ck_obj(); - if (g.fixed[object]) { - rspeak(msg); - return; - } - if (prep == PREPIN) { - vinsert(); - return; - } - /* Special case for liquids */ - if (object == WATER || object == OIL || object == WINE) { - if (here(BOTTLE) && here(CASK)) { - rspeak(315); - return; - } - iobj = object; - if (here(BOTTLE)) { - object = BOTTLE; - if (holding(BOTTLE)) - vfill(); - else - rspeak(312); - return; - } else if (here(CASK)) { - object = CASK; - if (holding(CASK)) - vfill(); - else - rspeak(312); - return; - } else { - rspeak(312); - return; - } - } - if (object != BEAR && ((burden(0) + burden(object)) > 15)) { - if (wearng(object)) { - g.prop[object] = 0; - bitoff(object, WEARBT); - } - rspeak(92); - return; - } - if (prep == PREPFR || enclosed(object)) { - vextract(); - return; - } - msg = 343; - /* Poster: hides wall safe */ - if (object == POSTER && g.place[SAFE] == 0) { - g.prop[POSTER] = 1; - msg = 362; - /* Move safe and wall containing safe into view */ - drop(SAFE, g.loc); - drop(WALL2, g.loc); - } - /* Boat: need the pole to push it */ - if (object == BOAT) { - if (!toting(POLE) && g.place[POLE] != -BOAT) { - rspeak(218); - return; - } else { - g.prop[BOAT] = 1; - msg = 221; - } - } - /* Special case for bird. */ - if (object == BIRD && g.prop[BIRD] <= 0) { - if (athand(ROD)) { - rspeak(26); - return; - } - if (!holding(CAGE)) { - rspeak(27); - return; - } - if (!ajar(CAGE)) { - rspeak(358); - return; - } - insert(BIRD, CAGE); - bitoff(CAGE, OPENBT); - pspeak(object, -1); - rspeak(54); - return; - } - /* SWORD If in anvil, need crown & must yank */ - if (object == SWORD && g.prop[SWORD] != 0) { - if (iobj && iobj != ANVIL) { - rspeak(noway()); - return; - } - if (verb != YANK) - if (!yes(215, 0, 54)) - return; - - if (!wearng(CROWN)) { - g.fixed[SWORD] = -1; - g.prop[SWORD] = 3; - pspeak(SWORD, 2); - return; - } - } - carry(object, g.loc); - if (object == POLE || object == SKEY || object == SWORD - || ((object == CLOAK || object == RING) && !wearng(object)) ) - g.prop[object] = 0; - - if (verb == YANK || object == SWORD) - msg = 204; - rspeak(msg); - return; -} - -static int ck_obj() -{ - int msg; - - msg = noway(); - if (object == PLANT && g.prop[PLANT] <= 0) - msg = 115; - if (object == BEAR && g.prop[BEAR] == 1) - msg = 169; - if (object == CHAIN && g.prop[BEAR] != 0) - msg = 170; - if (object == SWORD && g.prop[SWORD] == 5) - msg = 208; - if (object == CLOAK && g.prop[CLOAK] == 2) - msg = 242; - if (object == AXE && g.prop[AXE] == 2) - msg = 246; - if (object == PHONE) - msg = 251; - if (object == BEES || object == HIVE) - msg = 295; - if (object == STICKS) - msg = 296; - return (msg); -} - -/* - DROP etc. -*/ -void vdrop() -{ - int msg; - - /* Check for dynamite */ - if (holding(ROD2) && object == ROD && !holding(ROD)) - object = ROD2; - if (plural(object)) - msg = 105; - else - msg = 29; - - if (object == liq(BOTTLE)) - object = BOTTLE; - else if (object == liq(CASK)) - object = CASK; - - if (!toting(object)) { - rspeak(msg); - return; - } - if (prep == PREPIN) { - vinsert(); - return; - } - /* Snake and bird */ - if (object == BIRD && here(SNAKE)) { - rspeak(30); - if (g.closed) { - dwarfend(); - return; - } - extract(BIRD); - destroy(SNAKE); - /* Set snake prop for use by travel options */ - g.prop[SNAKE] = 1; - drop(BIRD, g.loc); - return; - } - msg = 344; - if (verb == LEAVE) - msg = 353; - if (verb == THROW) - msg = 352; - if (verb == TAKE) - msg = 54; - if (object == POLE && holding(BOAT)) { - rspeak(280); - return; - } - /* Coins and vending machine */ - if (object == COINS && here(VEND)) { - destroy(COINS); - drop(BATTERIES, g.loc); - pspeak(BATTERIES, 0); - return; - } - /* Bird and dragon (ouch!!) */ - if (object == BIRD && at(DRAGON) && g.prop[DRAGON] == 0) { - rspeak(154); - extract(BIRD); - destroy(BIRD); - if (g.place[SNAKE] == plac[SNAKE]) - g.tally2++; - return; - } - /* Bear and troll */ - if (object == BEAR && at(TROLL)) { - msg = 163; - destroy(TROLL); - destroy(TROLL + MAXOBJ); - move(TROLL2, plac[TROLL]); - move((TROLL2 + MAXOBJ), fixd[TROLL]); - juggle(CHASM); - g.prop[TROLL] = 2; - } - /* Vase */ - else if (object == VASE) { - if (g.loc == plac[PILLOW]) - msg = 54; - else { - g.prop[VASE] = at(PILLOW) ? 0 : 2; - pspeak(VASE, g.prop[VASE] + 1); - if (g.prop[VASE] != 0) - g.fixed[VASE] = -1; - } - } else { - if (worn(object) || object == POLE || object == BOAT) - g.prop[object] = 0; - if (worn(object)) - bitoff(object, WEARBT); - if (object == POLE) - g.prop[BOAT] = 0; - } - - if (enclosed(object)) - extract(object); - drop(object, g.loc); - rspeak(msg); - return; -} - -/* - OPEN. special stuff for opening clam/oyster. - The following can be opened without a key: - clam/oyster, door, pdoor, bottle, cask, cage -*/ -void vopen() -{ - int msg, oyclam; - - if (!hinged(object)) - msg = noway(); - else if (object == PDOOR && g.prop[PDOOR] == 1) - msg = 253; - else if (ajar(object)) - msg = 336; - else if (locks(object) || iobj == KEYS || iobj == SKEY) { - vunlock(); - return; - } else if (locked(object)) - if (object == DOOR) - msg = 111; - else - msg = 337; - else if (object == CLAM || object == OYSTER) { - oyclam = (object == OYSTER ? 1 : 0); - msg = oyclam + holding(object) ? 120 : 124; - if (!athand(TRIDENT)) - msg = 122 + oyclam; - if (iobj != 0 && iobj != TRIDENT) - msg = 376 + oyclam; - - if (msg == 124) { - destroy(CLAM); - drop(OYSTER, g.loc); - drop(PEARL, 105); - } - } else { - msg = 54; - biton(object, OPENBT); - } - rspeak(msg); - return; -} - -/* - close, shut - the following can be closed without keys: - door, pdoor, bottle, cask, cage -*/ -void vclose() -{ - if (!hinged(object)) - rspeak(noway()); - else if (!ajar(object)) - rspeak(338); - else if (locks(object)) - vlock(); - else { - rspeak(54); - bitoff(object, OPENBT); - } -} - -/* - Lamp ON. -*/ -void von() -{ - if (!athand(LAMP)) - actspk(verb); - else if (g.limit < 0) - rspeak(184); - else if (g.prop[LAMP] == 1) - rspeak(321); - else { - g.prop[LAMP] = 1; - if (g.loc == 200) - rspeak(108); - else - rspeak(39); - if (g.wzdark) { - g.wzdark = 0; - describe(); - descitem(); - } - } - return; -} - -/* - Lamp OFF. -*/ -void voff() -{ - if (!athand(LAMP)) - actspk(verb); - else if (g.prop[LAMP] == 0) - rspeak(322); - else { - g.prop[LAMP] = 0; - rspeak(40); - if (dark()) - rspeak(16); - } - return; -} - -/* - WAVE. no effect unless waving rod at fissure. -*/ -void vwave() -{ - if (!holding(object) && - (object != ROD || !holding(ROD2))) - rspeak(29); - else if (object != ROD || !at(FISSURE) || - !holding(object) || g.closing) - actspk(verb); - else if (iobj != 0 && iobj != FISSURE) - actspk(verb); - else { - g.prop[FISSURE] = 1 - g.prop[FISSURE]; - pspeak(FISSURE, 2 - g.prop[FISSURE]); - if (g.chase == 0 || g.prop[FISSURE] != 0) - return; - if ((g.loc == 17 && g.oldloc != 27) - || (g.loc == 27 && g.oldloc != 17)) - return; - /* Demise of the Wumpus. Champ must have just crossed bridge */ - rspeak(244); - g.chase = 0; - drop(RING, 209); - g.prop[WUMPUS] = 6; - move(WUMPUS, 209); - biton(WUMPUS, DEADBT); - if (g.place[AXE] != plac[WUMPUS]) - return; - g.fixed[AXE] = 0; - g.prop[AXE] = 0; - - } - return; -} - -/* - ATTACK, KILL etc. -*/ -void vkill() -{ - int msg, i, k; - boolean survival; - - survival = TRUE; - switch (object) { - case BIRD: - if (g.closed) - msg = 137; - else { - destroy(BIRD); - g.prop[BIRD] = 0; - if (g.place[SNAKE] == plac[SNAKE]) - g.tally2++; - msg = 45; - } - break; - case DWARF: - if (g.closed) { - dwarfend(); - return; - } - survival = do_battle(&msg); - break; - case 0: - msg = 44; - break; - case CLAM: - case OYSTER: - msg = 150; - break; - case DOG: - if (g.prop[DOG] == 1) - msg = 291; - else if (iobj == AXE) { - object = AXE; - iobj = DOG; - vthrow(); - return; - } else - msg = 110; - break; - case SNAKE: - msg = 46; - break; - case TROLL: - if (iobj == AXE) - msg = 158; - else - msg = 110; - break; - case BEAR: - msg = 165 + (g.prop[BEAR] + 1) / 2; - break; - case WUMPUS: - if (g.prop[WUMPUS] == 6) - msg = 167; - else if (iobj == AXE) { - object = AXE; - iobj = WUMPUS; - vthrow(); - return; - } else - msg = 110; - break; - case GNOME: - msg = 320; - break; - case DRAGON: - if (g.prop[DRAGON] != 0) { - msg = 167; - break; - } - if (!yes(49, 0, 0)) - break; - pspeak(DRAGON, 1); - biton(DRAGON, DEADBT); - g.prop[DRAGON] = 2; - g.prop[RUG] = 0; - k = (plac[DRAGON] + fixd[DRAGON]) / 2; - move((DRAGON + MAXOBJ), -1); - move((RUG + MAXOBJ), 0); - move(DRAGON, k); - move(RUG, k); - for (i = 1; i < MAXOBJ; i++) - if (g.place[i] == plac[DRAGON] - || g.place[i] == fixd[DRAGON] - || holding(i)) - move(i, k); - g.loc = k; - g.newloc = k; - return; - default: - actspk(verb); - return; - } - rspeak(msg); - if (!survival) { - g.oldloc2 = g.loc; - death(); - } - return; -} - -static boolean do_battle(msg_ptr) -int *msg_ptr; -{ - boolean survival; - int temp; - - survival = TRUE; - if (iobj == 0) - *msg_ptr = 49; - else if (iobj != AXE && iobj != SWORD) { - *msg_ptr = 355; - survival = FALSE; - } else if (pct(25)) { - temp = iobj; - iobj = object; - object = temp; - vthrow(); - return (TRUE); - } else if (pct(25)) { - *msg_ptr = 355; - survival = FALSE; - } else if (pct(36)) - *msg_ptr = 354; - else { - rspeak(356); - if (pct(61)) - *msg_ptr = 52; - else { - *msg_ptr = 53; - survival = FALSE; - } - } - return (survival); -} - -/* - POUR -*/ -void vpour() -{ - int msg; - - if (object == BOTTLE || object == CASK) { - iobj = object; - object = liq(iobj); - if (object == 0) { - rspeak(316); - return; - } - } else { - if (object < WATER || object > (WINE + 1)) { - rspeak(78); - return; - } - } - if (!holding(BOTTLE) && !holding(CASK)) { - rspeak(29); - return; - } - if (holding(BOTTLE) && liq(BOTTLE) == object) - iobj = BOTTLE; - if (holding(CASK) && liq(CASK) == object) - iobj = CASK; - if (iobj == 0) { - rspeak(29); - return; - } - if (!ajar(iobj)) { - rspeak(335); - return; - } - if (iobj == CASK) - object++; - g.prop[iobj] = 1; - extract(object); - g.place[object] = 0; - msg = 77; - if (iobj == CASK) { - object--; - msg = 104; - } - if (at(PLANT) || at(DOOR) || (at(SWORD) && g.prop[SWORD] != 0)) { - if (at(DOOR)) { - g.prop[DOOR] = 0; - if (object == OIL) { - g.prop[DOOR] = 1; - bitoff(DOOR, LOCKBT); - biton(DOOR, OPENBT); - } - msg = 113 + g.prop[DOOR]; - } else if (at(SWORD)) { - /* If sword is alread oily, don't let him clean it. No - soap. */ - if (g.prop[SWORD] != 5) { - g.prop[SWORD] = 4; - if (object == OIL) { - g.prop[SWORD] = 5; - g.fixed[SWORD] = -1; - } - msg = 206 + g.prop[SWORD] - 4; - } - } else { - msg = 112; - if (object == WATER) { - if (g.prop[PLANT] < 0) - g.prop[PLANT] = -g.prop[PLANT] - 1; - pspeak(PLANT, g.prop[PLANT] + 1); - g.prop[PLANT] = (g.prop[PLANT] + 2) % 6; - g.prop[PLANT2] = g.prop[PLANT] / 2; - newtravel = TRUE; - return; - } - } - } - rspeak(msg); - return; -} - -/* - EAT - If he ate the right thing and is in the right place, move him to - the other place with all his junk. Otherwise, narky message. -*/ -void veat() -{ - int msg, i, k, ll, kk; - - switch (object) { - case HONEY: - g.tally2++; - case FOOD: - destroy(object); - msg = 72; - break; - case BIRD: - case SNAKE: - case CLAM: - case OYSTER: - case FLOWER: - msg = 301; - break; - case DWARF: - case DRAGON: - case TROLL: - case DOG: - case WUMPUS: - case BEAR: - case GNOME: - msg = 250; - break; - case MUSHRM: - case CAKES: - k = object - MUSHRM; - ll = 229 + k; - k = 159 - k; - kk = SKEY; - if (object == MUSHRM) { - kk = TDOOR; - if (g.loc != 158) - g.tally2++; - } - destroy(object); - msg = 228; - if (!(here(kk) || g.fixed[kk] == g.loc)) - break; - msg = ll; - /* If he hasn't taken tiny key off shelf, don't let him get it - for free! */ - for (i = 1; i < MAXOBJ; i++) { - if (i == SKEY && g.prop[SKEY] == 1) - continue; - if (g.place[i] == plac[kk] && g.fixed[i] == 0) - move(i, k); - } - if (g.loc == plac[SKEY] && g.place[SKEY] == plac[SKEY]) - g.tally2++; - g.loc = k; - g.newloc = k; - newtravel = TRUE; - break; - default: - actspk(verb); - return; - } - rspeak(msg); - return; -} - -/* - DRINK -*/ -void vdrink() -{ - int msg, k, j; - - if (object == 0 && (iobj == BOTTLE || iobj == CASK)) - object = liq(iobj); - msg = 110; - if (object == OIL) - msg = 301; - if (object != WATER && object != WINE) { - rspeak(msg); - return; - } - if (iobj == 0) { - if (object == liqloc(g.loc)) - iobj = -1; - if (athand(CASK) && object == liq(CASK)) - iobj = CASK; - if (athand(BOTTLE) && object == liq(BOTTLE)) - iobj = BOTTLE; - } - msg = 73; - if (iobj != -1) { - if (iobj == CASK) - object++; - extract(object); - g.place[object] = 0; - g.prop[iobj] = 1; - msg = (iobj == CASK) ? 299 : 74; - } - if (object == WATER || object == (WATER + 1)) { - rspeak(msg); - return; - } - /* UH-OH. He's a wino. Let him reap the rewards of incontinence. - He'll wander around for awhile, then wake up somewhere or other, - having dropped most of his stuff. */ - rspeak(300); - if (g.prop[LAMP] == 1) - g.limit -= ranz(g.limit) / 2; - if (g.limit < 10) - g.limit = 25; - k = 0; - if (pct(15)) - k = 49; - if (k == 0 && pct(15)) - k = 53; - if (k == 0 && pct(25)) - k = 132; - if (k == 0) - k = 175; - if (outside(g.loc)) - k = 5; - if (k == g.loc) { - rspeak(msg); - return; - } - if (holding(AXE)) - move(AXE, k); - if (holding(LAMP)) - move(LAMP, k); - for (j = 1; j < MAXOBJ; j++) { - if (wearng(j)) - bitoff(j, WEARBT); - if (holding(j)) - drop(j, g.loc); - } - g.loc = k; - g.newloc = k; -} - -/* - THROW etc. -*/ -void vthrow() -{ - int msg, i, k, dwarfn; - - if (holding(ROD2) && object == ROD && !holding(ROD)) - object = ROD2; - if (!holding(object)) { - actspk(verb); - return; - } - if (object == BOAT || object == BEAR) { - rspeak(noway()); - return; - } - dwarfn = dcheck(); - if (iobj == 0) { - /* No indirect object was specified. If a dwarf is present, - assume it is the object. If not, look for other living - thing. If no living things present, treat 'THROW' as 'DROP'. */ - - if (dwarfn) - iobj = DWARF; - else { - /* No dwarves present; figure out pausible object. */ - k = 0; - for (i = 1; i < MAXOBJ; i++) { - if (at(i) && living(i)) { - iobj = i; - k++; - } - } - if (k == 0) { - vdrop(); - return; - } - /* It is a beastie of some sort. Is there more than one? - Don't kill the bird by default. */ - if (k > 1) { - rspeak(43); - return; - } else { - if (iobj == BIRD) { - vdrop(); - return; - } - if (treasr(object) && at(TROLL)) - iobj = TROLL; - } - } - } - if (object == SWORD || object == BOTTLE) { - vbreak(); - return; - } - if (object == FLOWER && iobj == HIVE) - iobj = BEES; - if (edible(object) && living(iobj)) { - vfeed(); - return; - } - /* If not axe, same as drop... */ - if (object != AXE && iobj != TROLL) { - vdrop(); - return; - } - /* AXE is THROWN */ - msg = 48; - switch (iobj) { - case DRAGON: - if (g.prop[DRAGON] == 0) - msg = 152; - break; - case DWARF: - /* At a dwarf... */ - if (pct(75)) { - g.dseen[dwarfn] = g.dloc[dwarfn] = 0; - msg = 47; - ++g.dkill; - if (g.dkill == 1) - msg = 149; - } - break; - case BEAR: - /* This'll teach him to throw axe at the bear */ - if (g.prop[BEAR] == 0) { - msg = 164; - drop(AXE, g.loc); - g.fixed[AXE] = -1; - g.prop[AXE] = 1; - juggle(BEAR); - } - rspeak(msg); - return; - case WUMPUS: - /* Or the WUMPUS! */ - if (g.prop[WUMPUS] == 6) { - vdrop(); - return; - } else { - msg = 245; - g.prop[AXE] = 2; - if (g.prop[WUMPUS] == 0) { - drop(AXE, g.loc); - g.fixed[AXE] = -1; - juggle(iobj); - } else { - msg = 243; - destroy(AXE); - } - } - rspeak(msg); - return; - case DOG: - /* Or the nice doggie! */ - if (g.prop[DOG] != 1) { - msg = 248; - g.prop[AXE] = 3; - drop(AXE, g.loc); - g.fixed[AXE] = -1; - juggle(iobj); - } - rspeak(msg); - return; - case TROLL: - /* Snarf a treasure for the troll */ - if (object == AXE) { - msg = 158; - } else if (!treasr(object) || - (object == CASK && (liq(CASK) != WINE))) { - vdrop(); - return; - } else { - msg = 159; - drop(object, 0); - if (object == CASK) - g.place[WINE + 1] = 0; - move(TROLL, 0); - move((TROLL + MAXOBJ), 0); - drop(TROLL2, plac[TROLL]); - drop((TROLL2 + MAXOBJ), fixd[TROLL]); - juggle(CHASM); - rspeak(msg); - return; - } - break; - - default: - /* Otherwise it is an attack */ - verb = KILL; - object = iobj; - iobj = objs[objx]; - vkill(); - return; - } - - rspeak(msg); - drop(AXE, g.loc); - g.newloc = g.loc; - describe(); -} - -/* - FIND might be carrying it, or it might be here. else give caveat. -*/ -void vfind() -{ - int msg; - - if (at(object) || - (liq(BOTTLE) == object && at(BOTTLE)) || - object == liqloc(g.loc)) - msg = 94; - else if (dcheck() && g.dflag >= 2 && object == DWARF) - msg = 94; - else if (g.closed) - msg = 138; - else if (at(object)) - msg = 24; - else { - actspk(verb); - return; - } - rspeak(msg); - return; -} - -/* - FEED -*/ -void vfeed() -{ - int msg; - - if (iobj == 0 || !living(iobj)) { - int i, k, kk; - - if (object == BIRD) { - rspeak(100); - return; - } - if (!living(object)) { - rspeak(noway()); - return; - } - /* See if there is anything edible around here. */ - - kk = 0; - k = 0; - for (i = 1; i < MAXOBJ; i++) - if (here(i) && edible(i)) { - k++; - kk = i; - } - iobj = object; - object = kk; - if (k != 1 && !dead(iobj)) { - printf("What do you want to feed the %s\n", otxt[objx]); - objs[1] = 0; - objx = 0; - return; - } - } - /* Feed object ot indirect object */ - msg = 102; - switch (iobj) { - case DRAGON: - if (g.prop[DRAGON] != 0) - msg = noway(); - break; - case TROLL: - msg = 182; - break; - case SNAKE: - if (object == BIRD && !g.closed) { - msg = 101; - destroy(BIRD); - g.prop[BIRD] = 0; - g.tally2++; - } - break; - case DWARF: - msg = 103; - g.dflag++; - break; - case BEAR: - if (g.prop[BEAR] == 3) - msg = noway(); - if (g.prop[BEAR] == 1 || g.prop[BEAR] == 2) - msg = 264; - if (object == FOOD) - msg = 278; - if (object == HONEY) { - g.prop[BEAR] = 1; - g.fixed[AXE] = 0; - destroy(HONEY); - msg = 168; - } - break; - case DOG: - msg = 291; - if (object == FOOD && g.prop[DOG] != 1) { - msg = 249; - destroy(FOOD); - } - break; - case WUMPUS: - if (g.prop[WUMPUS] == 6) - msg = 326; - if (g.prop[WUMPUS] == 0) - msg = 327; - if (object == FOOD) - msg = 240; - break; - case BEES: - if (object == FLOWER) { - if (enclosed(FLOWER)) - extract(FLOWER); - drop(FLOWER, g.loc); - g.fixed[FLOWER] = -1; - g.prop[FLOWER] = 1; - drop(HONEY, g.loc); - juggle(HONEY); - msg = 267; - g.prop[HIVE] = 1; - } - } - rspeak(msg); - return; -} - -/* - FILL. object with iobj -*/ -void vfill() -{ - int msg, k; - - if (!vessel(object)) - msg = 313; - else { - if (iobj == 0) - iobj = liqloc(g.loc); - if (object == BOTTLE || object == CASK) { - k = (object == CASK) ? 1 : 0; - msg = 0; - if (iobj == 0) - msg = 304 + k; - if (liq(object) != 0) - msg = 302 + k; - if (msg != 0) { - rspeak(msg); - return; - } - msg = 306 + k; - if (iobj == OIL) - msg = 308 + k; - if (iobj == WINE) - msg = 310 + k; - g.prop[object] = (int) g.loc_attrib[g.loc] & 14; - g.place[iobj + k] = -1; - insert(iobj + k, object); - } else if (object == VASE) { - if (iobj == 0 || !holding(VASE)) { - rspeak(144); - return; - } - msg = 145; - g.prop[VASE] = 2; - g.fixed[VASE] = -1; - if (enclosed(object)) - extract(object); - drop(object, g.loc); - } else if (object == GRAIL) - msg = 298; - else - msg = 339; - } - rspeak(msg); -} - -/* - READ. Magazine in dwarvish, message we've seen, and ... oyster? -*/ -void vread() -{ - int msg; - - if (blind()) { - actspk(verb); - return; - } - if (object && iobj) { - rspeak(confuz()); - return; - } - msg = confuz(); - if (!object) - object = iobj; - switch (object) { - case BOOK: - case BOOK2: - msg = 142; - break; - case BILLBD: - msg = 361; - break; - case CARVNG: - msg = 372; - break; - case MAGAZINE: - msg = 190; - break; - case MESSAGE: - msg = 191; - break; - case POSTER: - msg = 370; - break; - case TABLET: - msg = 196; - break; - case OYSTER: - if (g.hinted[2] && holding(OYSTER)) - msg = 194; - if (!g.hinted[2] && holding(OYSTER) && g.closed) { - g.hinted[2] = yes(192, 193, 54); - return; - } - break; - } - rspeak(msg); - return; -} - -/* - BREAK. works for mirror in repository and, of course the - vase and bottle. Also the sword is more brittle than it appears. -*/ -void vbreak() -{ - int msg, k; - boolean it_broke; - - it_broke = FALSE; - msg = 146; - switch (object) { - case MIRROR: - msg = 148; - if (g.closed) { - rspeak(197); - dwarfend(); - return; - } - break; - case VASE: - if (g.prop[VASE] == 0) { - it_broke = TRUE; - msg = 198; - g.prop[VASE] = 2; - } - break; - case BOTTLE: - if (g.prop[BOTTLE] != 3) { - it_broke = TRUE; - k = liq(BOTTLE); - msg = 231; - g.prop[BOTTLE] = 3; - if (k) { - extract(k); - g.place[k] = 0; - } - } - break; - case SWORD: - msg = 29; - if (holding(SWORD)) { - msg = 279; - g.prop[SWORD] = 4; - it_broke = TRUE; - } - break; - } - if (it_broke) { - if (enclosed(object)) - extract(object); - if (holding(object)) - drop(object, g.loc); - g.fixed[object] = -1; - } - rspeak(msg); - return; -} - -/* - WAKE. only use is to disturb the dwarves or the Wumpus. - Other wumpus-wakers link here. -*/ -void vwake() -{ - int msg; - - msg = actmsg[verb]; - if (at(WUMPUS)) { - g.chase = TRUE; - g.prop[WUMPUS] = 1; - msg = 276; - } - if (at(DOG) && g.prop[DOG] == 1) - msg = 291; - if (object == DWARF && g.closed) { - rspeak(199); - dwarfend(); - return; - } - rspeak(msg); - return; -} - -/* - YANK. A variant of 'CARRY'. In general, not a good idea. - At most, it gets the cloak or a couple of snide comments. - */ -void vyank() -{ - if (toting(object)) - vdrop(); - else if (object == BEAR && g.prop[CHAIN]) - rspeak(205); - else if (object == CLOAK && g.prop[CLOAK] == 2) { - /* Cloak. big trouble ahead. */ - g.prop[ROCKS] = 1; - g.prop[CLOAK] = 0; - g.fixed[CLOAK] = 0; - carry(CLOAK, g.loc); - rspeak(241); - if (at(WUMPUS) && g.prop[WUMPUS] == 0) { - g.chase = 1; - g.prop[WUMPUS] = 1; - rspeak(276); - } - } else - vtake(); - return; -} - -/* - WEAR. Only good for jewels, ruby slippers, cloak & crown. - But he might try the sword. Anything else is ridiculous. - Another variant of 'CARRY'. - */ -void vwear() -{ - int msg; - - if (object == SWORD && g.prop[SWORD] != 3) - msg = 209; - else if (worn(object)) { - if (object == CLOAK && g.prop[CLOAK] == 2) - msg = 242; - else if (wearng(object)) - msg = (object == SHOES) ? 227 : 210; - else { - g.prop[object] = 1; - biton(object, WEARBT); - if (enclosed(object)) - extract(object); - if (holding(object)) - msg = 54; - else { - vtake(); - return; - } - } - } else { - printf("Just exactly how does one wear a %s\n", otxt[objx]); - return; - } - rspeak(msg); - return; -} - -/* - HIT. If not punching out telephone, assume attack. - */ -void vhit() -{ - if (at(WUMPUS) && g.prop[WUMPUS] == 0) { - vwake(); - return; - } - if (object != PHONE) { - vkill(); - return; - } else { - if (g.closed) { - rspeak(282); - dwarfend(); - return; - } - if (g.prop[PHONE] == 2) - rspeak(256); - else { - drop(SLUGS, g.loc); - g.prop[PHONE] = 2; - g.prop[BOOTH] = 2; - rspeak(257); - } - } - return; -} - -/* - ANSWER (telephone). Smartass for anything else. - */ -void vanswer() -{ - int msg; - - switch (object) { - case DWARF: - case WUMPUS: - case SNAKE: - case BEAR: - case DRAGON: - msg = 259; - break; - case TROLL: - msg = 258; - break; - case BIRD: - msg = 260; - break; - case PHONE: - if (g.prop[PHONE] != 0) - msg = 269; - else if (g.closed) { - rspeak(283); - normend(); - return; - } else { - msg = 261; - g.prop[PHONE] = 1; - g.prop[BOOTH] = 2; - } - break; - default: - msg = actmsg[verb]; - break; - } - rspeak(msg); - return; -} - -/* - BLOW. Joshua fit de battle of Jericho, and de walls ... - */ -void vblow() -{ - int msg, i, k; - - msg = actmsg[verb]; - if (object != 0 && iobj != 0) { - rspeak(msg); - return; - } - if (object == 0) - object = iobj; - iobj = 0; - if (object == 0) - msg = 268; - if (object == HORN) { - msg = outside(g.loc) ? 277 : 266; - if (at(WUMPUS)) { - rspeak(msg); - if (g.prop[WUMPUS] == 0) - vwake(); - return; - } else if (g.prop[WALL] != 1 && (g.loc == 102 || g.loc == 194)) { - k = g.loc == 194 ? 195 : 196; - msg = 265; - g.prop[WALL] = 1; - for (i = 1; i < MAXOBJ; i++) - if (g.place[i] == g.loc || g.fixed[i] == g.loc) - move(i, k); - g.newloc = k; - } - } - rspeak(msg); - return; -} - -/* - DIAL. No effect unless at phone. - */ -void vdial() -{ - if (object != PHONE) - actspk(verb); - else if (g.closed) { - rspeak(283); - normend(); - } else - rspeak(271); - return; -} - -/* - PLAY. Only for horn or lyre. - */ -void vplay() -{ - int msg; - - msg = actmsg[verb]; - if (object != 0 && iobj != 0) { - rspeak(confuz()); - return; - } - if (object == 0) - object = iobj; - if (object == HORN) { - vblow(); - return; - } - if (object == LYRE) { - msg = 287; - if (here(DOG) && !dead(DOG)) { - g.prop[DOG] = 1; - biton(DOG, DEADBT); - g.fixed[AXE] = 0; - g.prop[AXE] = 0; - msg = 288; - } - } - rspeak(msg); - return; -} - -/* - PICK/ PICK UP. Can pick flower & mushrooms, - But must 'PICK UP' everything else. - */ -void vpick() -{ - if (object == 0) - object = iobj; - iobj = 0; - if (object == FLOWER || object == MUSHRM || prep != 0) - vtake(); - else - rspeak(confuz()); - return; -} - -/* - PUT DOWN: equivalent to drop - PUT IN: if liquid, means fill - PUT ON: wear of drop - */ -void vput() -{ - if (prep == 0) { - printf("Where do you want to put the %s\n", otxt[objx]); - return; - } - if (prep == PREPIN) - vinsert(); - else { - /* PUT ON: wear or put object on iobj */ - if (prep == PREPON) { - if (object == 0) { - object = iobj; - otxt[objx] = iotxt[iobx]; - iobj = 0; - } - if (worn(object) || object == 0) - vwear(); - else - vdrop(); - } else { - /* PUT DOWN: "drop" */ - if (object == 0 && iobj == 0) { - if (object == 0) - object = iobj; - iobj = 0; - vdrop(); - } else - rspeak(noway()); - } - } - return; -} - -/* turn on/off */ -void vturn() -{ - if (!prep) - rspeak(confuz()); - else { - if (!object && iobj == LAMP) - object = LAMP; - if (object != LAMP) - rspeak(noway()); - else if (prep == PREPON) - von(); - else - voff(); - } - return; -} - -/* - GET (no prep): "take" - GET IN: "enter" - GET OUT: "leave" - */ -void vget() -{ - if (prep == 0 || prep == PREPFR) - vtake(); - else if (object == 0) { - object = iobj; - iobj = 0; - prep = 0; - vtake(); - } - return; -} - -/* - INSERT/PUT IN - */ -void vinsert() -{ - int msg; - - if (iobj == 0) { - printf("Where do you want to %s it?\n", vtxt[vrbx]); - return; - } - msg = noway(); - if (object == SWORD && iobj == ANVIL && g.prop[SWORD] == 0) - msg = 350; - if (!vessel(iobj)) { - rspeak(msg); - return; - } - msg = ck_obj(); - if (g.fixed[object]) { - rspeak(msg); - return; - } - if (object == iobj) { - rspeak(252); - return; - } - if (iobj == BOTTLE || iobj == CASK || iobj == VASE - || iobj == GRAIL || (object >= WATER && object <= WINE + 1)) { - object = iobj; - iobj = objs[objx]; - vfill(); - return; - } - if (!ajar(iobj)) { - rspeak(358); - return; - } - if (iobj == CHEST) { - if (object == BOAT) - msg = noway(); - else { - if (wearng(object)) - bitoff(object, WEARBT); - if (worn(object)) - g.prop[object] = 0; - if (enclosed(object)) - extract(object); - insert(object, iobj); - msg = 54; - } - rspeak(msg); - return; - } - /* Bird goes into cage and only cage */ - if (object == BIRD && iobj != CAGE) { - rspeak(351); - return; - } - if (object != BIRD && iobj == CAGE) { - rspeak(329); - return; - } - if (object == BIRD) { - prep = 0; - vtake(); - return; - } - /* Bar vase & pillow from safe, to force putting down on florr */ - if ((object == VASE || object == PILLOW) && iobj == SAFE) { - rspeak(329); - return; - } - if (object != RADIUM && iobj == SHIELD) { - rspeak(329); - return; - } - if (iobj == PHONE) { - if (object == COINS || object == SLUGS) { - destroy(object); - msg = 330; - } else - msg = 329; - rspeak(msg); - return; - } - if (iobj == VEND) { - if (object == COINS || object == SLUGS) { - destroy(object); - move(BATTERIES, g.loc); - if (g.prop[BATTERIES] == 1) { - rspeak(317); - g.prop[VEND] = 1; - } - g.prop[BATTERIES] = 0; - pspeak(BATTERIES, 0); - } else - rspeak(noway()); - return; - } - /* Put batteries in lamp. There is a glitch here, in that if he - tries to get a third set of batteries before the second set has - been inserted, the second set disappears! - ***fix this some time *** - */ - if (iobj == LAMP) { - if (object != BATTERIES || g.prop[BATTERIES] != 0) - msg = noway(); - else { - g.prop[BATTERIES] = 1; - if (enclosed(BATTERIES)) - extract(BATTERIES); - if (holding(BATTERIES)) - drop(BATTERIES, g.loc); - g.limit = 400; - g.prop[LAMP] = 1; - g.lmwarn = FALSE; - msg = 188; - } - rspeak(msg); - return; - } - if (!small(object)) - msg = 329; - else { - if (wearng(object)) - bitoff(object, WEARBT); - if (worn(object)) - g.prop[object] = 0; - if (enclosed(object)) - extract(object); - insert(object, iobj); - msg = 54; - } - rspeak(msg); - return; - -} - -/* Remove or take from */ -void vextract() -{ - int msg; - - if (object == RING && g.prop[RING] == 2) { - prep = 0; - iobj = 0; - vtake(); - return; - } - msg = 343; - if (iobj == 0) { - if (!enclosed(object)) - msg = 340; - iobj = -g.place[object]; - } - if (g.place[object] != -iobj) - msg = 341; - if (!ajar(iobj)) - msg = 335; - if (object == WATER || object == OIL || object == WINE) - msg = 342; - if (!toting(object) && ((burden(0) + burden(object)) > 15)) - msg = 92; - if (msg == 343) { - if (object == BIRD) { - vdrop(); - return; - } - extract(object); - } - rspeak(msg); - return; -} - -/* - lock. chain, grate, chest, elfin door - Here are the current lock/unlock messages & numbers: - 31 you have no keys. - 32 it has no lock. - 34 it's already locked. - 35 the grate is now locked. - 36 the grate is now unlocked. - 37 it was allready unlocked. - 55 you can't unlock the keys. - 171 The chain is now unlocked. - 172 The chain is now locked. - 173 There is nothing here to which the chain can be locked. - 224 Your keys are all too large. - 234 The wrought-iron door is now locked. - 235 The tiny door is now locked. - 236 The wrought-iron door is now unlocked. - 237 The tiny door is now unlocked. - 375 You don't have the right key. - 333 the chest is now locked. - 334 the chest is now unlocked. - 367 The safe's door swings shut. -*/ -void vlock() -{ - int msg, k; - - if (!hinged(object)) - { - printf("I don't know how to lock or unlock the %s\n", - otxt[objx]); - return; - } - else if (!locks(object)) - msg = 32; - else if (locked(object)) - msg = 34; - else if (!athand(KEYS) && !athand(SKEY) && object != SAFE) - msg = 31; - else { - msg = 375; - switch (object) { - case CHAIN: - if (!athand(KEYS)) - break; - msg = 173; - if (g.loc != plac[CHAIN]) - break; - msg = 172; - g.prop[CHAIN] = 2; - if (enclosed(CHAIN)) - extract(CHAIN); - if (holding(CHAIN)) - drop(CHAIN, g.loc); - g.fixed[CHAIN] = -1; - biton(CHAIN, LOCKBT); - bitoff(CHAIN, OPENBT); - break; - - case CHEST: - if (!athand(KEYS)) - break; - msg = 334; - biton(CHEST, LOCKBT); - bitoff(CHEST, OPENBT); - break; - - case TDOOR: - case TDOOR2: - msg = 224; - if (!toting(SKEY)) - break; - g.prop[TDOOR] = 0; - g.prop[TDOOR2] = 0; - msg = 234 + (TDOOR2 - object); - k = TDOOR + TDOOR2 - object; - biton(k, LOCKBT); - bitoff(k, OPENBT); - biton(object, LOCKBT); - bitoff(object, OPENBT); - break; - - case GRATE: - if (!athand(KEYS)) - break; - g.prop[GRATE] = 0; - msg = 35; - biton(GRATE, LOCKBT); - bitoff(GRATE, OPENBT); - break; - - case SAFE: - g.prop[SAFE] = 0; - msg = 367; - biton(SAFE, LOCKBT); - bitoff(SAFE, OPENBT); - break; - - } - } - rspeak(msg); -} - -/* - UNLOCK. chain, grate, chest, elfin door. -*/ -void vunlock() -{ - int msg, k; - - if (object == KEYS || object == SKEY) - msg = 55; - else if (!hinged(object)) - { - printf("I don't know how to lock or unlock the %s\n", - otxt[objx]); - return; - } - else if (!locked(object)) - msg = 37; - else if (!locks(object)) - msg = 32; - else if (object == SAFE) { - if (iobj == KEYS || iobj == SKEY) - msg = 368; - else - msg = 342; - } else if (!athand(KEYS) && !athand(SKEY)) - msg = 31; - else { - msg = 375; - switch (object) { - case CHAIN: - if (!athand(KEYS)) - break; - if (g.prop[BEAR] == 0) - msg = 41; - else { - msg = 171; - g.prop[CHAIN] = 0; - g.fixed[CHAIN] = 0; - if (g.prop[BEAR] != 3) - g.prop[BEAR] = 2; - g.fixed[BEAR] = 2 - g.prop[BEAR]; - bitoff(CHAIN, LOCKBT); - biton(CHAIN, OPENBT); - } - break; - case CHEST: - if (athand(KEYS)) { - msg = 333; - bitoff(CHEST, LOCKBT); - biton(CHEST, OPENBT); - } - break; - case TDOOR: - case TDOOR2: - /* Elvin door stuff to lock/unlock tiny door w/special key. - the damn thing is really at four places, and we want the - right messages if he only has 'BIG'keys (or no keys). - Also, he can unlock it either while he is big or small. */ - msg = 224; - if (!athand(SKEY)) - break; - if (g.closing) { - msg = 130; - if (!g.panic) - g.clock2 = 15; - g.panic = TRUE; - } else { - g.prop[TDOOR] = 1; - g.prop[TDOOR2] = 1; - msg = 234 + 2 + (TDOOR2 - object); - k = TDOOR + (TDOOR2 - object); - bitoff(k, LOCKBT); - biton(k, OPENBT); - bitoff(object, LOCKBT); - biton(object, OPENBT); - } - break; - case GRATE: - if (!athand(KEYS)) - break; - if (g.closing) { - msg = 130; - if (!g.panic) - g.clock2 = 15; - g.panic = TRUE; - } else { - g.prop[GRATE] = 1; - msg = 36; - bitoff(GRATE, LOCKBT); - biton(GRATE, OPENBT); - } - break; - default: - msg = 33; - } - } - rspeak(msg); -} - -/* - LOOK. -*/ -void vlook() -{ - int sloc; - - if (object != 0) { - rspeak(confuz()); - return; - } - /* Look into something (a container). */ - if (vessel(iobj)) { - if (!ajar(iobj) && opaque(iobj)) - rspeak(actmsg[verb]); - else if (g.holder[iobj] == 0) - rspeak(359); - else { - putchar(' '); - lookin(iobj); - } - - /* Look at something. If written, read it. */ - } else if (printed(iobj)) { - object = iobj; - iobj = 0; - vread(); - } else if (iobj == SPHERE) { - if (!inside(g.loc) || athand(SAPPHIRE)) - rspeak(42); - else { - rspeak(400); - printf(" "); - sloc = g.place[SAPPHIRE]; - if ((g.loc_attrib[sloc] % 2 == 0 || enclosed(SAPPHIRE)) - && sloc != 200 - && !g.place[LAMP] == sloc && g.prop[LAMP] != 0) - rspeak(401); - else - desclg(sloc); - if (sloc == 239 && !g.flg239) { - rspeak(403); - g.flg239 = TRUE; - } - printf(" "); - rspeak(402); - } - } else - printf("I see nothing special about the %s?\n", iotxt[iobx]); - return; -} diff --git a/commands/advent/vocab.c b/commands/advent/vocab.c deleted file mode 100644 index 16ad15cc1..000000000 --- a/commands/advent/vocab.c +++ /dev/null @@ -1,594 +0,0 @@ - -/* - look-up vocabulary word in lex-ordered table. words may have - two entries with different codes. if minimum acceptable type - = 0, then return minimum of different codes. last word CANNOT - have two entries(due to binary sort). - word is the word to look up. - type is the minimum acceptable value, - if != 0 return %1000 -*/ - -#include -#include -#include "advent.h" -#include "advdec.h" - -static _CONST struct wac wc[] = { - "\"spelunker\"", 1016, - "22", 2053, - "22", 3012, - "34", 2053, - "34", 3013, - "4-leafed", 5034, - "7", 2053, - "7", 3011, - "?", 3051, - "above", 29, - "abra", 3050, - "abracd", 3050, - "across", 42, - "alacaz", 3050, - "all", 1109, - "altar", 90, - "and", 6001, - "answer", 2035, - "anvil", 1091, - "ascend", 29, - "at", 4009, - "attack", 2012, - "awaken", 2029, - "awkward", 26, - "axe", 1028, - "back", 8, - "ball", 1120, - "barren", 40, - "bat", 1104, - "bats", 1104, - "batshit", 1104, - "batteries", 1039, - "beans", 1024, - "bear", 1035, - "bed", 16, - "bedquilt", 70, - "bee", 1087, - "beehive", 1097, - "bees", 1087, - "billboard", 1116, - "bird", 1101, - "bitch", 2048, - "black", 5006, - "blast", 2023, - "blow", 2036, - "blowup", 2023, - "boat", 1048, - "book", 1110, - "booth", 1093, - "bottle", 1020, - "box", 1055, - "brass", 5004, - "break", 2028, - "bridge", 89, - "brief", 2026, - "broken", 54, - "broom", 1114, - "brush", 1114, - "brush", 2054, - "building", 12, - "bumble", 1087, - "burn", 2047, - "cage", 1004, - "cake", 1107, /* value must be - mushrooms + 1 */ - "cakes", 1107, - "call", 2038, - "calm", 2010, - "canister", 1118, - "canyon", 25, - "cape", 1047, - "capture", 2001, - "carpet", 1040, - "carry", 2001, - "carving", 1115, - "cask", 1071, - "catch", 2001, - "cave", 67, - "cavern", 73, - "chain", 1064, - "chalice", 1070, - "chant", 2003, - "chasm", 1021, /* troll bridge */ - "chest", 1055, - "chimney", 78, - "clam", 1014, - "click", 85, - "climb", 56, - "cloak", 1047, - "close", 2006, - "clover", 1073, - "cobble", 18, - "coins", 1054, - "comb", 1096, - "complain", 2048, - "continue", 7, - "continue", 2011, - "crack", 33, - "crap", 3106, - "crap!", 3106, - "crawl", 17, - "cross", 69, - "crown", 1066, - "crystal", 5033, - "cup", 1070, - "cupcakes", 1107, - "d", 30, - "dark", 22, - "debris", 51, - "defile", 23, - "depression", 63, - "descend", 30, - "describe", 2052, - "detonate", 2023, - "devour", 2014, - "diagnose", 2051, - "dial", 2039, - "diamond", 1051, - "diamonds", 1051, - "dig", 3066, - "discard", 2002, - "disturb", 2029, - "doff", 2002, - "dog", 1098, - "dome", 35, - "don", 2033, - "door", 1041, /* giant door */ - "down", 30, - "down", 4008, - "downstream", 5, - "downward", 30, - "dragon", 1031, - "drawing", 1029, - "drink", 2015, - "drop", 2002, - "droplet", 1075, - "dump", 2002, - "dust", 2054, - "dwarf", 1017, - "dwarves", 1017, - "e", 43, - "east", 43, - "eat", 2014, - "egg", 1056, - "eggs", 1056, - "elfin", 5019, - "emerald", 1059, - "empty", 2013, - "enter", 3, - "entrance", 64, - "everything", 1109, - "examine", 2052, - "excavate", 3066, - "exit", 11, - "explore", 2011, - "extinguish", 2008, - "fee", 2025, - "fee", 3001, - "feed", 2021, - "fie", 2025, - "fie", 3002, - "fight", 2012, - "figure", 1027, - "fill", 2022, - "find", 2019, - "fissure", 1012, - "fling", 2017, - "floor", 58, - "flower", 1046, - "flowers", 1046, - "foe", 2025, - "foe", 3003, - "follow", 2011, - "foo", 2025, - "foo", 3004, - "food", 1019, - "forcd", 1, - "forest", 6, - "fork", 77, - "forward", 7, - "fountain", 1103, - "four-leafed", 5034, - "free", 2002, - "fresh", 5010, - "from", 4005, - "fuck", 3079, - "fuck!", 3079, - "fum", 2025, - "fum", 3005, - "gate", 2058, - "get", 2044, - "geyser", 1037, /* same as volcano */ - "giant", 27, - "giant", 5029, - "glowing", 5031, - "gnome", 1105, - "go", 2011, - "gold", 1050, - "golden", 5001, - "goto", 2011, - "grab", 2032, - "grail", 1070, - "grate", 1003, - "green", 5032, - "grey", 5032, - "gripe", 2048, - "grotto", 91, - "guano", 1104, - "gully", 13, - "h20", 1081, - "hall", 38, - "headlamp", 1002, - "health", 2051, - "heave", 2017, - "heels", 1067, - "help", 3051, - "hike", 2011, - "hill", 2, - "hit", 2034, - "hive", 1097, - "hocus", 3050, - "hole", 52, - "holy", 5021, - "honey", 1096, - "honeycomb", 1096, - "horn", 1052, - "hound", 1098, - "house", 12, - "hurl", 2017, - "i", 2020, - "ice", 88, - "ignite", 2023, - "in", 19, - "in", 4001, - "insert", 2045, - "inside", 19, - "inside", 4001, - "into", 4001, - "inventory", 2020, - "inward", 19, - "iron", 5011, - "issue", 1016, - "jar", 1020, - "jerk", 2032, - "jewelry", 1053, - "jewels", 1053, - "jump", 39, - "keep", 2001, - "keg", 1071, - "key", 1090, - "keys", 1102, - "kick", 2034, - "kill", 2012, - "knapsack", 1108, - "knife", 1018, - "knives", 1018, - "knoll", 81, - "l", 2052, - "lamp", 1002, - "lantern", 1002, - "lead", 5023, - "leaden", 5023, - "leap", 39, - "leather", 5024, - "leave", 11, - "leave", 2037, - "ledge", 83, - "left", 36, - "light", 1002, - "little", 5012, - "lock", 2049, - "look", 2052, - "lost", 3068, - "low", 24, - "lyre", 1068, - "machine", 1038, - "magazine", 1016, - "main", 76, - "map", 2057, - "message", 1036, - "metal", 5035, - "ming", 5016, - "mirror", 1023, - "mist", 3069, - "moss", 1040, - "mumble", 2003, - "mushroom", 1106, - "mushrooms", 1106, - "n", 45, - "ne", 47, - "nest", 1056, - "north", 45, - "northeast", 47, - "northwest", 50, - "nothing", 2005, - "nowhere", 21, - "nugget", 1050, - "null", 21, - "nw", 50, - "oak", 5022, - "oaken", 5022, - "off", 4006, - "office", 76, - "oil", 1083, /* in bottle */ - "on", 4002, - "onto", 4002, - "onward", 7, - "open", 2004, - "opensesame", 3050, - "oriental", 72, - "out", 11, - "outdoors", 32, - "outside", 11, - "over", 41, - "oyster", 1015, - "pantry", 57, - "passage", 23, - "pause", 2030, - "pearl", 1061, - "persian", 5002, - "peruse", 2027, - "peyote", 1106, - "phone", 1094, - "phonebooth", 1094, - "phuce", 82, - "pick", 2041, - "pillow", 1010, - "pirate", 1030, - "pirloc", 2059, - "piss", 3107, - "piss!", 3107, - "pit", 31, - "placate", 2010, - "plant", 1024, - "platinum", 5017, - "play", 2040, - "plover", 71, - "plugh", 65, - "pocus", 3050, - "pole", 1009, - "pool", 80, - "poster", 1113, - "pottery", 1058, - "pound", 2034, - "pour", 2013, - "pray", 92, - "prayer", 92, - "proceed", 2011, - "pull", 2032, - "punch", 2034, - "put", 2042, - "pyramid", 1060, - "q", 2018, - "quartz", 5036, - "quit", 2018, - "radium", 1119, - "rare", 5018, - "ration", 1019, - "read", 2027, - "refill", 2022, - "release", 2002, - "remove", 2046, - "reply", 2035, - "report", 2048, - "reservoir", 75, - "restore", 2031, - "retreat", 8, - "return", 8, - "right", 37, - "ring", 1072, - "road", 2, - "rock", 1119, - "rock", 15, - "rocks", 1092, - "rocks", 1115, - "rod", 1005, - "room", 59, - "rowboat", 1048, - "rub", 2016, - "ruby", 5020, - "rug", 1062, - "run", 2011, - "rusty", 5028, - "s", 46, - "sack", 1108, - "safe", 1112, - "saint-michel", 93, - "sandwich", 1019, - "sapphire", 1069, - "save", 2030, - "say", 2003, - "score", 2024, - "se", 48, - "secret", 66, - "sesame", 3050, - "shadowy", 5027, - "shake", 2009, - "shards", 1058, - "shatter", 2028, - "shazam", 3050, - "shelf", 83, - "shell", 74, - "shield", 1118, - "ship", 1048, - "shit", 3106, - "shit!", 3106, - "shoes", 1067, - "shut", 2006, - "silk", 5013, - "silken", 5013, - "silver", 5014, - "sing", 2003, - "slab", 61, - "slabroom", 61, - "slay", 2012, - "slide", 79, - "slippers", 1067, - "slit", 60, - "slugs", 1095, - "small", 5012, - "smash", 2028, - "snake", 1011, - "south", 46, - "southeast", 48, - "southwest", 49, - "spelunker", 1016, - "sphere", 1120, - "spices", 1063, - "stair", 10, - "stairs", 10, - "stalagmite", 1026, - "star", 5026, - "statue", 1074, - "steal", 2001, - "steel", 5025, - "steps", 1007, - "steps", 34, - "stick", 1049, - "sticks", 1049, - "stone", 1119, - "stop", 3139, - "stream", 14, - "strike", 2034, - "strum", 2040, - "suggest", 2048, - "surface", 20, - "suspend", 2030, - "sw", 49, - "sweep", 2054, - "swim", 3147, - "swing", 2009, - "sword", 1065, - "tablet", 1013, - "take", 2001, - "tame", 2010, - "tasty", 5030, - "telephone", 1094, - "terse", 2055, - "then", 6002, - "throw", 2017, - "thunder", 84, - "tiny", 5012, - "to", 4004, - "tome", 1110, - "toss", 2017, - "tote", 2001, - "travel", 2011, - "treasure", 5015, - "tree", 1074, - "tree", 3064, - "trees", 3064, - "trident", 1057, - "troll", 1033, - "tube", 1118, - "tunnel", 23, - "turn", 2043, - "u", 29, - "unbrief", 2026, - "unlock", 2050, - "unterse", 2055, - "up", 29, - "up", 4007, - "upon", 4002, - "upstream", 4, - "upward", 29, - "used", 5009, - "utter", 2003, - "valley", 9, - "vase", 1058, - "velvet", 5007, - "vending", 5008, - "view", 28, - "volcano", 1037, - "volume", 1110, - "w", 44, - "wake", 2029, - "waken", 2029, - "walk", 2011, - "wall", 53, - "wall", 1088, /* in blue grotto */ - "wand", 1005, - "water", 1081, /* in bottle */ - "wave", 2009, - "wear", 2033, - "west", 44, - "whack", 2034, - "where", 2019, - "whirl", 80, - "whirlpool", 80, - "whisk", 1114, - "whiskbroom", 1114, - "wicker", 5005, - "wine", 1085, /* in bottle */ - "with", 4003, - "wiz", 2056, - "wolf", 1098, - "wooden", 5003, - "worn", 5009, - "worn-out", 5009, - "wornout", 5009, - "wumpus", 1099, - "xyzzy", 62, - "y2", 55, - "yank", 2032 -}; - -#define MAXWC (sizeof(wc) / sizeof(struct wac)) - -_PROTOTYPE(int binary, (char *)); - -int vocab(word, type) -char *word; -int type; -{ - int v1, v2, temp; - - if ((v1 = binary(word)) >= 0) { - if (v1 > 0 && strcmp(word, wc[v1 - 1].aword) == 0) - v2 = v1 - 1; - else if (v1 < (MAXWC - 1) && strcmp(word, wc[v1 + 1].aword) == 0) - v2 = v1 + 1; - else - v2 = v1; - if (wc[v1].acode > wc[v2].acode) { - temp = v1; - v1 = v2; - v2 = temp; - } - if (type <= CLASS(wc[v1].acode)) - return (wc[v1].acode); - else if (type <= CLASS(wc[v2].acode)) - return (wc[v2].acode); - else - return (-1); - } else - return (-1); -} - -int binary(w) -char *w; -{ - int lo, mid, hi, check; - - lo = 0; - hi = MAXWC - 1; - do { - mid = (lo + hi) / 2; - check = strcmp(w, wc[mid].aword); - if (check == 0) - return (mid); - else if (check < 0) - hi = mid - 1; - else - lo = mid + 1; - } while (lo <= hi); - return (-1); -} diff --git a/commands/ttt/Makefile b/commands/ttt/Makefile deleted file mode 100644 index 241c32ec8..000000000 --- a/commands/ttt/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -PROG= ttt -MAN= - -.include diff --git a/commands/ttt/ttt.c b/commands/ttt/ttt.c deleted file mode 100644 index 079718cf4..000000000 --- a/commands/ttt/ttt.c +++ /dev/null @@ -1,299 +0,0 @@ -/* tic tac toe (noughts and crosses) Author: Warren Toomey */ - -/* Copyright 1988 by Warren Toomey wkt@cs.adfa.oz.au[@uunet.uu.net] - * - * You may freely copy or distribute this code as long as this notice - * remains intact. - * - * You may modify this code, as long as this notice remains intact, and - * you add another notice indicating that the code has been modified. - * - * You may NOT sell this code or in any way profit from this code without - * prior agreement from the author. - */ - -/* Compile with cc -o tic tic.c -lcurses -ltermcap */ - -#include -#include - -#ifdef CURSES -#include -#endif - -#include - -#ifndef CURSES -#define printw printf -#endif - - -typedef struct { - int value; /* The move returned by the */ - int path; /* alphabeta consists of a value */ -} MOVE; /* and an actual move (path) */ - -_PROTOTYPE(int main, (void)); -_PROTOTYPE(int stateval, (int board [], int whosemove)); -_PROTOTYPE(MOVE alphabeta, (int board [], int whosemove, int alpha, int beta)); -_PROTOTYPE(void draw, (int board [])); -_PROTOTYPE(void getmove, (int board [])); -_PROTOTYPE(int endofgame, (int board [])); -_PROTOTYPE(int randommove, (void)); - - /* Static evaluator. Returns 100 if we have 3 in a row -100 if they have 3 - * in a row - * - * Board is array of 9 ints, where 0=empty square 1=our move 4= their move - * - * and board is indices 0 1 2 3 4 5 6 7 8 */ - - -int stateval(board, whosemove) -int board[]; -int whosemove; -{ - static int row[8][3] = {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}, /* Indices of 3in-a-rows */ - {0, 3, 6}, {1, 4, 7}, {2, 5, 8}, - {0, 4, 8}, {2, 4, 6}}; - - int temp; /* Temp row results */ - int i, j; /* Loop counters */ - int side; /* Depth multiplier */ - int win, lose; - - if (whosemove == 1) { - win = 100; - lose = -100; - side = 1; - } else { - /* Multiply by -1 if */ - win = -100; - lose = 100; - side = -1; - } /* not out move */ - for (i = 0; i < 8; i++) { /* For every 3-in-a-row */ - temp = 0; - for (j = 0; j < 3; j++) /* Add up the board values */ - temp += board[row[i][j]]; - - if (temp == 3) return(win); /* We've got 3 in a row */ - if (temp == 12) return (lose); /* They've got 3 in a row */ - } - return(0); /* Finally return sum */ -} - - -MOVE alphabeta(board, whosemove, alpha, beta) /* Alphabeta: takes a board, */ -int board[]; /* whose move, alpha & beta cutoffs, */ -int whosemove; /* and returns a move to make and */ -int alpha; /* the value that the move has */ -int beta; -{ - MOVE result, successor; - int best_score, i, best_path, mademove; - - result.value = stateval(board, whosemove); /* Work out the board's */ - /* Static value */ - if ((result.value == 100) || /* If a win or loss already */ - (result.value == -100)) - return(result); /* return the result */ - - best_score = beta; /* Ok, set worst score */ - mademove = 0; /* to the beta cutoff */ - for (i = 0; i < 9; i++) { - if (board[i] == 0) { /* For all valid moves */ - mademove = 1; - board[i] = whosemove; /* make the move on board */ - successor = alphabeta(board, 5 - whosemove, -best_score - 1, -alpha - 1); - /* Get value of the move */ - board[i] = 0; /* Take move back */ - if (-successor.value > best_score) { /* If a better score */ - best_score = -successor.value; /* update our score */ - best_path = i; /* and move */ - if (best_score > alpha) - break; /* If we've beaten alpha */ - } /* return immediately */ - } - } - if (mademove) { - result.value = best_score; /* Finally return best score */ - result.path = best_path;/* and best move */ - } - return(result); /* If no move, return static result */ -} - - -void draw(board) /* Draw the board */ -int board[]; -{ - int i, j, row; - static char out[] = " X O"; /* Lookup table for character */ - - row = 6; -#ifdef CURSES - move(row, 0); -#endif - for (j = 0; j < 9; j += 3) { - printw(" %d | %d | %d ", j, j + 1, j + 2); - for (i = 0; i < 3; i++) { - printw("%c ", out[board[j + i]]); - if (i < 2) printw("| "); - } - if (j < 4) { -#ifdef CURSES - move(++row, 0); -#else - printw("\n"); -#endif - printw("---+---+--- ---+---+---"); - } -#ifdef CURSES - move(++row, 0); -#else - printw("\n"); -#endif - } -#ifdef CURSES - refresh(); -#else - printw("\n"); -#endif -} - - -void getmove(board) /* Get a player's move */ -int board[]; -{ - int Move; - int ItemsRead; - char dumc; - - do { - do { -#ifdef CURSES - move(9, 40); - printw("Your move: "); /* Prompt for move */ - refresh(); -#else - printw("Your move: "); /* Prompt for move */ -#endif - ItemsRead = scanf("%d", &Move); /* Input the move */ - if (ItemsRead == 0) scanf("%c", &dumc); /* Remove the offending character */ - } - while (ItemsRead != 1); - } - while (board[Move]); - board[Move] = 4; /* If legal, add to board */ - draw(board); /* Draw the board */ -} - - -int endofgame(board) /* Determine end of the game */ -int board[]; -{ - int eval; - int count; - - eval = stateval(board, 1); -#ifdef CURSES - move(20, 25); -#endif - if (eval == 100) { - printw("I have beaten you.\n"); - return(1); - } - if (eval == -100) { - printw("Bus error (core dumped)\n"); - return(1); - } - count = 0; - for (eval = 0; eval < 9; eval++) - if (board[eval] != 0) count++; - if (count == 9) { - printw("A draw!\n"); - return(1); - } -#ifdef CURSES - refresh(); -#endif - return(0); -} - - -int randommove() -{ /* Make an initial random move */ - int i; - - i = abs((int) time((long *) 0)); - return(i % 9); -} - - -int main() -{ /* The actual game */ - int i, board[9]; - char ch; - MOVE ourmove; - - for (i = 0; i < 9; i++) board[i] = 0; /* Initialise the board */ -#ifdef CURSES - initscr(); - clear(); - refresh(); -#endif - printw(" TIC TAC TOE \n\n"); - printw(" Your moves are 'O'\n"); - printw(" My moves are 'X'\n\n"); -#ifdef CURSES - move(5, 0); - printw("Do you wish to move first: "); - refresh(); - while (scanf("%c", &ch) != 1); - move(5, 0); - printw(" ......."); /* Kludge to get rid */ - refresh(); - move(5, 0); - printw(" "); /* of input letter */ - refresh(); -#else - do - printw("Do you wish to move first: "); - while (scanf("%c", &ch) != 1); -#endif - if ((ch != 'y') && (ch != 'Y')) { - i = randommove(); /* If we move first */ - board[i] = 1; /* make it random */ -#ifdef CURSES - move(7, 42); - printw("My move: %d\n", i); - refresh(); -#else - printw("My move: %d\n", i); -#endif - } - draw(board); - getmove(board); - - while (1) { - ourmove = alphabeta(board, 1, 99, -99); /* Get a move for us; - * return wins */ - /* Immediately & ignore losses */ - board[ourmove.path] = 1;/* and make it */ -#ifdef CURSES - move(7, 42); - printw("My move: %d\n", ourmove.path); - refresh(); -#else - printw("My move: %d\n", ourmove.path); -#endif - draw(board); - if (endofgame(board)) break; /* If end of game, exit */ - getmove(board); /* Get opponent's move */ - if (endofgame(board)) break; /* If end of game, exit */ - } -#ifdef CURSES - endwin(); -#endif - return(0); -} diff --git a/man/man6/Makefile b/man/man6/Makefile index 3902935e8..63f5aa1c7 100644 --- a/man/man6/Makefile +++ b/man/man6/Makefile @@ -1,4 +1,4 @@ -MAN= advent.6 ttt.6 +MAN= .include .include diff --git a/man/man6/advent.6 b/man/man6/advent.6 deleted file mode 100644 index bb62e0a99..000000000 --- a/man/man6/advent.6 +++ /dev/null @@ -1,22 +0,0 @@ -.\" @(#)adventure.6 6.2 (Berkeley) 5/6/86 -.\" -.TH ADVENT 6 "May 6, 1986" -.AT 3 -.SH NAME -advent, adventure \- an exploration game -.SH SYNOPSIS -.B advent -.SH DESCRIPTION -The object of the game is to -locate and explore Colossal Cave, find the treasures hidden there, -and bring them back to the building with you. -The program is self-descriptive to a point, but part of the game is to discover -its rules. -.PP -To terminate a game, type `quit'; -to save a game for later resumption, type `save' now, and `restore' when -you resume. -.SH FILES -.TP 15 -.B advent.sav -A saved adventure game. diff --git a/man/man6/ttt.6 b/man/man6/ttt.6 deleted file mode 100644 index 9caf2ffe3..000000000 --- a/man/man6/ttt.6 +++ /dev/null @@ -1,23 +0,0 @@ -.TH TTT 6 -.SH NAME -ttt \- tic tac toe -.SH SYNOPSIS -\fBttt\fR -.br -.de FL -.TP -\\fB\\$1\\fR -\\$2 -.. -.de EX -.TP 20 -\\fB\\$1\\fR -# \\$2 -.. -.SH EXAMPLES -.EX "ttt " "Start the game" -.SH DESCRIPTION -.PP -This program allows the user to engage in a game of tic tac toe (noughts and -crosses) with the computer. -The program uses the alpha-beta algorithm, so the user had better be sharp.