act1.37 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024
  1. "VOCABULARY, ACTION FUNCTIONS, MAZE (NORMALLY ENCODED)"
  2. <DEFINE BLO (Y)
  3. <COND (<TYPE? ,REP SUBR FSUBR>
  4. <SET READ-TABLE <PUT <IVECTOR 256 0> <CHTYPE <ASCII !\<> FIX> !\>>
  5. <EVALTYPE FORM SEGMENT>
  6. <APPLYTYPE SUBR FIX>
  7. <PUT <ALLTYPES> 6 <7 <ALLTYPES>>>
  8. <SUBSTITUTE 2 1>
  9. <OFF .BH>)>>
  10. <GDECL (FF) STRING>
  11. <DEFINE ILO (BODY TYPE NM1 NM2 "OPTIONAL" M1 M2)
  12. #DECL ((BODY NM1 NM2 M1 M2) STRING (TYPE) FIX)
  13. <COND (<==? .TYPE *400000000000*>
  14. <COND (<OR <AND <MEMBER "<FLUSH-ME>" .BODY>
  15. <NOT <MEMBER ,XUNM ,WINNERS>>>
  16. <AND <MEMBER .NM1 ,WINNERS>
  17. <MEMBER ,FF .BODY>>>
  18. <EVAL <PARSE .BODY>>)>)>
  19. <DISMISS T>>
  20. ;"ROOM FUNCTIONS"
  21. <DEFINE EAST-HOUSE ("AUX" (WIN ,WINNER) (PRSVEC ,PRSVEC)
  22. (PRSACT <1 .PRSVEC>))
  23. #DECL ((PRSVEC) VECTOR (WIN) ADV (PRSACT) VERB)
  24. <COND (<==? .PRSACT ,LOOK!-WORDS>
  25. <TELL
  26. "You are behind the white house. In one corner of the house there
  27. is a small window which is " 1 <COND (,KITCHEN-WINDOW!-FLAG
  28. "open.")
  29. ("slightly ajar.")>>)>>
  30. ; "HACK THE KITCHEN WINDOW"
  31. <SETG GRUNLOCK!-FLAG <>>
  32. <DEFINE WINDOW-FUNCTION ("AUX" (PRSACT <1 ,PRSVEC>))
  33. #DECL ((PRSACT) VERB)
  34. <OPEN-CLOSE .PRSACT
  35. KITCHEN-WINDOW!-FLAG
  36. "With great effort, you open the window far enough to allow entry."
  37. "The window closes (more easily than it opened).">>
  38. <DEFINE OPEN-CLOSE (VERB ATM STROPN STRCLS)
  39. #DECL ((VERB) VERB (ATM) ATOM (STROPN STRCLS) STRING)
  40. <COND (<==? .VERB ,OPEN!-WORDS>
  41. <COND (,.ATM
  42. <TELL <PICK-ONE ,DUMMY>>)
  43. (<TELL .STROPN>
  44. <SETG .ATM T>)>)
  45. (<==? .VERB ,CLOSE!-WORDS>
  46. <COND (,.ATM
  47. <TELL .STRCLS>
  48. <SETG .ATM <>>
  49. T)
  50. (<TELL <PICK-ONE ,DUMMY>>)>)>>
  51. ; "KITCHEN -- CHECK THE WINDOW"
  52. <DEFINE KITCHEN ("AUX" (WIN ,WINNER) (PRSVEC ,PRSVEC)
  53. (PRSACT <1 .PRSVEC>))
  54. #DECL ((PRSVEC) VECTOR (WIN) ADV (PRSACT) VERB)
  55. <COND (<==? .PRSACT ,LOOK!-WORDS>
  56. <TELL
  57. "You are in the kitchen of the white house. A table seems to have
  58. been used recently for the preparation of food. A passage leads to
  59. the west and a dark staircase can be seen leading upward. To the
  60. east is a small window which is " 0>
  61. <COND (,KITCHEN-WINDOW!-FLAG
  62. <TELL "open." 1>)
  63. (<TELL "slightly ajar." 1>)>)
  64. (T)>>
  65. <DEFINE LEAF-PILE ("AUX" (PV ,PRSVEC) (L <2 .PV>))
  66. #DECL ((PV) <VECTOR [3 ANY]> (L) OBJECT)
  67. <COND (<==? <1 .PV> ,BURN!-WORDS>
  68. <PUT .L ,ORAND 1>
  69. <COND (<OROOM .L>
  70. <TELL "The leaves burn and the neighbors start to complain.">
  71. <REMOVE-OBJECT .L>)
  72. (T
  73. <DROP-OBJECT .L>
  74. <JIGS-UP
  75. "The sight of someone carrying a pile of burning leaves so offends
  76. the neighbors that they come over and put you out.">)>)
  77. (<==? <1 .PV> ,MOVE!-WORDS>
  78. <PUT .L ,ORAND 1>
  79. <TELL "Done.">)>>
  80. <PSETG RESDESC
  81. "However, with the water level lowered, there is merely a wide stream
  82. running through the center of the room.">
  83. <PSETG GLADESC
  84. "You are in a large room, with giant icicles hanging from the walls
  85. and ceiling. There are passages to the north and east.">
  86. <DEFINE GLACIER-ROOM ("AUX" (PRSACT <1 ,PRSVEC>))
  87. #DECL ((PRSACT) VERB)
  88. <COND (<==? .PRSACT ,LOOK!-WORDS>
  89. <COND (,GLACIER-FLAG!-FLAG
  90. <TELL ,GLADESC>
  91. <TELL "There is a large passageway leading westward." 1>)
  92. (<TELL ,GLADESC>)>)>>
  93. <DEFINE TROPHY-CASE ("AUX" (PRSACT <1 ,PRSVEC>))
  94. #DECL #DECL ((PRSACT) VERB)
  95. <COND (<==? .PRSACT ,TAKE!-WORDS>
  96. <TELL
  97. "The trophy case is securely fastened to the wall (perhaps to foil any
  98. attempt by robbers to remove it).">)>>
  99. <DEFINE GLACIER ("AUX" (PRSVEC ,PRSVEC) (PRSACT <1 .PRSVEC>) T)
  100. #DECL ((PRSVEC) <VECTOR VERB [2 ANY]> (PRSACT) VERB (T) OBJECT)
  101. <COND (<==? <VNAME .PRSACT> THROW!-WORDS>
  102. <COND (<==? <2 .PRSVEC> <SET T <FIND-OBJ "TORCH">>>
  103. <TELL
  104. "The torch hits the glacier and explodes into a great ball of flame,
  105. devouring the glacier. The water from the melting glacier rushes
  106. downstream, carrying the torch with it. In the place of the glacier,
  107. there is a passageway leading west.">
  108. <REMOVE-OBJECT <FIND-OBJ "ICE">>
  109. <REMOVE-OBJECT .T>
  110. <INSERT-OBJECT .T <FIND-ROOM "STREA">>
  111. <PUT .T ,ODESC2 "burned out ivory torch">
  112. <PUT .T ,ODESC1 "There is a burned out ivory torch here.">
  113. <PUT .T ,OLIGHT? 0>
  114. <TRZ .T ,FLAMEBIT>
  115. <OR <LIT? ,HERE> <TELL
  116. "The melting glacier seems to have carried the torch away, leaving
  117. you in the dark.">>
  118. <SETG GLACIER-FLAG!-FLAG T>)
  119. (<TELL
  120. "The glacier is unmoved by your ridiculous attempt.">
  121. <>)>)
  122. (<==? <VNAME .PRSACT> MELT!-WORDS>
  123. <TELL
  124. "How exactly are you going to melt this glacier?">)>>
  125. <PSETG YUKS
  126. '["Nice try."
  127. "You can't be serious."
  128. "Chomp, Chomp."
  129. "Not a prayer."
  130. "I don't think so."]>
  131. <DEFINE RESERVOIR-SOUTH ("AUX" (PRSACT <1 ,PRSVEC>))
  132. #DECL ((PRSACT) VERB)
  133. <COND (<==? .PRSACT ,LOOK!-WORDS>
  134. <COND (,LOW-TIDE!-FLAG
  135. <TELL
  136. "You are in the south end of a large cavernous room which was formerly
  137. a reservoir."
  138. >
  139. <TELL ,RESDESC 1>)
  140. (<TELL "You are at the south end of a large reservoir.">)>
  141. <TELL
  142. "There is a western exit, a passageway south, and a steep pathway
  143. climbing up along the edge of a cliff." 1>)>>
  144. <DEFINE RESERVOIR-NORTH ("AUX" (PRSACT <1 ,PRSVEC>))
  145. #DECL ((PRSACT) VERB)
  146. <COND (<==? .PRSACT ,LOOK!-WORDS>
  147. <COND (,LOW-TIDE!-FLAG
  148. <TELL
  149. "You are in the north end of a large cavernous room which was formerly
  150. a reservoir."
  151. >
  152. <TELL ,RESDESC 1>)
  153. (<TELL "You are at the north end of a large reservoir.">)>
  154. <TELL "There is a tunnel leaving the room to the north." 1>)>>
  155. ;"LIVING-ROOM -- FUNCTION TO ENTER THE DUNGEON FROM THE HOUSE"
  156. <DEFINE LIVING-ROOM ("AUX" (WIN ,WINNER) (PRSVEC ,PRSVEC) RUG?
  157. (PRSACT <1 .PRSVEC>) TC)
  158. #DECL ((PRSVEC) VECTOR (WIN) ADV (RUG?) <OR ATOM FALSE>
  159. (PRSACT) VERB (TC) OBJECT)
  160. <COND (<==? .PRSACT ,LOOK!-WORDS>
  161. <COND (,MAGIC-FLAG!-FLAG
  162. <TELL
  163. "You are in the living room. There is a door to the east. To the
  164. west is a cyclops-shaped hole in an old wooden door, above which is
  165. some strange gothic lettering " 0>)
  166. (<TELL
  167. "You are in the living room. There is a door to the east, a wooden
  168. door with strange gothic lettering to the west, which appears to be
  169. nailed shut, " 0>)>
  170. <SET RUG? <ORAND <FIND-OBJ "RUG">>>
  171. <COND (<AND .RUG? ,TRAP-DOOR!-FLAG>
  172. <TELL
  173. "and a rug lying beside an open trap-door." 1>)
  174. (.RUG?
  175. <TELL
  176. "and a closed trap-door at your feet." 1>)
  177. (,TRAP-DOOR!-FLAG
  178. <TELL "and an open trap-door at your feet." 1>)
  179. (<TELL
  180. "and a large oriental rug in the center of the room." 1>)>
  181. T)
  182. (<AND <SET TC <FIND-OBJ "TCASE">>
  183. <OR <==? .PRSACT ,TAKE!-WORDS>
  184. <AND <==? .PRSACT ,PUT!-WORDS>
  185. <==? <3 .PRSVEC> .TC>>>>
  186. <PUT ,WINNER ,ASCORE <+ ,RAW-SCORE
  187. <MAPF ,+ ,OTVAL <OCONTENTS .TC>>>>)>>
  188. <DEFINE TRAP-DOOR ("AUX" (PRSACT <1 ,PRSVEC>) (RM ,HERE))
  189. #DECL ((PRSACT) VERB (RM) ROOM)
  190. <COND (<==? .RM <FIND-ROOM "LROOM">>
  191. <COND (<==? .PRSACT ,OPEN!-WORDS>
  192. <COND (,TRAP-DOOR!-FLAG
  193. <TELL "It's open.">)
  194. (<TELL
  195. "The door reluctantly opens to reveal a rickety staircase descending
  196. into darkness.">)>
  197. <COND-OPEN DOWN!-DIRECTIONS .RM>)
  198. (<==? .PRSACT ,CLOSE!-WORDS>
  199. <COND (,TRAP-DOOR!-FLAG
  200. <TELL
  201. "The door swings shut and closes.">)
  202. (<TELL "It's closed.">)>
  203. <COND-CLOSE DOWN!-DIRECTIONS .RM>
  204. T)>)
  205. (<==? .RM <FIND-ROOM "CELLA">>
  206. <COND (<==? .PRSACT ,OPEN!-WORDS>
  207. <TELL
  208. "The door is locked from above.">)
  209. (<TELL <PICK-ONE ,DUMMY>>)>)>>
  210. <DEFINE LOOK-UNDER ("AUX" (OBJ <2 ,PRSVEC>))
  211. #DECL ((OBJ) OBJECT)
  212. <COND (<AND <==? .OBJ <FIND-OBJ "RUG">>
  213. <NOT <ORAND .OBJ>>
  214. <NOT ,TRAP-DOOR!-FLAG>>
  215. <TELL "Underneath the rug is a closed trap door.">)
  216. (<AND <==? .OBJ <FIND-OBJ "LEAVE">>
  217. <N==? <RVARS <FIND-ROOM "CLEAR">> 1>>
  218. <TELL "Underneath the pile of leaves is a grating.">)>>
  219. <DEFINE REPENT ()
  220. <TELL "It could very well be too late!">>
  221. <DEFINE CLEARING ("AUX" (PRSACT <1 ,PRSVEC>) (RM ,HERE) (GRATE <FIND-OBJ "GRAT1">)
  222. (LEAVES <FIND-OBJ "LEAVE">) (RV <RVARS .RM>))
  223. #DECL ((PRSACT) VERB (RM) ROOM (LEAVES GRATE) OBJECT (RV) FIX)
  224. <COND (<==? .PRSACT ,LOOK!-WORDS>
  225. <TELL
  226. "You are in a clearing, with a forest surrounding you on the west
  227. and south.">
  228. <COND (,KEY-FLAG!-FLAG
  229. <TELL "There is an open grating, descending into darkness." 1>)
  230. (<NOT <0? .RV>>
  231. <TELL "There is a grating securely fastened into the ground." 1>)>)
  232. (<AND <0? .RV>
  233. <OR <AND <==? .PRSACT ,BURN!-WORDS>
  234. <NOT <0? <ORAND .LEAVES>>>>
  235. <==? .PRSACT ,TAKE!-WORDS>
  236. <==? .PRSACT ,MOVE!-WORDS>>
  237. <==? <2 ,PRSVEC> .LEAVES>>
  238. <TELL "A grating appears on the ground.">
  239. <TRO .GRATE ,OVISON>
  240. <PUT .RM ,RVARS 1>)>>
  241. ; "CELLAR--FIRST ROOM IN BASEMENT."
  242. <DEFINE CELLAR ("AUX" (WIN ,WINNER) (PRSACT <1 ,PRSVEC>)
  243. (DOOR <FIND-OBJ "DOOR">))
  244. #DECL ((WIN) ADV (PRSACT) VERB (DOOR) OBJECT)
  245. <COND (<==? .PRSACT ,LOOK!-WORDS>
  246. <TELL
  247. "You are in a dark and damp cellar with a narrow passageway leading
  248. east, and a crawlway to the south. On the west is the bottom of a
  249. steep metal ramp which is unclimbable.">)
  250. (<AND <==? <VNAME .PRSACT> WALK-IN!-WORDS>
  251. ,TRAP-DOOR!-FLAG
  252. <NOT <OTOUCH? .DOOR>>>
  253. <SETG TRAP-DOOR!-FLAG <>>
  254. <PUT .DOOR ,OTOUCH? T>
  255. <TELL
  256. "The trap door crashes shut, and you hear someone barring it." 1>)>>
  257. "STUDIO: LET PEOPLE UP THE CHIMNEY IF THEY DON'T HAVE MUCH STUFF"
  258. <DEFINE CHIMNEY-FUNCTION ("AUX" (WINNER ,WINNER) (AOBJS <AOBJS .WINNER>))
  259. #DECL ((WINNER) ADV (AOBJS) <LIST [REST OBJECT]>)
  260. <COND (<AND <L=? <LENGTH .AOBJS> 2>
  261. <MEMQ <FIND-OBJ "LAMP"> .AOBJS>>
  262. <SETG LIGHT-LOAD!-FLAG T>
  263. ;"Door will slam shut next time, too, since this way up don't count."
  264. <COND (<NOT ,TRAP-DOOR!-FLAG>
  265. <PUT <FIND-OBJ "DOOR"> ,OTOUCH? <>>)>
  266. <>)
  267. (T
  268. <SETG LIGHT-LOAD!-FLAG <>>)>>
  269. ; "OBJECT FUNCTIONS"
  270. <DEFINE RUG ("AUX" (PRSVEC ,PRSVEC) (PRSA <1 .PRSVEC>) OBJ)
  271. #DECL ((PRSVEC) VECTOR (OBJ) OBJECT (PRSA) VERB)
  272. <COND (<==? .PRSA ,LIFT!-WORDS>
  273. <TELL
  274. "The rug is too heavy to lift, but in trying to take it you have
  275. noticed an irregularity beneath it.">)
  276. (<==? .PRSA ,MOVE!-WORDS>
  277. <COND (<ORAND <SET OBJ <FIND-OBJ "RUG">>>
  278. <TELL
  279. "Having moved the carpet previously, you find it impossible to move
  280. it again.">)
  281. (<TELL
  282. "With a great effort, the rug is moved to one side of the room.
  283. With the rug moved, the dusty cover of a closed trap-door appears.">
  284. <TRO <FIND-OBJ "DOOR"> ,OVISON>
  285. <PUT .OBJ ,ORAND T>)>)
  286. (<==? .PRSA ,TAKE!-WORDS>
  287. <TELL
  288. "The rug is extremely heavy and cannot be carried.">)>>
  289. <DEFINE RUSTY-KNIFE ("AUX" (PRSVEC ,PRSVEC) (PRSA <1 .PRSVEC>) (PRSI <3 .PRSVEC>))
  290. #DECL ((PRSVEC) VECTOR (PRSA) VERB (PRSI) <OR FALSE OBJECT>)
  291. <COND (<==? .PRSA ,TAKE!-WORDS>
  292. <AND <MEMQ <FIND-OBJ "SWORD"> <AOBJS ,WINNER>>
  293. <TELL
  294. "As you pick up the rusty knife, your sword gives a single pulse
  295. of blinding blue light.">>
  296. <>)
  297. (<OR <==? .PRSA ,ATTAC!-WORDS>
  298. <==? .PRSA ,SWING!-WORDS>
  299. <AND <==? .PRSA ,THROW!-WORDS> .PRSI>
  300. <==? .PRSA ,KILL!-WORDS>>
  301. <KILL-OBJ <FIND-OBJ "RKNIF"> ,WINNER>
  302. <JIGS-UP
  303. "As the knife approaches its victim, your mind is submerged by an
  304. overmastering will. Slowly, your hand turns, until the rusty blade
  305. is an inch from your neck. The knife seems to sing as it savagely
  306. slits your throat.">)>>
  307. <DEFINE SKELETON ("AUX" (RM <1 ,WINNER>) (LLD <FIND-ROOM "LLD2">) L)
  308. #DECL ((RM LLD) ROOM (L) <LIST [REST OBJECT]>)
  309. <TELL
  310. "A ghost appears in the room and is appalled at your having
  311. desecrated the remains of a fellow adventurer. He casts a curse
  312. on all of your valuables and orders them banished to the Land of
  313. the Living Dead. The ghost leaves, muttering obscenities.">
  314. <SET L <ROB-ROOM .RM () 100>>
  315. <SET L <ROB-ADV ,PLAYER .L>>
  316. <MAPF <>
  317. <FUNCTION (X) #DECL ((X) OBJECT)
  318. <PUT .X ,OROOM .LLD>>
  319. .L>
  320. <COND (<NOT <EMPTY? .L>>
  321. <PUTREST <REST .L <- <LENGTH .L> 1>> <ROBJS .LLD>>
  322. <PUT .LLD ,ROBJS .L>)>
  323. T>
  324. <DEFINE TROLL ("AUX" (PA <1 ,PRSVEC>)
  325. (PV ,PRSVEC) (PRSO <2 .PV>) (HERE ,HERE)
  326. (T <FIND-OBJ "TROLL">) (A <FIND-OBJ "AXE">))
  327. #DECL ((PV) VECTOR (PRSO) <OR FALSE OBJECT> (WIN) ADV
  328. (HERE) ROOM (T A) OBJECT (PA) VERB)
  329. <COND (<==? .PA ,FIGHT!-WORDS>
  330. <COND (<==? <OCAN .A> .T> <>)
  331. (<MEMQ .A <ROBJS ,HERE>>
  332. <SNARF-OBJECT .T .A>
  333. <AND <==? .HERE <OROOM .T>>
  334. <TELL
  335. "The troll, now worried about this encounter, recovers his bloody
  336. axe.">>
  337. T)
  338. (<==? .HERE <OROOM .T>>
  339. <TELL
  340. "The troll, disarmed, cowers in terror, pleading for his life in
  341. the guttural tongue of the trolls.">
  342. T)>)
  343. (<==? .PA ,DEAD\!!-WORDS> <SETG TROLL-FLAG!-FLAG T>)
  344. (<==? .PA ,OUT\!!-WORDS>
  345. <TRZ <FIND-OBJ "AXE"> ,OVISON>
  346. <PUT .T ,ODESC1 ,TROLLOUT>
  347. <SETG TROLL-FLAG!-FLAG T>)
  348. (<==? .PA ,IN\!!-WORDS>
  349. <TRO <FIND-OBJ "AXE"> ,OVISON>
  350. <COND (<==? <OROOM .T> .HERE>
  351. <TELL
  352. "The troll stirs, quickly resuming a fighting stance.">)>
  353. <PUT .T ,ODESC1 ,TROLLDESC>
  354. <SETG TROLL-FLAG!-FLAG <>>)
  355. (<==? .PA ,FIRST?!-WORDS> <PROB 33>)
  356. (<AND <OR <==? .PA ,THROW!-WORDS>
  357. <==? .PA ,GIVE!-WORDS>>
  358. .PRSO>
  359. <COND (<==? .PA ,THROW!-WORDS>
  360. <TELL
  361. "The troll, who is remarkably coordinated, catches the " 1 <ODESC2 .PRSO>>)
  362. (<TELL
  363. "The troll, who is not overly proud, graciously accepts the gift">)>
  364. <COND (<==? .PRSO <FIND-OBJ "KNIFE">>
  365. <TELL
  366. "and being for the moment sated, throws it back. Fortunately, the
  367. troll has poor control, and the knife falls to the floor. He does
  368. not look pleased.">
  369. <TRO .T ,FIGHTBIT>)
  370. (<TELL
  371. "and not having the most discriminating tastes, gleefully eats it.">
  372. <REMOVE-OBJECT <2 .PV>>)>)
  373. (<OR <==? .PA ,TAKE!-WORDS>
  374. <==? .PA ,MOVE!-WORDS>>
  375. <TELL
  376. "The troll spits in your face, saying \"Better luck next time.\"">)
  377. (<==? <VNAME .PA> MUNG!-WORDS>
  378. <TELL
  379. "The troll laughs at your puny gesture.">)>>
  380. "MIRROR ROOM HACKERY"
  381. <DEFINE MIRROR-ROOM ("AUX" (PRSACT <1 ,PRSVEC>))
  382. #DECL ((PRSACT) VERB)
  383. <COND (<AND <==? .PRSACT ,LOOK!-WORDS>
  384. <LIT? ,HERE>>
  385. <TELL
  386. "You are in a large square room with tall ceilings. On the south wall
  387. is an enormous mirror which fills the entire wall. There are exits
  388. on the other three sides of the room.">
  389. <COND (,MIRROR-MUNG!-FLAG
  390. <TELL
  391. "Unfortunately, you have managed to destroy it by your reckless
  392. actions." 1>)>)>>
  393. <SETG MIRROR-MUNG!-FLAG <>>
  394. <DEFINE MIRROR-MIRROR ("AUX" (PRSACT <1 ,PRSVEC>) RM1 RM2 L1)
  395. #DECL ((PRSACT) VERB (RM1 RM2) ROOM (L1) <LIST [REST OBJECT]>)
  396. <COND (<AND <NOT ,MIRROR-MUNG!-FLAG>
  397. <==? <VNAME .PRSACT> RUB!-WORDS>>
  398. <SET RM1 ,HERE>
  399. <SET RM2
  400. <COND (<==? .RM1 <FIND-ROOM "MIRR1">>
  401. <FIND-ROOM "MIRR2">)
  402. (<FIND-ROOM "MIRR1">)>>
  403. <SET L1 <ROBJS .RM1>>
  404. <PUT .RM1 ,ROBJS <ROBJS .RM2>>
  405. <PUT .RM2 ,ROBJS .L1>
  406. <MAPF <> <FUNCTION (X) #DECL ((X) OBJECT)
  407. <PUT .X ,OROOM .RM1>>
  408. <ROBJS .RM1>>
  409. <MAPF <> <FUNCTION (X) #DECL ((X) OBJECT)
  410. <PUT .X ,OROOM .RM2>>
  411. <ROBJS .RM2>>
  412. <GOTO .RM2>
  413. <TELL
  414. "There is a rumble from deep within the earth and the room shakes.">)
  415. (<OR <==? .PRSACT ,LOOK!-WORDS>
  416. <==? .PRSACT ,EXAMI!-WORDS>>
  417. <COND (,MIRROR-MUNG!-FLAG
  418. <TELL "The mirror is broken into many pieces.">)
  419. (<TELL "There is an ugly person staring at you.">)>)
  420. (<==? .PRSACT ,TAKE!-WORDS>
  421. <TELL
  422. "Nobody but a greedy surgeon would allow you to attempt that trick.">)
  423. (<OR <==? <VNAME .PRSACT> MUNG!-WORDS>
  424. <==? <VNAME .PRSACT> THROW!-WORDS>>
  425. <COND (,MIRROR-MUNG!-FLAG
  426. <TELL
  427. "Haven't you done enough already?">)
  428. (<SETG MIRROR-MUNG!-FLAG T>
  429. <TELL
  430. "You have broken the mirror. I hope you have a seven years supply of
  431. good luck handy.">)>)>>
  432. <DEFINE CAROUSEL-ROOM ("AUX" (PV ,PRSVEC))
  433. #DECL ((PV) VECTOR)
  434. <COND (<AND <==? <1 .PV> ,WALK-IN!-WORDS> ,CAROUSEL-ZOOM!-FLAG>
  435. <JIGS-UP ,SPINDIZZY>)
  436. (<==? <1 .PV> ,LOOK!-WORDS>
  437. <TELL
  438. "You are in a circular room with passages off in eight directions." 1>
  439. <COND (<NOT ,CAROUSEL-FLIP!-FLAG>
  440. <TELL
  441. "Your compass needle spins wildly, and you can't get your bearings." 1>)>)>>
  442. <DEFINE CAROUSEL-EXIT ("AUX" CX)
  443. #DECL ((CX) <OR CEXIT NEXIT ROOM>)
  444. <COND (,CAROUSEL-FLIP!-FLAG <>)
  445. (<TELL "Unfortunately, it is impossible to tell directions in here." 1>
  446. <CAROUSEL-OUT>)>>
  447. <DEFINE CAROUSEL-OUT ("AUX" CX)
  448. #DECL ((CX) <OR CEXIT NEXIT ROOM>)
  449. <AND <TYPE? <SET CX <NTH <REXITS ,HERE> <* 2 <+ 1 <MOD <RANDOM> 8>>>>> CEXIT>
  450. <CXROOM .CX>>>
  451. <DEFINE TORCH-ROOM ("AUX" (PRSACT <1 ,PRSVEC>))
  452. #DECL ((PRSACT) VERB)
  453. <COND (<==? .PRSACT ,LOOK!-WORDS>
  454. <TELL
  455. "You are in a large room with a prominent doorway leading to a down
  456. staircase. To the west is a narrow twisting tunnel. Above you is a
  457. large dome painted with scenes depicting elfin hacking rites. Up
  458. around the edge of the dome (20 feet up) is a wooden railing. In the
  459. center of the room there is a white marble pedestal.">
  460. <COND (,DOME-FLAG!-FLAG
  461. <TELL
  462. "A large piece of rope descends from the railing above, ending some
  463. five feet above your head." 1>)>)>>
  464. <DEFINE DOME-ROOM ("AUX" (PRSACT <1 ,PRSVEC>))
  465. #DECL ((PRSACT) VERB)
  466. <COND (<==? .PRSACT ,LOOK!-WORDS>
  467. <TELL
  468. "You are at the periphery of a large dome, which forms the ceiling
  469. of another room below. Protecting you from a precipitous drop is a
  470. wooden railing which circles the dome.">
  471. <COND (,DOME-FLAG!-FLAG
  472. <TELL
  473. "Hanging down from the railing is a rope which ends about ten feet
  474. from the floor below." 1>)>)
  475. (<==? <VNAME .PRSACT> JUMP!-WORDS>
  476. <JIGS-UP
  477. "I'm afraid that the leap you attempted has done you in.">)>>
  478. <DEFINE COFFIN-CURE ()
  479. <COND (<MEMQ <FIND-OBJ "COFFI"> <AOBJS ,WINNER>>
  480. <SETG EGYPT-FLAG!-FLAG <>>)
  481. (ELSE <SETG EGYPT-FLAG!-FLAG T>)>
  482. <>>
  483. <DEFINE LLD-ROOM ("AUX" (PV ,PRSVEC) (WIN ,WINNER) (WOBJ <AOBJS .WIN>)
  484. (PA <1 .PV>) (CAND <FIND-OBJ "CANDL">))
  485. #DECL ((PV) VECTOR (PA) VERB (WIN) ADV (WOBJ) <LIST [REST OBJECT]>
  486. (CAND) OBJECT)
  487. <COND (<==? .PA ,LOOK!-WORDS>
  488. <TELL
  489. "You are outside a large gateway, on which is inscribed
  490. \"Abandon every hope, all ye who enter here.\"
  491. The gate is open; through it you can see a desolation, with a pile of
  492. mangled corpses in one corner. Thousands of voices, lamenting some
  493. hideous fate, can be heard.">
  494. <COND (<NOT ,LLD-FLAG!-FLAG>
  495. <TELL
  496. "The way through the gate is barred by evil spirits, who jeer at your
  497. attempts to pass.">)>)
  498. (<==? <VNAME .PA> EXORC!-WORDS>
  499. <COND (<MEMQ <FIND-OBJ "GHOST"> <ROBJS ,HERE>>
  500. <COND (<AND <MEMQ <FIND-OBJ "BELL"> .WOBJ>
  501. <MEMQ <FIND-OBJ "BOOK"> .WOBJ>
  502. <MEMQ <SET CAND <FIND-OBJ "CANDL">> .WOBJ>
  503. <G? <OLIGHT? .CAND> 0>>
  504. <TELL
  505. "There is a clap of thunder, and a voice echoes through the cavern:
  506. \"Begone, fiends!\" The spirits, sensing the presence of a greater
  507. power, flee through the walls.">
  508. <REMOVE-OBJECT <FIND-OBJ "GHOST">>
  509. <SETG LLD-FLAG!-FLAG T>)
  510. (<TELL "You are not equipped for an exorcism.">)>)
  511. (<JIGS-UP
  512. "There is a clap of thunder, and a voice echoes through the
  513. cavern: \"Begone, chomper!\" Apparently, the voice thinks you
  514. are an evil spirit, and dismisses you from the realm of the living.">)>)>>
  515. <DEFINE LLD2-ROOM ("AUX" (PRSA <1 ,PRSVEC>))
  516. #DECL ((PRSA) VERB)
  517. <COND (<==? .PRSA ,LOOK!-WORDS>
  518. <TELL
  519. "You have entered the Land of the Living Dead, a large desolate room.
  520. Although it is apparently uninhabited, you can hear the sounds of
  521. thousands of lost souls weeping and moaning. In the east corner are
  522. stacked the remains of dozens of previous adventurers who were less
  523. fortunate than yourself. To the east is an ornate passage,
  524. apparently recently constructed. "
  525. 1
  526. <COND (,ON-POLE!-FLAG
  527. " Amid the desolation, you spot what
  528. appears to be your head, at the end of a long pole.") ("")>>)>>
  529. <DEFINE GHOST-FUNCTION ("AUX" (PV ,PRSVEC) (G <FIND-OBJ "GHOST">))
  530. #DECL ((PV) VECTOR (G) OBJECT)
  531. <COND (<==? <3 .PV> .G>
  532. <TELL "How can you attack a spirit with material objects?">
  533. <>)
  534. (<==? <2 .PV> .G>
  535. <TELL "You seem unable to affect these spirits.">)>>
  536. <DEFINE MAZE-11 ("AUX" (PRSACT <1 ,PRSVEC>))
  537. #DECL ((PRSACT) VERB)
  538. <COND (<==? .PRSACT ,LOOK!-WORDS>
  539. <TELL
  540. "You are in a small room near the maze. There are twisty passages
  541. in the immediate vicinity.">
  542. <COND (,KEY-FLAG!-FLAG
  543. <TELL
  544. "Above you is an open grating with sunlight pouring in.">)
  545. (,GRUNLOCK!-FLAG
  546. <TELL "Above you is a grating.">)
  547. (<TELL
  548. "Above you is a grating locked with a skull-and-crossbones lock.">)>)>>
  549. <DEFINE GRAT1-FUNCTION ("AUX" (PRSACT <1 ,PRSVEC>))
  550. #DECL ((PRSACT) VERB)
  551. <COND (,GRUNLOCK!-FLAG
  552. <OPEN-CLOSE .PRSACT
  553. KEY-FLAG!-FLAG
  554. "The grating opens."
  555. "The grating is closed.">)
  556. (<TELL "The grating is locked.">)>>
  557. <DEFINE GRAT2-FUNCTION ("AUX" (PRSACT <1 ,PRSVEC>))
  558. #DECL ((PRSACT) VERB)
  559. <COND (,GRUNLOCK!-FLAG
  560. <OPEN-CLOSE .PRSACT
  561. KEY-FLAG!-FLAG
  562. "The grating opens to reveal trees above you."
  563. "The grating is closed.">
  564. <TRO <FIND-OBJ "GRAT1"> ,OVISON>)
  565. (<TELL "The grating is locked.">)>>
  566. <DEFINE TREASURE-ROOM ("AUX" (PV ,PRSVEC) (HACK ,ROBBER-DEMON)
  567. HH CHALI
  568. (HOBJ <HOBJ .HACK>) (FLG <>) TL (HERE ,HERE) (ROOMS ,ROOMS))
  569. #DECL ((HACK) HACK (PV) <VECTOR VERB> (HH) <LIST [REST OBJECT]>
  570. (HOBJ) OBJECT (FLG) <OR ATOM FALSE> (TL ROOMS) <LIST [REST ROOM]>
  571. (HERE) ROOM)
  572. <COND (<AND <HACTION .HACK>
  573. <==? <VNAME <1 .PV>> WALK-IN!-WORDS>>
  574. <COND (<SET FLG <N==? <OROOM .HOBJ> .HERE>>
  575. <TELL
  576. "You hear a scream of anguish as you violate the robber's hideaway.
  577. Using passages unknown to you, he rushes to its defense.">
  578. <COND (<OROOM .HOBJ>
  579. <REMOVE-OBJECT .HOBJ>)>
  580. <TRO .HOBJ ,FIGHTBIT>
  581. <PUT .HACK ,HROOM .HERE>
  582. <PUT .HACK ,HROOMS <COND (<EMPTY? <SET TL <REST <MEMQ .HERE .ROOMS>>>>
  583. .ROOMS)
  584. (.TL)>>
  585. <INSERT-OBJECT .HOBJ .HERE>)
  586. (T
  587. <TRO .HOBJ ,FIGHTBIT>)>
  588. <AND <NOT <OCAN <SET CHALI <FIND-OBJ "CHALI">>>>
  589. <==? <OROOM .CHALI> .HERE>
  590. <TRZ .CHALI ,TAKEBIT>>
  591. <COND (<NOT <LENGTH? <ROBJS .HERE> 2>>
  592. <TELL
  593. "The thief gestures mysteriously, and the treasures in the room
  594. suddenly vanish.">)>
  595. <MAPF <>
  596. <FUNCTION (X) #DECL ((X) OBJECT)
  597. <COND (<AND <N==? .X .CHALI>
  598. <N==? .X .HOBJ>>
  599. <TRZ .X ,OVISON>)>>
  600. <ROBJS .HERE>>)>>
  601. <DEFINE TREAS ()
  602. <COND (<AND <==? <1 ,PRSVEC> ,TREAS!-WORDS>
  603. <==? ,HERE <FIND-ROOM "TEMP1">>>
  604. <GOTO <FIND-ROOM "TREAS">>
  605. <ROOM-DESC>)
  606. (<AND <==? <1 ,PRSVEC> ,TEMPL!-WORDS>
  607. <==? ,HERE <FIND-ROOM "TREAS">>>
  608. <GOTO <FIND-ROOM "TEMP1">>
  609. <ROOM-DESC>)
  610. (T <TELL "Nothing happens.">)>>
  611. <DEFINE PRAYER ()
  612. <COND (<AND <==? ,HERE <FIND-ROOM "TEMP2">>
  613. <GOTO <FIND-ROOM "FORE1">>>
  614. <ROOM-DESC>)
  615. (<TELL
  616. "If you pray enough, your prayers may be answered.">)>>
  617. <SETG GATE-FLAG!-FLAG <>>
  618. <DEFINE DAM-ROOM ("AUX" (PRSACT <1 ,PRSVEC>))
  619. #DECL ((PRSACT) VERB)
  620. <COND
  621. (<==? .PRSACT ,LOOK!-WORDS>
  622. <TELL
  623. "You are standing on the top of the Flood Control Dam #3, which was
  624. quite a tourist attraction in times far distant. There are paths to
  625. the north, south, east, and down.">
  626. <COND (,LOW-TIDE!-FLAG
  627. <TELL
  628. "It appears that the dam has been opened since the water level behind
  629. it is low and the sluice gate has been opened. Water is rushing
  630. downstream through the gates." 1>)
  631. (<TELL
  632. "The sluice gates on the dam are closed. Behind the dam, there can be
  633. seen a wide lake. A small stream is formed by the runoff from the
  634. lake." 1>)>
  635. <TELL
  636. "There is a control panel here. There is a large metal bolt on the
  637. panel. Above the bolt is a small green plastic bubble." 1>
  638. <COND (,GATE-FLAG!-FLAG <TELL "The green bubble is glowing." 1>)>)>>
  639. <DEFINE BOLT-FUNCTION ("AUX" (PRSACT <1 ,PRSVEC>) (PRSI <3 ,PRSVEC>)
  640. (TRUNK <FIND-OBJ "TRUNK">))
  641. #DECL ((PRSACT) VERB (TRUNK) OBJECT (PRSI) <OR FALSE OBJECT>)
  642. <COND (<==? .PRSACT ,TURN!-WORDS>
  643. <COND (<==? .PRSI <FIND-OBJ "WRENC">>
  644. <COND (,GATE-FLAG!-FLAG
  645. <COND (,LOW-TIDE!-FLAG
  646. <SETG LOW-TIDE!-FLAG <>>
  647. <TELL
  648. "The sluice gates close and water starts to collect behind the dam.">
  649. <AND <MEMQ .TRUNK <ROBJS <FIND-ROOM "RESES">>>
  650. <TRZ .TRUNK ,OVISON>>
  651. T)
  652. (<SETG LOW-TIDE!-FLAG T>
  653. <TELL
  654. "The sluice gates open and water pours through the dam.">
  655. <TRO .TRUNK ,OVISON>)>)
  656. (<TELL
  657. "The bolt won't turn with your best effort.">)>)
  658. (<TYPE? .PRSI OBJECT>
  659. <TELL
  660. "The bolt won't turn using the " 1 <ODESC2 .PRSI> ".">)>)>>
  661. <PSETG DROWNINGS
  662. '["up to your ankles."
  663. "up to your shin."
  664. "up to your knees."
  665. "up to your hips."
  666. "up to your waist."
  667. "up to your chest."
  668. "up to your neck."
  669. "over your head."
  670. "high in your lungs."]>
  671. <GDECL (DROWNINGS) <VECTOR [REST STRING]>>
  672. <DEFINE MAINT-ROOM ("AUX" (PV ,PRSVEC) (PRSACT <1 .PV>) (PRSO <2 .PV>)
  673. (PRSI <3 .PV>) (MNT <FIND-ROOM "MAINT">)
  674. (HERE? <==? ,HERE .MNT>) HACK)
  675. #DECL ((PRSACT) VERB (PRSI) <OR FALSE OBJECT> (HERE?) <OR ATOM FALSE>
  676. (MNT) ROOM (PRSO) PRSOBJ (HACK) FIX)
  677. <COND (<==? .PRSACT ,C-INT!-WORDS>
  678. <PUT .MNT ,RVARS <+ 1 <SET HACK <RVARS .MNT>>>>
  679. <COND (<AND .HERE?
  680. <TELL "The water level here is now "
  681. 1
  682. <NTH ,DROWNINGS <+ 1 </ <SET HACK <RVARS .MNT>>
  683. 2>>>>>)>
  684. <COND (<G=? <SET HACK <RVARS .MNT>> 16>
  685. <MUNG-ROOM .MNT
  686. "The room is full of water and cannot be entered.">
  687. <CLOCK-INT ,MNTIN 0>
  688. <AND .HERE?
  689. <JIGS-UP "I'm afraid you have done drowned yourself."
  690. >>)>)>
  691. <COND (<==? <VNAME .PRSACT> PUSH!-WORDS>
  692. <COND (<==? .PRSO <FIND-OBJ "BLBUT">>
  693. <COND (<0? <SET HACK <RVARS ,HERE>>>
  694. <TELL
  695. "There is a rumbling sound and a stream of water appears to burst
  696. from the east wall of the room (apparently, a leak has occurred in a
  697. pipe.)">
  698. <PUT ,HERE ,RVARS 1>
  699. <CLOCK-INT ,MNTIN -1>
  700. T)
  701. (<TELL "The blue button appears to be jammed.">)>)
  702. (<==? .PRSO <FIND-OBJ "RBUTT">>
  703. <PUT ,HERE ,RLIGHT? <NOT <RLIGHT? ,HERE>>>
  704. <COND (<RLIGHT? ,HERE>
  705. <TELL "The lights within the room come on.">)
  706. (<TELL "The lights within the room shut off.">)>)
  707. (<==? .PRSO <FIND-OBJ "BRBUT">>
  708. <SETG GATE-FLAG!-FLAG <>>
  709. <TELL "Click.">)
  710. (<==? .PRSO <FIND-OBJ "YBUTT">>
  711. <SETG GATE-FLAG!-FLAG T>
  712. <TELL "Click.">)>)>>
  713. <DEFINE LEAK-FUNCTION ("AUX" HACK
  714. (PRSVEC ,PRSVEC) (PRSA <1 .PRSVEC>) (PRSI <3 .PRSVEC>))
  715. #DECL ((PRSVEC) <VECTOR [3 ANY]> (PRSA) VERB (PRSI) <OR OBJECT FALSE>
  716. (HACK) FIX)
  717. <COND (<==? <2 .PRSVEC> <FIND-OBJ "LEAK">>
  718. <COND (<AND <==? <VNAME .PRSA> PLUG!-WORDS>
  719. <G? <SET HACK <RVARS ,HERE>> 0>>
  720. <COND (<==? .PRSI <FIND-OBJ "PUTTY">>
  721. <PUT ,HERE ,RVARS -1>
  722. <CLOCK-INT ,MNTIN 0>
  723. <TELL
  724. "By some miracle of elven technology, you have managed to stop the
  725. leak in the dam.">)
  726. (<WITH-TELL .PRSI>)>)>)>>
  727. <DEFINE TUBE-FUNCTION ("AUX" (PRSVEC ,PRSVEC))
  728. #DECL ((PRSVEC) <VECTOR [3 ANY]>)
  729. <COND (<AND <==? <1 .PRSVEC> ,PUT!-WORDS>
  730. <==? <3 .PRSVEC> <FIND-OBJ "TUBE">>>
  731. <TELL "The tube refuses to accept anything.">)>>
  732. <DEFINE WITH-TELL (OBJ)
  733. #DECL ((OBJ) OBJECT)
  734. <TELL "With a " 1 <ODESC2 .OBJ> "?">>
  735. <DEFINE CAVE2-ROOM ("AUX" FOO BAR (PRSACT <1 ,PRSVEC>) C)
  736. #DECL ((FOO) <VECTOR FIX CEVENT> (BAR) CEVENT (PRSACT) VERB (C) OBJECT)
  737. <COND (<==? <VNAME .PRSACT> WALK-IN!-WORDS>
  738. <AND <MEMQ <SET C <FIND-OBJ "CANDL">> <AOBJS ,WINNER>>
  739. <PROB 50>
  740. <1? <OLIGHT? .C>>
  741. <CLOCK-DISABLE <SET BAR <2 <SET FOO <ORAND .C>>>>>
  742. <PUT .C ,OLIGHT? -1>
  743. <TELL
  744. "The cave is very windy at the moment and your candles have blown out.">>)>>
  745. <DEFINE BOTTLE-FUNCTION ("AUX" (PRSACT <1 ,PRSVEC>))
  746. #DECL ((PRSACT) VERB)
  747. <COND (<==? <1 .PRSACT> THROW!-WORDS>
  748. <TELL "The bottle hits the far wall and is decimated.">
  749. <REMOVE-OBJECT <2 ,PRSVEC>>)
  750. (<==? <1 .PRSACT> MUNG!-WORDS>
  751. <COND (<MEMQ <2 ,PRSVEC> <AOBJS ,WINNER>>
  752. <PUT ,WINNER ,AOBJS <SPLICE-OUT <2 ,PRSVEC> <AOBJS ,WINNER>>>
  753. <TELL "You have destroyed the bottle. Well done.">)
  754. (<MEMQ <2 ,PRSVEC> <ROBJS ,HERE>>
  755. <PUT ,HERE ,ROBJS <SPLICE-OUT <2 ,PRSVEC> <ROBJS ,HERE>>>
  756. <TELL "A brilliant maneuver destroys the bottle.">)>)>>
  757. <DEFINE FILL ("AUX" (REM <>) (PRSVEC ,PRSVEC) (W <FIND-OBJ "WATER">))
  758. #DECL ((REM) <OR ATOM FALSE> (PRSVEC) <VECTOR VERB OBJECT ANY> (W) OBJECT)
  759. <COND (<OBJECT-ACTION>)
  760. (<OR <RTRNN ,HERE ,RFILLBIT>
  761. <SET REM <OR <==? <OCAN .W> <AVEHICLE ,WINNER>>
  762. <==? <OROOM .W> ,HERE>>>>
  763. <PUT .PRSVEC 1 ,TAKE!-WORDS>
  764. <PUT .PRSVEC 3 <2 .PRSVEC>>
  765. <PUT .PRSVEC 2 .W>
  766. <WATER-FUNCTION .REM>)
  767. (<TELL "I can't find any water here.">)>>
  768. <DEFINE WATER-FUNCTION ("OPTIONAL" (REM T)
  769. "AUX" (PRSVEC ,PRSVEC) (PRSACT <1 .PRSVEC>) (ME ,WINNER)
  770. (B <FIND-OBJ "BOTTL">) (W <2 .PRSVEC>)
  771. (AV <AVEHICLE .ME>) (CAN <3 .PRSVEC>))
  772. #DECL ((PRSACT) VERB (ME) ADV (B W) OBJECT (REM) <OR ATOM FALSE>
  773. (PRSVEC) <VECTOR [3 ANY]> (AV) <OR OBJECT FALSE> (CAN) <OR FALSE OBJECT>)
  774. <COND (<OR <==? .PRSACT ,TAKE!-WORDS>
  775. <==? .PRSACT ,PUT!-WORDS>>
  776. <COND (<AND .AV <==? .AV .CAN>>
  777. <TELL "There is now a puddle in the bottom of the "
  778. 1
  779. <ODESC2 .AV>
  780. ".">
  781. <COND (<MEMQ .W <AOBJS .ME>>
  782. <DROP-OBJECT .W .ME>)>
  783. <COND (<MEMQ .W <OCONTENTS .AV>>)
  784. (<PUT .AV ,OCONTENTS (.W !<OCONTENTS .AV>)>
  785. <PUT .W ,OCAN .AV>)>)
  786. (<AND .CAN <N==? .CAN .B>>
  787. <TELL "The water leaks out of the " 1 <ODESC2 .CAN>
  788. " and evaporates immediately.">
  789. <COND (<MEMQ .W <AOBJS .ME>>
  790. <DROP-OBJECT .W .ME>)
  791. (<REMOVE-OBJECT .W>)>)
  792. (<MEMQ .B <AOBJS .ME>>
  793. <COND (<NOT <EMPTY? <OCONTENTS .B>>>
  794. <TELL "The bottle is already full.">)
  795. (<NOT <OOPEN? .B>>
  796. <TELL "The bottle is closed.">)
  797. (T
  798. <AND .REM <REMOVE-OBJECT .W>>
  799. <PUT .B ,OCONTENTS (.W)>
  800. <PUT .W ,OCAN .B>
  801. <TELL "The bottle is now full of water.">)>)
  802. (<AND <==? <OCAN .W> .B>
  803. <==? .PRSACT ,TAKE!-WORDS>
  804. <NOT .CAN>>
  805. <PUT .PRSVEC 2 .B>
  806. <TAKE T>
  807. <PUT .PRSVEC 2 .W>)
  808. (<TELL "The water slips through your fingers.">)>)
  809. (<OR <==? .PRSACT ,DROP!-WORDS>
  810. <==? .PRSACT ,POUR!-WORDS>
  811. <==? .PRSACT ,GIVE!-WORDS>>
  812. <COND (<MEMQ .W <AOBJS .ME>>
  813. <DROP-OBJECT .W .ME>)>
  814. <COND (.AV
  815. <TELL "There is now a puddle in the bottom of the "
  816. 1
  817. <ODESC2 .AV>
  818. ".">)
  819. (<TELL "The water spills to the floor and evaporates immediately.">
  820. <REMOVE-OBJECT .W>)>)
  821. (<==? .PRSACT ,THROW!-WORDS>
  822. <TELL "The water splashes on the walls, and evaporates immediately.">
  823. <REMOVE-OBJECT .W>)>>
  824. <DEFINE ROPE-FUNCTION ("AUX" (PRSACT <1 ,PRSVEC>) (DROOM <FIND-ROOM "DOME">)
  825. (ROPE <FIND-OBJ "ROPE">) (WIN ,WINNER))
  826. #DECL ((PRSACT) VERB (ROPE) OBJECT (WIN) ADV (DROOM) ROOM)
  827. <COND (<N==? ,HERE .DROOM>
  828. <SETG DOME-FLAG!-FLAG <>>
  829. <COND (<==? <VNAME .PRSACT> TIE!-WORDS>
  830. <TELL "There is nothing it can be tied to.">)
  831. (<==? <VNAME .PRSACT> UNTIE!-WORDS>
  832. <TELL "It is not tied to anything.">)>)
  833. (<AND <==? <VNAME .PRSACT> TIE!-WORDS>
  834. <==? <3 ,PRSVEC> <FIND-OBJ "RAILI">>>
  835. <COND (,DOME-FLAG!-FLAG
  836. <TELL "The rope is already attached.">)
  837. (<TELL
  838. "The rope drops over the side and comes within ten feet of the floor.">
  839. <SETG DOME-FLAG!-FLAG T>
  840. <TRO .ROPE ,NDESCBIT>
  841. <COND (<NOT <OROOM .ROPE>>
  842. <PUT .WIN ,AOBJS <SPLICE-OUT .ROPE <AOBJS .WIN>>>
  843. <INSERT-OBJECT .ROPE .DROOM>)>)>)
  844. (<==? <VNAME .PRSACT> UNTIE!-WORDS>
  845. <COND (,DOME-FLAG!-FLAG
  846. <SETG DOME-FLAG!-FLAG <>>
  847. <TRZ .ROPE ,NDESCBIT>
  848. <TELL
  849. "Although you tied it incorrectly, the rope becomes free.">)
  850. (<TELL "It is not tied to anything.">)>)
  851. (<AND <==? .PRSACT ,DROP!-WORDS>
  852. <NOT ,DOME-FLAG!-FLAG>>
  853. <REMOVE-OBJECT .ROPE>
  854. <INSERT-OBJECT .ROPE <FIND-ROOM "TORCH">>
  855. <TELL "The rope drops gently to the floor below.">)
  856. (<AND <==? .PRSACT ,TAKE!-WORDS>
  857. ,DOME-FLAG!-FLAG
  858. <TELL "The rope is tied to the railing.">>)>>
  859. <DEFINE CYCLOPS ("AUX" (PRSACT <1 ,PRSVEC>) (PRSOB1 <2 ,PRSVEC>) (RM ,HERE)
  860. (FOOD <FIND-OBJ "FOOD">) (DRINK <FIND-OBJ "WATER">)
  861. (COUNT <RVARS .RM>) (GARLIC <FIND-OBJ "GARLI">) CYC)
  862. #DECL ((PRSACT) VERB (PRSOB1) <OR OBJECT FALSE> (RM) ROOM (FOOD DRINK) OBJECT
  863. (CYC GARLIC) OBJECT (COUNT) FIX)
  864. <COND (,CYCLOPS-FLAG!-FLAG
  865. <COND (<OR <==? .PRSACT ,AWAKE!-WORDS>
  866. <==? .PRSACT ,MUNG!-WORDS>
  867. <==? .PRSACT ,BURN!-WORDS>
  868. <==? .PRSACT ,FIGHT!-WORDS>>
  869. <TELL
  870. "The cyclops yawns and stares at the thing that woke him up.">
  871. <SETG CYCLOPS-FLAG!-FLAG <>>
  872. <TRZ <SET CYC <FIND-OBJ "CYCLO">> ,SLEEPBIT>
  873. <TRO .CYC ,FIGHTBIT>
  874. <PUT .RM ,RVARS <ABS <RVARS .RM>>>
  875. T)>)
  876. (<G? <ABS .COUNT> 5>
  877. <JIGS-UP
  878. "The cyclops, tired of all of your games and trickery, eats you.
  879. The cyclops says 'Mmm. Just like mom used to make 'em.'">)
  880. (<==? <VNAME .PRSACT> GIVE!-WORDS>
  881. <COND (<==? .PRSOB1 .FOOD>
  882. <COND (<G=? .COUNT 0>
  883. <REMOVE-OBJECT .FOOD>
  884. <TELL
  885. "The cyclops says 'Mmm Mmm. I love hot peppers! But oh, could I use
  886. a drink. Perhaps I could drink the blood of that thing'. From the
  887. gleam in his eye, it could be surmised that you are 'that thing'.">
  888. <PUT .RM ,RVARS <MIN -1 <- .COUNT>>>)>)
  889. (<==? .PRSOB1 .DRINK>
  890. <COND (<L? .COUNT 0>
  891. <REMOVE-OBJECT .DRINK>
  892. <TRO <SET CYC <FIND-OBJ "CYCLO">> ,SLEEPBIT>
  893. <TRZ .CYC ,FIGHTBIT>
  894. <TELL
  895. "The cyclops looks tired and quickly falls fast asleep (what did you
  896. put in that drink, anyway?).">
  897. <SETG CYCLOPS-FLAG!-FLAG T>)
  898. (<TELL
  899. "The cyclops apparently was not thirsty at the time and refuses your
  900. generous gesture.">
  901. <>)>)
  902. (<==? .PRSOB1 .GARLIC>
  903. <TELL "The cyclops may be hungry, but there is a limit.">
  904. <PUT .RM ,RVARS <AOS-SOS .COUNT>>)
  905. (<TELL "The cyclops is not so stupid as to eat THAT!">
  906. <PUT .RM ,RVARS <AOS-SOS .COUNT>>)>)
  907. (<OR <==? .PRSACT ,FIRST?!-WORDS>
  908. <==? .PRSACT ,FIGHT!-WORDS>> <>)
  909. (<AND <PUT .RM ,RVARS <AOS-SOS .COUNT>> <>>)
  910. (<OR <==? .PRSACT ,THROW!-WORDS>
  911. <==? <VNAME .PRSACT> MUNG!-WORDS>>
  912. <COND (<PROB 50>
  913. <TELL
  914. "Your actions don't appear to be doing much harm to the cyclops, but
  915. they do not exactly lower your insurance premiums, either.">)
  916. (<TELL
  917. "The cyclops ignores all injury to his body with a shrug.">)>)
  918. (<==? .PRSACT ,TAKE!-WORDS>
  919. <TELL
  920. "The cyclops is rather heavy and doesn't take kindly to being grabbed.">)
  921. (<==? .PRSACT ,TIE!-WORDS>
  922. <TELL
  923. "You cannot tie the cyclops, although he is fit to be tied.">)>>
  924. <DEFINE CYCLOPS-ROOM ("AUX" (PV ,PRSVEC) (RM ,HERE) (VARS <RVARS .RM>))
  925. #DECL ((PV) VECTOR (RM) ROOM (VARS) FIX)
  926. <COND (<==? <1 .PV> ,LOOK!-WORDS>
  927. <TELL
  928. "You are in a room with an exit on the west side, and a staircase
  929. leading up.">
  930. <COND (<AND ,CYCLOPS-FLAG!-FLAG <NOT ,MAGIC-FLAG!-FLAG>>
  931. <TELL
  932. "The cyclops, perhaps affected by a drug in your drink, is sleeping
  933. blissfully at the foot of the stairs.">)
  934. (,MAGIC-FLAG!-FLAG
  935. <TELL
  936. "On the north of the room is a wall which used to be solid, but which
  937. now has a cyclops-sized hole in it.">)
  938. (<0? .VARS>
  939. <TELL
  940. "A cyclops, who looks prepared to eat horses (much less mere
  941. adventurers), blocks the staircase. From his state of health, and
  942. the bloodstains on the walls, you gather that he is not very
  943. friendly, though he likes people." 1>)
  944. (<G? .VARS 0>
  945. <TELL
  946. "The cyclops is standing in the corner, eyeing you closely. I don't
  947. think he likes you very much. He looks extremely hungry even for a
  948. cyclops.">)
  949. (<L? .VARS 0>
  950. <TELL
  951. "The cyclops, having eaten the hot peppers, appears to be gasping.
  952. His enflamed tongue protrudes from his man-sized mouth.">)>
  953. <COND (,CYCLOPS-FLAG!-FLAG)
  954. (<OR <0? .VARS> <TELL <NTH ,CYCLOMAD <ABS .VARS>>>>)>)>>
  955. <PSETG CYCLOMAD
  956. '["The cyclops seems somewhat agitated."
  957. "The cyclops appears to be getting more agitated."
  958. "The cyclops is moving about the room, looking for something."
  959. "The cyclops was looking for salt and pepper. I think he is gathering
  960. condiments for his upcoming snack."
  961. "The cyclops is moving toward you in an unfriendly manner."
  962. "You have two choices: 1. Leave 2. Become dinner."]>
  963. <GDECL (CYCLOMAD) <VECTOR [REST STRING]>>
  964. <DEFINE AOS-SOS (FOO)
  965. #DECL ((FOO) FIX)
  966. <COND (<L? .FOO 0> <SET FOO <- .FOO 1>>)
  967. (<SET FOO <+ .FOO 1>>)>
  968. <COND (,CYCLOPS-FLAG!-FLAG)
  969. (<TELL <NTH ,CYCLOMAD <ABS .FOO>>>)>
  970. .FOO>
  971. <SETG ECHO-FLAG!-FLAG <>>
  972. <DEFINE ECHO-ROOM ("AUX" (READER-STRING ,READER-STRING)
  973. (B ,INBUF) L (RM <FIND-ROOM "ECHO">) (OUTCHAN ,OUTCHAN)
  974. VERB (WALK ,WALK!-WORDS))
  975. #DECL ((OUTCHAN) CHANNEL (WALK VERB) VERB
  976. (READER-STRING) STRING (PRSACT) VERB (B) STRING (L) FIX (RM) ROOM)
  977. <COND (,ECHO-FLAG!-FLAG)
  978. (<UNWIND
  979. <PROG ()
  980. <MAPF <>
  981. <FUNCTION (OBJ) #DECL ((OBJ) OBJECT)
  982. <COND (<OVIS? .OBJ>
  983. <TRO .OBJ ,ECHO-ROOM-BIT>
  984. <TRZ .OBJ ,OVISON>)>>
  985. <ROBJS .RM>>
  986. <REPEAT ((PRSVEC ,PRSVEC) RANDOM-ACTION)
  987. #DECL ((PRSVEC) VECTOR)
  988. <SET L
  989. <READSTRING .B
  990. ,INCHAN
  991. .READER-STRING>>
  992. <READCHR ,INCHAN>
  993. <OR ,ALT-FLAG <READCHR ,INCHAN>>
  994. <SETG MOVES <+ ,MOVES 1>>
  995. <COND (<AND <EPARSE <LEX .B <REST .B .L> T> T>
  996. <==? <SET VERB <1 .PRSVEC>> .WALK>
  997. <2 .PRSVEC>
  998. <MEMQ <CHTYPE <2 .PRSVEC> ATOM>
  999. <REXITS .RM>>>
  1000. <SET RANDOM-ACTION <VFCN .VERB>>
  1001. <APPLY-RANDOM .RANDOM-ACTION>
  1002. <COND (<N==? ,HERE .RM>
  1003. <MAPF <>
  1004. <FUNCTION (X) #DECL ((X) OBJECT)
  1005. <COND (<TRNN .X ,ECHO-ROOM-BIT>
  1006. <TRZ .X ,ECHO-ROOM-BIT>
  1007. <TRO .X ,OVISON>)>>
  1008. <ROBJS .RM>>)>
  1009. <RETURN T>)
  1010. (<PRINTSTRING .B .OUTCHAN .L>
  1011. <SETG TELL-FLAG T>
  1012. <CRLF>
  1013. <COND (<==? <MEMBER "ECHO" <UPPERCASE .B>> .B>
  1014. <TELL "The acoustics of the room change subtly."
  1015. 1>
  1016. <SETG ECHO-FLAG!-FLAG T>
  1017. <MAPF <>
  1018. <FUNCTION (X) #DECL ((X) OBJECT)
  1019. <COND (<TRNN .X ,ECHO-ROOM-BIT>
  1020. <TRZ .X ,ECHO-ROOM-BIT>
  1021. <TRO .X ,OVISON>)>>
  1022. <ROBJS .RM>>
  1023. <RETURN T>)>)>>>
  1024. <PROG ()
  1025. <GOTO <FIND-ROOM "CHAS3">>
  1026. <SETG MOVES <+ ,MOVES 1>>
  1027. <MAPF <>
  1028. <FUNCTION (X) #DECL ((X) OBJECT)
  1029. <COND (<TRNN .X ,ECHO-ROOM-BIT>
  1030. <TRZ .X ,ECHO-ROOM-BIT>
  1031. <TRO .X ,OVISON>)>>
  1032. <ROBJS .RM>>>>)>>
  1033. <DEFINE LEAPER ("AUX" (RM ,HERE) (EXITS <REXITS .RM>) M)
  1034. #DECL ((RM) ROOM (EXITS) EXIT (M) <OR <PRIMTYPE VECTOR> FALSE>)
  1035. <COND (<SET M <MEMQ DOWN!-WORDS .EXITS>>
  1036. <COND (<OR <TYPE? <2 .M> NEXIT>
  1037. <AND <TYPE? <2 .M> CEXIT>
  1038. <NOT <CXFLAG <2 .M>>>>>
  1039. <JIGS-UP <PICK-ONE ,JUMPLOSS>>)>)
  1040. (<TELL <PICK-ONE ,WHEEEEE>>)>>
  1041. <DEFINE SKIPPER ()
  1042. <TELL <PICK-ONE ,WHEEEEE>>>
  1043. <SETG HS 0>
  1044. <GDECL (HS) FIX>
  1045. <DEFINE HELLO ("AUX" (PRSOBJ <2 ,PRSVEC>) (AMT <SETG HS <+ ,HS 1>>))
  1046. #DECL ((PRSOBJ) <OR OBJECT FALSE> (AMT) FIX)
  1047. <COND (.PRSOBJ
  1048. <COND (<==? .PRSOBJ <FIND-OBJ "SAILO">>
  1049. <COND (<0? <MOD .AMT 20>>
  1050. <TELL
  1051. "You seem to be repeating yourself.">)
  1052. (<0? <MOD .AMT 10>>
  1053. <TELL
  1054. "I think that phrase is getting a bit worn out.">)
  1055. (<TELL
  1056. "Nothing happens here.">)>)
  1057. (<==? .PRSOBJ <FIND-OBJ "AVIAT">>
  1058. <TELL "Here, nothing happens.">)
  1059. (<TELL
  1060. "I think that only schizophrenics say 'Hello' to a " 1 <ODESC2 .PRSOBJ> ".">)>)
  1061. (<TELL <PICK-ONE ,HELLOS>>)>>
  1062. <PSETG HELLOS
  1063. '["Hello."
  1064. "Good day."
  1065. "Nice weather we've been having lately"
  1066. "How are you?"
  1067. "Goodbye."]>
  1068. <PSETG WHEEEEE
  1069. '["Very good. Now you can go to the second grade."
  1070. "Have you tried hopping around the dungeon, too?"
  1071. "Are you enjoying yourself?"
  1072. "Wheeeeeeeeee!!!!!"
  1073. "Do you expect me to applaud?"]>
  1074. <PSETG JUMPLOSS
  1075. '["You should have looked before you leaped."
  1076. "I'm afraid that leap was a bit much for your weak frame."
  1077. "In the movies, your life would be passing in front of your eyes."
  1078. "Geronimo....."]>
  1079. <GDECL (HELLOS WHEEEEE JUMPLOSS) <VECTOR [REST STRING]>>
  1080. <DEFINE READER ("AUX" (PV ,PRSVEC) (PO <2 .PV>) (PI <3 .PV>))
  1081. #DECL ((PV) VECTOR (PO) OBJECT (PI) <OR FALSE OBJECT>)
  1082. <COND (<NOT <LIT? ,HERE>>
  1083. <TELL "It is impossible to read in the dark.">)
  1084. (<AND .PI <NOT <TRANSPARENT? .PI>>>
  1085. <TELL "How does one look through a " 1 <ODESC2 .PI> "?">)
  1086. (<NOT <READABLE? .PO>>
  1087. <TELL "How can I read a " 1 <ODESC2 .PO> "?">)
  1088. (<OBJECT-ACTION>)
  1089. (<TELL <OREAD .PO>>)>>
  1090. <DEFINE WELL ()
  1091. <COND (,RIDDLE-FLAG!-FLAG <TELL "Well what?">)
  1092. (<==? ,HERE <FIND-ROOM "RIDDL">>
  1093. <SETG RIDDLE-FLAG!-FLAG T>
  1094. <TELL
  1095. "There is a clap of thunder and the east door opens.">)
  1096. (<TELL "Well what?">)>>
  1097. <DEFINE SINBAD ()
  1098. <COND (<AND <==? ,HERE <FIND-ROOM "CYCLO">>
  1099. <MEMQ <FIND-OBJ "CYCLO"> <ROBJS ,HERE>>>
  1100. <SETG CYCLOPS-FLAG!-FLAG T>
  1101. <TELL
  1102. "The cyclops, hearing the name of his deadly nemesis, flees the room
  1103. by knocking down the wall on the north of the room.">
  1104. <SETG MAGIC-FLAG!-FLAG T>
  1105. <REMOVE-OBJECT <FIND-OBJ "CYCLO">>)
  1106. (<TELL
  1107. "Wasn't he a sailor?">)>>
  1108. <DEFINE GRANITE ()
  1109. <TELL "I think you are taking this thing for granite.">>
  1110. <PSETG DUMMY
  1111. '["Look around."
  1112. "You think it isn't?"
  1113. "I think you've already done that."]>
  1114. <GDECL (DUMMY) <VECTOR [REST STRING]>>
  1115. <DEFINE BRUSH ("AUX" (PRSO <2 ,PRSVEC>) (PRSI <3 ,PRSVEC>))
  1116. #DECL ((PRSO) OBJECT (PRSI) <OR OBJECT FALSE>)
  1117. <COND (<==? .PRSO <FIND-OBJ "TEETH">>
  1118. <COND (<AND <==? .PRSI <FIND-OBJ "PUTTY">>
  1119. <MEMQ .PRSI <AOBJS ,WINNER>>>
  1120. <JIGS-UP
  1121. "Well, you seem to have been brushing your teeth with some sort of
  1122. glue. As a result, your mouth gets glued together (with your nose)
  1123. and you die of respiratory failure.">)
  1124. (<NOT .PRSI>
  1125. <TELL
  1126. "Dental hygiene is highly recommended, but I'm not sure what you want
  1127. to brush them with.">)
  1128. (<TELL
  1129. "A nice idea, but with a " 1 <ODESC2 .PRSI> "?">)>)
  1130. (<TELL
  1131. "If you wish, but I can't understand why??">)>>
  1132. <DEFINE RING ("AUX" (PRSOBJ <2 ,PRSVEC>))
  1133. #DECL ((PRSOBJ) <OR OBJECT FALSE>)
  1134. <COND (<==? .PRSOBJ <FIND-OBJ "BELL">>
  1135. <TELL
  1136. "Ding, dong.">)
  1137. (<TELL
  1138. "How, exactly, can I ring that?">)>>
  1139. <DEFINE EAT ("AUX" (PRSVEC ,PRSVEC) (EAT? <>) (DRINK? <>) (PRSOBJ <2 .PRSVEC>)
  1140. NOBJ (AOBJS <AOBJS ,WINNER>))
  1141. #DECL ((PRSOBJ) OBJECT (NOBJ) <OR OBJECT FALSE> (PRSVEC) <VECTOR [3 ANY]>
  1142. (AOBJS) <LIST [REST OBJECT]> (EAT? DRINK?) <OR ATOM FALSE>)
  1143. <COND (<OBJECT-ACTION>)
  1144. (<AND <SET EAT? <EDIBLE? .PRSOBJ>> <MEMQ .PRSOBJ .AOBJS>>
  1145. <COND (<==? <1 .PRSVEC> ,DRINK!-WORDS>
  1146. <TELL "How can I drink that?">)
  1147. (<TELL
  1148. "Thank you very much. It really hit the spot.">
  1149. <PUT ,WINNER ,AOBJS <SPLICE-OUT .PRSOBJ .AOBJS>>)>)
  1150. (<AND <SET DRINK? <DRINKABLE? .PRSOBJ>>
  1151. <SET NOBJ <OCAN .PRSOBJ>>
  1152. <MEMQ .NOBJ .AOBJS>>
  1153. <COND (<OOPEN? .NOBJ>
  1154. <TELL
  1155. "Thank you very much. I was rather thirsty (from all this talking,
  1156. probably).">)
  1157. (T
  1158. <TELL
  1159. "I'd like to, but I can't get to it.">)>
  1160. <PUT .PRSOBJ ,OCAN <>>
  1161. <PUT .NOBJ ,OCONTENTS <SPLICE-OUT .PRSOBJ <OCONTENTS .NOBJ>>>)
  1162. (<NOT <OR .EAT? .DRINK?>>
  1163. <TELL
  1164. "I don't think that the " 1 <ODESC2 .PRSOBJ> " would agree with you.">)
  1165. (<TELL
  1166. "I think you should get that first.">)>>
  1167. <DEFINE JARGON ()
  1168. <TELL "Well, FOO, BAR, and BLETCH to you too!">>
  1169. <DEFINE CURSES ()
  1170. <TELL <PICK-ONE ,OFFENDED>>>
  1171. <PSETG OFFENDED
  1172. '["Such language in a high-class establishment like this!"
  1173. "You ought to be ashamed of yourself."
  1174. "Its not so bad. You could have been killed already."
  1175. "Tough shit, asshole."
  1176. "Oh, dear. Such language from a supposed winning adventurer!"]>
  1177. <GDECL (OFFENDED) <VECTOR [REST STRING]>>
  1178. "ROBBER"
  1179. <DEFINE ROBBER ROBBER (HACK
  1180. "AUX" (RM <HROOM .HACK>) ROBJ
  1181. (SEEN? <RSEEN? .RM>) (WIN ,WINNER) (WROOM ,HERE)
  1182. (HOBJ <HOBJ .HACK>) (STILL <FIND-OBJ "STILL">)
  1183. HERE? (HH <HOBJS .HACK>) (TREAS <FIND-ROOM "TREAS">))
  1184. #DECL ((HACK) HACK (RM WROOM) ROOM (ROBJ HH) <LIST [REST OBJECT]>
  1185. (SEEN?) <OR ATOM FALSE> (WIN) ADV (HOBJ) OBJECT (ROBBER) ACTIVATION
  1186. (HERE?) <OR ROOM FALSE> (STILL) OBJECT (TREAS) ROOM)
  1187. <PROG ((ONCE <>) OBJT)
  1188. #DECL ((ONCE) <OR ATOM FALSE> (OBJT) <LIST [REST OBJECT]>)
  1189. <COND (<SET HERE? <OROOM .HOBJ>>
  1190. <SET RM .HERE?>)>
  1191. <SET ROBJ <ROBJS .RM>>
  1192. <SET OBJT .HH>
  1193. <COND
  1194. (<AND <==? .RM .TREAS>
  1195. <N==? .RM .WROOM>>
  1196. <COND (.HERE?
  1197. <COND (<==? <OROOM .STILL> .TREAS>
  1198. <SNARF-OBJECT .HOBJ .STILL>)>
  1199. <REMOVE-OBJECT .HOBJ>
  1200. <SET HERE? <>>)>
  1201. <MAPF <>
  1202. <FUNCTION (X)
  1203. #DECL ((X) OBJECT)
  1204. <COND (<G? <OTVAL .X> 0>
  1205. <PUT .HACK ,HOBJS <SET HH <SPLICE-OUT .X .HH>>>
  1206. <INSERT-OBJECT .X .RM>)>>
  1207. .HH>)
  1208. (<==? .RM .WROOM> ;"Adventurer is in room: CHOMP, CHOMP"
  1209. <COND
  1210. (<==? .RM .TREAS>) ; "Don't move, Gertrude"
  1211. (<NOT <HFLAG .HACK>>
  1212. <COND (<AND <NOT .HERE?> <PROB 30>>
  1213. <COND (<==? <OCAN .STILL> .HOBJ>
  1214. <INSERT-OBJECT .HOBJ .RM>
  1215. <TELL
  1216. "Someone carrying a large bag is casually leaning against one of the
  1217. walls here. He does not speak, but it is clear from his aspect that
  1218. the bag will be taken only over his dead body.">
  1219. <PUT .HACK ,HFLAG T>
  1220. <RETURN T .ROBBER>)>)
  1221. (<AND .HERE?
  1222. <FIGHTING? .HOBJ>
  1223. <COND (<NOT <WINNING? .HOBJ .WIN>>
  1224. <TELL
  1225. "Your opponent, determining discretion to be the better part of
  1226. valor, decides to terminate this little contretemps. With a rueful
  1227. nod of his head, he steps backward into the gloom and disappears.">
  1228. <REMOVE-OBJECT .HOBJ>
  1229. <TRZ .HOBJ ,FIGHTING>
  1230. <SNARF-OBJECT .HOBJ .STILL>
  1231. <RETURN T .ROBBER>)
  1232. (<PROB 90>)>>)
  1233. (<AND .HERE? <PROB 30>>
  1234. <TELL
  1235. "The holder of the large bag just left, looking disgusted.
  1236. Fortunately, he took nothing.">
  1237. <REMOVE-OBJECT .HOBJ>
  1238. <SNARF-OBJECT .HOBJ .STILL>
  1239. <RETURN T .ROBBER>)
  1240. (<PROB 70> <RETURN T .ROBBER>)
  1241. (T
  1242. <COND (<MEMQ .STILL <HOBJS .HACK>>
  1243. <PUT .HACK ,HOBJS <SPLICE-OUT .STILL <HOBJS .HACK>>>
  1244. <PUT .HOBJ ,OCONTENTS (.STILL)>
  1245. <PUT .STILL ,OCAN .HOBJ>)>
  1246. <PUT .HACK ,HOBJS <SET HH <ROB-ROOM .RM .HH 100>>>
  1247. <PUT .HACK ,HOBJS <SET HH <ROB-ADV .WIN .HH>>>
  1248. <PUT .HACK ,HFLAG T>
  1249. <COND (<AND <N==? .OBJT .HH> <NOT .HERE?>>
  1250. <TELL
  1251. "A seedy-looking individual with a large bag just wandered through
  1252. the room. On the way through, he quietly abstracted all valuables
  1253. from the room and from your possession, mumbling something about
  1254. \"Doing unto others before..\"">)
  1255. (.HERE?
  1256. <SNARF-OBJECT .HOBJ .STILL>
  1257. <COND (<N==? .OBJT .HH>
  1258. <TELL
  1259. "The other occupant just left, still carrying his large bag. You may
  1260. not have noticed that he robbed you blind first.">)
  1261. (<TELL
  1262. "The other occupant (he of the large bag), finding nothing of value,
  1263. left disgusted.">)>
  1264. <REMOVE-OBJECT .HOBJ>
  1265. <SET HERE? <>>)
  1266. (T
  1267. <TELL
  1268. "A 'lean and hungry' gentleman just wandered through. Finding
  1269. nothing of value, he left disgruntled.">)>)>)
  1270. (T
  1271. <COND (.HERE? ;"Here, already announced."
  1272. <COND (<PROB 30>
  1273. <PUT .HACK ,HOBJS <SET HH <ROB-ROOM .RM .HH 100>>>
  1274. <PUT .HACK ,HOBJS <SET HH <ROB-ADV .WIN .HH>>>
  1275. <COND (<MEMQ <FIND-OBJ "ROPE"> .HH>
  1276. <SETG DOME-FLAG!-FLAG <>>)>
  1277. <COND (<==? .OBJT .HH>
  1278. <TELL
  1279. "The other occupant (he of the large bag), finding nothing of value,
  1280. left disgusted.">)
  1281. (T
  1282. <TELL
  1283. "The other occupant just left, still carrying his large bag. You may
  1284. not have noticed that he robbed you blind first.">)>
  1285. <REMOVE-OBJECT .HOBJ>
  1286. <SET HERE? <>>
  1287. <SNARF-OBJECT .HOBJ .STILL>)
  1288. (<RETURN T .ROBBER>)>)>)>)
  1289. (<AND <MEMQ .HOBJ <ROBJS .RM>> ;"Leave if victim left"
  1290. <SNARF-OBJECT .HOBJ .STILL>
  1291. <REMOVE-OBJECT .HOBJ>
  1292. <SET HERE? <>>>)
  1293. (<AND <==? <OROOM .STILL> .RM>
  1294. <SNARF-OBJECT .HOBJ .STILL>
  1295. <>>)
  1296. (.SEEN? ;"Hack the adventurer's belongings"
  1297. <PUT .HACK ,HOBJS <SET HH <ROB-ROOM .RM .HH 75>>>
  1298. <COND
  1299. (<AND <==? <RDESC2 .RM> ,MAZEDESC> <==? <RDESC2 .WROOM> ,MAZEDESC>>
  1300. <MAPF <>
  1301. <FUNCTION (X)
  1302. #DECL ((X) OBJECT)
  1303. <COND (<AND <CAN-TAKE? .X> <OVIS? .X> <PROB 40>>
  1304. <TELL
  1305. "You hear, off in the distance, someone saying \"My, I wonder what
  1306. this fine " 3 <ODESC2 .X> " is doing here.\"">
  1307. <TELL "" 1>
  1308. <COND (<PROB 60>
  1309. <REMOVE-OBJECT .X>
  1310. <PUT .X ,OTOUCH? T>
  1311. <PUT .HACK ,HOBJS <SET HH (.X !.HH)>>)>
  1312. <MAPLEAVE>)>>
  1313. <ROBJS .RM>>)
  1314. (<MAPF <>
  1315. <FUNCTION (X)
  1316. #DECL ((X) OBJECT)
  1317. <COND (<AND <0? <OTVAL .X>> <CAN-TAKE? .X> <OVIS? .X> <PROB 20>>
  1318. <REMOVE-OBJECT .X>
  1319. <PUT .X ,OTOUCH? T>
  1320. <PUT .HACK ,HOBJS <SET HH (.X !.HH)>>
  1321. <COND (<==? .RM .WROOM>
  1322. <TELL "You suddenly notice that the "
  1323. 1
  1324. <ODESC2 .X>
  1325. " vanished.">)>
  1326. <MAPLEAVE>)>>
  1327. <ROBJS .RM>>
  1328. <COND (<MEMQ <FIND-OBJ "ROPE"> .HH>
  1329. <SETG DOME-FLAG!-FLAG <>>)>)>)>
  1330. <COND (<SET ONCE <NOT .ONCE>> ;"Move to next room, and hack."
  1331. <PROG ((ROOMS <HROOMS .HACK>))
  1332. <SET RM <1 .ROOMS>>
  1333. <COND (<EMPTY? <SET ROOMS <REST .ROOMS>>>
  1334. <SET ROOMS ,ROOMS>)>
  1335. <COND (<RTRNN .RM ,RSACREDBIT> ;"Can I work here?"
  1336. <AGAIN>)>
  1337. <PUT .HACK ,HROOM .RM>
  1338. <PUT .HACK ,HFLAG <>>
  1339. <PUT .HACK ,HROOMS .ROOMS>
  1340. <SET SEEN? <RSEEN? .RM>>>
  1341. <AGAIN>)>> ;"Drop worthless cruft, sometimes"
  1342. <OR <==? .RM .TREAS>
  1343. <MAPF <>
  1344. <FUNCTION (X)
  1345. #DECL ((X) OBJECT)
  1346. <COND (<AND <0? <OTVAL .X>> <PROB 30>>
  1347. <PUT .HACK ,HOBJS <SET HH <SPLICE-OUT .X .HH>>>
  1348. <INSERT-OBJECT .X .RM>
  1349. <AND <==? .RM .WROOM>
  1350. <TELL
  1351. "The robber, rummaging through his bag, dropped a few items he found
  1352. valueless." >>)>>
  1353. .HH>>>
  1354. <DEFINE SNARF-OBJECT (WHO WHAT)
  1355. #DECL ((WHO WHAT) OBJECT)
  1356. <COND (<AND <N==? <OCAN .WHAT> .WHO>
  1357. <OR <OROOM .WHAT>
  1358. <OCAN .WHAT>>>
  1359. <REMOVE-OBJECT .WHAT>
  1360. <PUT .WHAT ,OCAN .WHO>
  1361. <PUT .WHO ,OCONTENTS (.WHAT !<OCONTENTS .WHO>)>)
  1362. (.WHO)>>
  1363. <DEFINE ROBBER-FUNCTION ("AUX" (PRSACT <1 ,PRSVEC>)
  1364. (DEM <GET-DEMON "THIEF">) (PV ,PRSVEC)
  1365. (PRSOBJ <2 .PV>) (HERE ,HERE) (FLG <>)
  1366. BRICK FUSE ST F (T <HOBJ .DEM>) (CHALI <FIND-OBJ "CHALI">))
  1367. #DECL ((PV) VECTOR (DEM) HACK (PRSACT) VERB (PRSOBJ) <OR OBJECT FALSE>
  1368. (CHALI T HOBJ ST BRICK FUSE) OBJECT (F) <VECTOR ANY CEVENT> (HERE) ROOM
  1369. (FLG) <OR ATOM FALSE>)
  1370. <COND (<==? .PRSACT ,FIGHT!-WORDS>
  1371. <COND (<==? <OCAN <SET ST <FIND-OBJ "STILL">>> .T> <>)
  1372. (<==? <OROOM .ST> .HERE>
  1373. <SNARF-OBJECT .T .ST>
  1374. <TELL
  1375. "The robber, somewhat surprised at this turn of events, nimbly
  1376. retrieves his stilletto.">
  1377. T)
  1378. (ELSE
  1379. <TELL
  1380. "Annoyed to be left unarmed in such an obviously dangerous
  1381. neighborhood, the thief slips off into the shadows.">
  1382. <TRO .CHALI ,TAKEBIT>
  1383. <REMOVE-OBJECT .T>)>)
  1384. (<==? .PRSACT ,DEAD\!!-WORDS>
  1385. <COND (<NOT <EMPTY? <HOBJS .DEM>>>
  1386. <TELL " His booty remains.">
  1387. <MAPF <> <FUNCTION (X) #DECL ((X) OBJECT)
  1388. <INSERT-OBJECT .X .HERE>
  1389. <TRO .X ,ECHO-ROOM-BIT>>
  1390. <HOBJS .DEM>>
  1391. <PUT .DEM ,HOBJS ()>)>
  1392. <TRO .CHALI ,TAKEBIT>
  1393. <COND (<==? .HERE <FIND-ROOM "TREAS">>
  1394. <MAPF <>
  1395. <FUNCTION (X) #DECL ((X) OBJECT)
  1396. <COND (<AND <N==? .X .CHALI>
  1397. <N==? .X .T>>
  1398. <COND (<TRNN .X ,ECHO-ROOM-BIT>
  1399. <TRZ .X ,ECHO-ROOM-BIT>)
  1400. (<TRO .X ,OVISON>
  1401. <COND (<NOT .FLG>
  1402. <SET FLG T>
  1403. <TELL
  1404. "As the thief dies, the power of his magic decreases, and his
  1405. treasures reappear:" 2>)>
  1406. <TELL " A " 2 <ODESC2 .X>>)>)>>
  1407. <ROBJS .HERE>>)>
  1408. <PUT .DEM ,HACTION <>>)
  1409. (<==? .PRSACT ,FIRST?!-WORDS> <PROB 20>)
  1410. (<==? .PRSACT ,OUT\!!-WORDS>
  1411. <PUT .DEM ,HACTION <>>
  1412. <TRZ <FIND-OBJ "STILL"> ,OVISON>
  1413. <TRO .CHALI ,TAKEBIT>
  1414. <PUT .T ,ODESC1 ,ROBBER-U-DESC>)
  1415. (<==? .PRSACT ,IN\!!-WORDS>
  1416. <COND (<==? <HROOM .DEM> .HERE>
  1417. <TELL
  1418. "The robber revives, briefly feigning continued unconsciousness, and
  1419. when he sees his moment, scrambles away from you.">)>
  1420. <COND (<TYPE? ,ROBBER OFFSET> <PUT .DEM ,HACTION ROBBER>)
  1421. (<PUT .DEM ,HACTION ROBBER>)>
  1422. <PUT .T ,ODESC1 ,ROBBER-C-DESC>
  1423. <COND (<AND <==? .HERE <FIND-ROOM "TREAS">>
  1424. <OROOM <SET CHALI .CHALI>>>
  1425. <TRZ .CHALI ,TAKEBIT>)>
  1426. <TRO <FIND-OBJ "STILL"> ,OVISON>)
  1427. (<AND <TYPE? .PRSOBJ OBJECT>
  1428. <==? <2 .PV> ,KNIFE!-OBJECTS>
  1429. <==? <VNAME .PRSACT> THROW!-WORDS>
  1430. <NOT <TRNN .T ,FIGHTBIT>>>
  1431. <COND (<PROB 10>
  1432. <TELL
  1433. "You evidently frightened the robber, though you didn't hit him. He
  1434. flees" 1
  1435. <COND (<EMPTY? <HOBJS .DEM>>
  1436. ".")
  1437. (T
  1438. <MAPF <> <FUNCTION (X) #DECL ((X) OBJECT)
  1439. <INSERT-OBJECT .X .HERE>> <HOBJS .DEM>>
  1440. <PUT .DEM ,HOBJS ()>
  1441. ", but the contents of his bag fall on the floor.")>>
  1442. <REMOVE-OBJECT .T>)
  1443. (T
  1444. <TELL
  1445. "You missed. The thief makes no attempt to take the knife, though it
  1446. would be a fine addition to the collection in his bag. He does seem
  1447. angered by your attempt.">
  1448. <TRO .T ,FIGHTBIT>)>)
  1449. (<AND <OR <==? .PRSACT ,THROW!-WORDS>
  1450. <==? .PRSACT ,GIVE!-WORDS>>
  1451. <TYPE? .PRSOBJ OBJECT>
  1452. <N==? .PRSOBJ <HOBJ .DEM>>>
  1453. <COND (<L? <OCAPAC .T> 0>
  1454. <PUT .T ,OCAPAC <- <OCAPAC .T>>>
  1455. <PUT .DEM ,HACTION <COND (<TYPE? ,ROBBER OFFSET> ,ROBBER)
  1456. (ROBBER)>>
  1457. <TRO <FIND-OBJ "STILL"> ,OVISON>
  1458. <PUT .T ,ODESC1 ,ROBBER-C-DESC>
  1459. <TELL
  1460. "Your proposed victim suddenly recovers consciousness.">)>
  1461. <COND (<AND <==? .PRSOBJ <SET BRICK <FIND-OBJ "BRICK">>>
  1462. <==? <OCAN <SET FUSE <FIND-OBJ "FUSE">>> .BRICK>
  1463. <ORAND .FUSE>
  1464. <NOT <0? <CTICK <2 <SET F <ORAND .FUSE>>>>>>>
  1465. ; "I.e., he's trying to give us the brick with a lighted fuse."
  1466. <TELL
  1467. "The thief seems rather offended by your offer. Do you think he's as
  1468. stupid as you are?">)
  1469. (<REMOVE-OBJECT .PRSOBJ>
  1470. <PUT .DEM ,HOBJS (.PRSOBJ !<HOBJS .DEM>)>
  1471. <TELL
  1472. "The thief places the " 1 <ODESC2 .PRSOBJ> " in his bag and thanks
  1473. you politely.">)>)
  1474. (<AND .PRSACT <==? <VNAME .PRSACT> TAKE!-WORDS>>
  1475. <TELL
  1476. "Once you got him, what would you do with him?">)>>
  1477. <DEFINE CHALICE ("AUX" (PRSA <1 ,PRSVEC>) (CH <2 ,PRSVEC>) TR T)
  1478. #DECL ((PRSA) VERB (CH) OBJECT (TR) ROOM (T) OBJECT)
  1479. <COND (<==? .PRSA ,TAKE!-WORDS>
  1480. <COND (<AND <NOT <OCAN .CH>>
  1481. <==? <OROOM .CH> <SET TR <FIND-ROOM "TREAS">>>
  1482. <==? <OROOM <SET T <FIND-OBJ "THIEF">>> .TR>
  1483. <FIGHTING? .T>
  1484. <HACTION ,ROBBER-DEMON>>
  1485. <TELL
  1486. "Realizing just in time that you'd be stabbed in the back if you
  1487. attempted to take the chalice, you return to the fray.">)>)>>
  1488. <DEFINE BURNER ("AUX" (PV ,PRSVEC) (PRSO <2 .PV>) (PRSI <3 .PV>))
  1489. #DECL ((PV) VECTOR (PRSO PRSI) OBJECT)
  1490. <COND (<FLAMING? .PRSI>
  1491. <COND (<OBJECT-ACTION>)
  1492. (<AND <==? <AVEHICLE ,WINNER> <FIND-OBJ "BALLO">>
  1493. <BALLOON>>)
  1494. (<AND <BURNABLE? .PRSO>
  1495. <COND (<MEMQ .PRSO <AOBJS ,WINNER>>
  1496. <TELL
  1497. "The " 1 <ODESC2 .PRSO> " catches fire.">
  1498. <JIGS-UP
  1499. "Unfortunately, you were holding it at the time.">)
  1500. (<HACKABLE? .PRSO ,HERE>
  1501. <TELL
  1502. "The " 1 <ODESC2 .PRSO> " catches fire and is consumed.">
  1503. <REMOVE-OBJECT .PRSO>)
  1504. (<TELL "You don't have that.">)>>)
  1505. (<TELL
  1506. "I don't think you can burn a " 1 <ODESC2 .PRSO> ".">)>)
  1507. (<TELL
  1508. "With a " 1 <ODESC2 .PRSI> "??!?">)>>
  1509. <DEFINE TURNER ("AUX" (PV ,PRSVEC) (PRSO <2 .PV>) (PRSI <3 .PV>))
  1510. #DECL ((PV) VECTOR (PRSO PRSI) OBJECT)
  1511. <COND (<TRNN .PRSO ,TURNBIT>
  1512. <COND (<TRNN .PRSI ,TOOLBIT>
  1513. <OBJECT-ACTION>)
  1514. (<TELL
  1515. "You certainly can't turn it with a " 1 <ODESC2 .PRSI> ".">)>)
  1516. (<TELL
  1517. "You can't turn that!">)>>
  1518. <PSETG DOORMUNGS
  1519. '["The door is invulnerable."
  1520. "You cannot damage this door."
  1521. "The door is still under warranty."]>
  1522. <GDECL (DOORMUNGS) <VECTOR [REST STRING]>>
  1523. <DEFINE DDOOR-FUNCTION ("AUX" (PA <1 ,PRSVEC>))
  1524. #DECL ((PA) VERB)
  1525. <COND (<==? .PA ,OPEN!-WORDS>
  1526. <TELL
  1527. "The door cannot be opened.">)
  1528. (<==? .PA ,BURN!-WORDS>
  1529. <TELL
  1530. "You cannot burn this door.">)
  1531. (<==? .PA ,MUNG!-WORDS>
  1532. <TELL <PICK-ONE ,DOORMUNGS>>)>>
  1533. <DEFINE INFLATER ("AUX" (PRSI <2 ,PRSVEC>) (PRSO <3 ,PRSVEC>))
  1534. #DECL ((PRSI PRSO) OBJECT)
  1535. <COND (<==? .PRSI <FIND-OBJ "IBOAT">>
  1536. <COND (<==? .PRSO <FIND-OBJ "PUMP">>
  1537. <OBJECT-ACTION>)
  1538. (<TELL "You would inflate it with that?">)>)
  1539. (<==? .PRSI <FIND-OBJ "RBOAT">>
  1540. <TELL "Inflating it further would probably burst it.">)
  1541. (<TELL "How can you inflate that?">)>>
  1542. <DEFINE DEFLATER ("AUX" (PRSO <2 ,PRSVEC>))
  1543. #DECL ((PRSO) OBJECT)
  1544. <COND (<==? .PRSO <FIND-OBJ "RBOAT">>
  1545. <OBJECT-ACTION>)
  1546. (<TELL "Come on, now!">)>>
  1547. <DEFINE LOCKER ("AUX" (PRSO <2 ,PRSVEC>))
  1548. #DECL ((PRSO) OBJECT)
  1549. <COND (<==? .PRSO <FIND-OBJ "GRAT2">>
  1550. <SETG GRUNLOCK!-FLAG <>>
  1551. <TELL "The grate is locked.">
  1552. <MAPF <>
  1553. <FUNCTION (X)
  1554. #DECL ((X) <OR CEXIT NEXIT ROOM>)
  1555. <COND (<AND <TYPE? .X CEXIT>
  1556. <==? <CXFLAG .X> KEY-FLAG!-FLAG>>
  1557. <PUT .X ,CXSTR "The grate is locked.">
  1558. <MAPLEAVE>)>>
  1559. <REXITS ,HERE>>)
  1560. (<TELL "It doesn't seem to work.">)>>
  1561. <DEFINE UNLOCKER ("AUX" (PRSO <2 ,PRSVEC>) (PRSI <3 ,PRSVEC>) (R <FIND-ROOM "MGRAT">))
  1562. #DECL ((PRSO PRSI) OBJECT (R) ROOM)
  1563. <COND (<==? .PRSO <FIND-OBJ "GRAT2">>
  1564. <COND (<==? .PRSI <FIND-OBJ "KEYS">>
  1565. <SETG GRUNLOCK!-FLAG T>
  1566. <TELL "The grate is unlocked.">
  1567. <MAPF <>
  1568. <FUNCTION (X)
  1569. #DECL ((X) <OR CEXIT NEXIT ROOM>)
  1570. <COND (<AND <TYPE? .X CEXIT>
  1571. <==? <CXFLAG .X> KEY-FLAG!-FLAG>>
  1572. <PUT .X ,CXSTR "The grate is closed.">
  1573. <MAPLEAVE>)>>
  1574. <REXITS .R>>)
  1575. (<TELL "Can you unlock a grating with a " 1 <ODESC2 .PRSI> "?">)>)
  1576. (<TELL "It doesn't seem to work.">)>>
  1577. <DEFINE KILLER ("AUX" (PV ,PRSVEC) (PRSO <2 .PV>) (PRSI <3 .PV>))
  1578. #DECL ((PV) VECTOR (PRSO PRSI) <OR FALSE OBJECT>)
  1579. <COND (<NOT .PRSO>
  1580. <TELL "There is nothing here to kill.">)
  1581. (<NOT .PRSI>
  1582. <TELL "Trying to kill a " 1 <ODESC2 .PRSO>
  1583. " with your bare hands is suicidal.">)
  1584. (<NOT <TRNN .PRSI ,WEAPONBIT>>
  1585. <TELL "Trying to kill a " 0 <ODESC2 .PRSO>
  1586. " with a ">
  1587. <TELL <ODESC2 .PRSI> 1 " is suicidal.">)
  1588. (ELSE
  1589. <BLOW ,PLAYER .PRSO <ORAND .PRSI> T <>>)>>
  1590. <DEFINE ATTACKER ("AUX" (PV ,PRSVEC) (PRSO <2 .PV>) (PRSI <3 .PV>))
  1591. #DECL ((PV) VECTOR (PRSO PRSI) <OR FALSE OBJECT>)
  1592. <COND (<NOT .PRSO>
  1593. <TELL "There is nothing here to attack.">)
  1594. (<NOT .PRSI>
  1595. <TELL "Attacking a " 1 <ODESC2 .PRSO>
  1596. " with your bare hands is suicidal.">)
  1597. (<NOT <TRNN .PRSI ,WEAPONBIT>>
  1598. <TELL "Attacking a " 0 <ODESC2 .PRSO>
  1599. " with a ">
  1600. <TELL <ODESC2 .PRSI> 1 " is suicidal.">)
  1601. (ELSE
  1602. <BLOW ,PLAYER .PRSO <ORAND .PRSI> T <>>)>>
  1603. <DEFINE SWINGER ("AUX" (PV ,PRSVEC) (PRSO <2 .PV>) (PRSI <3 .PV>))
  1604. #DECL ((PV) VECTOR (PRSO PRSI) <OR FALSE OBJECT>)
  1605. <PUT .PV 2 .PRSI>
  1606. <PUT .PV 3 .PRSO>
  1607. <ATTACKER>>
  1608. <DEFINE HACK-HACK (OBJ STR "OPTIONAL" (OBJ2 <>))
  1609. #DECL ((OBJ) OBJECT (STR) STRING (OBJ2) <OR FALSE STRING>)
  1610. <COND (<OBJECT-ACTION>)
  1611. (.OBJ2
  1612. <TELL .STR 0 <ODESC2 .OBJ> " with a ">
  1613. <TELL .OBJ2 1 <PICK-ONE ,HO-HUM>>)
  1614. (ELSE
  1615. <TELL .STR 1 <ODESC2 .OBJ> <PICK-ONE ,HO-HUM>>)>>
  1616. <PSETG HO-HUM
  1617. '[" does not seem to do anything."
  1618. " is not notably useful."
  1619. " isn't very interesting."
  1620. " doesn't appear worthwhile."
  1621. " has no effect."
  1622. " doesn't do anything."]>
  1623. <GDECL (HO-HUM) <VECTOR [REST STRING]>>
  1624. <DEFINE MUNGER ("AUX" (PRSO <2 ,PRSVEC>) (PRSW <3 ,PRSVEC>))
  1625. #DECL ((PRSW) <OR OBJECT FALSE> (PRSO) OBJECT)
  1626. <COND (<TRNN .PRSO ,VILLAIN>
  1627. <COND (.PRSW
  1628. <COND (<TRNN .PRSW ,WEAPONBIT>
  1629. <BLOW ,PLAYER .PRSO <ORAND .PRSW> T <>>)
  1630. (T
  1631. <TELL "Munging a " 0 <ODESC2 .PRSO> " with a ">
  1632. <TELL <ODESC2 .PRSW> 1 " is quite self-destructive.">)>)
  1633. (T
  1634. <TELL "Munging a " 1 <ODESC2 .PRSO> " with your bare hands is suicidal.">)>)
  1635. (<HACK-HACK .PRSO "Munging a ">)>>
  1636. <DEFINE KICKER ("AUX" (PRSO <2 ,PRSVEC>))
  1637. #DECL ((PRSO) OBJECT)
  1638. <HACK-HACK .PRSO "Munging a ">>
  1639. <DEFINE WAVER ("AUX" (PRSO <2 ,PRSVEC>))
  1640. #DECL ((PRSO) OBJECT)
  1641. <HACK-HACK .PRSO "Waving a ">>
  1642. <DEFINE R/L ("AUX" (PRSO <2 ,PRSVEC>))
  1643. #DECL ((PRSO) OBJECT)
  1644. <HACK-HACK .PRSO "Playing in this way with a ">>
  1645. <DEFINE RUBBER ("AUX" (PRSO <2 ,PRSVEC>))
  1646. #DECL ((PRSO) OBJECT)
  1647. <HACK-HACK .PRSO "Fiddling with a ">>
  1648. <DEFINE EXORCISE ()
  1649. <COND (<OBJECT-ACTION>) (T)>>
  1650. <DEFINE PLUGGER ()
  1651. <COND (<OBJECT-ACTION>)
  1652. (<TELL "This has no effect.">)>>
  1653. <DEFINE UNTIE ("AUX" (PRSO <2 ,PRSVEC>))
  1654. #DECL ((PRSO) OBJECT)
  1655. <COND (<OBJECT-ACTION>)
  1656. (<TRNN .PRSO ,TIEBIT>
  1657. <TELL "I don't think so.">)
  1658. (<TELL "This cannot be tied, so it cannot be untied!">)>>
  1659. <DEFINE PUSHER ("AUX" (PRSO <2 ,PRSVEC>))
  1660. #DECL ((PRSO) OBJECT)
  1661. <COND (<OBJECT-ACTION>)
  1662. (<MEMQ BUTTO!-OBJECTS <ONAMES .PRSO>>)
  1663. (<HACK-HACK .PRSO "Pushing the ">)>>
  1664. <DEFINE TIE ("AUX" (PRSO <2 ,PRSVEC>))
  1665. #DECL ((PRSO) OBJECT)
  1666. <COND (<TRNN .PRSO ,TIEBIT>
  1667. <COND (<OBJECT-ACTION>)
  1668. (<TELL "You can't tie it to that.">)>)
  1669. (<TELL "How can you tie that to anything.">)>>
  1670. <DEFINE MELTER ("AUX" (PRSO <2 ,PRSVEC>))
  1671. #DECL ((PRSO) OBJECT)
  1672. <COND (<OBJECT-ACTION>)
  1673. (<TELL "I'm not sure that a " 1 <ODESC2 .PRSO> " can be melted.">)>>
  1674. <SETG ON-POLE!-FLAG <>>
  1675. <DEFINE BODY-FUNCTION ("AUX" (PRSA <1 ,PRSVEC>))
  1676. #DECL ((PRSA) VERB)
  1677. <COND (<==? .PRSA ,TAKE!-WORDS>
  1678. <TELL "A force keeps you from taking the bodies.">)
  1679. (<OR <==? .PRSA ,MUNG!-WORDS>
  1680. <==? .PRSA ,BURN!-WORDS>>
  1681. <COND (,ON-POLE!-FLAG)
  1682. (<SETG ON-POLE!-FLAG T>
  1683. <INSERT-OBJECT <FIND-OBJ "HPOLE"> <FIND-ROOM "LLD2">>)>
  1684. <JIGS-UP
  1685. "The voice of the guardian of the dungeon booms out from the darkness
  1686. 'Your disrespect costs you your life!' and places your head on a pole.">)>>
  1687. <DEFINE MUMBLER ()
  1688. <TELL "You'll have to speak up if you expect me to hear you!">>
  1689. <DEFINE ALARM ("AUX" (PRSO <2 ,PRSVEC>))
  1690. #DECL ((PRSO) OBJECT)
  1691. <COND (<TRNN .PRSO ,SLEEPBIT>
  1692. <OBJECT-ACTION>)
  1693. (<TELL "The " 1 <ODESC2 .PRSO> " isn't sleeping.">)>>
  1694. <DEFINE ZORK ()
  1695. <TELL "That word is replaced henceforth with DUNGEON.">>
  1696. <DEFINE DUNGEON ()
  1697. <TELL "At your service!">>
  1698. <DEFINE PAINTING ("AUX" (PRSA <1 ,PRSVEC>) (ART <2 ,PRSVEC>))
  1699. #DECL ((PRSA) VERB (ART) OBJECT)
  1700. <COND (<==? .PRSA ,MUNG!-WORDS>
  1701. <PUT .ART ,OTVAL 0>
  1702. <PUT .ART ,ODESC2 "worthless piece of canvas">
  1703. <PUT .ART ,ODESC1 "There is a worthless piece of canvas here.">
  1704. <TELL
  1705. "Congratulations! Unlike the other vandals, who merely stole the
  1706. artist's masterpieces, you have destroyed one.">)>>
  1707. <PSETG DIMMER "The lamp appears to be getting dimmer.">
  1708. <PSETG LAMP-TICKS [50 30 20 10 4 0]>
  1709. <PSETG LAMP-TELLS [,DIMMER ,DIMMER ,DIMMER ,DIMMER "The lamp is dying."]>
  1710. <DEFINE LANTERN ("AUX" (PV ,PRSVEC) (VERB <1 .PV>) (HERE ,HERE)
  1711. (RLAMP <FIND-OBJ "LAMP">) FOO)
  1712. #DECL ((PV) VECTOR (VERB) VERB (HERE) ROOM (RLAMP) OBJECT
  1713. (FOO) <VECTOR ANY CEVENT>)
  1714. <COND (<==? .VERB ,THROW!-WORDS>
  1715. <TELL
  1716. "The lamp has smashed into the floor and the light has gone out.">
  1717. <REMOVE-OBJECT <FIND-OBJ "LAMP">>
  1718. <INSERT-OBJECT <FIND-OBJ "BLAMP"> .HERE>)
  1719. (<==? .VERB ,C-INT!-WORDS>
  1720. <LIGHT-INT .RLAMP ,LNTIN ,LAMP-TICKS ,LAMP-TELLS>)
  1721. (<==? .VERB ,TURN-ON!-WORDS>
  1722. <CLOCK-ENABLE <2 <SET FOO <ORAND .RLAMP>>>>
  1723. <>)
  1724. (<==? .VERB ,TURN-OFF!-WORDS>
  1725. <CLOCK-DISABLE <2 <SET FOO <ORAND .RLAMP>>>>
  1726. <>)>>
  1727. <DEFINE SWORD-GLOW (DEM
  1728. "AUX" (SW <HOBJ .DEM>) (G <OTVAL .SW>) (HERE ,HERE) (NG 0))
  1729. #DECL ((DEM) HACK (SW) OBJECT (NG G) FIX (HERE) ROOM)
  1730. <COND (<AND <NOT <OROOM .SW>> <NOT <OCAN .SW>>
  1731. <MEMQ .SW <AOBJS ,PLAYER>>>
  1732. <COND (<INFESTED? .HERE> <SET NG 2>)
  1733. (<MAPF <>
  1734. <FUNCTION (E)
  1735. #DECL ((E) <OR ROOM CEXIT NEXIT ATOM>)
  1736. <COND (<TYPE? .E ROOM>
  1737. <AND <INFESTED? .E> <MAPLEAVE T>>)
  1738. (<TYPE? .E CEXIT>
  1739. <AND <INFESTED? <2 .E>> <MAPLEAVE T>>)>>
  1740. <REXITS .HERE>>
  1741. <SET NG 1>)>
  1742. <COND (<==? .NG .G>)
  1743. (<==? .NG 2> <TELL "Your sword has begun to glow very brightly.">)
  1744. (<1? .NG> <TELL "Your sword is glowing with a faint blue glow.">)
  1745. (<0? .NG> <TELL "Your sword is no longer glowing.">)>
  1746. <PUT .SW ,OTVAL .NG>)
  1747. (<PUT .DEM ,HACTION <>>)>>
  1748. <DEFINE SWORD ("AUX" (PA <1 ,PRSVEC>))
  1749. #DECL ((PA) VERB)
  1750. <COND (<AND <==? .PA ,TAKE!-WORDS>
  1751. <==? ,WINNER ,PLAYER>>
  1752. <PUT ,SWORD-DEMON ,HACTION <COND (<TYPE? ,SWORD-GLOW OFFSET>
  1753. ,SWORD-GLOW)
  1754. (SWORD-GLOW)>>
  1755. <>)>>
  1756. <DEFINE INFESTED? (R "AUX" (VILLAINS ,VILLAINS) (DEM <GET-DEMON "THIEF">))
  1757. #DECL ((R) ROOM (VILLAINS) <LIST [REST OBJECT]> (DEM) HACK)
  1758. <OR <AND <==? .R <HROOM .DEM>>
  1759. <HACTION .DEM>>
  1760. <MAPF <>
  1761. <FUNCTION (V)
  1762. #DECL ((V) OBJECT)
  1763. <COND (<==? .R <OROOM .V>> <MAPLEAVE T>)>>
  1764. .VILLAINS>>>
  1765. <PSETG CDIMMER "The candles grow shorter.">
  1766. <PSETG CANDLE-TICKS [20 10 5 0]>
  1767. <PSETG CANDLE-TELLS [,CDIMMER ,CDIMMER "The candles are very short."]>
  1768. <DEFINE MATCH-FUNCTION ("AUX" (PRSA <1 ,PRSVEC>) (PRSO <2 ,PRSVEC>)
  1769. (MATCH <FIND-OBJ "MATCH">) (MC <ORAND .MATCH>))
  1770. #DECL ((PRSA) VERB (MATCH) OBJECT (MC) FIX)
  1771. <COND (<AND <==? .PRSA ,LIGHT!-WORDS> <==? .PRSO .MATCH>>
  1772. <COND (<AND <PUT .MATCH ,ORAND <SET MC <- .MC 1>>>
  1773. <L=? .MC 0>>
  1774. <TELL "I'm afraid that you have run out of matches.">)
  1775. (<TRO .MATCH ,FLAMEBIT>
  1776. <PUT .MATCH ,OLIGHT? 1>
  1777. <CLOCK-INT ,MATIN 2>
  1778. <TELL "One of the matches starts to burn.">)>)
  1779. (<AND <==? .PRSA ,TURN-OFF!-WORDS> <1? <OLIGHT? .MATCH>>>
  1780. <TELL "The match is out.">
  1781. <TRZ .MATCH ,FLAMEBIT>
  1782. <PUT .MATCH ,OLIGHT? 0>
  1783. <CLOCK-INT ,MATIN 0>
  1784. T)
  1785. (<==? .PRSA ,C-INT!-WORDS>
  1786. <TELL "The match has gone out.">
  1787. <TRZ .MATCH ,FLAMEBIT>
  1788. <PUT .MATCH ,OLIGHT? 0>)>>
  1789. <DEFINE CANDLES ("AUX" (PRSACT <1 ,PRSVEC>) (C <FIND-OBJ "CANDL">)
  1790. (WINNER ,WINNER) (AO <AOBJS .WINNER>) (W <3 ,PRSVEC>)
  1791. MATCH FOO ORPHANS)
  1792. #DECL ((PRSACT) VERB (MATCH C) OBJECT (W) <OR FALSE OBJECT> (WINNER) ADV
  1793. (AO) <LIST [REST OBJECT]> (FOO) <VECTOR FIX CEVENT>
  1794. (ORPHANS) <VECTOR [4 ANY]>)
  1795. <OR <ORAND .C> <PUT .C ,ORAND [0 <CLOCK-INT ,CNDIN 50>]>>
  1796. <SET FOO <ORAND .C>>
  1797. <COND (<==? .PRSACT ,LIGHT!-WORDS>
  1798. <COND (<0? <OLIGHT? .C>>
  1799. <TELL
  1800. "Alas, there's not much left of the candles. Certainly not enough to
  1801. burn.">)
  1802. (<NOT .W>
  1803. <TELL "With what?">
  1804. <PUT <SET ORPHANS ,ORPHANS>
  1805. ,OFLAG T>
  1806. <PUT .ORPHANS ,OACTION .PRSACT>
  1807. <PUT .ORPHANS ,OSLOT1 .C>
  1808. <PUT .ORPHANS ,OPREP <CHTYPE WITH!-WORDS PREP>>
  1809. <SETG PARSE-WON <>>
  1810. T)
  1811. (<AND <==? .W <SET MATCH <FIND-OBJ "MATCH">>>
  1812. <1? <OLIGHT? .MATCH>>>
  1813. <COND (<1? <OLIGHT? .C>>
  1814. <TELL "The candles are already lighted.">)
  1815. (<PUT .C ,OLIGHT? 1>
  1816. <TELL "The candles are lighted.">
  1817. <CLOCK-ENABLE <2 .FOO>>)>)
  1818. (<==? .W <FIND-OBJ "TORCH">>
  1819. <COND (<1? <OLIGHT? .C>>
  1820. <TELL
  1821. "You realize, just in time, that the candles are already lighted.">)
  1822. (<TELL
  1823. "The heat from the torch is so intense that the candles are vaporised.">
  1824. <COND (<OR <OROOM .C> <OCAN .C>>
  1825. <REMOVE-OBJECT .C>)
  1826. (<PUT .WINNER ,AOBJS <SPLICE-OUT .C .AO>>)>)>)
  1827. (<TELL
  1828. "You have to light them with something that's burning, you know.">)>)
  1829. (<==? .PRSACT ,TURN-OFF!-WORDS>
  1830. <CLOCK-DISABLE <2 .FOO>>
  1831. <COND (<1? <OLIGHT? .C>>
  1832. <TELL "The flame is extinguished.">
  1833. <PUT .C ,OLIGHT? -1>)
  1834. (<TELL "The candles are not lighted.">)>)
  1835. (<==? .PRSACT ,C-INT!-WORDS>
  1836. <LIGHT-INT .C ,CNDIN ,CANDLE-TICKS ,CANDLE-TELLS>)>>
  1837. <DEFINE BLACK-BOOK ("AUX" (PV ,PRSVEC) (V <1 .PV>) (B <2 .PV>))
  1838. #DECL ((PV) <VECTOR [3 ANY]> (B) OBJECT (V) VERB)
  1839. <COND (<==? .V ,BURN!-WORDS>
  1840. <COND (<OROOM .B>
  1841. <REMOVE-OBJECT .B>)
  1842. (<DROP-OBJECT .B>)>
  1843. <JIGS-UP
  1844. "A booming voice says 'Wrong, cretin!' and you notice that you have
  1845. turned into a pile of dust.">)>>
  1846. <DEFINE LIGHT-INT (OBJ CEV TICK TELL "AUX" CNT TIM (FOO <ORAND .OBJ>))
  1847. #DECL ((OBJ) OBJECT (FCN) APPLICABLE (TICK) <VECTOR [REST FIX]>
  1848. (TELL) <VECTOR [REST STRING]> (TIM CNT) FIX (FOO) <VECTOR FIX CEVENT>)
  1849. <PUT .FOO 1 <SET CNT <+ <1 .FOO> 1>>>
  1850. <CLOCK-INT .CEV <SET TIM <NTH .TICK .CNT>>>
  1851. <COND (<0? .TIM>
  1852. <COND (<OR <NOT <OROOM .OBJ>> <==? <OROOM .OBJ> ,HERE>>
  1853. <TELL "I hope you have more light than from a " 1 <ODESC2 .OBJ> ".">)>
  1854. <PUT .OBJ ,OLIGHT? 0>)
  1855. (<OR <NOT <OROOM .OBJ>>
  1856. <==? <OROOM .OBJ> ,HERE>>
  1857. <TELL <NTH .TELL .CNT>>)>>
  1858. <DEFINE HACKABLE? (OBJ RM "AUX" (AV <AVEHICLE ,WINNER>))
  1859. #DECL ((OBJ) OBJECT (RM) ROOM (AV) <OR FALSE OBJECT>)
  1860. <COND (.AV
  1861. <SEARCH-LIST <OID .OBJ> <OCONTENTS .AV> <>>)
  1862. (<SEARCH-LIST <OID .OBJ> <ROBJS .RM> <>>)>>