-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathegg.zil
271 lines (254 loc) · 8.02 KB
/
egg.zil
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
"EGG for
ENCHANTER
Copyright 1983 Infocom, Inc. All Rights Reserved.
"
;"Where, if the player messes up, he gets it all over his face."
<ROOM JEWEL-ROOM
(IN ROOMS)
(DESC "Jewel Room")
(LDESC
"This fabulous room commands a magnificent view of the Lonely Mountain
which lies to the north and west. The room itself is filled with
beautiful chests and cabinets which once contained precious jewels
and other objets d'art. These are empty. Winding stone stairs
lead down to the base of the tower.")
(DOWN TO NW-TOWER)
(FLAGS RLANDBIT ONBIT)
(TEXT "You can see the Lonely Mountain to the northwest.")
(GLOBAL STAIRS MOUNTAIN WINDOW)>
<OBJECT JEWEL-CHESTS
(IN JEWEL-ROOM)
(DESC "collection of chests and cabinets")
(SYNONYM CHEST CHESTS CABINET)
(ADJECTIVE BEAUTIFUL)
(FLAGS NDESCBIT CONTBIT)
(ACTION JEWEL-CHESTS-F)>
<ROUTINE JEWEL-CHESTS-F ()
<COND (<VERB? LOOK-INSIDE EXAMINE>
<TELL "There's nothing inside." CR>)
(<VERB? OPEN CLOSE>
<TELL "Don't bother. There's nothing inside anyway." CR>)
(<VERB? PUT>
<TELL
"A waste of time. You'd probably forget where you put it." CR>)>>
<OBJECT EGG
(IN JEWEL-ROOM)
(DESC "beautiful, ornamented egg")
(FDESC
"There is an ornamented egg here, both beautiful and complex. It is
carefully crafted and bears further examination.")
(SYNONYM EGG)
(ADJECTIVE BEAUTIFUL JEWELLED FABERGE ORNAME)
(FLAGS TAKEBIT CONTBIT TRANSBIT TREASURE)
(SIZE 8)
(CAPACITY 10)
(ACTION EGG-F)>
<OBJECT EGG-KNOB-1
(IN EGG)
(DESC "lapis handle")
(SYNONYM HANDLE)
(ADJECTIVE LAPIS)
(FLAGS NDESCBIT)
(TEXT "turned")
(ACTION EGG-KNOB-F)>
<OBJECT EGG-KNOB-2
(IN EGG)
(DESC "emerald knob")
(SYNONYM KNOB)
(ADJECTIVE EMERALD)
(FLAGS NDESCBIT VOWELBIT)
(TEXT "twisted")
(ACTION EGG-KNOB-F)>
<OBJECT EGG-KNOB-3
(IN EGG)
(DESC "silver slide")
(SYNONYM SLIDE)
(ADJECTIVE SILVER)
(FLAGS NDESCBIT)
(TEXT "shoved")
(ACTION EGG-KNOB-F)>
<OBJECT EGG-KNOB-4
(IN EGG)
(DESC "golden crank")
(SYNONYM CRANK)
(ADJECTIVE GOLDEN)
(FLAGS NDESCBIT)
(TEXT "wound")
(ACTION EGG-KNOB-F)>
<OBJECT EGG-KNOB-5
(IN EGG)
(DESC "diamond-studded button")
(SYNONYM BUTTON)
(ADJECTIVE DIAMOND)
(FLAGS NDESCBIT)
(TEXT "pushed")
(ACTION EGG-KNOB-F)>
<ROUTINE EGG-KNOB-STATE (KNOB "OPTIONAL" (VER? <>))
<COND (<OR .VER? <FSET? .KNOB ,OPENBIT>>
<TELL "The " D .KNOB>
<COND (<FSET? .KNOB ,OPENBIT>
<TELL " has been ">)
(.VER?
<TELL " has not yet been ">)>
<TELL <GETP .KNOB ,P?TEXT> ". ">)>>
<ROUTINE EGG-F ()
<COND (<AND <VERB? LOOK-INSIDE> <NOT <FSET? ,EGG ,OPENBIT>>>
<TELL "The egg isn't open!" CR>)
(<VERB? EXAMINE>
<TELL
"This ornamented egg is both beautiful and complex. The egg itself is
mother-of-pearl, but decorated with delicate gold traceries inlaid with
jewels and other precious metals. On the surface are a lapis handle, an
emerald knob, a silver slide, a golden crank, and a diamond-studded button
carefully and unobtrusively imbedded in the decorations. These various
protuberances are likely to be connected with some machinery inside." CR>
<EGG-KNOB-STATE ,EGG-KNOB-1>
<EGG-KNOB-STATE ,EGG-KNOB-2>
<EGG-KNOB-STATE ,EGG-KNOB-3>
<EGG-KNOB-STATE ,EGG-KNOB-4>
<EGG-KNOB-STATE ,EGG-KNOB-5>
<TELL "The " D ,PRSO " is ">
<COND (<FSET? ,PRSO ,OPENBIT> <TELL "open.">)
(ELSE <TELL "closed.">)>
<CRLF>
<RTRUE>)
(<AND <VERB? PUT> <==? ,PRSI ,EGG>>
<TELL
"You can't put the " D ,PRSO " inside the egg without damaging it." CR>)
(<AND <VERB? REZROV> <NOT <FSET? ,EGG ,OPENBIT>>>
<FSET ,EGG ,OPENBIT>
<SETG SCORE <+ ,SCORE ,EGG-POINT>>
<SETG EGG-POINT 0>
<TELL
"The egg seems to come to life and each piece slides effortlessly in the
correct pattern. The egg opens">
<COND (<IN? ,DAMAGED-SCROLL ,EGG>
<FCLEAR ,DAMAGED-SCROLL ,INVISIBLE>
<THIS-IS-IT ,DAMAGED-SCROLL>
<TELL ", revealing a shredded scroll inside,
nestled among a profusion of shredders, knives, and other sharp instruments,
cunningly connected to the knobs, buttons, etc. on the outside">)>
<TELL "." CR>)
(<AND <VERB? LOOK-INSIDE>
<FSET? ,PRSO ,OPENBIT>
<NOT <FIRST? ,PRSO>>>
<TELL
"On the inside of the egg are many complex cutting devices." CR>)
(<AND <VERB? OPEN> <NOT <FSET? ,EGG ,OPENBIT>>>
<TELL
"That seems to be the problem." CR>)
(<AND <VERB? CLOSE> <FSET? ,EGG ,OPENBIT>>
<FCLEAR ,EGG-KNOB-1 ,OPENBIT>
<FCLEAR ,EGG-KNOB-2 ,OPENBIT>
<FCLEAR ,EGG-KNOB-3 ,OPENBIT>
<FCLEAR ,EGG-KNOB-4 ,OPENBIT>
<FCLEAR ,EGG-KNOB-5 ,OPENBIT>
<TELL
"As you close the egg, all of the pieces slide back into place, locking
it shut." CR>
<FCLEAR ,EGG ,OPENBIT>)
(<VERB? MUNG>
<TELL
"The egg is smashed into little tiny pieces by the force of your blow.">
<COND (<IN? ,DAMAGED-SCROLL ,EGG>
<FCLEAR ,DAMAGED-SCROLL ,INVISIBLE>
<MOVE ,DAMAGED-SCROLL ,SCRAMBLED-EGG>
<TELL
" Inside the now broken egg are the remains of a small spell scroll,
damaged beyond hope of learning.">)>
<CRLF>
<MOVE ,SCRAMBLED-EGG <LOC ,EGG>>
<REMOVE ,EGG>)>>
<ROUTINE EGG-KNOB-F ()
<COND (<VERB? REZROV OPEN TURN MOVE PUSH>
<COND (<FSET? ,PRSO ,OPENBIT>
<TELL "It's already in the open position." CR>)
(ELSE
<FSET ,PRSO ,OPENBIT>
<COND (<VERB? REZROV>
<SETG SCORE <+ ,SCORE ,EGG-POINT>>
<SETG EGG-POINT 0>
<TELL
"The " D ,PRSO " vibrates, moving this way and that, becoming almost
plastic, and finally moves to the open position." CR>)
(<FSET? ,EGG ,OPENBIT>
<TELL
"The " D ,PRSO " moves, and a cunning and diabolically engineered set
of gears, knives, grinders, and slicers moves across the interior of the
egg." CR>
<COND (<IN? ,DAMAGED-SCROLL ,EGG>
<TELL
"The scroll resting there is now shredded beyond recognition." CR>)>
<RTRUE>)
(ELSE
<TELL
"The " D ,PRSO " moves to the open position, after some resistance and
a few odd noises from some machinery which resides inside the egg." CR>
<COND (<AND <FSET? ,EGG-KNOB-1 ,OPENBIT>
<FSET? ,EGG-KNOB-2 ,OPENBIT>
<FSET? ,EGG-KNOB-3 ,OPENBIT>
<FSET? ,EGG-KNOB-4 ,OPENBIT>
<FSET? ,EGG-KNOB-5 ,OPENBIT>>
<SETG SCORE <+ ,SCORE ,EGG-POINT>>
<SETG EGG-POINT 0>
<FSET ,EGG ,OPENBIT>
<TELL "The egg falls open">
<COND (<IN? ,DAMAGED-SCROLL ,EGG>
<FCLEAR ,DAMAGED-SCROLL ,INVISIBLE>
<THIS-IS-IT ,DAMAGED-SCROLL>
<TELL
", revealing a shredded scroll inside">)>
<TELL "." CR>)>
<RTRUE>)>)>)
(<VERB? TAKE>
<TELL
"The " D ,PRSO " is an integral part of the egg and thus cannot be taken." CR>)
(<VERB? EXAMINE>
<EGG-KNOB-STATE ,PRSO T>
<CRLF>)
(<VERB? CLOSE>
<COND (<FSET? ,PRSO ,OPENBIT>
<TELL
"The " D ,PRSO " closes easily, but more noises issue from the interior." CR>
<FCLEAR ,PRSO ,OPENBIT>)
(ELSE
<TELL "It's already closed." CR>)>)
(<VERB? MUNG>
<PERFORM ,V?MUNG ,EGG>
<RTRUE>)>>
<OBJECT SCRAMBLED-EGG
(DESC "scrambled egg")
(SYNONYM EGG)
(ADJECTIVE BROKEN SCRAMBLED)
(FLAGS TAKEBIT CONTBIT OPENBIT)
(ACTION SCRAMBLED-EGG-F)
(CAPACITY 10)>
<ROUTINE SCRAMBLED-EGG-F ("AUX" (L <LOC ,SCRAMBLED-EGG>) F)
<COND (<VERB? KREBF>
<COND (<SET F <FIRST? ,SCRAMBLED-EGG>>
<MOVE .F ,EGG>)>
<THIS-IS-IT ,EGG>
<REMOVE ,SCRAMBLED-EGG>
<MOVE ,EGG .L>
<TELL
"The egg is returned to its former pristine beauty!" CR>)>>
<OBJECT DAMAGED-SCROLL
(IN EGG)
(DESC "shredded scroll")
(SYNONYM SCROLL)
(ADJECTIVE SHREDDED)
(TEXT
"The scroll is damaged beyond readability. You can make out the word
\"summon,\" in the title, but that's all.")
(ACTION DAMAGED-SCROLL-F)
(FLAGS TAKEBIT READBIT INVISIBLE)>
<ROUTINE DAMAGED-SCROLL-F ("AUX" (L <LOC ,DAMAGED-SCROLL>))
<COND (<VERB? KREBF>
<REMOVE ,DAMAGED-SCROLL>
<MOVE ,SUMMON-SCROLL .L>
<THIS-IS-IT ,SUMMON-SCROLL>
<SETG SCORE <+ ,SCORE ,REPAIR-POINT>>
<SETG REPAIR-POINT 0>
<TELL
"The scroll reforms, its slices and cuts rejoining, until there is a
whole scroll, somewhat faded, in its place!" CR>)>>