-
Notifications
You must be signed in to change notification settings - Fork 15
/
global.zap
147 lines (126 loc) · 2.97 KB
/
global.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
.FUNCT RT-GLOBAL-HERE:ANY:0:1,CONTEXT,P
ZERO? HERE /FALSE
GETP HERE,P?ACTION >P
ZERO? P /FALSE
CALL P,CONTEXT
RSTACK
.FUNCT RT-YOU:ANY:0:1,CONTEXT
ZERO? CONTEXT \FALSE
ZERO? NOW-PRSI /?CCL5
CALL PERFORM,PRSA,PRSO,WINNER
RSTACK
?CCL5: CALL PERFORM,PRSA,WINNER,PRSI
RSTACK
.FUNCT RT-TH-HUMAN-BODY:ANY:0:1,CONTEXT,TMP,PERSON
EQUAL? CONTEXT,M-OBJDESC \?CCL3
PRINTI "their body"
RTRUE
?CCL3: ZERO? CONTEXT \FALSE
CALL1 GET-NP
GET STACK,1 >TMP
ZERO? TMP /?CND6
GET TMP,2 >PERSON
?CND6: ZERO? PERSON /?CCL10
CALL2 VISIBLE?,PERSON
ZERO? STACK \?CCL10
ICALL1 NP-CANT-SEE
RETURN 2
?CCL10: PRINT K-NO-REFER-MSG
PRINTI "any"
PRINTI " part of"
ZERO? PERSON /?CCL16
ICALL RT-PRINT-OBJ,PERSON,K-ART-THE
PRINTC 39
FSET? PERSON,FL-PLURAL \?CCL18
FSET? PERSON,FL-COLLECTIVE \?CND14
?CCL18: PRINTC 115
JUMP ?CND14
?CCL16: PRINTI " their"
?CND14: PRINTI " body.]"
CRLF
RETURN 2
.FUNCT RT-GN-BODY:ANY:2:2,TBL,FINDER,PART,PTR,N
ADD TBL,8 >PTR
GET TBL,1 >N
?PRG1: DLESS? 'N,0 /FALSE
GET PTR,0 >PART
ZERO? PART /?CND3
FSET? PART,FL-YOUR /?REP2
EQUAL? PART,TH-PLAYER-BODY /?REP2
EQUAL? PART,TH-HUMAN-BODY /?CND3
RETURN PART
?CND3: ADD PTR,2 >PTR
JUMP ?PRG1
?REP2: RETURN PART
.FUNCT RT-TH-PLAYER-BODY:ANY:0:1,CONTEXT
ZERO? CONTEXT \FALSE
PRINT K-NO-REFER-MSG
PRINTI "that part of your body.]"
CRLF
RETURN 2
.FUNCT RT-TH-GROUND:ANY:0:3,CONTEXT,ART,CAP?
EQUAL? CONTEXT,M-OBJDESC \?CCL3
ZERO? ART /?CND4
ICALL RT-PRINT-ARTICLE,TH-GROUND,ART,CAP?
?CND4: EQUAL? ART,FALSE-VALUE,K-ART-THE,K-ART-A /?CCL8
EQUAL? ART,K-ART-ANY \FALSE
?CCL8: ZERO? ART /?CND11
PRINTC 32
?CND11: FSET? HERE,FL-INDOORS \?CCL15
PRINTI "floor"
RTRUE
?CCL15: PRINTI "ground"
RTRUE
?CCL3: ZERO? CONTEXT \FALSE
EQUAL? PRSA,V?LOOK-ON,V?EXAMINE \FALSE
CALL2 RT-SEE-ANYTHING-IN?,HERE
ZERO? STACK /FALSE
PRINTI "You see"
ICALL2 RT-PRINT-CONTENTS,HERE
PRINTI " on"
ICALL RT-PRINT-OBJ,TH-GROUND,K-ART-THE
PRINTC 46
CRLF
RTRUE
.FUNCT RT-TH-SKY:ANY:0:3,CONTEXT,ART,CAP?,RM
EQUAL? CONTEXT,M-OBJDESC \?CCL3
ZERO? ART /?CND4
ICALL RT-PRINT-ARTICLE,TH-SKY,ART,CAP?
?CND4: EQUAL? ART,FALSE-VALUE,K-ART-THE,K-ART-A /?CCL8
EQUAL? ART,K-ART-ANY \FALSE
?CCL8: ZERO? ART /?CND11
PRINTC 32
?CND11: FSET? HERE,FL-INDOORS \?CCL15
PRINTI "ceiling"
RTRUE
?CCL15: PRINTI "sky"
RTRUE
?CCL3: ZERO? CONTEXT \FALSE
ZERO? NOW-PRSI /?CCL22
PUSH 2
JUMP ?CND20
?CCL22: PUSH 1
?CND20: CALL2 EVERYWHERE-VERB?,STACK
ZERO? STACK \FALSE
FSET? HERE,FL-INDOORS \?CCL25
CALL NOUN-USED?,TH-SKY,W?SKY
ZERO? STACK /FALSE
CALL1 NP-CANT-SEE
RSTACK
?CCL25: CALL NOUN-USED?,TH-SKY,W?CEILING
ZERO? STACK /FALSE
CALL1 NP-CANT-SEE
RSTACK
.FUNCT RT-LG-DEEPCORE:ANY:0:1,CONTEXT
ZERO? CONTEXT \FALSE
EQUAL? PRSA,V?EXAMINE \FALSE
PRINTR "It looks like Deepcore."
.FUNCT RT-LG-TROUGH:ANY:0:1,CONTEXT
ZERO? CONTEXT \FALSE
EQUAL? PRSA,V?EXAMINE \FALSE
PRINTR "It looks like the Cayman trough."
.FUNCT RT-LG-MONTANA:ANY:0:1,CONTEXT
ZERO? CONTEXT \FALSE
EQUAL? PRSA,V?EXAMINE \FALSE
PRINTR "It looks like the Montana."
.ENDI