"TERROR for
ENCHANTER
(c) Copyright 1983 Infocom, Inc. All Rights Reserved.
"
<OBJECT TERROR
(DESC "lurking evil presence")
(SYNONYM TERROR PRESENCE FORCE)
(ADJECTIVE STALKING EVIL LURKING UNSEEN)
(GLOBAL TERROR)
<ROUTINE TERROR-F ()
<COND (<VERB? ZIFMIA>
<TELL
"As you cast the zifmia spell, you are overpowered with such a sense of
malice that you cannot continue. All in all, a good thing probably." CR>)
(<VERB? VAXUM>
<TELL
"The terror may be friendlier, but with friends like that...." CR>)
(<VERB? GUNCHO>
<TELL
"The room fills with a horrible noise, darkens to pitch blackness, and
then lightens. The weight of fear lifts." CR>)>>
<OBJECT TMAP
(DESC "map")
(FDESC
"Lying on the ground is an old parchment map.")
(SYNONYM MAP)
(ADJECTIVE OLD PARCHMENT)
(CAPACITY 100)
<OBJECT PENCIL
(DESC "badly worn pencil")
(FDESC
"In one corner of the room is a badly worn pencil, inscribed with runes.")
(SYNONYM PENCIL ERASER RUNES)
(ADJECTIVE BADLY WORN)
(TEXT
"It says \"Frobozz Magic Pencil Company.\" Some sort of joke, probably.")
<ROUTINE TMAP-F ()
<COND (<VERB? KULCAD>
<TELL
"At once, a maze of lines forms, connecting all of the spots on the map.
Suddenly, the world becomes still and cold." CR CR>
<RTRUE>)
(<VERB? OPEN CLOSE PUT>
<TELL "You can't do that." CR>)
(<VERB? DRAW-ON>
<RTRUE>)
(T
<TELL "You have nothing to draw with." CR>)>)
(<VERB? READ EXAMINE LOOK-INSIDE>
<TELL
"The map consists of a drawing with nine points, each represented by
a strange character, with interconnecting thin pencil lines. Using your
native alphabet, it looks like this:" CR>
<GLOBAL PENCIL-COUNT 2>
<GLOBAL ERASER-COUNT 2>
<GLOBAL PENCIL-TBL
<TABLE "gone" "very nearly gone" "nearly gone">>
<GLOBAL ERASER-TBL
<TABLE "not fit for use" "barely usable" "negligible">>
<ROUTINE PENCIL-F ()
<COND (<VERB? KULCAD>
<TELL
"As the pencil dissolves into nothingness, everything becomes still
and cold." CR CR>
<RTRUE>)
(<VERB? EXAMINE>
<TELL
"The pencil is very old and covered with finely inlaid runes. The point is
">
" and the attached eraser is "
"." CR>)>>
The maze rooms are lettered T-A to T-I. Why do the POINTBIT objects have apparently random letters? Because they have to avoid single-letter words already in use by the parser. E and D are directions; I and G are verb abbreviations; A is a common article.
<OBJECT POINT-B
(DESC "point B")
(SYNONYM B)
(ADJECTIVE POINT)
(POINT 1)>
<OBJECT POINT-R
(DESC "point R")
(SYNONYM R)
(ADJECTIVE POINT)
(POINT 2)>
<OBJECT POINT-K
(DESC "point K")
(SYNONYM K)
(ADJECTIVE POINT)
(POINT 3)>
<OBJECT POINT-H
(DESC "point H")
(SYNONYM H)
(ADJECTIVE POINT)
(POINT 4)>
<OBJECT POINT-J
(DESC "point J")
(SYNONYM J)
(ADJECTIVE POINT)
(POINT 5)>
<OBJECT POINT-M
(DESC "point M")
(SYNONYM M)
(ADJECTIVE POINT)
(POINT 6)>
<OBJECT POINT-V
(DESC "point V")
(SYNONYM V)
(ADJECTIVE POINT)
(POINT 7)>
<OBJECT POINT-F
(DESC "point F")
(SYNONYM F)
(ADJECTIVE POINT)
(POINT 8)>
<OBJECT POINT-P
(DESC "point P")
(SYNONYM P)
(ADJECTIVE POINT)
(POINT 9)>
<CONSTANT T-NW 1>
<CONSTANT T-WEST 3>
<CONSTANT T-SW 5>
<CONSTANT T-SOUTH 7>
<CONSTANT T-SE 9>
<CONSTANT T-EAST 11>
<CONSTANT T-NE 13>
<CONSTANT T-NORTH 15>
<GLOBAL T-DIR-TABLE <TABLE 0 0 0 0 0 "/" 0 "!" 0 "\\">>
<ROOM T-A
(DESC "Translucent Room")
(TMAZE <TABLE
(CAPACITY 1)
<ROOM T-B
(DESC "Translucent Room")
(TMAZE <TABLE
0 0 0 0 0 0 0 0
(CAPACITY 2)
<ROOM T-C
(DESC "Translucent Room")
(TMAZE <TABLE
(CAPACITY 3)
<ROOM T-D
(DESC "Translucent Room")
(TMAZE <TABLE
(CAPACITY 4)
<ROOM T-E
(DESC "Translucent Room")
(TMAZE <TABLE
(CAPACITY 5)
<ROOM T-F
(DESC "Translucent Room")
(TMAZE <TABLE
(CAPACITY 6)
<ROOM T-G
(DESC "Translucent Room")
(TMAZE <TABLE
(CAPACITY 7)
<ROOM T-H
(DESC "Translucent Room")
(TMAZE <TABLE
0 0 0 0 0 0 0 0 -1>)
(CAPACITY 8)
<ROOM T-I
(DESC "Translucent Room")
(TMAZE <TABLE
(CAPACITY 9)
<GLOBAL TMAZE-DIRS <TABLE "northwest" "west" "southwest" "south"
"southeast" "east" "northeast" "north">>
<OBJECT BLACK-PASSAGE
(DESC "black passage")
(SYNONYM PASSAGE)
(ADJECTIVE BLACK)
<ROUTINE BLACK-PASSAGE-F ()
<COND (<VERB? EXAMINE>
<TELL
"The passages are perfectly round and black; the walls seem to be made of
carbon." CR>)>>
<ROUTINE TMAZE-F (RARG "AUX" TBL (NEX 0) (FLG <>) (OFFS 0) (PLU <>))
<TELL
"You hear a horrible anguished scream through the walls of the cavern as the
terror realizes that it is trapped and its scroll of power stolen!" CR CR>
<TELL
"This is a peculiar room, whose cream-colored walls are thin and
translucent." CR>
<REPEAT ()
<COND (<EQUAL? <GET .TBL .OFFS> -1>
<RETURN>)
(<EQUAL? <GET .TBL <+ .OFFS 1>> 1>
<SET NEX <+ .NEX 1>>)>
<SET OFFS <+ .OFFS 2>>>
<COND (<EQUAL? .NEX 0>
<TELL
"There is not a single exit from this place." CR>
<RTRUE>)
(<EQUAL? .NEX 1>
<TELL
"An exit is">)
(T
<SET PLU T>
<TELL
"Passages go">)>
<TELL " to the ">
<SET OFFS 0>
<REPEAT ()
<COND (<EQUAL? <GET .TBL .OFFS> -1>
<RETURN>)
(<EQUAL? <GET .TBL <+ .OFFS 1>> 1>
<COND (<G? .NEX 2>
<SET FLG T>
<TELL ", ">)
(<EQUAL? .NEX 2>
<COND (.FLG <TELL ",">)>
<TELL " and ">)>
<SET NEX <- .NEX 1>>)>
<SET OFFS <+ .OFFS 2>>>
<TELL "
and ">
<COND (.PLU <TELL "they are">)
(T <TELL "it is">)>
<TELL
" very strange indeed, perfectly round and black as pitch." CR>)
<COND (<VERB? WALK>
<TELL
"Your feet are leaden with fear, and cold sweat runs down your back as you
make your way to the door, but you make no progress. Your mind tells you
you are running, but you aren't getting anywhere." CR>)>)
(<VERB? WALK>
<RTRUE>)
<SET OFFS
2>
1>>>
1>>
<GOTO <GET .TBL <- .OFFS 1>>>
<TELL
"An evil presence pervades the room, its source unseen. Fear seeps into
your mind, like fog. You look fearfully around. There is something
horrible here." CR>)
<TELL
"You sense that near this place an evil presence lurks. It seems close by
and is moving." CR>)>
<RTRUE>)
(T
<TELL "You can't go that way." CR>)>)>)>>
<ROUTINE END-OF-WORLD ()
<TELL
"You suddenly feel weak and your knees buckle. Just as you collapse to the
ground, you find yourself in the presence of the Circle. They seem tense
and frightened and ask desperately about your recent doings. As you tell
your tale of the map and pencil, they recoil in horror. \"The Terror is
released!\" cries one. Belboz sinks into his throne. \"We are doomed!\"
he gasps. One by one, the wizards flee to prepare a hopeless defense." CR>
<ROUTINE DRAW-TMAZE ()
<TELL CR "B">
<TELL "J" CR>
<TELL " ">
<CRLF>
<TELL " ">
<TELL " ">
<TELL " ">
<TELL " ">
<CRLF>
<TELL " ">
<TELL " ">
<TELL " ">
<TELL " ">
<CRLF>
<TELL " K">
<TELL "V" CR>
<TELL " ">
<TELL " ">
<TELL " ">
<CRLF>
<TELL " ">
<TELL " ">
<TELL " ">
<TELL " ">
<TELL " ">
<TELL " ">
<TELL " ">
<CRLF>
<TELL " ">
<TELL " ">
<TELL " ">
<TELL " ">
<CRLF>
<TELL "R">
<TELL "M">
<TELL "F">
<TELL CR " ">
<TELL " ">
<TELL " ">
<TELL " ">
<TELL " ">
<TELL " ">
<TELL CR " ">
<TELL " ">
<TELL " ">
<TELL " ">
<TELL " ">
<TELL " ">
<TELL CR " ">
<TELL " ">
<TELL CR " H">
<TELL "P" CR CR>
<RTRUE>>
<ROUTINE FIXED-FONT-ON () <PUT 0 8 <BOR <GET 0 8> 2>>>
<ROUTINE FIXED-FONT-OFF() <PUT 0 8 <BAND <GET 0 8> -3>>>
<ROUTINE CN (L DIR)
<COND (<NOT <0? <GET <GETP .L ,P?TMAZE> .DIR>>>
(T <TELL " ">)>>
<ROUTINE ECN (L DN "AUX" (FLG <>))
<SET FLG T>
<TELL "---">)
(T <TELL " ">)>
<COND (.FLG <TELL "+">)
(T <TELL "!">)>)
(.FLG <TELL "-">)
(T <TELL " ">)>
<COND (.FLG <TELL "---">)
(T <TELL " ">)>>
Connect two points on the TMAP. This calls itself with the arguments reversed so that the connection is two-way.
This also clears TERROR-TRAPPED and starts the I-TERROR timer, if it isn’t already running.
<ROUTINE CONNECT (RM1 RM2 "OPTIONAL" (FLIP <>) "AUX" TBL RMX)
<REPEAT ()
<COND (<EQUAL? <SET RMX <GET .TBL 0>> -1>
<TELL
"The pencil doesn't seem to allow that line to be drawn." CR>
<RTRUE>)
(<EQUAL? .RMX .RM2>
<COND (<0? <GET .TBL 1>>
<COND (<NOT .FLIP>
<CONNECT .RM2 .RM1 T>
<TELL
"A thin line now connects the two spots on the map, but the
<COND (<EQUAL? ,HERE .RM1 .RM2>
<PUT .TBL 1 1>
(T
<TELL
"There is already a line connecting those spots." CR>)>
<RTRUE>)>
<SET TBL <REST .TBL 4>>>>
Disconnect two points on the TMAP. This calls itself with the arguments reversed so that the disconnection is two-way.
<ROUTINE DISCONNECT (RM1 RM2 "OPTIONAL" (FLIP <>) "AUX" TBL RMX)
<REPEAT ()
<COND (<EQUAL? <SET RMX <GET .TBL 0>> -1>
<TELL
"Those two spots aren't connected on the map." CR>
<RTRUE>)
(<EQUAL? .RMX .RM2>
<COND (<0? <GET .TBL 1>>
<TELL
"Those two spots aren't connected on the map." CR>)
(T
<COND (<NOT .FLIP>
<DISCONNECT .RM2 .RM1 T>
<TELL
"The line between the two spots is erased, leaving the eraser
<COND (<EQUAL? ,HERE .RM1 .RM2>
.RM2
<>>)>)>
<PUT .TBL 1 0>)>
<RTRUE>)>
<SET TBL <REST .TBL 4>>>>
<ROUTINE DESCRIBE-NEW-EXIT (RM1 RM2 "OPTIONAL" (MAKE? T)
"AUX" TMP TBL (OFFS 0))
<COND (<EQUAL? .RM2 ,HERE>
<SET TMP .RM1>
<SET RM1 .RM2>
<SET RM2 .TMP>)>
<REPEAT ()
<COND (<EQUAL? <SET TMP <GET .TBL .OFFS>> .RM2>
<RETURN>)
(<EQUAL? .TMP -1>
<TELL "*ERROR* BAD-EXIT DESCRIBE-NEW-EXIT" CR>
<RETURN>)
(T
<SET OFFS <+ .OFFS 2>>)>>
<TELL "Suddenly, the ">
<COND (.MAKE? <TELL "wall">)
(T <TELL "black passage">)>
<TELL " to the ">
<COND (.MAKE?
<TELL " opens to form a perfectly round and black passage">)
(T
<TELL " closes off">)>
<TELL "!" CR>>
Check if two maze rooms are adjacent and connected by a single drawn line.
<ROUTINE CONNECTED? (RM1 RM2 "AUX" TBL RMX)
<COND (<NOT .TBL> <RFALSE>)>
<REPEAT ()
<COND (<EQUAL? <SET RMX <GET .TBL 0>> -1>
<RFALSE>)
(<EQUAL? .RMX .RM2>
<COND (<0? <GET .TBL 1>>
<RFALSE>)
(T
<RTRUE>)>)>
<SET TBL <REST .TBL 4>>>>
<GLOBAL TWAIT 0>
<GLOBAL TERROR-ARRIVES
"An evil presence, borne on a cold blast of air, seems to move beside
you, weighing you down with emanations of malice and hatred. A cold fear
covers you like fog.">
<GLOBAL TERROR-MOVED <>>
Move the TERROR, if possible. This runs every turn after you first use the PENCIL.
If TERROR-TRAPPED is false, this attempts to compute a path towards the exit. If there is none, TERROR-TRAPPED is set true.
If TERROR-TRAPPED is true, and you are adjacent to the Terror, it jumps you. Otherwise, it stays put.
<ROUTINE I-TERROR ("AUX" RM NRM (FLG <>))
<COND (<EQUAL? ,HERE .NRM>
<SET FLG T>)
<TELL
"Somewhere near, an evil presence lurks, probing your mind. It
seems to be moving quickly." CR>
<SET FLG T>)
<TELL
"You can no longer sense the evil presence nearby." CR>
<SET FLG T>)>
<SET FLG T>
<TELL
"You feel that two powerful, evil forces are searching each other out.
As they meet, the air lightens. Belboz appears before you. \"Something
has disturbed the ancient Terror. Krill himself knows this and will try
to use it to his purposes. Already, they may have joined together. You
must not allow the Terror to escape, or we are all doomed!\" He fades into
the gloom." CR>)>
<COND (<EQUAL? .NRM ,T-A>
<SET FLG T>
<TELL
"The presence seems to grow stronger each passing second,
beating you down with its awesome power." CR>)
(T
<SET FLG T>
<TELL
"At once, a strange and horrible feeling wells up inside of you.
An unseen yet awesomely powerful force, exuding pure evil, seems
to fill the very chamber." CR>)>)>
.FLG)
<RTRUE>)
(T
<COND (<EQUAL? .NRM ,T-I> <RTRUE>)
>
(T
<TELL
"From somewhere nearby, an unseen force probes you, and you are gripped
by a sickening feeling." CR>)>
<RTRUE>)>>
Whether the TERROR is stuck in the maze (with no path to the exit). The I-TERROR timer routine uses this as a shortcut; if the flag is set, it doesn’t bother with path computation.
This is set if a path computation fails. It’s cleared when you draw a pencil line; that’s what sets the Terror in motion (or at least it tries).
<GLOBAL TERROR-TRAPPED <>>
Lists of which rooms connect to which other rooms. (Except for T-A. Once the Terror reaches there, the world ends, so it doesn’t have to move any more!)
This is a static table; it lists all potential connections, drawn or undrawn. The “drawn” flags are kept in the TMAZE property for each room. (That property also lists the potential connections, so TWALK-PATHS is redundant, but it’s handy for the TWALK routine.)
<GLOBAL TWALK-PATHS
<LTABLE <LTABLE>
<LTABLE 1 3 4 6>
<LTABLE 1 2 5 6 7 4>
<LTABLE 2 3 6 9>
<LTABLE 1 3 6 7>
<LTABLE 3 5 2 4 7 8 9>
<LTABLE 5 3 6 8 9>
<LTABLE 6 7 9>
<LTABLE 4 6 7 8>>>
<ROUTINE TNULL-F ()
<RFALSE>>
Compute a path from a given room to the exit. (The given room is always the TERROR’s location, but the TWALK logic is general.) Returns true if such a path exists; the route is stored in PATH-TBL.
PATH-OUT? does the heavy lifting.
<ROUTINE TWALK (RM)
<GLOBAL TTRIES 0>
The start point of the route search. This is set when TWALK is called.
<GLOBAL PSTART <>>
<CONSTANT TWALK-MAX 5>
<GLOBAL PATH-TBL <TABLE 0 0 0 0 0 0 0>>
<GLOBAL TWALK-LEVEL 0>
If the TERROR’s location is connected to any room, this returns one of them. If not, it returns false.
I think this was intended to make the Terror wander in frustration if it had no exit path. It is still called from I-TERROR, but the line that makes use of the result is commented out.
<ROUTINE TWALK1 ("AUX" TBL RM NRM (OFFS 1) CNT)
<SET CNT <GET .TBL 0>>
<REPEAT ()
<COND (<G? .OFFS .CNT>
<RFALSE>)
<GET .TBL .OFFS>>>>
<RETURN .NRM>)>
<SET OFFS <+ .OFFS 1>>>>
A recursive routine which finds a route from PSTART to the exit. Returns true if such a path exists; the route is stored in PATH-TBL.
Used by TWALK.
<ROUTINE PATH-OUT? (RM "AUX" (OFFS 1) TBL (CNT 0) NRM)
<RTRUE>)
<RFALSE>)>
<COND (<0? <SET CNT <GET .TBL 0>>>
<RTRUE>)>
<REPEAT ()
<COND (<G? .OFFS .CNT>
<RFALSE>)
<GET .TBL .OFFS>>>>
<PATH-OUT? .NRM>>
<RTRUE>)>
<SET OFFS <+ .OFFS 1>>>>
<OBJECT LEGEND-BOOK
(DESC "dusty book")
(SYNONYM BOOK PAGE)
(ADJECTIVE OLD DUSTY FIRST LEGEND)
(FDESC
"Amid the tubes is an old and dusty book.")
(SIZE 6)
<ROUTINE LEGEND-BOOK-F ()
<COND (<AND <VERB? CLOSE>
<TELL
"Closed." CR>)
(<VERB? READ EXAMINE LOOK-INSIDE OPEN>
<TELL
"The first page of the book was the table of contents. Only two chapter names
can be read: The Legend of the Unseen Terror and The Legend of the Great
Implementers." CR>)
(<VERB? TURN>
<TELL
"Rather than turning pages, why don't you simply read the legends." CR>)>>
<OBJECT LEGEND-ONE
(DESC "Legend of the Unseen Terror")
(SYNONYM LEGEND TERROR)
(ADJECTIVE UNSEEN)
(TEXT
"This legend, written in an ancient tongue, goes something like this:
At one time a shapeless and formless manifestation of evil was disturbed
from millenia of sleep. It was so powerful that it required the combined
wisdom of the leading enchanters of that age to conquer it. The legend tells
how the enchanters lured the Terror \"to a recess deep within the earth\" by
placing there a powerful spell scroll. When it had reached the scroll, the
enchanters trapped it there with a spell that encased it in the living
rock. The Terror was so horrible that none would dare speak of it. A comment
at the end of the narration indicates that the story is considered to be quite
fanciful; no other chronicles of the age mention the Terror in any form.")>
<OBJECT LEGEND-TWO
(DESC "Legend of the Great Implementers" )
(SYNONYM LEGEND IMPLEMENTERS)
(ADJECTIVE GREAT)
(TEXT
"This legend, written in an ancient tongue, speaks of the creation
of the world. A more absurd account can hardly be imagined. The universe,
it seems, was created by \"Implementers\" who directed the running of great
engines. These engines produced this world and others, strange and wondrous,
as a test or puzzle for others of their kind. It goes on to state that these
beings stand ready to aid those entrapped within their creation. The great
magician-philosopher Helfax notes that a creation of this kind is morally
and logically indefensible and discards the theory as \"colossal claptrap
and kludgery.\"")
<ROUTINE LEGEND-TWO-F ()
<COND (<AND <VERB? ZIFMIA> <NOT ,IMP-SEEN>>
<TELL
"The implementers of the world, Marc Blank and Dave Lebling, appear before
you, looking quite as confused as yourself. They speak:|
Dave: \"What's happening here?\"|
Marc: \"Uh, I dunno. YOU wrote this code, not me.\"|
Dave: \"Hmm. Another day, another bug. Let's see here...\"|
They disappear a moment later.|
Dave's voice: \"That should do it.\"" CR>)>>