-
Notifications
You must be signed in to change notification settings - Fork 27
/
village.zap
613 lines (549 loc) · 17.1 KB
/
village.zap
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
.SEGMENT "VILLAGE"
.FUNCT VILLAGE-F
EQUAL? HERE,PARAPET \?CCL3
CALL2 TOUCHING?,VILLAGE
ZERO? STACK /?CCL3
CALL2 CANT-REACH,VILLAGE
RSTACK
?CCL3: EQUAL? PRSA,V?ENTER \?CCL7
EQUAL? HERE,VILLAGE-GATE \?CCL10
CALL2 DO-WALK,P?EAST
RSTACK
?CCL10: CALL1 V-WALK-AROUND
RSTACK
?CCL7: EQUAL? PRSA,V?EXIT \FALSE
CALL1 V-WALK-AROUND
RSTACK
.FUNCT OUTER-BAILEY-F,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "This open area is a rolling meadow extending from the moat to the distant perimeter fortifications. A drawbridge "
FSET? DRAWBRIDGE,OPENBIT \?CCL6
PRINTI "leads over the"
JUMP ?CND4
?CCL6: PRINTI "is raised, leaving an impassable"
?CND4: PRINTI " moat to the southeast, and roads lead northeast, southwest, and northwest."
RTRUE
.FUNCT TREE-STUMP-F,VARG
ZERO? VARG \FALSE
EQUAL? PRSA,V?EXAMINE \?CCL5
GETP TREE-STUMP,P?LDESC
PRINT STACK
FIRST? TREE-STUMP \?CCL8
PRINTC 32
RFALSE
?CCL8: CRLF
RTRUE
?CCL5: EQUAL? PRSA,V?GET-NEAR \?CCL10
ICALL PERFORM,V?ENTER,TREE-STUMP
RTRUE
?CCL10: EQUAL? PRSA,V?LISTEN \?CCL12
ZERO? PLANT-TALKER /?CCL12
PRINTR "The stump is dead and silent."
?CCL12: EQUAL? PRSA,V?ENTER \?CCL16
SET 'JUMP-X,0
SET 'JUMP-Y,0
RFALSE
?CCL16: EQUAL? PRSA,V?EXIT \?CCL18
SET 'JUMP-X,99
SET 'JUMP-Y,99
RFALSE
?CCL18: EQUAL? PRSA,V?RAISE,V?TAKE,V?LOOK-UNDER \FALSE
PRINTR "100 men couldn't uproot this stump!"
.FUNCT PERIMETER-WALL-F,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "Before you rises the massive stone wall which forms the first line of defense for the castle grounds. To the northwest, the huge oak gates "
FSET? OUTER-GATE,OPENBIT \?CCL6
PRINTI "lie wide open, revealing dense forest beyond!"
RTRUE
?CCL6: PRINTI "are closed and reinforced, forming an impassable barrier across the road from the southeast."
RTRUE
.FUNCT WEST-OF-HOUSE-ENTER-F,RARG
FSET? OUTER-GATE,OPENBIT \?CCL3
ZERO? RARG \?CND4
ICALL1 RETURN-FROM-MAP
ICALL2 INC-SCORE,30
PRINTI "You dive through the doors as the castle begins its final tremors! Landing on soft grass, you roll to a stop, and turn to see the castle's final moments. But, oddly, though it is collapsing, it doesn't seem to be getting destroyed. Instead, it is merely shrinking, shrivelling... You rub your eyes in disbelief, as the once mighty castle transforms itself into ever tinier structures. At long last there is stillness, and the dust begins to clear"
PRINT ELLIPSIS
?CND4: RETURN WEST-OF-HOUSE
?CCL3: IN? NW-SE-PASSAGE,HERE \?CCL7
EQUAL? NW-SE-PASSAGE-DIR,P?NW \?CCL7
ZERO? RARG \FALSE
ICALL1 CANT-GO
RFALSE
?CCL7: ZERO? RARG \FALSE
ICALL1 RETURN-FROM-MAP
ICALL2 THIS-IS-IT,OUTER-GATE
ICALL2 DO-FIRST,STR?527
RFALSE
.FUNCT OUTER-GATE-F
EQUAL? PRSA,V?OPEN \FALSE
PRINTR "It would take the power of a wizard to open these massive doors."
.FUNCT I-END-GAME
INC 'END-GAME-COUNTER
EQUAL? END-GAME-COUNTER,12 \?CCL3
ICALL1 RETURN-FROM-MAP
CALL2 JIGS-UP,STR?528
RSTACK
?CCL3: EQUAL? END-GAME-COUNTER,11 \?CCL5
ICALL1 RETURN-FROM-MAP
PRINTR " A great rumble fills the air, and the buildings around you teeter like drunken dancers!"
?CCL5: EQUAL? END-GAME-COUNTER,9 \?CCL7
ICALL1 RETURN-FROM-MAP
PRINTR " Boulders of rubble roll past, threatening to crush you!"
?CCL7: EQUAL? END-GAME-COUNTER,6 \?CCL9
ICALL1 RETURN-FROM-MAP
PRINTR " As the grounds continue to shake, a multitude of rats well up from within and flee toward the perimeter wall."
?CCL9: EQUAL? END-GAME-COUNTER,3 \FALSE
ICALL1 RETURN-FROM-MAP
PRINTI " The "
FSET? HERE,OUTSIDEBIT \?CCL14
PRINTI "ground"
JUMP ?CND12
?CCL14: PRINTI "floor"
?CND12: PRINTR " rolls and shudders, making it difficult to stay on your feet."
.FUNCT WEST-OF-HOUSE-F,RARG
EQUAL? RARG,M-ENTER \?CCL3
ICALL1 RETURN-FROM-MAP
CALL1 UPDATE-STATUS-LINE
RSTACK
?CCL3: EQUAL? RARG,M-END \FALSE
ICALL1 RETURN-FROM-MAP
CRLF
ICALL1 HIT-ANY-KEY
CLEAR 0
CRLF
ICALL2 MARGINAL-PIC,EPILOGUE-LETTER
DIROUT D-SCREEN-OFF
PRINTC 65
DIROUT D-SCREEN-ON
PRINTI "s you stare dumbfounded at the white house, the jester appears, laughing as though at some supreme trick. Then, a low moaning wind begins to blow, and slowly, ever so slowly, his appearance shifts, until you see before you a wizard of incredible age and obvious power. His hoary visage stirs an ancient ancestral memory. He speaks in a new voice, tired but commanding of instant respect. ""I am Megaboz,"" he states, and your skin tingles at the presence of a legend.
""Yes, I still live. I have waited a long time for this day; to meet the one who would guard after I am gone.
""The Great Underground Empire is no more; but Quendor remains. The white house will stand as a warning and reminder of the excesses of the Flatheads. Some day, a new Empire may rise; you -- and your successors -- shall watch over the land, and ensure that future Empire be benevolent. Henceforth, you shall be known as Dungeon Master.
""As promised by Decree, half the wealth of the kingdom is yours!"" Your mind is suddenly filled with images of a vast underground Treasury, piled with unfathomable wealth. But the image is tempered by the ironic knowledge that you will never have use for such wealth. As the image fades, you hear tinkling bells and the voice of the jester/Megaboz: ""Well, I'm outta here! Over to you, Dungeon Master!"" You find yourself alone, left to ponder the years ahead, long years of keeping watch over Quendor and searching, ever searching, for your successor"
PRINT ELLIPSIS
CALL1 FINISH
RSTACK
.FUNCT LOCKER-F
EQUAL? PRSA,V?LOCK \FALSE
EQUAL? PRSO,LOCKER \FALSE
PRINTR "You don't have the right key."
.SEGMENT "0"
.FUNCT POSTER-F
EQUAL? PRSA,V?EXAMINE \?CCL3
PRINTR "The poster shows pin-up model Ursula Flathead (Miss Miznia, 878 GUE) in a typical suggestive pose and minimal cover."
?CCL3: EQUAL? PRSA,V?ROLL \FALSE
PRINTR "You curl it into a tube, but as you let go it flattens again."
.ENDSEG
.SEGMENT "VILLAGE"
.FUNCT GATE-PS
CALL2 PERFORM-PRSA,ARCH
RSTACK
.FUNCT TAX-OFFICE-F,RARG
EQUAL? RARG,M-END \FALSE
IN? ZORKMID-COIN,LOCAL-GLOBALS \FALSE
ICALL2 SETUP-ORPHAN,STR?44
IN? JESTER,HERE /FALSE
ICALL2 DEQUEUE,I-JESTER
MOVE JESTER,HERE
ICALL2 THIS-IS-IT,JESTER
ICALL1 RETURN-FROM-MAP
PRINTI " A bookkeeper is hunched over one of the desks. He looks up as you enter, and you see that it is the jester, wearing suspenders, a bow tie, thick eyeglasses, and a green visor.
"""
GETP TAX-OFFICE,P?RIDDLE
PRINT STACK
CRLF
RTRUE
.SEGMENT "0"
.FUNCT PIGEON-F
EQUAL? PRSA,V?EXAMINE \?CCL3
PRINTR "The pigeon, though strikingly lifelike, is merely a clay reproduction. On the bottom is some tiny writing."
?CCL3: EQUAL? PRSA,V?TAKE \?CCL5
EQUAL? PRSO,PIGEON \?CCL5
CALL2 ULTIMATELY-IN?,PIGEON
ZERO? STACK \FALSE
FSET? OUTER-GATE,OPENBIT /FALSE
ZERO? TIME-STOPPED \FALSE
RANDOM 100
LESS? 10,STACK \?CTR14
GRTR? P-MULT,1 \?CCL15
?CTR14: PRINTI "Your eyes must be starting to play tricks on you. It almost seemed like the clay pigeon "
IN? PIGEON,HERE \?CCL20
PRINTI "hopped"
JUMP ?CND18
?CCL20: PRINTI "squirmed"
?CND18: PRINTR " out of reach at the last second."
?CCL15: CALL2 ITAKE,TRUE-VALUE
EQUAL? STACK,M-FATAL /TRUE
CALL2 ULTIMATELY-IN?,PERCH
ZERO? STACK /?CCL24
PRINTR "Taken."
?CCL24: PRINTI "As you take the pigeon, you feel a dizziness, like that which one gets from drinking Miznian wines too quickly. "
CALL2 META-LOC,PERCH
EQUAL? STACK,HERE /?CTR26
EQUAL? HERE,OUBLIETTE \?CCL27
EQUAL? REMOVED-PERCH-LOC,OUBLIETTE \?CCL27
?CTR26: LOC PROTAGONIST
EQUAL? STACK,YACHT,DB /?CND32
MOVE PROTAGONIST,HERE
?CND32: PRINTR "When the disorientation passes, you seem to have moved a few feet."
?CCL27: ICALL1 CAST-HUNGER-SPELL
PRINTI "The world blurs, then darkens. You blink"
PRINT ELLIPSIS
SET 'HAND-IN-WALDO,FALSE-VALUE
CALL2 MOVE-TO-PERCH,PROTAGONIST
RSTACK
?CCL5: EQUAL? PRSA,V?PUT-ON \FALSE
EQUAL? PRSI,PERCH \FALSE
PRINTR "There's no apparent way to put the pigeon on the perch."
.FUNCT MOVE-TO-PERCH,WHAT,PERCH-LOC,L,OFFSET,RM,OBJ,X,N,TOOK-STUFF
CALL2 META-LOC,PERCH >PERCH-LOC
ZERO? PERCH-LOC /?CND1
IN? PERCH-LOC,ROOMS \?CND1
LOC PERCH
EQUAL? STACK,YACHT,DB \?CND1
LOC PERCH >PERCH-LOC
?CND1: EQUAL? WHAT,PROTAGONIST \?CND6
EQUAL? HERE,PLAIN \?CCL10
ICALL STORE,PLAIN-OFFSET,PLAIN-LOC,PLAIN
JUMP ?CND6
?CCL10: EQUAL? HERE,CONSTRUCTION \?CCL12
ICALL STORE,CONSTRUCTION-OFFSET,CONSTRUCTION-LOC,CONSTRUCTION
JUMP ?CND6
?CCL12: EQUAL? HERE,FR-OFFICES \?CCL14
ICALL STORE,OFFICES-OFFSET,FLOOR-NUMBER,FR-OFFICES
JUMP ?CND6
?CCL14: EQUAL? HERE,OFFICES-NORTH \?CCL16
ICALL STORE,OFFICES-N-OFFSET,FLOOR-NUMBER,OFFICES-NORTH
JUMP ?CND6
?CCL16: EQUAL? HERE,OFFICES-SOUTH \?CCL18
ICALL STORE,OFFICES-S-OFFSET,FLOOR-NUMBER,OFFICES-SOUTH
JUMP ?CND6
?CCL18: EQUAL? HERE,OFFICES-EAST \?CCL20
ICALL STORE,OFFICES-E-OFFSET,FLOOR-NUMBER,OFFICES-EAST
JUMP ?CND6
?CCL20: EQUAL? HERE,OFFICES-WEST \?CND6
ICALL STORE,OFFICES-W-OFFSET,FLOOR-NUMBER,OFFICES-WEST
?CND6: ZERO? PERCH-LOC /?CCL24
EQUAL? WHAT,PROTAGONIST \?CCL27
EQUAL? HERE,MARSH \?CND28
IN? JESTER,NICE-LUNCH-SPOT \?CND28
ICALL1 REMOVE-J
?CND28: ICALL2 GOTO,PERCH-LOC
EQUAL? HERE,LAKE-BOTTOM \?CCL34
ICALL2 JIGS-UP,DROWN
RTRUE
?CCL34: EQUAL? HERE,PLAIN /TRUE
FCLEAR CLOAK,WORNBIT
RTRUE
?CCL27: EQUAL? PERCH-LOC,LAKE-BOTTOM \?CCL37
SET 'PIECE-DROWNED,1
ICALL ROB,WHAT,LAKE-BOTTOM
REMOVE WHAT
RTRUE
?CCL37: CALL FIND-IN,PERCH-LOC,WHITEBIT >X
ZERO? X \?CCL39
CALL FIND-IN,PERCH-LOC,BLACKBIT >X
ZERO? X /?CND38
?CCL39: ICALL ROB,X,WHAT
REMOVE X
?CND38: FIRST? PERCH-LOC >X /?PRG43
?PRG43: ZERO? X /?REP44
NEXT? X >N /?BOGUS47
?BOGUS47: FSET? X,TAKEBIT \?CND48
FSET? X,TRYTAKEBIT /?CND48
CALL FIND-IN,X,TRYTAKEBIT
ZERO? STACK \?CND48
SET 'TOOK-STUFF,TRUE-VALUE
MOVE X,WHAT
?CND48: SET 'X,N
JUMP ?PRG43
?REP44: MOVE WHAT,PERCH-LOC
EQUAL? PERCH-LOC,HERE \FALSE
PRINTI " With a surprisingly high-pitched squeal of alarm,"
ICALL2 APRINT,WHAT
PRINTI " materializes nearby. "
FSET? WHAT,FEMALEBIT \?CCL58
PRINTI "Sh"
JUMP ?CND56
?CCL58: PRINTC 72
?CND56: PRINTI "e seems somewhat dazed by the experience"
ZERO? TOOK-STUFF /?CCL61
PRINTR ", but not too dazed to pick the ground clean."
?CCL61: PRINT PERIOD-CR
RTRUE
?CCL24: CALL2 FIND-PERCH,PERCH >L
ZERO? L /?CCL63
GRTR? L,5000 \?CCL66
SET 'OFFSET,OFFICES-W-OFFSET
SET 'RM,OFFICES-WEST
JUMP ?CND64
?CCL66: GRTR? L,4000 \?CCL68
SET 'OFFSET,OFFICES-E-OFFSET
SET 'RM,OFFICES-EAST
JUMP ?CND64
?CCL68: GRTR? L,3000 \?CCL70
SET 'OFFSET,OFFICES-S-OFFSET
SET 'RM,OFFICES-SOUTH
JUMP ?CND64
?CCL70: GRTR? L,2000 \?CCL72
SET 'OFFSET,OFFICES-N-OFFSET
SET 'RM,OFFICES-NORTH
JUMP ?CND64
?CCL72: GRTR? L,1000 \?CCL74
SET 'OFFSET,OFFICES-OFFSET
SET 'RM,FR-OFFICES
JUMP ?CND64
?CCL74: GRTR? L,399 \?CCL76
SET 'OFFSET,CONSTRUCTION-OFFSET
SET 'RM,CONSTRUCTION
JUMP ?CND64
?CCL76: SET 'OFFSET,PLAIN-OFFSET
SET 'RM,PLAIN
?CND64: EQUAL? WHAT,PROTAGONIST \?CCL79
SUB L,OFFSET >L
EQUAL? RM,PLAIN \?CCL82
DIV L,8
ADD STACK,1 >RANK
MOD L,8
ADD STACK,1 >FILE
SET 'PLAIN-LOC,L
EQUAL? HERE,PLAIN /?CND83
MOVE CLOAK,PROTAGONIST
FSET CLOAK,WORNBIT
LOC PROTAGONIST
FSET? STACK,TAKEBIT \?CCL87
SET 'CLOAK-LOC,HERE
JUMP ?CND83
?CCL87: LOC PROTAGONIST >CLOAK-LOC
?CND83: ICALL UNSTORE,OFFSET,L,RM
JUMP ?CND80
?CCL82: EQUAL? RM,CONSTRUCTION \?CCL89
DIV L,8
ADD STACK,1 >RANK
MOD L,8
ADD STACK,1 >FILE
SET 'CONSTRUCTION-LOC,L
ICALL UNSTORE,OFFSET,L,RM
JUMP ?CND80
?CCL89: SET 'FLOOR-NUMBER,L
ICALL2 OFFICE-UNSTORE,L
?CND80: EQUAL? RM,PLAIN /?CND90
FCLEAR CLOAK,WORNBIT
?CND90: EQUAL? HERE,MARSH \?CND92
IN? JESTER,NICE-LUNCH-SPOT \?CND92
ICALL1 REMOVE-J
?CND92: CALL2 GOTO,RM
RSTACK
?CCL79: EQUAL? WHAT,WHITE-PAWN \?CCL98
EQUAL? RM,PLAIN \?CCL98
SUB L,OFFSET
LESS? STACK,8 \?CCL98
ICALL ROB,WHITE-PAWN,WHITE-QUEEN
SET 'WHAT,WHITE-QUEEN
JUMP ?CND96
?CCL98: EQUAL? WHAT,BLACK-PAWN \?CND96
EQUAL? RM,PLAIN \?CND96
SUB L,OFFSET
GRTR? STACK,55 \?CND96
ICALL ROB,BLACK-PAWN,BLACK-QUEEN
SET 'WHAT,BLACK-QUEEN
?CND96: REMOVE WHAT
ICALL REMOVE-ANY-PIECE,L,WHAT
ICALL PIECE-SNARF,L,WHAT
SUB L,OFFSET
CALL PUT-IN-STORAGE,OFFSET,WHAT,STACK
RSTACK
?CCL63: EQUAL? WHAT,PROTAGONIST \?CCL107
EQUAL? REMOVED-PERCH-LOC,WATER \?CCL110
HLIGHT H-BOLD
PRINTI "Surrounded by Water"
CRLF
HLIGHT H-NORMAL
CALL2 JIGS-UP,DROWN
RSTACK
?CCL110: EQUAL? REMOVED-PERCH-LOC,GROUND,OUBLIETTE \?CCL112
PRINTI "You appear "
EQUAL? REMOVED-PERCH-LOC,OUBLIETTE \?CCL115
PRINTI "knee deep in mud"
PRINT ELLIPSIS
FCLEAR CLOAK,WORNBIT
EQUAL? HERE,MARSH \?CND116
IN? JESTER,NICE-LUNCH-SPOT \?CND116
ICALL1 REMOVE-J
?CND116: CALL2 GOTO,OUBLIETTE
RSTACK
?CCL115: CALL2 JIGS-UP,STR?548
RSTACK
?CCL112: EQUAL? REMOVED-PERCH-LOC,PSEUDO-OBJECT \?CCL121
CALL2 JIGS-UP,STR?549
RSTACK
?CCL121: EQUAL? REMOVED-PERCH-LOC,BROGMOID \?CCL123
CALL2 JIGS-UP,STR?550
RSTACK
?CCL123: CALL2 JIGS-UP,STR?551
RSTACK
?CCL107: EQUAL? REMOVED-PERCH-LOC,OUBLIETTE \?CCL125
MOVE WHAT,OUBLIETTE
ICALL REMOVE-ANY-PIECE,L,WHAT
CALL PIECE-SNARF,L,WHAT
RSTACK
?CCL125: REMOVE WHAT
RTRUE
.FUNCT FIND-PERCH,OBJ,L,CNT
?PRG1: LESS? CNT,STORAGE-TABLE-LENGTH /?CCL5
LOC OBJ
ZERO? STACK /?REP2
LOC OBJ
CALL2 FIND-PERCH,STACK >L
RETURN L
?CCL5: ADD CNT,1
GET STORAGE-TABLE,STACK
EQUAL? STACK,OBJ \?CND3
GET STORAGE-TABLE,CNT >L
RETURN L
?CND3: ADD CNT,2 >CNT
JUMP ?PRG1
?REP2: RETURN L
.ENDSEG
.SEGMENT "VILLAGE"
.FUNCT FR-BLDG-F
EQUAL? PRSA,V?RESEARCH \?CCL3
CALL PICTURED-ENTRY,FR-ILL,STR?552
RSTACK
?CCL3: EQUAL? PRSA,V?EXAMINE \?CCL5
EQUAL? HERE,VILLAGE-CENTER \?CCL8
PRINTR "Most of the building is lost in the clouds."
?CCL8: PRINTR "You're in it!"
?CCL5: EQUAL? PRSA,V?ENTER \?CCL10
EQUAL? HERE,VILLAGE-CENTER \?CCL13
CALL2 DO-WALK,P?EAST
RSTACK
?CCL13: EQUAL? HERE,PHIL-HALL \?CCL15
CALL2 DO-WALK,P?NORTH
RSTACK
?CCL15: PRINT LOOK-AROUND
RTRUE
?CCL10: EQUAL? PRSA,V?EXIT \FALSE
CALL1 V-WALK-AROUND
RSTACK
.FUNCT FR-OFFICES-ENTER-F,RARG
ZERO? RARG /?CCL3
RETURN FR-OFFICES
?CCL3: EQUAL? HERE,FR-HQ \?CCL5
SET 'FLOOR-NUMBER,2
JUMP ?CND1
?CCL5: SET 'FLOOR-NUMBER,399
?CND1: ICALL2 OFFICE-UNSTORE,FLOOR-NUMBER
RETURN FR-OFFICES
.FUNCT OFFICES-F,RARG
EQUAL? RARG,M-ENTER \?CCL3
SET 'BEEN-IN-FR-UPPER-FLOORS,TRUE-VALUE
RETURN BEEN-IN-FR-UPPER-FLOORS
?CCL3: EQUAL? RARG,M-LOOK \FALSE
PRINTI "You are on Floor "
PRINTN FLOOR-NUMBER
PRINTI " of the FrobozzCo Building. The offices of one subsidiary or another can be entered in all four directions. Stairs lead up and down."
RTRUE
.FUNCT FR-FLOOR-F,RARG
EQUAL? PRSO,P?UP \?CCL3
EQUAL? FLOOR-NUMBER,399 \?CCL3
RETURN FR-PENTHOUSE
?CCL3: EQUAL? PRSO,P?DOWN \?CCL7
EQUAL? FLOOR-NUMBER,2 \?CCL7
RETURN FR-HQ
?CCL7: ZERO? RARG \FALSE
ICALL STORE,OFFICES-OFFSET,FLOOR-NUMBER
ICALL STORE,OFFICES-N-OFFSET,FLOOR-NUMBER,OFFICES-NORTH
ICALL STORE,OFFICES-S-OFFSET,FLOOR-NUMBER,OFFICES-SOUTH
ICALL STORE,OFFICES-E-OFFSET,FLOOR-NUMBER,OFFICES-EAST
ICALL STORE,OFFICES-W-OFFSET,FLOOR-NUMBER,OFFICES-WEST
EQUAL? PRSO,P?UP \?CCL14
INC 'FLOOR-NUMBER
JUMP ?CND12
?CCL14: DEC 'FLOOR-NUMBER
?CND12: ICALL2 OFFICE-UNSTORE,FLOOR-NUMBER
RETURN FR-OFFICES
.FUNCT OFFICE-UNSTORE,L
ICALL UNSTORE,OFFICES-OFFSET,L,FR-OFFICES
ICALL UNSTORE,OFFICES-N-OFFSET,L,OFFICES-NORTH
ICALL UNSTORE,OFFICES-S-OFFSET,L,OFFICES-SOUTH
ICALL UNSTORE,OFFICES-E-OFFSET,L,OFFICES-EAST
CALL UNSTORE,OFFICES-W-OFFSET,L,OFFICES-WEST
RSTACK
.FUNCT FR-OUTER-OFFICES-F,RARG
EQUAL? RARG,M-LOOK \FALSE
PRINTI "You are in an office on floor "
PRINTN FLOOR-NUMBER
PRINTI " of the FrobozzCo Building. The office has a lovely "
EQUAL? HERE,OFFICES-NORTH \?CCL6
PRINTI "north"
JUMP ?CND4
?CCL6: EQUAL? HERE,OFFICES-SOUTH \?CCL8
PRINTI "south"
JUMP ?CND4
?CCL8: EQUAL? HERE,OFFICES-EAST \?CCL10
PRINTI "east"
JUMP ?CND4
?CCL10: PRINTI "west"
?CND4: PRINTI "ern exposure. The only exit is to the "
EQUAL? HERE,OFFICES-NORTH \?CCL13
PRINTI "south"
JUMP ?CND11
?CCL13: EQUAL? HERE,OFFICES-SOUTH \?CCL15
PRINTI "north"
JUMP ?CND11
?CCL15: EQUAL? HERE,OFFICES-EAST \?CCL17
PRINTI "west"
JUMP ?CND11
?CCL17: PRINTI "east"
?CND11: PRINTC 46
RTRUE
.FUNCT FR-PENTHOUSE-F,RARG
EQUAL? RARG,M-ENTER \FALSE
FSET? FR-PENTHOUSE,TOUCHBIT /FALSE
SET 'DO-J,TRUE-VALUE
CALL QUEUE,I-JESTER,1
RSTACK
.FUNCT PHIL-ENTER-F,RARG
ZERO? RARG \?CND1
EQUAL? CURRENT-SPLIT,TEXT-WINDOW-PIC-LOC /?CCL2
RETURN PHIL-HALL
?CCL2: PRINTI "The passage takes you from the FrobozzCo Building back into the castle. It widens"
PRINT ELLIPSIS
?CND1: RETURN PHIL-HALL
.ENDSEG
.SEGMENT "LAKE"
.FUNCT FR-BASEMENT-ENTER-F,RARG
ZERO? RARG \?CND1
EQUAL? CURRENT-SPLIT,TEXT-WINDOW-PIC-LOC /?CCL2
RETURN FR-BASEMENT
?CCL2: PRINTI "The passage narrows as it leaves the castle, then widens again as it enters"
PRINT ELLIPSIS
?CND1: RETURN FR-BASEMENT
.ENDSEG
.SEGMENT "0"
.SEGMENT "VILLAGE"
.FUNCT RING-F,AV,HOLDING-STUFF
EQUAL? PRSA,V?WEAR \FALSE
LOC PROTAGONIST >AV
MOVE RING,PROTAGONIST
FSET RING,WORNBIT
PRINTI "As you slip the ring onto your finger, you clumsily "
EQUAL? HERE,UNDER-THE-WORLD,HANGING-FROM-ROOTS,LEDGE-IN-PIT /?CTR5
EQUAL? HERE,MOUTH-OF-CAVE \?CCL6
?CTR5: PRINTI "lose your grip, and plunge downward. "
ICALL PERFORM,V?LEAP,ROOMS
RTRUE
?CCL6: CALL2 CCOUNT,PROTAGONIST
GRTR? STACK,1 \?CCL10
PRINTI "drop everything you were holding."
FSET? AV,DROPBIT \?CCL13
PUSH AV
JUMP ?CND11
?CCL13: PUSH HERE
?CND11: ICALL ROB,PROTAGONIST,STACK,TRUE-VALUE
CRLF
RTRUE
?CCL10: PRINTR "trip over your own feet and just barely manage to keep your balance."
.ENDSEG
.ENDI