-
Notifications
You must be signed in to change notification settings - Fork 8
/
tells.zil
332 lines (285 loc) · 8.52 KB
/
tells.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
"TELLS (formerly GMACROS) for
The Zork Trilogy
(c) Copyright 1983 Infocom, Inc. All Rights Reserved
-- GERMAN EDITION"
<SETG C-ENABLED? 0>
<SETG C-ENABLED 1>
<SETG C-DISABLED 0>
<TELL-TOKENS (CRLF CR) <CRLF>
D * <DPRINT .X <>>
N * <PRINTN .X>
C * <PRINTC .X>
DER-NOM * <DER-NOM-PRINT .X>
DER-NOM-CAP * <DER-NOM-CAP-PRINT .X>
DER-ACC * <DER-ACC-PRINT .X>
DER-ACC-CAP * <DER-ACC-CAP-PRINT .X>
DER-DAT * <DER-DAT-PRINT .X>
EIN-NOM * <EIN-NOM-PRINT .X>
EIN-NOM-CAP * <EIN-NOM-CAP-PRINT .X>
EIN-ACC * <EIN-ACC-PRINT .X>
EIN-ACC-CAP * <EIN-ACC-CAP-PRINT .X>
EIN-DAT * <EIN-DAT-PRINT .X>
PRONOUN-NOM * <PRONOUN-NOM-PRINT .X>
PRONOUN-NOM-CAP * <PRONOUN-NOM-CAP-PRINT .X>
PRONOUN-ACC * <PRONOUN-ACC-PRINT .X>>
;"German character names. For non-C64 machines, the font is switched to
font-3 then these chars. below are printed, then, the font is switched
back to font-1, the default font."
;"I could have special umlaut-descs and no pure strings in the game -- but
still there would have to be this switching of fonts WITHIN a word. Which
must be done in some funny TELL routine."
;"Or I could be REALLY REALLY disgusting and have 3 descs for an object --
the first half of the word, the flavor of umlaut, then the last half
of the word."
<ROUTINE DO-CURSET (Y X)
<COND (<EQUAL? 1 ,CWIDTH ,CHEIGHT>
<CURSET .Y .X>
<RFALSE>)
(T
<SET X <* .X ,CWIDTH>>
<CURSET <* .Y ,CHEIGHT> .X>
<RFALSE>)>>
;"CASE : DER = NOM / DEN = ACC / DEM = DAT
EIN = NOM / EINEN = ACC / EINEM = DAT"
<ROUTINE DPRINT (OBJ CASE)
<COND (<GETP .OBJ ,P?ADJDESC>
<TELL <GETP .OBJ ,P?ADJDESC>>
<COND ;"is a Der-word"
(<EQUAL? .CASE ,W?DER ,W?DEN ,W?DEM>
<COND (<OR <EQUAL? .CASE ,W?DER>
<AND <EQUAL? .CASE ,W?DEN>
;<EQUAL? <GETP .OBJ ,P?GENDER> ,W?DER>
<NOT <FSET? .OBJ ,DERBIT>>>>
<PRINTI "e">)
(T
<PRINTI "en">)>)
;"is an Ein-word"
(;<EQUAL? <GETP .OBJ ,P?GENDER> ,W?DER>
<FSET? .OBJ ,DERBIT>
<PRINTI "er">)
(<AND ;<EQUAL? <GETP .OBJ ,P?GENDER> ,W?DAS>
<FSET? .OBJ ,DASBIT>
<NOT <EQUAL? .CASE ,W?EINEM>>>
<PRINTI "es">)
(<AND ;<EQUAL? <GETP .OBJ ,P?GENDER> ,W?DIE>
<FSET? .OBJ ,DIEBIT>
<EQUAL? .CASE ,W?EINEM>>
<PRINTI "e">)
(T
<PRINTI "en">)>
<TELL " ">)>
<PRINTD .OBJ>>
;<ROUTINE IS-FEM? (OBJ)
<COND (<AND <NOT <FSET? .OBJ ,DERBIT>>
<NOT <FSET? .OBJ ,DASBIT>>>
<RTRUE>)
(T
<RFALSE>)>>
<ROUTINE DER-NOM-PRINT (OBJ)
<COND (<FSET? .OBJ ,DERBIT>
<TELL "der ">)
(<FSET? .OBJ ,DIEBIT>
<TELL "die ">)
(<FSET? .OBJ ,DASBIT>
<TELL "das ">)>
<DPRINT .OBJ ,W?DER>>
<ROUTINE DER-NOM-CAP-PRINT (OBJ)
<COND (<FSET? .OBJ ,DERBIT>
<TELL "Der ">)
(<FSET? .OBJ ,DIEBIT>
<TELL "Die ">)
(<FSET? .OBJ ,DASBIT>
<TELL "Das ">)>
<DPRINT .OBJ ,W?DER>>
<ROUTINE DER-ACC-PRINT (OBJ)
<COND (<FSET? .OBJ ,DERBIT>
<TELL "den ">)
(<FSET? .OBJ ,DIEBIT>
<TELL "die ">)
(<FSET? .OBJ ,DASBIT>
<TELL "das ">)>
<DPRINT .OBJ ,W?DEN>>
<ROUTINE DER-ACC-CAP-PRINT (OBJ)
<COND (<FSET? .OBJ ,DERBIT>
<TELL "Den ">)
(<FSET? .OBJ ,DIEBIT>
<TELL "Die ">)
(<FSET? .OBJ ,DASBIT>
<TELL "Das ">)>
<DPRINT .OBJ ,W?DEN>>
<ROUTINE DER-DAT-PRINT (OBJ)
<COND (<OR <FSET? .OBJ ,DERBIT>
<FSET? .OBJ ,DASBIT>>
<TELL "dem ">)
(<FSET? .OBJ ,DIEBIT>
<TELL "der ">)>
<DPRINT .OBJ ,W?DEM>>
<ROUTINE EIN-NOM-PRINT (OBJ)
<COND (<OR <FSET? .OBJ ,DERBIT>
<FSET? .OBJ ,DASBIT>>
<TELL "ein ">)
(<FSET? .OBJ ,DIEBIT>
<TELL "eine ">)>
<DPRINT .OBJ ,W?EIN>>
<ROUTINE EIN-NOM-CAP-PRINT (OBJ)
<COND (<OR <FSET? .OBJ ,DASBIT>
<FSET? .OBJ ,DERBIT>>
<TELL "Ein ">)
(<FSET? .OBJ ,DIEBIT>
<TELL "Eine ">)>
<DPRINT .OBJ ,W?EIN>>
<ROUTINE EIN-ACC-PRINT (OBJ)
<COND (<FSET? .OBJ ,DERBIT>
<TELL "einen ">)
(<FSET? .OBJ ,DIEBIT>
<TELL "eine ">)
(<FSET? .OBJ ,DASBIT>
<TELL "ein ">)>
<DPRINT .OBJ ,W?EINEN>>
<ROUTINE EIN-ACC-CAP-PRINT (OBJ)
<COND (<FSET? .OBJ ,DERBIT>
<TELL "Einen ">)
(<FSET? .OBJ ,DIEBIT>
<TELL "Eine ">)
(<FSET? .OBJ ,DASBIT>
<TELL "Ein ">)>
<DPRINT .OBJ ,W?EINEN>>
<ROUTINE EIN-DAT-PRINT (OBJ)
<COND (<OR <FSET? .OBJ ,DERBIT>
<FSET? .OBJ ,DASBIT>>
<TELL "einem ">)
(<FSET? .OBJ ,DIEBIT>
<TELL "einer ">)>
<DPRINT .OBJ ,W?EINEM>>
<ROUTINE PRONOUN-NOM-PRINT (OBJ)
<COND (<FSET? .OBJ ,DERBIT>
<TELL "er">)
(<FSET? .OBJ ,DASBIT>
<TELL "es">)
(<FSET? .OBJ ,DIEBIT>
<TELL "sie">)
(T
<TELL "es">)>>
<ROUTINE PRONOUN-NOM-CAP-PRINT (OBJ)
<COND (<FSET? .OBJ ,DERBIT>
<TELL "Er">)
(<FSET? .OBJ ,DIEBIT>
<TELL "Sie">)
(T
<TELL "Es">)>>
<ROUTINE PRONOUN-ACC-PRINT (OBJ)
<COND (<FSET? .OBJ ,DERBIT>
<TELL "ihn">)
(<FSET? .OBJ ,DIEBIT>
<TELL "sie">)
(T
<TELL "es">)>>
<DEFMAC VERB? ("ARGS" ATMS)
<MULTIFROB PRSA .ATMS>>
<DEFMAC PRSO? ("ARGS" ATMS)
<MULTIFROB PRSO .ATMS>>
<DEFMAC PRSI? ("ARGS" ATMS)
<MULTIFROB PRSI .ATMS>>
<DEFMAC ROOM? ("ARGS" ATMS)
<MULTIFROB HERE .ATMS>>
<DEFINE MULTIFROB (X ATMS "AUX" (OO (OR)) (O .OO) (L ()) ATM)
<REPEAT ()
<COND (<EMPTY? .ATMS>
<RETURN!- <COND (<LENGTH? .OO 1> <ERROR .X>)
(<LENGTH? .OO 2> <NTH .OO 2>)
(ELSE <CHTYPE .OO FORM>)>>)>
<REPEAT ()
<COND (<EMPTY? .ATMS> <RETURN!->)>
<SET ATM <NTH .ATMS 1>>
<SET L
(<COND (<TYPE? .ATM ATOM>
<FORM GVAL
<COND (<==? .X PRSA>
<PARSE
<STRING "V?"
<SPNAME .ATM>>>)
(ELSE .ATM)>>)
(ELSE .ATM)>
!.L)>
<SET ATMS <REST .ATMS>>
<COND (<==? <LENGTH .L> 3> <RETURN!->)>>
<SET O <REST <PUTREST .O (<FORM EQUAL? <FORM GVAL .X> !.L>)>>>
<SET L ()>>>
<DEFMAC BSET ('OBJ "ARGS" BITS)
<MULTIBITS FSET .OBJ .BITS>>
<DEFMAC BCLEAR ('OBJ "ARGS" BITS)
<MULTIBITS FCLEAR .OBJ .BITS>>
<DEFMAC BSET? ('OBJ "ARGS" BITS)
<MULTIBITS FSET? .OBJ .BITS>>
<DEFINE MULTIBITS (X OBJ ATMS "AUX" (O ()) ATM)
<REPEAT ()
<COND (<EMPTY? .ATMS>
<RETURN!- <COND (<LENGTH? .O 1> <NTH .O 1>)
(<==? .X FSET?> <FORM OR !.O>)
(ELSE <FORM PROG () !.O>)>>)>
<SET ATM <NTH .ATMS 1>>
<SET ATMS <REST .ATMS>>
<SET O
(<FORM .X
.OBJ
<COND (<TYPE? .ATM FORM> .ATM)
(ELSE <FORM GVAL .ATM>)>>
!.O)>>>
<DEFMAC RFATAL ()
'<PROG () <PUSH 2> <RSTACK>>>
<DEFMAC PROB ('BASE? "OPTIONAL" 'LOSER?)
<COND (<ASSIGNED? LOSER?> <FORM ZPROB .BASE?>)
(ELSE <FORM G? .BASE? '<RANDOM 100>>)>>
<ROUTINE ZPROB
(BASE)
<COND (,LUCKY <G? .BASE <RANDOM 100>>)
(ELSE <G? .BASE <RANDOM 300>>)>>
<ROUTINE RANDOM-ELEMENT (FROB)
<GET .FROB <RANDOM <GET .FROB 0>>>>
<ROUTINE PICK-ONE (FROB
"AUX" L ;<GET .FROB 0> CNT ;<GET .FROB 1> RND MSG RFROB)
<SET L <GET .FROB 0>>
<SET CNT <GET .FROB 1>>
<SET L <- .L 1>>
<SET FROB <REST .FROB 2>>
<SET RFROB <REST .FROB <* .CNT 2>>>
<SET RND <RANDOM <- .L .CNT>>>
<SET MSG <GET .RFROB .RND>>
<PUT .RFROB .RND <GET .RFROB 1>>
<PUT .RFROB 1 .MSG>
<SET CNT <+ .CNT 1>>
<COND (<==? .CNT .L> <SET CNT 0>)>
<PUT .FROB 0 .CNT>
.MSG>
<DEFMAC ENABLE ('INT) <FORM PUT .INT ,C-ENABLED? 1>>
<DEFMAC DISABLE ('INT) <FORM PUT .INT ,C-ENABLED? 0>>
<DEFMAC FLAMING? ('OBJ)
<FORM AND <FORM FSET? .OBJ ',FLAMEBIT>
<FORM FSET? .OBJ ',ONBIT>>>
<DEFMAC OPENABLE? ('OBJ)
<FORM OR <FORM FSET? .OBJ ',DOORBIT>
<FORM FSET? .OBJ ',CONTBIT>>>
<DEFMAC ABS ('NUM)
<FORM COND (<FORM L? .NUM 0> <FORM - 0 .NUM>)
(T .NUM)>>
<DEFMAC RMGL-SIZE ('TBL)
<COND (<AND <GASSIGNED? PLUS-MODE> ,PLUS-MODE>
<FORM - <FORM / <FORM PTSIZE .TBL> 2> 1>)
(T <FORM - <FORM PTSIZE .TBL> 1>)>>
;<DEFMAC GET/B ('TBL 'PTR)
<COND (<AND <GASSIGNED? PLUS-MODE> ,PLUS-MODE>
<FORM GET .TBL .PTR>)
(T <FORM GETB .TBL .PTR>)>>
;<DEFMAC PUT/B ('TBL 'PTR 'OBJ)
<COND (<AND <GASSIGNED? PLUS-MODE> ,PLUS-MODE>
<FORM PUT .TBL .PTR .OBJ>)
(T <FORM PUTB .TBL .PTR .OBJ>)>>
;<DEFMAC ZMEMQ/B ('OBJ 'TBL "OPT" ('SIZ <>))
<COND (<AND <GASSIGNED? PLUS-MODE> ,PLUS-MODE>
<COND (<NOT .SIZ>
<FORM ZMEMQ .OBJ .TBL>)
(T <FORM ZMEMQ .OBJ .TBL .SIZ>)>)
(T
<COND (<NOT .SIZ>
<FORM ZMEMQB .OBJ .TBL>)
(T <FORM ZMEMQB .OBJ .TBL .SIZ>)>)>>