1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132 |
- ; "SUBTITLE THE ENDGAME"
- <OR <GASSIGNED? END-GAME!-FLAG> <BLOAT 20000 0 0 500>>
- "============ ZORK END-GAME FUNCTIONS ============="
- <SETG END-GAME-EXISTS? T>
- ;"enable endgame"
- <SETG END-GAME!-FLAG <>>
- ;"endgame has begun?"
- <DEFMAC DOPEN ('OBJ) <FORM TRO .OBJ ,OPENBIT>>
- <DEFMAC DCLOSE ('OBJ) <FORM TRZ .OBJ ,OPENBIT>>
- <DEFINE DPR (OBJ)
- #DECL ((OBJ) OBJECT)
- <COND (<TRNN .OBJ ,OPENBIT> "open.")("closed.")>>
- ;"SUBTITLE Is There Life after Death?"
- <DEFINE TOMB-FUNCTION ()
- <COND (<VERB? "LOOK">
- <TELL ,TOMB-DESC1
- ,LONG-TELL1 <DPR <FIND-OBJ "TOMB">>
- ,TOMB-DESC2>)>>
- <DEFINE CRYPT-FUNCTION ("AUX" (EG? ,END-GAME!-FLAG))
- #DECL ((EG?) <OR ATOM FALSE>)
- <COND (<AND .EG? <VERB? "LOOK">>
- <TELL ,CRYPT-DESC
- ,LONG-TELL1
- <DPR <FIND-OBJ "TOMB">>>)>>
- <DEFINE CRYPT-OBJECT ("AUX" (EG? ,END-GAME!-FLAG)
- (C <FIND-OBJ "TOMB">))
- #DECL ((EG?) <OR ATOM FALSE> (C) OBJECT)
- <COND (<AND <NOT .EG?> <HEAD-FUNCTION>>)
- (<AND .EG? <VERB? "OPEN">>
- <COND (<NOT <TRNN .C ,OPENBIT>>
- <DOPEN .C>
- <TELL
- "The door of the crypt is extremely heavy, but it opens easily.">)
- (ELSE
- <TELL "The crypt is already open.">)>
- T)
- (<AND .EG? <VERB? "CLOSE">>
- <COND (<TRNN .C ,OPENBIT>
- <DCLOSE .C>
- <TELL "The crypt is closed.">)
- (ELSE <TELL "The crypt is already closed.">)>
- <COND (<==? ,HERE <FIND-ROOM "CRYPT">>
- <CLOCK-INT ,STRTE 3>)>)>>
- <DEFINE START-END ("AUX" (HERE ,HERE))
- #DECL ((HERE) ROOM)
- <COND (<==? .HERE <FIND-ROOM "CRYPT">>
- <COND (<LIT? .HERE>
- <CLOCK-INT ,STRTE 3>)
- (ELSE
- <TELL ,PASS-WORD-INST ,LONG-TELL1>
- <ENTER-END-GAME>)>)>>
- <DEFINE ENTER-END-GAME ("AUX" (LAMP <FIND-OBJ "LAMP">) (SWORD <FIND-OBJ "SWORD">)
- C (W ,WINNER))
- #DECL ((LAMP SWORD) OBJECT (C) <VECTOR FIX CEVENT> (W) ADV)
- <TRO .LAMP ,LIGHTBIT>
- <TRZ .LAMP ,ONBIT>
- <PUT <SET C <OLINT .LAMP>> 1 0>
- <PUT <2 .C> ,CTICK 350>
- <PUT <2 .C> ,CFLAG <>>
- <PUT ,SWORD-DEMON
- ,HACTION
- <COND (<TYPE? ,SWORD-GLOW OFFSET> ,SWORD-GLOW)
- (SWORD-GLOW)>>
- <PUT ,ROBBER-DEMON ,HACTION <>>
- <MAPF <>
- <FUNCTION (O "AUX" L)
- #DECL ((O) OBJECT (L) <OR FALSE VECTOR>)
- <COND (<SET L <OLINT .O>> <CLOCK-DISABLE <2 .L>>)>>
- <AOBJS .W>>
- <TRO .LAMP ,TOUCHBIT>
- <TRO .SWORD ,TOUCHBIT>
- <PUT <PUT .LAMP ,OROOM <>> ,OCAN <>>
- <PUT <PUT .SWORD ,OROOM <>> ,OCAN <>>
- <PUT .W ,AOBJS (.LAMP .SWORD)>
- <SETG END-GAME!-FLAG T>
- <SCORE-ROOM <FIND-ROOM "CRYPT">>
- <GOTO <FIND-ROOM "TSTRS">>
- <ROOM-DESC>>
- \
- ;"SUBTITLE It's All Done with Mirrors"
- <SETG MR1!-FLAG T>
- <SETG MR2!-FLAG T>
- <SETG MIRROR-OPEN!-FLAG <>>
- <SETG WOOD-OPEN!-FLAG <>>
- <SETG MRSWPUSH!-FLAG <>>
- <DEFINE MRGO ("AUX" (DIR <2 ,PRSVEC>) (NRM <MEMQ .DIR <REXITS ,HERE>>) (CEX <2 .NRM>)
- (TORM <CXROOM .CEX>) (MDIR ,MDIR))
- #DECL ((DIR) DIRECTION (NRM) <VECTOR DIRECTION CEXIT>
- (CEX) CEXIT (TORM) ROOM (MDIR) FIX)
- <COND (<MEMQ .DIR [<FIND-DIR "NORTH"> <FIND-DIR "SOUTH">]>
- <COND (<==? ,MLOC .TORM>
- <COND (<N-S .MDIR>
- <TELL "There is a wooden wall blocking your way.">)
- (<MIRBLOCK .DIR .MDIR>)>
- <>)
- (.TORM)>)
- (<==? ,MLOC .TORM>
- <COND (<N-S .MDIR> <GO-E-W .TORM .DIR>)
- (<MIRBLOCK .DIR .MDIR> <>)>)
- (.TORM)>>
- <DEFINE MIRBLOCK (DIR MDIR)
- #DECL ((DIR) DIRECTION (MDIR) FIX)
- <COND (<==? .DIR <FIND-DIR "SOUTH">>
- <SET MDIR <MOD <+ .MDIR 180> 360>>)>
- <COND (<OR <AND <==? .MDIR 270> <NOT ,MR1!-FLAG>>
- <AND <==? .MDIR 90> <NOT ,MR2!-FLAG>>>
- <TELL "There is a large broken mirror blocking your way.">)
- (ELSE
- <TELL "There is a large mirror blocking your way.">)>>
- <DEFINE GO-E-W (RM DIR
- "AUX" (SPR <STRINGP <RID .RM>>) (SPD <STRINGP <CHTYPE .DIR PSTRING>>)
- (STR ,MRESTR))
- #DECL ((RM) ROOM (DIR) DIRECTION (SPR SPD STR) STRING)
- <OR <==? <2 .SPD> !\E> <SET STR ,MRWSTR>>
- <FIND-ROOM <SUBSTRUC .SPR 0 3 .STR>>>
- <SETG MRESTR " E">
- <SETG MRWSTR "MRBW">
- <DEFMAC N-S ('FX) <FORM 0? <FORM MOD .FX 180>>>
- <DEFMAC E-W ('FX) <FORM OR <FORM ==? .FX 90> <FORM ==? .FX 270>>>
- <DEFINE EWTELL (RM "AUX" (EAST? <==? <4 <STRINGP <RID .RM>>> !\E>) M1? MWIN)
- #DECL ((RM) ROOM (EAST? MWIN M1?) <OR FALSE ATOM>)
- <SET MWIN
- <COND (<SET M1? <==? 180 <+ ,MDIR <COND (.EAST? 0) (180)>>>>
- ,MR1!-FLAG)
- (,MR2!-FLAG)>>
- <TELL
- "You are in a narrow room, whose "
- 0
- <COND (.EAST? "west") ("east")>
- " wall is a large ">
- <TELL <COND (.MWIN "mirror.") ( "wooden panel
- which once contained a mirror.")>>
- <AND .M1? ,MIRROR-OPEN!-FLAG <TELL <COND (.MWIN ,MIROPEN) (,PANOPEN)>>>
- <TELL "The opposite wall is solid rock.">>
- <DEFINE MRCEW ()
- <COND (<VERB? "LOOK">
- <EWTELL ,HERE>
- <TELL "Somewhat to the north" ,LONG-TELL1 ,GUARDSTR>)>>
- <DEFINE MRBEW ()
- <COND (<VERB? "LOOK">
- <EWTELL ,HERE>
- <TELL "To the north and south are large hallways.">)>>
- <DEFINE MRAEW ()
- <COND (<VERB? "LOOK">
- <EWTELL ,HERE>
- <TELL "To the north is a large hallway.">)>>
- ;"LOOK-TO -- takes room to north, room to south (if any), and instructions
- for describing what is north and south. These are interpreted as:
- STRING -- print it, T -- guardians are there, otherwise, nothing interesting.
- If the mirror is found to north or south, the corresponding instruction is
- set to T, and later innocuous messages are printed for the directions with
- nothing interesting in them."
- <DEFINE LOOK-TO (NSTR "OPTIONAL" (SSTR <>) (NTELL <>) (STELL <>) (HTELL T)
- "AUX" (NRM <>) (SRM <>) NORTH? (MDIR ,MDIR) MIR? (M1? <>) DIR)
- #DECL ((DIR) STRING (NSTR SSTR) <OR STRING FALSE>
- (NTELL STELL) <OR ATOM FALSE STRING>
- (HTELL NORTH? MIR? M1?) <OR ATOM FALSE> (RM) ROOM
- (NRM SRM) <OR ROOM FALSE> (MDIR) FIX)
- <AND <TYPE? .NSTR STRING> <SET NRM <FIND-ROOM .NSTR>>>
- <AND <TYPE? .SSTR STRING> <SET SRM <FIND-ROOM .SSTR>>>
- <AND .HTELL <TELL ,HALLWAY ,LONG-TELL1>>
- <COND (<TYPE? .NTELL ATOM>
- <TELL "Somewhat to the north" ,LONG-TELL1 ,GUARDSTR>)
- (<TYPE? .NTELL STRING> <TELL .NTELL>)>
- <COND (<TYPE? .STELL ATOM>
- <TELL "Somewhat to the south" ,LONG-TELL1 ,GUARDSTR>)
- (<TYPE? .STELL STRING> <TELL .STELL>)>
- <COND (<PROG ()
- <COND (<==? ,MLOC .NRM>
- <SET NORTH? <SET NTELL T>> <SET DIR "north">)
- (<==? ,MLOC .SRM>
- <SET NORTH? <>> <SET STELL T> <SET DIR "south">)>>
- <SET MIR?
- <COND (<OR <AND .NORTH? <G? .MDIR 180> <L? .MDIR 359>>
- <AND <NOT .NORTH?> <G? .MDIR 0> <L? .MDIR 179>>>
- <SET M1? T>
- ,MR1!-FLAG)
- (,MR2!-FLAG)>>
- <COND (<E-W .MDIR>
- <TELL <COND (.MIR? "A large mirror fills the ")
- ("A large panel fills the ")>
- 1
- .DIR
- " side of the hallway.">
- <AND .M1?
- ,MIRROR-OPEN!-FLAG
- <TELL <COND (.MIR? ,MIROPEN)(,PANOPEN)> ,LONG-TELL1>>
- <OR .MIR?
- <TELL "The shattered pieces of a mirror cover the floor.">>)
- (<TELL "The "
- 0
- .DIR
-
- " side of the room is divided by a wooden wall into small
- hallways to the ">
- <TELL .DIR 0 "east and ">
- <TELL .DIR 1 "west.">)>)>
- <AND .HTELL
- <COND (<AND <NOT .NTELL> <NOT .STELL>>
- <TELL "The corridor continues north and south.">)
- (<NOT .NTELL> <TELL "The corridor continues north.">)
- (<NOT .STELL> <TELL "The corridor continues south.">)>>
- T>
- <DEFINE MRDF ()
- <COND (<VERB? "LOOK">
- <LOOK-TO "FDOOR" "MRG" <> T>)>>
- <DEFINE MRCF ()
- <COND (<VERB? "LOOK">
- <LOOK-TO "MRG" "MRB" T>)>>
- <DEFINE MRBF ()
- <COND (<VERB? "LOOK">
- <LOOK-TO "MRC" "MRA">)>>
- <DEFINE MRAF ()
- <COND (<VERB? "LOOK">
- <LOOK-TO "MRB" <> <> "A passage enters from the south.">)>>
- "Infestation function for Sword-glow demon, tailored for end game"
- <DEFINE EG-INFESTED? (R "AUX" (M <FIND-ROOM "MRG">))
- #DECL ((R M) ROOM)
- <OR <==? .R .M>
- <AND <==? ,MLOC .M> <==? .R <FIND-ROOM "INMIR">>>
- <==? .R <FIND-ROOM "MRGE">>
- <==? .R <FIND-ROOM "MRGW">>>>
- <DEFINE GUARDIANS ()
- <COND (<VERB? "GO-IN">
- <TELL ,GUARDKILL ,LONG-TELL1>
- <JIGS-UP "">)
- (<VERB? "ATTAC">
- <TELL ,GUARD-ATTACK ,LONG-TELL1>
- <JIGS-UP "">)
- (<VERB? "HELLO">
- <TELL "The statues are impassive.">)>>
- <DEFINE MIRROR-DIR? (DIR RM "AUX" M (MDIR ,MDIR))
- #DECL ((MDIR) FIX (DIR) DIRECTION (RM) ROOM
- (M) <OR FALSE <VECTOR DIRECTION CEXIT>>)
- <AND <SET M <MEMQ <FIND-DIR "NORTH"> <REXITS .RM>>>
- <==? ,MLOC <CXROOM <2 .M>>>
- <COND (<OR <AND <==? .DIR <FIND-DIR "NORTH">>
- <G? .MDIR 180>
- <L? .MDIR 360>>
- <AND <==? .DIR <FIND-DIR "SOUTH">>
- <G? .MDIR 0>
- <L? .MDIR 180>>>
- 1)
- (2)>>>
- <DEFINE WALL-FUNCTION ("AUX" (HERE ,HERE) (NORTH? <>))
- #DECL ((HERE) ROOM (NORTH?) <OR FALSE FIX>)
- <COND (<AND ,END-GAME!-FLAG
- <N-S ,MDIR>
- <OR <SET NORTH? <MIRROR-DIR? <FIND-DIR "NORTH"> .HERE>>
- <MIRROR-DIR? <FIND-DIR "SOUTH"> .HERE>>>
- <COND (<VERB? "PUSH">
- <TELL "The structure won't budge.">)>)>>
- <DEFINE MIRROR-HERE? (RM "AUX" (SP <STRINGP <RID .RM>>) (MDIR ,MDIR))
- #DECL ((RM) ROOM (SP) STRING (MDIR) FIX)
- <COND (<==? <LENGTH .SP> 4>
- <COND (<==? 180 <+ .MDIR <COND (<==? <4 .SP> !\E> 0) (180)>>> 1)
- (2)>)
- (<N-S .MDIR> <>)
- (<MIRROR-DIR? <FIND-DIR "NORTH"> .RM>)
- (<MIRROR-DIR? <FIND-DIR "SOUTH"> .RM>)>>
- <DEFINE MIRROR-FUNCTION ("AUX" MIRROR)
- #DECL ((MIRROR) <OR FIX FALSE>)
- <COND (<NOT <SET MIRROR <MIRROR-HERE? ,HERE>>>
- <TELL
- "I can't see a mirror here.">)
- (<VERB? "C-INT">
- <SETG MIRROR-OPEN!-FLAG <>>
- <TELL "The mirror slams shut.">)
- (<VERB? "OPEN" "MOVE">
- <TELL
- "I don't see a way to open the mirror here.">)
- (<VERB? "LKIN">
- <COND (<OR <AND <1? .MIRROR> ,MR1!-FLAG> ,MR2!-FLAG>
- <TELL "A disheveled adventurer stares back at you.">)
- (<TELL "The mirror is broken into little pieces.">)>)
- (<VERB? "POKE" "MUNG">
- <COND (<1? .MIRROR>
- <COND (,MR1!-FLAG
- <SETG MR1!-FLAG <>>
- <TELL ,MIRBREAK ,LONG-TELL1>)
- (<TELL ,MIRBROKE ,LONG-TELL1>)>)
- (,MR2!-FLAG
- <SETG MR2!-FLAG <>>
- <TELL ,MIRBREAK ,LONG-TELL1>)
- (<TELL ,MIRBROKE ,LONG-TELL1>)>)
- (<OR <AND <1? .MIRROR> <NOT ,MR1!-FLAG>> <NOT ,MR2!-FLAG>>
- <TELL
- "Shards of a broken mirror are dangerous to play with.">)
- (<VERB? "PUSH">
- <TELL <COND (<1? .MIRROR>
- "The mirror is mounted on a wooden panel which moves slightly inward
- as you push, and back out when you let go. The mirror feels fragile.")
- (T
- "The mirror is unyielding, but seems rather fragile.")> ,LONG-TELL1>)>>
- <DEFINE PANEL-FUNCTION ("AUX" MIRROR)
- #DECL ((MIRROR) <OR FIX FALSE>)
- <COND (<NOT <SET MIRROR <MIRROR-HERE? ,HERE>>>
- <TELL
- "I can't see a panel here.">)
- (<VERB? "OPEN" "MOVE">
- <TELL
- "I don't see a way to open the panel here.">)
- (<VERB? "POKE" "MUNG">
- <COND (<1? .MIRROR>
- <COND (,MR1!-FLAG
- <TELL ,PANELBREAK ,LONG-TELL1>)
- (<TELL ,PANELBROKE ,LONG-TELL1>)>)
- (,MR2!-FLAG
- <TELL ,PANELBREAK ,LONG-TELL1>)
- (<TELL ,PANELBROKE ,LONG-TELL1>)>)
- (<VERB? "PUSH">
- <TELL <COND (<1? .MIRROR>
- "The wooden panel moves slightly inward as you push, and back out
- when you let go.")
- (T
- "The panel is unyielding.")>>)>>
- <GDECL (DIRVEC) <VECTOR [REST DIRECTION FIX]>>
- <DEFINE MIROUT ("AUX" DIR (MDIR ,MDIR) RM)
- #DECL ((DIR) <OR ATOM DIRECTION FIX> (MDIR) FIX (RM) <OR FALSE ROOM>)
- <COND (<==? <2 ,PRSVEC> <FIND-DIR "EXIT">> <SET DIR T>)
- (ELSE <SET DIR <2 <MEMQ <2 ,PRSVEC> ,DIRVEC>>>)>
- <COND (,MIRROR-OPEN!-FLAG
- <COND (<OR <NOT <TYPE? .DIR FIX>> <==? <MOD <+ .MDIR 270> 360> .DIR>>
- <COND (<N-S .MDIR>
- <MIREW>)
- (<MIRNS <L? .MDIR 180> T>)>)
- (<TELL ,NOWAY ,LONG-TELL1>
- <>)>)
- (,WOOD-OPEN!-FLAG
- <COND (<OR <NOT <TYPE? .DIR FIX>> <==? <MOD <+ .MDIR 180> 360> .DIR>>
- <COND (<SET RM <MIRNS <NOT <0? .MDIR>> T>>
- <TELL "As you leave, the door swings shut.">
- <SETG WOOD-OPEN!-FLAG <>>
- .RM)
- (<TELL ,NOWAY>)>)
- (<TELL ,NOWAY>
- <>)>)
- (<TELL ,NOWAY>
- <>)>>
- "MIRNS -- returns room in a given direction from the mirror (north or
- south as indicated by first argument). If second arg is T, then we
- are exiting, not moving the mirror, so don't worry about ends."
- <DEFINE MIRNS ("OPTIONAL" (NORTH? <L? ,MDIR 180>) (EXIT? <>)
- "AUX" (MLOC ,MLOC) (REX <REXITS .MLOC>) M EXIT)
- #DECL ((MLOC) ROOM (REX) EXIT (M) <OR FALSE <VECTOR DIRECTION>>
- (EXIT?) <OR ATOM FALSE> (EXIT) <OR DOOR ROOM CEXIT NEXIT>
- (NORTH?) <OR FALSE FIX ATOM>)
- <COND (<AND <NOT .EXIT?>
- <OR <AND .NORTH? <==? .MLOC ,NORTHEND>>
- <AND <NOT .NORTH?> <==? .MLOC ,SOUTHEND>>>>
- <>)
- (<SET M
- <MEMQ <COND (.NORTH? <FIND-DIR "NORTH">) (<FIND-DIR "SOUTH">)>
- .REX>>
- <SET EXIT <2 .M>>
- <COND (<TYPE? .EXIT CEXIT> <CXROOM .EXIT>)
- (<TYPE? .EXIT ROOM> .EXIT)>)>>
- <GDECL (NORTHEND SOUTHEND) ROOM>
- <DEFINE MIREW ()
- <FIND-ROOM <SUBSTRUC <STRINGP <RID ,MLOC>>
- 0
- 3
- <COND (<0? ,MDIR> ,MRWSTR)
- (,MRESTR)>>>>
- <DEFINE MIRIN ()
- <COND (<==? <MIRROR-HERE? ,HERE> 1>
- <COND (,MIRROR-OPEN!-FLAG <FIND-ROOM "INMIR">)
- (<TELL "The panel is closed."> <>)>)
- (<TELL "The structure blocks your way."> T)>>
- <DEFINE MREYE-ROOM ("AUX" O)
- #DECL ((O) <OR FALSE OBJECT>)
- <COND (<VERB? "LOOK">
- <TELL
- "You are in a small room, with narrow passages exiting to the north
- and south. A narrow red beam of light crosses the room at the north
- end, inches above the floor." ,LONG-TELL>
- <COND (<SET O <BEAM-STOPPED?>>
- <TELL " The beam is stopped halfway across the
- room by a " 1 <ODESC2 .O> " lying on the floor.">)
- (<TELL "" 1>)>
- <LOOK-TO "MRA" <> <> <> <>>)>>
- <DEFINE BEAM-STOPPED? ("AUX" (BEAM <FIND-OBJ "RBEAM">))
- #DECL ((BEAM) OBJECT)
- <MAPF <>
- <FUNCTION (O)
- #DECL ((O) OBJECT)
- <COND (<N==? .O .BEAM> <MAPLEAVE .O>)>>
- <ROBJS <FIND-ROOM "MREYE">>>>
- ; "This function cannot have its .PRSI and .PRSO's changed to <PRSI> etc!!"
- <DEFINE BEAM-FUNCTION ("AUX" (PRSO <PRSO>) (PRSI <PRSI>)
- (HERE ,HERE) (BEAM <FIND-OBJ "RBEAM">))
- #DECL ((PRSO PRSI) OBJECT (HERE) ROOM (BEAM) OBJECT)
- <COND (<VERB? "PUT" "POKE" "MUNG">
- <COND (<VERB? "PUT">
- <SET PRSI .PRSO>
- <SET PRSO <PRSI>>)>
- <COND (<OR <NOT .PRSI> <N==? .PRSO .BEAM>> <>)
- (<DROP-IF .PRSI>
- <INSERT-OBJECT .PRSI .HERE>
- <TELL
- "The beam is now interrupted by a " 1 <ODESC2 .PRSI> " lying on the floor.">)
- (<MEMQ .PRSI <ROBJS .HERE>>
- <TELL
- "The " 1 <ODESC2 .PRSI> " already breaks the beam.">)
- (<TELL
- "You can't break the beam with a " 1 <ODESC2 .PRSI> ".">)>)
- (<AND <VERB? "TAKE"> <==? <PRSO> .BEAM>>
- <TELL
- "No doubt you have a bottle of moonbeams as well.">)>>
- <DEFINE MRSWITCH ("AUX" (HERE ,HERE))
- #DECL ((HERE) ROOM)
- <COND (<VERB? "PUSH">
- <COND (,MRSWPUSH!-FLAG <TELL "The button is already depressed.">)
- (<TELL "The button becomes depressed.">
- <COND (<BEAM-STOPPED?>
- <CLOCK-ENABLE <CLOCK-INT ,MRINT 7>>
- <SETG MRSWPUSH!-FLAG T>
- <SETG MIRROR-OPEN!-FLAG T>)
- (<TELL "The button pops back out.">)>)>)
- (<VERB? "C-INT">
- <SETG MRSWPUSH!-FLAG <>>
- <SETG MIRROR-OPEN!-FLAG <>>
- <COND (<OR <==? <MIRROR-HERE? .HERE> 1>
- <==? .HERE <FIND-ROOM "INMIR">>>
- <TELL "The mirror quietly swings shut.">)
- (<==? .HERE <FIND-ROOM "MRANT">>
- <TELL "The button pops back to its original position.">)>)>>
- <SETG MDIR 270>
- <GDECL (MDIR) FIX (MLOC) ROOM>
- ;"mirror points... 0 = north"
- <SETG POLEUP!-FLAG 0>
- <GDECL (POLEUP!-FLAG) FIX>
- ;"pole raised?: 0 -- in hole or channel, 1 -- foor level, 2 -- in air"
- <DEFINE MAGIC-MIRROR ("AUX" (MDIR ,MDIR) (MLOC ,MLOC) (STARTER <>))
- #DECL ((MDIR) FIX (MLOC) ROOM (STARTER) <OR ATOM FALSE>)
- <COND (<VERB? "LOOK">
- <SET STARTER <==? .MLOC ,STARTROOM>>
- <TELL ,INSIDE-MIRROR-1 ,LONG-TELL>
- <COND (<AND .STARTER <==? .MDIR 270>>
- <COND (<NOT <0? ,POLEUP!-FLAG>>
- <TELL
- "has been lifted out
- of a hole carved in the stone floor. There is evidently enough
- friction to keep the pole from dropping back down." ,LONG-TELL1>)
- (ELSE
- <TELL "has been dropped
- into a hole carved in the stone floor.">)>)
- (<OR <0? .MDIR> <==? .MDIR 180>>
- <COND (<NOT <0? ,POLEUP!-FLAG>>
- <TELL "is positioned above
- the stone channel in the floor.">)
- (ELSE
- <TELL "has been dropped
- into the stone channel incised in the floor.">)>)
- (ELSE
- <TELL "is resting on the
- stone floor.">)>
- <TELL ,MIRROR-POLE-DESC
- ,LONG-TELL1
- <NTH ,LONGDIRS <+ </ .MDIR 45> 1>>
- ".">)>>
- <GDECL (LONGDIRS) <VECTOR [REST STRING]>>
- ;"MOVEMENT"
- <DEFINE MPANELS ("AUX" (MDIR ,MDIR))
- #DECL ((MDIR) FIX)
- <COND (<VERB? "PUSH">
- <COND (<NOT <0? ,POLEUP!-FLAG>>
- <AND <==? ,MLOC <FIND-ROOM "MRG">>
- <TELL "The movement of the structure alerts the Guardians.">
- <JIGS-UP ,GUARDKILL>>
- <COND (<OR <==? <PRSO> <FIND-OBJ "RDWAL">>
- <==? <PRSO> <FIND-OBJ "YLWAL">>>
- <SET MDIR <MOD <+ .MDIR 45> 360>>
- <TELL "The structure rotates clockwise.">)
- (<SET MDIR <MOD <+ .MDIR 315> 360>>
- <TELL "The structure rotates counterclockwise.">)>
- <TELL "The arrow on the compass rose now indicates "
- 1
- <NTH ,LONGDIRS <+ 1 </ .MDIR 45>>>
- ".">
- <COND (,WOOD-OPEN!-FLAG
- <SETG WOOD-OPEN!-FLAG <>>
- <TELL ,WOOD-CLOSES>)>
- <SETG MDIR .MDIR>)
- (<N-S .MDIR>
- <TELL "The short pole prevents the structure from rotating.">)
- (<TELL "The structure shakes slightly but doesn't move.">)>)>>
- <PSETG WOOD-CLOSES "The pine wall closes quietly.">
- <DEFINE MENDS ("AUX" (MDIR ,MDIR) RM (MRG <FIND-ROOM "MRG">) (MLOC ,MLOC))
- #DECL ((MDIR) FIX
- (RM) <OR FALSE ROOM> (MRG MLOC) ROOM)
- <COND (<VERB? "PUSH">
- <COND (<NOT <N-S .MDIR>>
- <TELL
- "The structure rocks back and forth slightly but doesn't move.">)
- (<==? <PRSO> <FIND-OBJ "OAKND">>
- <COND (<SET RM <MIRNS>> <MIRMOVE <0? .MDIR> .RM>)
- (<TELL
- "The structure has reached the end of the stone channel and won't
- budge.">)>)
- (<TELL "The pine wall swings open.">
- <AND <OR <==? .MLOC .MRG>
- <AND <==? .MLOC <FIND-ROOM "MRD">>
- <==? .MDIR 0>>
- <AND <==? .MLOC <FIND-ROOM "MRC">>
- <==? .MDIR 180>>>
- <TELL
- "The pine door opens into the field of view of the Guardians.">
- <JIGS-UP ,GUARDKILL>>
- <SETG WOOD-OPEN!-FLAG T>
- <CLOCK-ENABLE <CLOCK-INT ,PININ 5>>)>)
- (<VERB? "C-INT">
- <COND (,WOOD-OPEN!-FLAG
- <SETG WOOD-OPEN!-FLAG <>>
- <TELL ,WOOD-CLOSES>)>
- T)>>
- <DEFINE MIRMOVE (NORTH? RM
- "AUX" (MRG <FIND-ROOM "MRG">) (PU? <NOT <0? ,POLEUP!-FLAG>>))
- #DECL ((NORTH?) <OR FIX ATOM FALSE> (RM MRG) ROOM (PU?) <OR ATOM FALSE>)
- <TELL <COND (.PU? "The structure wobbles ")
- ("The structure slides ")>
- 1
- <COND (.NORTH? "north") ("south")>
- " and stops over another compass rose.">
- <SETG MLOC .RM>
- <AND <==? .RM .MRG>
- <==? ,HERE <FIND-ROOM "INMIR">>
- <COND (.PU?
- <TELL
- "The structure wobbles as it moves, alerting the Guardians.">)
- (<OR <NOT ,MR1!-FLAG> <NOT ,MR2!-FLAG>>
- <TELL
- "A Guardian notices a wooden structure creeping by, and his
- suspicions are aroused.">)
- (<OR ,MIRROR-OPEN!-FLAG ,WOOD-OPEN!-FLAG>
- <TELL
- "A Guardian notices the open side of the structure, and his suspicions
- are aroused.">)>
- <JIGS-UP ,GUARDKILL1>>
- T>
- <DEFINE SHORT-POLE ("AUX" (MDIR ,MDIR) (PU ,POLEUP!-FLAG))
- #DECL ((MDIR PU) FIX)
- <COND (<VERB? "RAISE">
- <COND (<==? .PU 2>
- <TELL "The pole cannot be raised further.">)
- (<SETG POLEUP!-FLAG 2>
- <TELL "The pole is now slightly above the floor.">)>)
- (<VERB? "PUSH" "LOWER">
- <COND (<0? .PU> <TELL "The pole cannot be lowered further.">)
- (<N-S .MDIR>
- <TELL "The pole is lowered into the channel.">
- <SETG POLEUP!-FLAG 0>
- T)
- (<AND <==? .MDIR 270> <==? ,MLOC <FIND-ROOM "MRB">>>
- <SETG POLEUP!-FLAG 0>
- <TELL "The pole is lowered into the stone hole.">)
- (<1? .PU>
- <TELL "The pole is already resting on the floor.">)
- (<SETG POLEUP!-FLAG 1>
- <TELL "The pole now rests on the stone floor.">)>)>>
- \
- ; "SUBTITLE The Spanish Inquisition"
- <SETG QVEC <REST <IVECTOR 15 '<>> 15>>
- <SETG NQVEC <IVECTOR 3 '<>>>
- <GDECL (NQVEC QVEC) <VECTOR [REST <OR QUESTION FALSE>]>>
- <SETG NQATT 0>
- ;"tries recorded for this question"
- <SETG INQOBJS ()>
- <GDECL (NUMS) <VECTOR [REST STRING]>
- (NQATT) FIX
- (INQOBJS) <LIST [REST OBJECT]>
- (NUMOBJS) <VECTOR [REST OBJECT FIX]>>
- <DEFINE CORRECT? (ANS CORRECT "AUX" (1CORR <1 .CORRECT>))
- #DECL ((ANS) <VECTOR [REST STRING]> (CORRECT) VECTOR
- (1CORR) <OR OBJECT ACTION FALSE STRING>)
- <REPEAT (W A)
- #DECL ((W) <OR ATOM FALSE> (A) STRING)
- <COND (<EMPTY? .ANS> <RETURN>)
- (<AND <NOT <EMPTY? <SET A <1 .ANS>>>>
- <SET W <LOOKUP .A ,WORDS>>
- <TYPE? ,.W BUZZ>>
- <SET ANS <REST .ANS>>)
- (ELSE <RETURN>)>>
- <COND (<TYPE? .1CORR STRING> <MEMBER <1 .ANS> .CORRECT>)
- (<REPEAT ((LV .ANS) STR ATM OBJ (ADJ <>) VAL)
- #DECL ((LV) <VECTOR [REST STRING]> (STR) STRING
- (ATM) <OR FALSE ATOM> (VAL) ANY
- (ADJ) <OR FALSE ADJECTIVE>
- (OBJ) <OR FALSE OBJECT>)
- <AND <EMPTY? <SET STR <1 .LV>>> <RETURN <>>>
- <COND (<SET ATM <LOOKUP .STR ,ACTIONS>>
- <RETURN <==? ,.ATM .1CORR>>)
- (<SET ATM <LOOKUP .STR ,WORDS>>
- <COND (<TYPE? <SET VAL ,.ATM> ADJECTIVE>
- <SET ADJ .VAL>)>)
- (<SET ATM <LOOKUP .STR ,OBJECT-OBL>>
- <COND (<SET OBJ <SEARCH-LIST .ATM ,INQOBJS .ADJ>>
- <RETURN <==? .OBJ .1CORR>>)>)>
- <SET LV <REST .LV>>>)>>
- <DEFINE INQUISITOR ("OPTIONAL" (ANS <>)
- "AUX" (NQV ,NQVEC) (QUES <1 .NQV>) (NQATT ,NQATT))
- #DECL ((ANS) <OR FALSE <VECTOR [REST STRING]>>
- (NQV) <VECTOR [REST QUESTION]> (QUES) QUESTION (NQATT) FIX)
- <COND (<VERB? "C-INT">
- <TELL "The booming voice asks:
- \"" 1 <QSTR .QUES> "\"">
- <CLOCK-INT ,INQIN 2>)
- (<AND .ANS ,INQSTART? <L? .NQATT 5>>
- <COND (<CORRECT? .ANS <QANS .QUES>>
- <TELL "The dungeon master says \"Excellent\".">
- <COND (<EMPTY? <SET NQV <REST .NQV>>>
- <TELL ,QUIZ-WIN ,LONG-TELL1>
- <DOPEN <FIND-OBJ "QDOOR">>
- <CLOCK-DISABLE ,INQIN>)
- (<SETG NQATT 0>
- <SETG NQVEC .NQV>
- <TELL "The booming voice asks:
- \""
- 1
- <QSTR <1 .NQV>>
- "\"">
- <CLOCK-INT ,INQIN 2>)>)
- (<SET NQATT <SETG NQATT <+ 1 .NQATT>>>
- <TELL "The dungeon master says \"You are wrong." 0>
- <COND (<==? .NQATT 5>
- <TELL ,INQ-LOSE ,LONG-TELL1>
- <CLOCK-DISABLE ,INQIN>)
- (<TELL " You have "
- 0
- <NTH ,NUMS <- 5 .NQATT>>
- " more chance">
- <TELL
- <COND (<==? .NQATT 4>
- ".\"")
- ("s.\"")>>)>)>)
- (<TELL "There is no reply.">)>>
- <SETG INQSTART? <>>
- ;"if D.M. has stated the rules."
- <DEFINE INQSTART ("AUX" (QV ,QVEC) (NQV <SETG NQVEC <TOP ,NQVEC>>))
- #DECL ((QV NQV) <VECTOR [REST QUESTION]>)
- <COND (<NOT ,INQSTART?>
- <CLOCK-ENABLE <CLOCK-INT ,INQIN 2>>
- <TELL ,QUIZ-RULES ,LONG-TELL1>
- <SETG INQSTART? T>
- <SELECT .QV .NQV>
- <TELL "The booming voice asks:
- \"" 1 <QSTR <1 .NQV>> "\"">)
- (<TELL
- "The Dungeonmaster gazes at you impatiently, and says, \"My conditions
- have been stated, abide by them or depart!\"">)>>
- <DEFINE ANSWER ("AUX" (LV ,LEXV) M (HERE ,HERE))
- #DECL ((LV M) <VECTOR [REST STRING]> (HERE) ROOM)
- <SET M <MEMBER "" .LV>>
- <COND (<AND .M <==? .HERE <FIND-ROOM "RIDDL">> <NOT ,RIDDLE-FLAG!-FLAG>>
- <COND (<CORRECT? <REST .M> '["WELL"]>
- <SETG RIDDLE-FLAG!-FLAG T>
- <TELL
- "There is a clap of thunder and the east door opens.">)>)
- (<AND .M ,END-GAME!-FLAG <==? .HERE <FIND-ROOM "FDOOR">>>
- <INQUISITOR <REST .M>>)
- (<TELL "No one seems to be listening.">)>>
- <DEFINE MASTER-ACTOR ("AUX" (HERE ,HERE) (PRSO <2 ,PRSVEC>))
- #DECL ((HERE) ROOM (PRSO) <OR FALSE OBJECT DIRECTION>)
- <COND (<NOT <TRNN <FIND-OBJ "QDOOR"> ,OPENBIT>> <TELL "There is no reply.">)
- (<VERB? "WALK">
- <COND (<OR <AND <OR <==? .PRSO <FIND-DIR "SOUTH">>
- <==? .PRSO <FIND-DIR "ENTER">>>
- <==? .HERE <FIND-ROOM "NCORR">>>
- <AND <OR <==? .PRSO <FIND-DIR "NORTH">>
- <==? .PRSO <FIND-DIR "ENTER">>>
- <==? .HERE <FIND-ROOM "SCORR">>>>
- <TELL
- "\"I am not permitted to enter the prison cell.\"">)
- (<TELL
- "\"I prefer to stay where I am, thank you.\"">)>)
- (<MEMQ <PRSA> ,MASTER-ACTIONS> <>)
- (<TELL "\"I cannot perform that action for you.\"">)>>
- <DEFINE MASTER-FUNCTION ()
- <COND (<VERB? "ATTAC">
- <JIGS-UP ,MASTER-ATTACK>)
- (<VERB? "TAKE">
- <TELL
- "\"I'm willing to accompany you, but not ride in your pocket!\"">)>>
- <GDECL (MASTER-ACTIONS) VECTOR>
- <DEFINE BDOOR-FUNCTION ()
- <COND (<VERB? "GO-IN">
- <CLOCK-ENABLE <CLOCK-INT ,FOLIN -1>>)
- (<VERB? "LOOK">
- <TELL
- "You are in a narrow north-south corridor. At the south end is a door
- and at the north end is an east-west corridor. The door is " ,LONG-TELL1
- <DPR <FIND-OBJ "QDOOR">>>)>>
- <DEFINE FDOOR-FUNCTION ()
- <COND (<VERB? "GO-IN">
- <CLOCK-INT ,FOLIN 0>)
- (<VERB? "LOOK">
- <LOOK-TO <> "MRD"
- "You are in a north-south hallway which ends in a large wooden door." <> <>>
- <TELL
- "The wooden door has a barred panel in it at about head height. The
- panel is " ,LONG-TELL
- <COND (<AND <CFLAG ,INQIN> <NOT <0? <CTICK ,INQIN>>>> "open")("closed")>>
- <TELL " and the door is " 1 <DPR <FIND-OBJ "QDOOR">>>
- T)>>
- <DEFINE WOOD-DOOR ()
- <COND (<VERB? "OPEN" "CLOSE">
- <TELL "The door won't budge.">)
- (<VERB? "KNOCK">
- <COND (,INQSTART?
- <TELL "There is no answer.">)
- (<INQSTART>)>)>>
- <SETG FOLFLAG T> ;"Following?"
- <DEFINE FOLLOW ("AUX" (WIN ,WINNER) (MAST <OACTOR <FIND-OBJ "MASTE">>)
- (HERE ,HERE) (MROOM <AROOM .MAST>))
- #DECL ((WIN MAST) ADV (HERE MROOM) ROOM)
- <COND (<VERB? "C-INT">
- <COND (<==? .HERE .MROOM>)
- (<N==? .HERE <FIND-ROOM "CELL">>
- <AND <MEMQ <AOBJ .MAST> <ROBJS .MROOM>>
- <PUT .MROOM
- ,ROBJS
- <SPLICE-OUT <AOBJ .MAST> <ROBJS .MROOM>>>>
- <PUT .MAST ,AROOM .HERE>
- <SETG FOLFLAG T>
- <INSERT-OBJECT <AOBJ .MAST> .HERE>
- <TELL <COND (<MEMQ .HERE <REXITS .MROOM>>
- "The dungeon master follows you.")
- ("The dungeon master catches up to you.")>>)
- (,FOLFLAG
- <TELL
- "You notice that the dungeon master does not follow.">
- <SETG FOLFLAG <>>
- T)>)
- (<==? .WIN .MAST>
- <CLOCK-INT ,FOLIN -1>
- <TELL "The dungeon master answers, 'I will follow.'">)>>
- <DEFINE STAY ()
- <COND (<==? ,WINNER <OACTOR <FIND-OBJ "MASTE">>>
- <CLOCK-INT ,FOLIN 0>
- <TELL "The dungeon master says, 'I will stay.'">)
- (<==? ,WINNER ,PLAYER>
- <TELL "You will be lost without me.">)>>
- \
- ;"SUBTITLE 'The end had come, and this was it; he dropped her in the Flaming Pit.'"
- <SETG LCELL 1> ;"cell in slot"
- <SETG PNUMB 1> ;"cell pointed at"
- <SETG ACELL <>> ;"cell player is in"
- <SETG DCELL <>> ;"cell d.m. is in"
- <GDECL (LCELL PNUMB ACELL DCELL) <OR FIX FALSE>>
- <DEFINE MOVIES (R "AUX" (CO ,COBJS))
- #DECL ((R) ROOM (CO VALUE) <LIST [REST OBJECT]>)
- <MAPF ,LIST
- <FUNCTION (O)
- #DECL ((O) OBJECT)
- <COND (<NOT <MEMQ .O .CO>> <MAPRET .O>)
- (ELSE <MAPRET>)>>
- <ROBJS .R>>>
- <DEFINE STUFF (R L1 L2)
- #DECL ((L1 L2) LIST (R) ROOM)
- <COND (<EMPTY? .L1> <SET L1 .L2>)
- (<EMPTY? .L2>)
- (ELSE
- <SET L1 <LIST !.L1 !.L2>> ;"on purpose, no sharing wanted -- pdl")>
- <MAPF <>
- <FUNCTION (O) #DECL ((O) OBJECT) <PUT .O ,OROOM .R>>
- .L1>
- <PUT .R ,ROBJS .L1>>
- <DEFINE CELL-MOVE ("AUX" (NEW ,PNUMB) (OLD ,LCELL) (CELL <FIND-ROOM "CELL">)
- (NCELL <FIND-ROOM "NCELL">) (PCELL <FIND-ROOM "PCELL">)
- (D <FIND-OBJ "ODOOR">) (CELLS ,CELLS) PO (ME ,PLAYER)
- (DM ,MASTER))
- #DECL ((NEW OLD) FIX (CELL) ROOM (CELLS) <UVECTOR [REST LIST]>
- (D) OBJECT (NCELL PCELL) ROOM (PO) LIST (ME DM) ADV)
- <PUT .CELLS .OLD <SET PO <MOVIES .CELL>>>
- <STUFF .CELL <NTH .CELLS .NEW> ,COBJS>
- <PUT .CELLS .NEW ()>
- <COND (<==? .OLD 4> <STUFF .NCELL .PO ,NOBJS>)
- (ELSE <STUFF .PCELL .PO ,POBJS>)>
- <DCLOSE <FIND-OBJ "CDOOR">>
- <DCLOSE .D>
- <COND (<==? .NEW 4> <TRO .D ,OVISON>)
- (ELSE <TRZ .D ,OVISON>)>
- <COND (<==? <AROOM .ME> .CELL>
- <SETG ACELL .OLD>
- <GOTO <COND (<==? .OLD 4> <TRO .D ,OVISON> .NCELL)
- (ELSE .PCELL)>
- .ME>)
- (<==? ,ACELL .NEW>
- <SETG ACELL <>>
- <GOTO <FIND-ROOM "CELL"> .ME>)>
- <COND (<==? <AROOM .DM> .CELL>
- <PUT .DM ,AROOM .PCELL>
- <SETG DCELL .OLD>)
- (<==? ,DCELL .NEW>
- <SETG DCELL <>>)>
- <SETG LCELL .NEW>>
- <DEFINE PARAPET ()
- <COND (<VERB? "LOOK">
- <TELL ,PARAPET-DESC
- ,LONG-TELL1
- <NTH ,NUMS ,PNUMB>
- "'.">)>>
- <DEFINE DIAL ("AUX" N)
- #DECL ((N) <OR FALSE <VECTOR [REST OBJECT FIX]>>)
- <COND (<VERB? "SET" "PUT" "MOVE" "TRNTO">
- <COND (<NOT <EMPTY? <PRSI>>>
- <COND (<SET N <MEMQ <PRSI> ,NUMOBJS>>
- <SETG PNUMB <2 .N>>
- <TELL "The dial now points to '" 1
- <NTH ,NUMS <2 .N>> "'.">)
- (<TELL "The dial face only contains numbers.">)>)
- (<TELL "You must specify what to set the dial to.">)>)
- (<VERB? "SPIN">
- <SETG PNUMB <+ 1 <MOD <RANDOM> 8>>>
- <TELL
- "The dial spins and comes to a stop pointing at '" 1 <NTH ,NUMS ,PNUMB> "'.">)>>
- <DEFINE DIALBUTTON ("AUX" (CDOOR <TRNN <FIND-OBJ "CDOOR"> ,OPENBIT>))
- #DECL ((CDOOR) <OR ATOM FALSE>)
- <COND (<VERB? "PUSH">
- <CELL-MOVE>
- <TELL
- "The button depresses with a slight click, and pops back.">
- <AND .CDOOR <TELL "The cell door is now closed.">>
- T)>>
- <DEFINE TAKE-FIVE ()
- <COND (<VERB? "TAKE">
- <PERFORM WAIT <FIND-VERB "WAIT">>)>>
- <DEFINE CELL-ROOM ()
- <COND (<VERB? "LOOK">
- <TELL
- "You are in a featureless prison cell. You can see "
- 1
- <COND (<TRNN <FIND-OBJ "CDOOR"> ,OPENBIT>
- "the east-west
- corridor outside the open wooden door in front of you.")
- ("only the flames
- and smoke of the pit out the small window in a closed door in front
- of you.")>>
- <COND (<==? ,LCELL 4>
- <TELL
- "Behind you is a bronze door which seems to be "
- 1
- <COND (<TRNN <FIND-OBJ "ODOOR"> ,OPENBIT>
- "open.")
- ("closed.")>>)>)>>
-
- <DEFINE PCELL-ROOM ()
- <COND (<VERB? "LOOK">
- <TELL
- "You are in a featureless prison cell. Its wooden door is securely
- fastened, and you can see only the flames and smoke of the pit out
- the small window." ,LONG-TELL1>)>>
- <DEFINE NCELL-ROOM ()
- <COND (<VERB? "LOOK">
- <TELL
- "You are in a featureless prison cell. Its wooden door is securely
- fastened, and you can see only the flames and smoke of the pit out
- its small window." ,LONG-TELL1>
- <TELL
- "On the other side of the cell is a bronze door which seems to be
- " 1 <DPR <FIND-OBJ "ODOOR">>>)>>
- <DEFINE NCORR-ROOM ()
- <COND (<VERB? "LOOK">
- <TELL ,EWC-DESC ,LONG-TELL1
- <DPR <FIND-OBJ "CDOOR">>>)>>
- <DEFINE SCORR-ROOM ()
- <COND (<VERB? "LOOK">
- <TELL
- "You are in an east-west corridor which turns north at its eastern
- and western ends. The walls of the corridor are marble. An
- additional passage leads south at the center of the corridor." ,LONG-TELL1>
- <COND (<==? ,LCELL 4>
- <TELL
- "In the center of the north wall of the passage is a bronze door
- which is " 1 <DPR <FIND-OBJ "ODOOR">>>)>)>>
- <DEFINE CELL-DOOR ()
- <COND (<VERB? "OPEN" "CLOSE">
- <OPEN-CLOSE <FIND-OBJ "CDOOR">
- "The wooden door opens."
- "The wooden door closes.">)>>
- <DEFINE BRONZE-DOOR ("AUX" (HERE ,HERE)
- (NCELL? <==? .HERE <FIND-ROOM "NCELL">>))
- #DECL ((NCELL?) <OR ATOM FALSE> (HERE) ROOM)
- <COND (<VERB? "OPEN" "CLOSE">
- <COND (<OR .NCELL?
- <AND <==? ,LCELL 4>
- <OR <==? .HERE <FIND-ROOM "CELL">>
- <==? .HERE <FIND-ROOM "SCORR">>>>>
- <OPEN-CLOSE <FIND-OBJ "ODOOR">
- "The bronze door opens."
- "The bronze door closes.">
- <COND (<AND .NCELL? <VERB? "OPEN">>
- <TELL
- "On the other side of the door is a narrow passage which opens out
- into a larger area.">)
- (T)>)
- (<TELL
- "I see no bronze door here.">)>)>>
- <DEFINE MAYBE-DOOR ()
- <COND (<NOT <TRNN <FIND-OBJ "ODOOR"> ,OPENBIT>>
- <COND (<==? ,LCELL 4>
- <TELL "The bronze door is closed.">)
- (<TELL "You can't go that way.">)>)>>
-
- <DEFINE LOCKED-DOOR ()
- <COND (<VERB? "OPEN">
- <TELL "The door is securely fastened.">)>>
- \
- "=========== The Ultimate Winnage =========="
- <DEFINE NIRVANA ()
- <COND (<VERB? "GO-IN">
- <DCLOSE <FIND-OBJ "ODOOR">>
- <TELL ,WIN-TOTALLY>
- <FINISH (". Won Totally!")>)>>
- \
- "=========== Doing it the Lazy Way ========="
- <DEFINE INCANT ("AUX" (LV ,LEXV) M)
- #DECL ((LV M) <VECTOR [REST STRING]>)
- <COND (<SET M <MEMBER "" .LV>>
- <INCANTATION <REST .M>>)>>
- <SETG SPELL!-FLAG <>>
- <GDECL (XUNM) STRING (WINNERS) <VECTOR [REST STRING]>>
- <DEFINE INCANTATION (LV "AUX" W1 W2 (UNM ,XUNM))
- #DECL ((LV) <VECTOR [REST STRING]> (UNM W1 W2) STRING)
- <COND (<OR ,SPELL!-FLAG <RTRNN <FIND-ROOM "MRANT"> ,RSEENBIT>>
- <TELL
- "Incantations are useless once you have gotten this far.">)
- (<OR <LENGTH? .LV 1> <EMPTY? <SET W1 <1 .LV>>>>
- <TELL "That incantation seems to have been a failure.">)
- (<EMPTY? <SET W2 <2 .LV>>>
- <COND (<AND ,SPELL!-FLAG <N=? .W1 ,SPELL!-FLAG>>
- <TELL "Sorry, only one incantation to a customer.">)
- (<OR ,END-GAME!-FLAG <MEMBER .UNM ,WINNERS>>
- <SET W2 <PW .UNM .W1>>
- <TELL "A hollow voice replies: \"" 0 .W1 " ">
- <TELL .W2 1 "\".">
- <SETG SPELL!-FLAG <STRING .W1>>)
- (<TELL "That spell has no obvious effect.">)>)
- (<OR <=? .W1 <PW .UNM .W2>>
- <=? .W2 <PW .UNM .W1>>>
- <TELL
- "As the last syllable of your spell fades into silence, darkness
- envelops you, and the earth shakes briefly. Then all is quiet.">
- <SETG SPELL!-FLAG <STRING .W1>>
- <ENTER-END-GAME>)
- (<TELL "That spell doesn't appear to have done anything useful.">)>>
- <SETG SWU <IUVECTOR 5 0>>
- <SETG KWU <IUVECTOR 5 0>>
- <SETG STR <ISTRING 5>>
- <DEFINE PW (UNM KEY "AUX" (SU ,SWU) (KU ,KWU) (STR ,STR) USUM)
- #DECL ((UNM KEY STR VALUE) STRING (SU KU) UVECTOR (USUM) FIX)
- <REPEAT ((S .UNM) (SU .SU) (K .KEY) (KU .KU))
- #DECL ((S K) STRING (SU KU) UVECTOR)
- <COND (<EMPTY? .SU> <RETURN T>)>
- <AND <EMPTY? .K> <SET K .KEY>>
- <AND <EMPTY? .S> <SET S .UNM>>
- <PUT .SU 1 <- <ASCII <1 .S>> 64>>
- <PUT .KU 1 <- <ASCII <1 .K>> 64>>
- <SET K <REST .K>>
- <SET S <REST .S>>
- <SET SU <REST .SU>>
- <SET KU <REST .KU>>>
- <SET USUM <+ <MOD <+ !.SU> 8> <* 8 <MOD <+ !.KU> 8>>>>
- <MAPR <>
- <FUNCTION (S) #DECL ((S) STRING) <PUT .S 1 <ASCII 0>>>
- .STR>
- <MAPR <>
- <FUNCTION (SU KU STR "AUX" (S <1 .SU>) (K <1 .KU>))
- #DECL ((SU KU) UVECTOR (STR) STRING (S K) FIX)
- <SET S <CHTYPE <ANDB <XORB <XORB .S .K> .USUM> 31> FIX>>
- <SET USUM <MOD <+ .USUM 1> 32>>
- <COND (<G? .S 26> <SET S <MOD .S 26>>)>
- <AND <0? .S> <SET S 1>>
- <PUT .STR 1 <ASCII <+ .S 64>>>>
- .SU
- .KU
- .STR>
- .STR>
- \
- <DEFINE TURNTO ()
- <COND (<OBJECT-ACTION>)
- (<TELL "That cannot be turned.">)>>
- "=========== CEVENTs and such ============="
- <OR <LOOKUP "COMPILE" <ROOT>>
- <LOOKUP "GROUP-GLUE" <GET INITIAL OBLIST>>
- <PROG ()
- <CEVENT 0 ,MRSWITCH <> "MRINT">
- <CEVENT 0 ,START-END T "STRTE">
- <CEVENT 0 ,MENDS <> "PININ">
- <CEVENT 0 ,INQUISITOR <> "INQIN">
- <CEVENT 0 ,FOLLOW <> "FOLIN">>>
- <GDECL (MRINT STRTE PININ INQIN FOLIN) CEVENT>
|