-
Notifications
You must be signed in to change notification settings - Fork 33
/
gglobals.zap
137 lines (116 loc) · 3.79 KB
/
gglobals.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
.FUNCT NOT-HERE-OBJECT-F,TBL,PRSO?=1,OBJ
EQUAL? PRSO,NOT-HERE-OBJECT \?ELS3
EQUAL? PRSI,NOT-HERE-OBJECT \?ELS3
PRINTR "Those things aren't here!"
?ELS3: EQUAL? PRSO,NOT-HERE-OBJECT \?ELS9
SET 'TBL,P-PRSO
JUMP ?CND1
?ELS9: SET 'TBL,P-PRSI
SET 'PRSO?,FALSE-VALUE
?CND1: SET 'P-CONT,FALSE-VALUE
SET 'QUOTE-FLAG,FALSE-VALUE
EQUAL? WINNER,PLAYER \?ELS14
PRINTI "You can't see any "
CALL NOT-HERE-PRINT,PRSO?
PRINTR " here!"
?ELS14: PRINTI "The "
PRINTD WINNER
PRINTI " seems confused. ""I don't see any "
CALL NOT-HERE-PRINT,PRSO?
PRINTR " here!"""
.FUNCT NOT-HERE-PRINT,PRSO?,?TMP1
ZERO? P-OFLAG /?ELS5
ZERO? P-XADJ /?CND7
PRINTB P-XADJN
?CND7: ZERO? P-XNAM /FALSE
PRINTB P-XNAM
RTRUE
?ELS5: ZERO? PRSO? /?ELS18
GET P-ITBL,P-NC1 >?TMP1
GET P-ITBL,P-NC1L
CALL BUFFER-PRINT,?TMP1,STACK,FALSE-VALUE
RSTACK
?ELS18: GET P-ITBL,P-NC2 >?TMP1
GET P-ITBL,P-NC2L
CALL BUFFER-PRINT,?TMP1,STACK,FALSE-VALUE
RSTACK
.FUNCT NULL-F,A1,A2
RFALSE
.FUNCT STAIRS-F
EQUAL? PRSA,V?THROUGH \FALSE
PRINTR "You should say whether you want to go up or down."
.FUNCT SAILOR-FCN
EQUAL? PRSA,V?TELL \?ELS5
SET 'P-CONT,FALSE-VALUE
SET 'QUOTE-FLAG,FALSE-VALUE
PRINTR "You can't talk to the sailor that way."
?ELS5: EQUAL? PRSA,V?EXAMINE \?ELS9
PRINTR "There is no sailor to be seen."
?ELS9: EQUAL? PRSA,V?HELLO \FALSE
INC 'HS
MOD HS,20
ZERO? STACK \?ELS18
PRINTR "You seem to be repeating yourself."
?ELS18: MOD HS,10
ZERO? STACK \?ELS22
PRINTR "I think that phrase is getting a bit worn out."
?ELS22: PRINTR "Nothing happens here."
.FUNCT GROUND-FUNCTION
EQUAL? PRSA,V?PUT-ON,V?PUT \?ELS5
EQUAL? PRSI,GROUND \?ELS5
CALL PERFORM,V?DROP,PRSO
RTRUE
?ELS5: CALL NULL-F
ZERO? STACK \FALSE
EQUAL? PRSA,V?DIG \FALSE
PRINTR "The ground is too hard for digging here."
.FUNCT GRUE-FUNCTION
EQUAL? PRSA,V?EXAMINE \?ELS5
PRINTR "The grue is a sinister, lurking presence in the dark places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale."
?ELS5: EQUAL? PRSA,V?FIND \?ELS9
PRINTR "There is no grue here, but I'm sure there is at least one lurking in the darkness nearby. I wouldn't let my light go out if I were you!"
?ELS9: EQUAL? PRSA,V?LISTEN \FALSE
PRINTR "It makes no sound but is always lurking in the darkness nearby."
.FUNCT CRETIN-FCN
EQUAL? PRSA,V?TELL \?ELS5
SET 'P-CONT,FALSE-VALUE
SET 'QUOTE-FLAG,FALSE-VALUE
PRINTR "Talking to yourself is said to be a sign of impending mental collapse."
?ELS5: EQUAL? PRSA,V?GIVE \?ELS9
EQUAL? PRSI,ME \?ELS9
CALL PERFORM,V?TAKE,PRSO
RTRUE
?ELS9: EQUAL? PRSA,V?MAKE \?ELS13
PRINTR "Only you can do that."
?ELS13: EQUAL? PRSA,V?DISEMBARK \?ELS17
PRINTR "You'll have to do that on your own."
?ELS17: EQUAL? PRSA,V?EAT \?ELS21
PRINTR "Auto-cannibalism is not the answer."
?ELS21: EQUAL? PRSA,V?MUNG,V?ATTACK \?ELS25
ZERO? PRSI /?ELS30
FSET? PRSI,WEAPONBIT \?ELS30
CALL JIGS-UP,STR?167
RSTACK
?ELS30: PRINTR "Suicide is not the answer."
?ELS25: EQUAL? PRSA,V?THROW \?ELS38
EQUAL? PRSO,ME \FALSE
PRINTR "Why don't you just walk like normal people?"
?ELS38: EQUAL? PRSA,V?TAKE \?ELS47
PRINTR "How romantic!"
?ELS47: EQUAL? PRSA,V?EXAMINE \FALSE
CALL NULL-F
ZERO? STACK \TRUE
PRINTR "That's difficult unless your eyes are prehensile."
.FUNCT PATH-OBJECT
EQUAL? PRSA,V?FOLLOW,V?TAKE \?ELS5
PRINTR "You must specify a direction to go."
?ELS5: EQUAL? PRSA,V?FIND \?ELS9
PRINTR "I can't help you there...."
?ELS9: EQUAL? PRSA,V?DIG \FALSE
PRINTR "Not a chance."
.FUNCT ZORKMID-FUNCTION
EQUAL? PRSA,V?EXAMINE \?ELS5
PRINTR "The zorkmid is the unit of currency of the Great Underground Empire."
?ELS5: EQUAL? PRSA,V?FIND \FALSE
PRINTR "The best way to find zorkmids is to go out and look for them."
.ENDI