-
Notifications
You must be signed in to change notification settings - Fork 27
/
defs.zil
132 lines (102 loc) · 3.77 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
"DEFS to replace parser's versions for
ZORK ZERO
(c) Copyright 1988 Infocom, Inc. All Rights Reserved."
<BEGIN-SEGMENT 0>
<INCLUDE "SYMBOLS">
<COMPILATION-FLAG P-DEBUGGING-PARSER <>>
<ADD-TELL-TOKENS D * <DPRINT .X>>
<DELAY-DEFINITION CAPITAL-NOUN?>
<REPLACE-DEFINITION FIRST-HINT-POS
<CONSTANT FIRST-HINT-LINE 5>
<CONSTANT FIRST-HINT-COLUMN 7>>
<DELAY-DEFINITION READ-INPUT>
<DELAY-DEFINITION GAME-VERB?>
<DELAY-DEFINITION LIT?>
<REPLACE-DEFINITION NO-M-WINNER-VERB?
<DEFMAC NO-M-WINNER-VERB? ()
'<VERB? ASK-ABOUT ;MAKE-WITH SRIDE-DIR SSEARCH-OBJECT-FOR
;SGIVE SPUT-ON SSHOW STHROW SWRAP ;TELL-ABOUT STOUCH>>>
<REPLACE-DEFINITION NOT-HERE-VERB?
<ROUTINE NOT-HERE-VERB? (V)
<EQUAL? .V ,V?WALK-TO ,V?RESEARCH>>>
<REPLACE-DEFINITION OWNERS
<CONSTANT OWNERS <TABLE (PURE LENGTH) JESTER WALL>>>
<REPLACE-DEFINITION PARSER-REPORT <CONSTANT PARSER-REPORT <>>>
<REPLACE-DEFINITION PERSONBIT <CONSTANT PERSONBIT ACTORBIT>>
<REPLACE-DEFINITION PLAYER <CONSTANT PLAYER PROTAGONIST>>
<REPLACE-DEFINITION PRINT-INTQUOTE <CONSTANT PRINT-INTQUOTE 0>>
<DELAY-DEFINITION REFRESH>
<REPLACE-DEFINITION ROOMSBIT <CONSTANT ROOMSBIT KLUDGEBIT>>
<REPLACE-DEFINITION SEE-VERB?
<ROUTINE SEE-VERB? ()
<VERB? CHASTISE COUNT EXAMINE FIND TAKE
;INVENTORY LOOK LOOK-BEHIND LOOK-DOWN LOOK-INSIDE
LOOK-UNDER READ SEARCH>>>
<COMPILATION-FLAG P-APOSTROPHE-BREAKS-WORDS <>>
<REPLACE-DEFINITION SIBREAKS <SETG20 SIBREAKS ".,\"!?">>
<REPLACE-DEFINITION SETUP-ORPHAN-NP <CONSTANT SETUP-ORPHAN-NP 0>>
<REPLACE-DEFINITION SPEAKING-VERB?
<ROUTINE SPEAKING-VERB? ("OPT" (A ,PRSA))
<COND (<EQUAL? .A ;,V?ANSWER ,V?ASK-ABOUT ,V?ASK-FOR ,V?HELLO
,V?NO ;,V?REPLY ,V?TELL ,V?TELL-ABOUT ,V?YES>
<RTRUE>)>>>
<DELAY-DEFINITION STATUS-LINE>
<REPLACE-DEFINITION TELL-TOO-DARK
<ROUTINE TELL-TOO-DARK ()
<SETG P-CONT -1> ;<RFATAL>
<TELL ,TOO-DARK>
<COND (<VERB? LOOK>
<GRUE-PIT-WARNING>)
(T
<CRLF>)>>>
<COMPILATION-FLAG P-TITLE-ABBRS T>
<REPLACE-DEFINITION TITLE-ABBR?
<DEFMAC TITLE-ABBR?!- ('WRD) <FORM EQUAL? .WRD ',W?ST ',W?D ',W?J ',W?A>>>
<DELAY-DEFINITION VERB-ALL-TEST>
<REPLACE-DEFINITION YES? <CONSTANT YES? 0>>
<COMPILATION-FLAG P-PS-ADV T>
<COMPILATION-FLAG P-PS-COMMA T>
<COMPILATION-FLAG P-PS-OFWORD T>
;<COMPILATION-FLAG P-PS-THEWORD T>
<COMPILATION-FLAG P-PS-QUOTE T>
<TERMINALS VERB NOUN ADJ ;"keep these three in order! -- SWG"
DIR
PARTICLE PREP ;"keep these two in order! -- SWG"
ASKWORD ;7
OFWORD ;ARTICLE QUOTE COMMA
ADV QUANT MISCWORD>
<PROPDEF DIRECTIONS <>
(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")>
;<REPLACE-DEFINITION GET-DEXITOBJ
<ROUTINE GET-DEXITOBJ (PT) <ZGET <REST .PT> ,DEXITOBJ>>>
<DIRECTIONS NORTH NE EAST SE SOUTH SW WEST NW UP DOWN IN OUT>
<OBJECT INTDIR
(LOC GLOBAL-OBJECTS)
(DESC "direction")
(SYNONYM NORTH NE EAST SE SOUTH SW WEST NW ;UP ;DOWN)>
;<CONSTANT M-OBJDESC? 10>
<ZSTART GO> ;"else, ZIL gets confused between verb-word GO and routine GO"
<CONSTANT S-FULL 7>
<END-SEGMENT>