-
Notifications
You must be signed in to change notification settings - Fork 16
/
defs.zil
351 lines (326 loc) · 7.75 KB
/
defs.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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
"DEFS for
SHOGUN
(c) Copyright 1988 Infocom, Inc. All Rights Reserved."
;"see if we can save some space"
<CHRSET 0 "abcdefghiklmnoprstuwyT.,\"">
<CHRSET 1 "jqvxzABCEGHIJLMNOPRSWY?!'-">
<CHRSET 2 "DFKQUVXZ123[]:;=*()#}>/ ">
<INCLUDE "SYMBOLS">
<COMPILATION-FLAG P-DEBUGGING-PARSER T>
<TELL-TOKENS (CRLF CR) <CRLF>
(NUM N) * <PRINTN .X>
(CHAR CHR C) * <PRINTC .X>
G *:STRING <PRINT .X>
D ,PRSO <DPRINT-PRSO>
D ,PRSI <DPRINT-PRSI>
D * <DPRINT .X>
CD ,PRSO <CDPRINT-PRSO>
CD ,PRSI <CDPRINT-PRSI>
CD * <CDPRINT .X>
THE ,PRSO <THE-PRINT-PRSO>
THE ,PRSI <THE-PRINT-PRSI>
THE * <THE-PRINT .X>
CTHE ,PRSO <CTHE-PRINT-PRSO>
CTHE ,PRSI <CTHE-PRINT-PRSI>
CTHE * <CTHE-PRINT .X>
(A AN) ,PRSO <PRINTA-PRSO>
(A AN) ,PRSI <PRINTA-PRSI>
(A AN) * <PRINTA .X>
(CA CAN) ,PRSO <CPRINTA-PRSO>
(CA CAN) ,PRSI <CPRINTA-PRSI>
(CA CAN) * <CPRINTA .X>
I *:STRING <PRINTUNDER .X>
HIM/HER * <PRINT-HIM/HER .X>
CHE/SHE * <CPRINT-HE/SHE .X>
HE/SHE * <PRINT-HE/SHE .X>
HIS/HER * <PRINT-HIS/HER .X>
IS/ARE * <PRINT-IS/ARE .X>
S * <PRINT-PLURAL .X>>
<REPLACE-DEFINITION BUZZER-WORD?
<ROUTINE BUZZER-WORD? (WD PTR) <>>>
<REPLACE-DEFINITION DIR-VERB-PRSI?
<ROUTINE DIR-VERB-PRSI? (NP) <>>>
<DELAY-DEFINITION GAME-VERB?> ;"to replace parser's versions"
<BLOCK (<ROOT>)>
TELL-CTHE
TELL-THE
THINGS
<ENDBLOCK>
<REPLACE-DEFINITION TELL-THE
<DEFMAC TELL-THE ("ARGS" X) <FORM THE-PRINT !.X>>>
<REPLACE-DEFINITION TELL-CTHE
<DEFMAC TELL-CTHE ("ARGS" X) <FORM CTHE-PRINT !.X>>>
<REPLACE-DEFINITION OWNERS
<CONSTANT OWNERS
<TABLE (PURE LENGTH)
BLACKTHORNE
CHOPSTICKS
CITY
CREWMEN
CROWD
GALLEY
GOD
GRUEL
GYOKO
ISHIDO
KIRITSUBO
LG-ERASMUS
LIZARD
MAPLE-GLADE
MARIKO
MATES
MURA
OMI
PARCHMENT
REEF
SEARCH-PARTY
SEBASTIO
SIGN-OF-CROSS
SPILLBERGEN
STRAIT-OF-MAGELLAN
TORANAGA
VINCK
YABU
YOSHINAKA>>>
<DELAY-DEFINITION READ-INPUT>
<REPLACE-DEFINITION PERSONBIT <CONSTANT PERSONBIT PERSON>>
<REPLACE-DEFINITION NARTICLEBIT <CONSTANT NARTICLEBIT NOTHEBIT>>
<REPLACE-DEFINITION REFRESH
<ROUTINE V-$REFRESH ()
<SETG SHERE <>>
<COND (<NOT <EQUAL? ,P-CAN-UNDO 2>>
<REPAINT-DISPLAY>)
(<EQUAL? ,P-CAN-UNDO 2>
<NORMAL-COLOR>
<SCREEN ,S-FULL>
<NORMAL-COLOR>
<SCREEN 0>
<RESET-MARGIN>
<CLEAR 0>
<UPDATE-STATUS-LINE>
<COND (<EQUAL? ,HERE ,MAZE>
<DISPLAY-MAZE>)>
<COND (<QUEUED? I-SETUP-ANSWER>
<I-SETUP-ANSWER>
;"interrupts won't run")>
<TELL "[UNDO done.]" CR>)>>>
<REPLACE-DEFINITION ROOMSBIT
<CONSTANT ROOMSBIT RLANDBIT>>
<REPLACE-DEFINITION SETUP-ORPHAN-NP
<CONSTANT SETUP-ORPHAN-NP 0>>
<DELAY-DEFINITION STATUS-LINE>
<DELAY-DEFINITION YES?>
<COMPILATION-FLAG P-PS-COMMA T>
<TERMINALS (VERB 6) (NOUN 4) (ADJ 5)
;ADV QUANT MISCWORD
(DIR 1) TOBE QWORD CANDO COMMA
(PARTICLE 3) (PREP 2) ;"keep these two in order! -- SWG"
ASKWORD
COMMA APOSTR OFWORD ARTICLE QUOTE>
<PROPDEF DIRECTIONS <> ;"direction defs for 'rooms-first'"
(DIR TO R:ROOM =
(UEXIT 1) ;444 #SEMI "UNCONDITIONAL EXIT"
(REXIT <ROOM .R>) #SEMI "TO ROOM")
(DIR S:STRING =
(NEXIT 2) ;99 #SEMI "IMPOSSIBLE EXIT"
(NEXITSTR <STRING .S>) #SEMI "FAILURE MESSAGE")
(DIR SORRY S:STRING =
(NEXIT 2) #SEMI "IMPOSSIBLE EXIT"
(NEXITSTR <STRING .S>) #SEMI "FAILURE MESSAGE")
(DIR PER F:FCN =
(FEXIT 3) ;53 #SEMI "CONDITIONAL EXIT"
(FEXITFCN <WORD .F>) #SEMI "PER FUNCTION"
<BYTE 0>)
(DIR TO R:ROOM IF F:GLOBAL "OPT" ELSE S:STRING =
(CEXIT 4) ;7 #SEMI "CONDITIONAL EXIT"
(REXIT <ROOM .R>) #SEMI "TO ROOM"
(CEXITFLAG <GLOBAL .F>) #SEMI "IF FLAG IS TRUE"
(CEXITSTR <STRING .S>) #SEMI "FAILURE MESSAGE")
(DIR TO R:ROOM IF O:OBJECT IS OPEN "OPT" ELSE S:STRING =
(DEXIT 5) ;15 #SEMI "CONDITIONAL EXIT"
(DEXITOBJ <OBJECT .O>) #SEMI "IF DOOR IS OPEN"
(DEXITSTR <STRING .S>) #SEMI "FAILURE MESSAGE"
(DEXITRM <ROOM .R>) #SEMI "TO ROOM")>
<DIRECTIONS NORTH NE EAST SE SOUTH SW WEST NW
UP DOWN IN OUT FORE AFT PORT STARBOARD>
<SETG L-SEARCH-PATH (["P" ""] !,L-SEARCH-PATH)>
<REPLACE-DEFINITION WINNER-SAYS-WHICH?
<ROUTINE WINNER-SAYS-WHICH? (NP)
<RFATAL>>>
<REPLACE-DEFINITION INVALID-OBJECT?
<ROUTINE INVALID-OBJECT? (OBJ)
<COND (<NOT <LOC .OBJ>> <RTRUE>)
(<AND <NOT <IN? .OBJ ,GLOBAL-OBJECTS>>
<NOT <IN? .OBJ ,GENERIC-OBJECTS>>
<NOT <IN-SCENE? .OBJ>>>
<RTRUE>)
(ELSE <RFALSE>)>>>
<REPLACE-DEFINITION VERB-ALL-TEST
<DEFINE VERB-ALL-TEST (O I "AUX" L) ;"O=PRSO I=PRSI"
<SET L <LOC .O>>
<COND (<EQUAL? ,PRSA ,V?DROP ,V?GIVE>
<COND (<AND <EQUAL? .L ,WINNER>
<NOT <FSET? .L ,WEARBIT>>>
<RTRUE>)
(T <RFALSE>)>)
(<EQUAL? ,PRSA ,V?PUT>
<COND (<EQUAL? .O .I>
<RFALSE>)
(<NOT <IN? .O .I>>
<RTRUE>)
(T <RFALSE>)>)
(<EQUAL? ,PRSA ,V?TAKE>
<COND (<FSET? .O ,DONT-ALL> <RFALSE>)
(<FSET? .O ,WEARBIT> <RFALSE>)
(<AND <NOT <FSET? .O ,TAKEBIT>>
<NOT <FSET? .O ,TRYTAKEBIT>>>
<RFALSE>)>
<COND (<NOT <ZERO? .I>>
<COND (<NOT <EQUAL? .L .I>>
<RFALSE>)>)
(<EQUAL? .L ;,WINNER ,HERE>
<RTRUE>)>
<COND (<OR <FSET? .L ,PERSONBIT>
<FSET? .L ,SURFACEBIT>>
<RTRUE>)
(<AND <FSET? .L ,CONTBIT>
<FSET? .L ,OPENBIT>>
<RTRUE>)
(T <RFALSE>)>)
(<AND <EQUAL? ,PRSA ,V?WEAR>
<NOT <FSET? .O ,WEARABLE>>>
<RFALSE>)
(<NOT <ZERO? .I>>
<COND (<NOT <EQUAL? .O .I>>
<RTRUE>)
(T <RFALSE>)>)
(T <RTRUE>)>>>
<REPLACE-DEFINITION SPECIAL-CONTRACTION?
<VOC "FO">
<VOC "C">
<VOC "FOC">
<VOC "SLE">
<ROUTINE SPECIAL-CONTRACTION? (PTR)
<COND (<AND <EQUAL? <ZGET .PTR 0> ,W?FO>
<EQUAL? <ZGET .PTR ,P-LEXELEN> ,W?APOSTROPHE>
<EQUAL? <ZGET .PTR <* 2 ,P-LEXELEN>> ,W?C>>
,W?FOC)
(<AND <EQUAL? <ZGET .PTR 0> ,W?FOC>
<EQUAL? <ZGET .PTR ,P-LEXELEN> ,W?APOSTROPHE>
<EQUAL? <ZGET .PTR <* 2 ,P-LEXELEN>> ,W?SLE>>
,W?FOCSLE)>>>
<REPLACE-DEFINITION SPEAKING-VERB?
<DEFINE SPEAKING-VERB? ("OPT" (A ,PRSA) ;(PER 0))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,DOWN-ARROW "s"
,LEFT-ARROW "w"
,RIGHT-ARROW "e"
;"vt100 keypad keys"
,F1 "examine "
,F2 "take "
,F3 "wear "
,F4 "bow to "
,F5 "turn wheel to "
,F6 "inventory"
,F7 "nw"
,F8 "ne"
,F9 "se"
,F10 "sw"
-1 0
-1 <TABLE "Save Definition File" SOFT-SAVE-DEFS>
-1 <TABLE "Restore Definition File" SOFT-RESTORE-DEFS>
-1 <TABLE "Reset Defaults" SOFT-RESET-DEFAULTS>
-1 <TABLE "Exit" SOFT-EXIT>>>