Fix strange inside-out organization of the input routines.
[open-adventure.git] / actions1.c
1 #include <stdlib.h>
2 #include <stdbool.h>
3 #include "misc.h"
4 #include "main.h"
5 #include "share.h"
6 #include "funcs.h"
7
8 /* This stuff was broken off as part of an effort to get the main program
9  * to compile without running out of memory.  We're called with a number
10  * that says what label the caller wanted to "goto", and we return a
11  * similar label number for the caller to "goto".
12  */
13
14 /*  Analyse a verb.  remember what it was, go back for object if second word
15  *  unless verb is "say", which snarfs arbitrary second word. */
16
17 int action(long STARTAT) {
18         switch(STARTAT) {
19            case 4000: goto L4000;
20            case 4090: goto L4090;
21            case 5000: goto L5000;
22            }
23         BUG(99);
24
25 L4000:  VERB=K;
26         SPK=ACTSPK[VERB];
27         if(WD2 > 0 && VERB != SAY) return(2800);
28         if(VERB == SAY)OBJ=WD2;
29         if(OBJ > 0) goto L4090;
30
31 /*  Analyse an intransitive verb (ie, no object given yet). */
32
33         switch (VERB-1) { case 0: goto L8010; case 1: return(8000); case 2:
34                 return(8000); case 3: goto L8040; case 4: return(2009); case 5: goto L8040;
35                 case 6: goto L8070; case 7: goto L8080; case 8: return(8000); case
36                 9: return(8000); case 10: return(2011); case 11: goto L9120; case 12:
37                 goto L9130; case 13: goto L8140; case 14: goto L9150; case 15:
38                 return(8000); case 16: return(8000); case 17: goto L8180; case 18:
39                 return(8000); case 19: goto L8200; case 20: return(8000); case 21:
40                 goto L9220; case 22: goto L9230; case 23: goto L8240; case 24:
41                 goto L8250; case 25: goto L8260; case 26: goto L8270; case 27:
42                 return(8000); case 28: return(8000); case 29: goto L8300; case 30:
43                 goto L8310; case 31: goto L8320; case 32: goto L8330; case 33:
44                 goto L8340; }
45 /*           TAKE DROP  SAY OPEN NOTH LOCK   ON  OFF WAVE CALM
46  *           WALK KILL POUR  EAT DRNK  RUB TOSS QUIT FIND INVN
47  *           FEED FILL BLST SCOR  FOO  BRF READ BREK WAKE SUSP
48  *           RESU FLY  LSTN ZZZZ */
49         BUG(23);
50
51 /*  Analyse a transitive verb. */
52
53 L4090:  switch (VERB-1) { case 0: goto L9010; case 1: goto L9020; case 2: goto
54                 L9030; case 3: goto L9040; case 4: return(2009); case 5: goto L9040;
55                 case 6: goto L9070; case 7: goto L9080; case 8: goto L9090; case
56                 9: return(2011); case 10: return(2011); case 11: goto L9120; case 12:
57                 goto L9130; case 13: goto L9140; case 14: goto L9150; case 15:
58                 goto L9160; case 16: goto L9170; case 17: return(2011); case 18:
59                 goto L9190; case 19: goto L9190; case 20: goto L9210; case 21:
60                 goto L9220; case 22: goto L9230; case 23: return(2011); case 24:
61                 return(2011); case 25: return(2011); case 26: goto L9270; case 27:
62                 goto L9280; case 28: goto L9290; case 29: return(2011); case 30:
63                 return(2011); case 31: goto L9320; case 32: return(2011); case 33:
64                 goto L8340; }
65 /*           TAKE DROP  SAY OPEN NOTH LOCK   ON  OFF WAVE CALM
66  *           WALK KILL POUR  EAT DRNK  RUB TOSS QUIT FIND INVN
67  *           FEED FILL BLST SCOR  FOO  BRF READ BREK WAKE SUSP
68  *           RESU FLY  LSTN ZZZZ */
69         BUG(24);
70
71 /*  Analyse an object word.  See if the thing is here, whether we've got a verb
72  *  yet, and so on.  Object must be here unless verb is "find" or "invent(ory)"
73  *  (and no new verb yet to be analysed).  Water and oil are also funny, since
74  *  they are never actually dropped at any location, but might be here inside
75  *  the bottle or urn or as a feature of the location. */
76
77 L5000:  OBJ=K;
78         if(!HERE(K)) goto L5100;
79 L5010:  if(WD2 > 0) return(2800);
80         if(VERB != 0) goto L4090;
81         SETPRM(1,WD1,WD1X);
82         RSPEAK(255);
83          return(2600);
84
85 L5100:  if(K != GRATE) goto L5110;
86         if(LOC == 1 || LOC == 4 || LOC == 7)K=DPRSSN;
87         if(LOC > 9 && LOC < 15)K=ENTRNC;
88         if(K != GRATE) return(8);
89 L5110:  if(K == DWARF && ATDWRF(LOC) > 0) goto L5010;
90         if((LIQ(0) == K && HERE(BOTTLE)) || K == LIQLOC(LOC)) goto L5010;
91         if(OBJ != OIL || !HERE(URN) || PROP[URN] == 0) goto L5120;
92         OBJ=URN;
93          goto L5010;
94 L5120:  if(OBJ != PLANT || !AT(PLANT2) || PROP[PLANT2] == 0) goto L5130;
95         OBJ=PLANT2;
96          goto L5010;
97 L5130:  if(OBJ != KNIFE || KNFLOC != LOC) goto L5140;
98         KNFLOC= -1;
99         SPK=116;
100          return(2011);
101 L5140:  if(OBJ != ROD || !HERE(ROD2)) goto L5190;
102         OBJ=ROD2;
103          goto L5010;
104 L5190:  if((VERB == FIND || VERB == INVENT) && WD2 <= 0) goto L5010;
105         SETPRM(1,WD1,WD1X);
106         RSPEAK(256);
107          return(2012);
108
109
110
111
112 /*  Routines for performing the various action verbs */
113
114 /*  Statement numbers in this section are 8000 for intransitive verbs, 9000 for
115  *  transitive, plus ten times the verb number.  many intransitive verbs use the
116  *  transitive code, and some verbs use code for other verbs, as noted below. */
117
118 /*  Carry, no object given yet.  OK if only one object present. */
119
120 L8010:  if(ATLOC[LOC] == 0 || LINK[ATLOC[LOC]] != 0 || ATDWRF(LOC) > 0) return(8000);
121         OBJ=ATLOC[LOC];
122
123 /*  Transitive carry/drop are in separate file. */
124
125 L9010:  return(carry());
126 L9020:  return(discard(false));
127
128 /*  SAY.  Echo WD2 (or WD1 if no WD2 (SAY WHAT?, etc.).)  Magic words override. */
129
130 L9030:  SETPRM(1,WD2,WD2X);
131         if(WD2 <= 0)SETPRM(1,WD1,WD1X);
132         if(WD2 > 0)WD1=WD2;
133         I=VOCAB(WD1,-1);
134         if(I == 62 || I == 65 || I == 71 || I == 2025 || I == 2034) goto L9035;
135         RSPEAK(258);
136          return(2012);
137
138 L9035:  WD2=0;
139         OBJ=0;
140          return(2630);
141
142 /*  Lock, unlock, no object given.  Assume various things if present. */
143
144 L8040:  SPK=28;
145         if(HERE(CLAM))OBJ=CLAM;
146         if(HERE(OYSTER))OBJ=OYSTER;
147         if(AT(DOOR))OBJ=DOOR;
148         if(AT(GRATE))OBJ=GRATE;
149         if(OBJ != 0 && HERE(CHAIN)) return(8000);
150         if(HERE(CHAIN))OBJ=CHAIN;
151         if(OBJ == 0) return(2011);
152
153 /*  Lock, unlock object.  Special stuff for opening clam/oyster and for chain. */
154
155 L9040:  if(OBJ == CLAM || OBJ == OYSTER) goto L9046;
156         if(OBJ == DOOR)SPK=111;
157         if(OBJ == DOOR && PROP[DOOR] == 1)SPK=54;
158         if(OBJ == CAGE)SPK=32;
159         if(OBJ == KEYS)SPK=55;
160         if(OBJ == GRATE || OBJ == CHAIN)SPK=31;
161         if(SPK != 31 || !HERE(KEYS)) return(2011);
162         if(OBJ == CHAIN) goto L9048;
163         if(!CLOSNG) goto L9043;
164         K=130;
165         if(!PANIC)CLOCK2=15;
166         PANIC=true;
167          return(2010);
168
169 L9043:  K=34+PROP[GRATE];
170         PROP[GRATE]=1;
171         if(VERB == LOCK)PROP[GRATE]=0;
172         K=K+2*PROP[GRATE];
173          return(2010);
174
175 /*  Clam/Oyster. */
176 L9046:  K=0;
177         if(OBJ == OYSTER)K=1;
178         SPK=124+K;
179         if(TOTING(OBJ))SPK=120+K;
180         if(!TOTING(TRIDNT))SPK=122+K;
181         if(VERB == LOCK)SPK=61;
182         if(SPK != 124) return(2011);
183         DSTROY(CLAM);
184         DROP(OYSTER,LOC);
185         DROP(PEARL,105);
186          return(2011);
187
188 /*  Chain. */
189 L9048:  if(VERB == LOCK) goto L9049;
190         SPK=171;
191         if(PROP[BEAR] == 0)SPK=41;
192         if(PROP[CHAIN] == 0)SPK=37;
193         if(SPK != 171) return(2011);
194         PROP[CHAIN]=0;
195         FIXED[CHAIN]=0;
196         if(PROP[BEAR] != 3)PROP[BEAR]=2;
197         FIXED[BEAR]=2-PROP[BEAR];
198          return(2011);
199
200 L9049:  SPK=172;
201         if(PROP[CHAIN] != 0)SPK=34;
202         if(LOC != PLAC[CHAIN])SPK=173;
203         if(SPK != 172) return(2011);
204         PROP[CHAIN]=2;
205         if(TOTING(CHAIN))DROP(CHAIN,LOC);
206         FIXED[CHAIN]= -1;
207          return(2011);
208
209 /*  Light.  Applicable only to lamp and urn. */
210
211 L8070:  if(HERE(LAMP) && PROP[LAMP] == 0 && LIMIT >= 0)OBJ=LAMP;
212         if(HERE(URN) && PROP[URN] == 1)OBJ=OBJ*100+URN;
213         if(OBJ == 0 || OBJ > 100) return(8000);
214
215 L9070:  if(OBJ == URN) goto L9073;
216         if(OBJ != LAMP) return(2011);
217         SPK=184;
218         if(LIMIT < 0) return(2011);
219         PROP[LAMP]=1;
220         RSPEAK(39);
221         if(WZDARK) return(2000);
222          return(2012);
223
224 L9073:  SPK=38;
225         if(PROP[URN] == 0) return(2011);
226         SPK=209;
227         PROP[URN]=2;
228          return(2011);
229
230 /*  Extinguish.  Lamp, urn, dragon/volcano (nice try). */
231
232 L8080:  if(HERE(LAMP) && PROP[LAMP] == 1)OBJ=LAMP;
233         if(HERE(URN) && PROP[URN] == 2)OBJ=OBJ*100+URN;
234         if(OBJ == 0 || OBJ > 100) return(8000);
235
236 L9080:  if(OBJ == URN) goto L9083;
237         if(OBJ == LAMP) goto L9086;
238         if(OBJ == DRAGON || OBJ == VOLCAN)SPK=146;
239          return(2011);
240
241 L9083:  PROP[URN]=PROP[URN]/2;
242         SPK=210;
243          return(2011);
244
245 L9086:  PROP[LAMP]=0;
246         RSPEAK(40);
247         if(DARK(0))RSPEAK(16);
248          return(2012);
249
250 /*  Wave.  No effect unless waving rod at fissure or at bird. */
251
252 L9090:  if((!TOTING(OBJ)) && (OBJ != ROD || !TOTING(ROD2)))SPK=29;
253         if(OBJ != ROD || !TOTING(OBJ) || (!HERE(BIRD) && (CLOSNG || !AT(FISSUR))))
254                 return(2011);
255         if(HERE(BIRD))SPK=206+MOD(PROP[BIRD],2);
256         if(SPK == 206 && LOC == PLACE[STEPS] && PROP[JADE] < 0) goto L9094;
257         if(CLOSED) return(18999);
258         if(CLOSNG || !AT(FISSUR)) return(2011);
259         if(HERE(BIRD))RSPEAK(SPK);
260         PROP[FISSUR]=1-PROP[FISSUR];
261         PSPEAK(FISSUR,2-PROP[FISSUR]);
262          return(2012);
263
264 L9094:  DROP(JADE,LOC);
265         PROP[JADE]=0;
266         TALLY=TALLY-1;
267         SPK=208;
268          return(2011);
269
270 /*  Attack also moved into separate module. */
271
272 L9120:  return(attack());
273
274 /*  Pour.  If no object, or object is bottle, assume contents of bottle.
275  *  special tests for pouring water or oil on plant or rusty door. */
276
277 L9130:  if(OBJ == BOTTLE || OBJ == 0)OBJ=LIQ(0);
278         if(OBJ == 0) return(8000);
279         if(!TOTING(OBJ)) return(2011);
280         SPK=78;
281         if(OBJ != OIL && OBJ != WATER) return(2011);
282         if(HERE(URN) && PROP[URN] == 0) goto L9134;
283         PROP[BOTTLE]=1;
284         PLACE[OBJ]=0;
285         SPK=77;
286         if(!(AT(PLANT) || AT(DOOR))) return(2011);
287
288         if(AT(DOOR)) goto L9132;
289         SPK=112;
290         if(OBJ != WATER) return(2011);
291         PSPEAK(PLANT,PROP[PLANT]+3);
292         PROP[PLANT]=MOD(PROP[PLANT]+1,3);
293         PROP[PLANT2]=PROP[PLANT];
294         K=NUL;
295          return(8);
296
297 L9132:  PROP[DOOR]=0;
298         if(OBJ == OIL)PROP[DOOR]=1;
299         SPK=113+PROP[DOOR];
300          return(2011);
301
302 L9134:  OBJ=URN;
303          goto L9220;
304
305 /*  Eat.  Intransitive: assume food if present, else ask what.  transitive: food
306  *  ok, some things lose appetite, rest are ridiculous. */
307
308 L8140:  if(!HERE(FOOD)) return(8000);
309 L8142:  DSTROY(FOOD);
310         SPK=72;
311          return(2011);
312
313 L9140:  if(OBJ == FOOD) goto L8142;
314         if(OBJ == BIRD || OBJ == SNAKE || OBJ == CLAM || OBJ == OYSTER || OBJ ==
315                 DWARF || OBJ == DRAGON || OBJ == TROLL || OBJ == BEAR || OBJ ==
316                 OGRE)SPK=71;
317          return(2011);
318
319 /*  Drink.  If no object, assume water and look for it here.  if water is in
320  *  the bottle, drink that, else must be at a water loc, so drink stream. */
321
322 L9150:  if(OBJ == 0 && LIQLOC(LOC) != WATER && (LIQ(0) != WATER || !HERE(BOTTLE)))
323                 return(8000);
324         if(OBJ == BLOOD) goto L9153;
325         if(OBJ != 0 && OBJ != WATER)SPK=110;
326         if(SPK == 110 || LIQ(0) != WATER || !HERE(BOTTLE)) return(2011);
327         PROP[BOTTLE]=1;
328         PLACE[WATER]=0;
329         SPK=74;
330          return(2011);
331
332 L9153:  DSTROY(BLOOD);
333         PROP[DRAGON]=2;
334         OBJSND[BIRD]=OBJSND[BIRD]+3;
335         SPK=240;
336          return(2011);
337
338 /*  Rub.  Yields various snide remarks except for lit urn. */
339
340 L9160:  if(OBJ != LAMP)SPK=76;
341         if(OBJ != URN || PROP[URN] != 2) return(2011);
342         DSTROY(URN);
343         DROP(AMBER,LOC);
344         PROP[AMBER]=1;
345         TALLY=TALLY-1;
346         DROP(CAVITY,LOC);
347         SPK=216;
348          return(2011);
349
350 /*  Throw moved into separate module. */
351
352 L9170:  return(throw());
353
354 /*  Quit.  Intransitive only.  verify intent and exit if that's what he wants. */
355
356 L8180:  if(YES(22,54,54)) score(1);
357          return(2012);
358
359 /*  Find.  Might be carrying it, or it might be here.  Else give caveat. */
360
361 L9190:  if(AT(OBJ) || (LIQ(0) == OBJ && AT(BOTTLE)) || K == LIQLOC(LOC) || (OBJ ==
362                 DWARF && ATDWRF(LOC) > 0))SPK=94;
363         if(CLOSED)SPK=138;
364         if(TOTING(OBJ))SPK=24;
365          return(2011);
366
367 /*  Inventory.  If object, treat same as find.  Else report on current burden. */
368
369 L8200:  SPK=98;
370         /* 8201 */ for (I=1; I<=100; I++) {
371         if(I == BEAR || !TOTING(I)) goto L8201;
372         if(SPK == 98)RSPEAK(99);
373         BLKLIN=false;
374         PSPEAK(I,-1);
375         BLKLIN=true;
376         SPK=0;
377 L8201:  /*etc*/ ;
378         } /* end loop */
379         if(TOTING(BEAR))SPK=141;
380          return(2011);
381
382 /* Feed/fill are in the other module. */
383
384 L9210:  return(feed());
385 L9220:  return(fill());
386
387 /*  Blast.  No effect unless you've got dynamite, which is a neat trick! */
388
389 L9230:  if(PROP[ROD2] < 0 || !CLOSED) return(2011);
390         BONUS=133;
391         if(LOC == 115)BONUS=134;
392         if(HERE(ROD2))BONUS=135;
393         RSPEAK(BONUS);
394          score(0);
395
396 /*  Score.  Call scoring routine but tell it to return. */
397
398 L8240:  score(-1);
399         SETPRM(1,SCORE,MXSCOR);
400         SETPRM(3,TURNS,TURNS);
401         RSPEAK(259);
402          return(2012);
403
404 /*  FEE FIE FOE FOO (AND FUM).  ADVANCE TO NEXT STATE IF GIVEN IN PROPER ORDER.
405  *  LOOK UP WD1 IN SECTION 3 OF VOCAB TO DETERMINE WHICH WORD WE'VE GOT.  LAST
406  *  WORD ZIPS THE EGGS BACK TO THE GIANT ROOM (UNLESS ALREADY THERE). */
407
408 L8250:  K=VOCAB(WD1,3);
409         SPK=42;
410         if(FOOBAR == 1-K) goto L8252;
411         if(FOOBAR != 0)SPK=151;
412          return(2011);
413
414 L8252:  FOOBAR=K;
415         if(K != 4) return(2009);
416         FOOBAR=0;
417         if(PLACE[EGGS] == PLAC[EGGS] || (TOTING(EGGS) && LOC == PLAC[EGGS])) 
418                 return(2011);
419 /*  Bring back troll if we steal the eggs back from him before crossing. */
420         if(PLACE[EGGS] == 0 && PLACE[TROLL] == 0 && PROP[TROLL] ==
421                 0)PROP[TROLL]=1;
422         K=2;
423         if(HERE(EGGS))K=1;
424         if(LOC == PLAC[EGGS])K=0;
425         MOVE(EGGS,PLAC[EGGS]);
426         PSPEAK(EGGS,K);
427          return(2012);
428
429 /*  Brief.  Intransitive only.  Suppress long descriptions after first time. */
430
431 L8260:  SPK=156;
432         ABBNUM=10000;
433         DETAIL=3;
434          return(2011);
435
436 /*  Read.  Print stuff based on objtxt.  Oyster (?) is special case. */
437
438 L8270:  for (I=1; I<=100; I++) {
439         if(HERE(I) && OBJTXT[I] != 0 && PROP[I] >= 0)OBJ=OBJ*100+I;
440         } /* end loop */
441         if(OBJ > 100 || OBJ == 0 || DARK(0)) return(8000);
442
443 L9270:  if(DARK(0)) goto L5190;
444         if(OBJTXT[OBJ] == 0 || PROP[OBJ] < 0) return(2011);
445         if(OBJ == OYSTER && !CLSHNT) goto L9275;
446         PSPEAK(OBJ,OBJTXT[OBJ]+PROP[OBJ]);
447          return(2012);
448
449 L9275:  CLSHNT=YES(192,193,54);
450          return(2012);
451
452 /*  Break.  Only works for mirror in repository and, of course, the vase. */
453
454 L9280:  if(OBJ == MIRROR)SPK=148;
455         if(OBJ == VASE && PROP[VASE] == 0) goto L9282;
456         if(OBJ != MIRROR || !CLOSED) return(2011);
457         SPK=197;
458          return(18999);
459
460 L9282:  SPK=198;
461         if(TOTING(VASE))DROP(VASE,LOC);
462         PROP[VASE]=2;
463         FIXED[VASE]= -1;
464          return(2011);
465
466 /*  Wake.  Only use is to disturb the dwarves. */
467
468 L9290:  if(OBJ != DWARF || !CLOSED) return(2011);
469         SPK=199;
470          return(18999);
471
472 /*  Suspend.  Offer to save things in a file, but charging some points (so
473  *  can't win by using saved games to retry battles or to start over after
474  *  learning zzword). */
475
476 L8300:  SPK=201;
477         RSPEAK(260);
478         if(!YES(200,54,54)) return(2012);
479         SAVED=SAVED+5;
480         KK= -1;
481
482 /*  This next part is shared with the "resume" code.  the two cases are
483  *  distinguished by the value of kk (-1 for suspend, +1 for resume). */
484
485 L8305:  DATIME(I,K);
486         K=I+650*K;
487         SAVWRD(KK,K);
488         K=VRSION;
489         SAVWRD(0,K);
490         if(K != VRSION) goto L8312;
491 /*  Herewith are all the variables whose values can change during a game,
492  *  omitting a few (such as I, J, ATTACK) whose values between turns are
493  *  irrelevant and some whose values when a game is
494  *  suspended or resumed are guaranteed to match.  if unsure whether a value
495  *  needs to be saved, include it.  overkill can't hurt.  pad the last savwds
496  *  with junk variables to bring it up to 7 values. */
497         SAVWDS(ABBNUM,BLKLIN,BONUS,CLOCK1,CLOCK2,CLOSED,CLOSNG);
498         SAVWDS(DETAIL,DFLAG,DKILL,DTOTAL,FOOBAR,HOLDNG,IWEST);
499         SAVWDS(KNFLOC,LIMIT,LL,LMWARN,LOC,NEWLOC,NUMDIE);
500         SAVWDS(OBJ,OLDLC2,OLDLOC,OLDOBJ,PANIC,SAVED,SETUP);
501         SAVWDS(SPK,TALLY,THRESH,TRNDEX,TRNLUZ,TURNS,OBJTXT[OYSTER]);
502         SAVWDS(VERB,WD1,WD1X,WD2,WZDARK,ZZWORD,OBJSND[BIRD]);
503         SAVWDS(OBJTXT[SIGN],CLSHNT,NOVICE,K,K,K,K);
504         SAVARR(ABB,LOCSIZ);
505         SAVARR(ATLOC,LOCSIZ);
506         SAVARR(DLOC,6);
507         SAVARR(DSEEN,6);
508         SAVARR(FIXED,100);
509         SAVARR(HINTED,HNTSIZ);
510         SAVARR(HINTLC,HNTSIZ);
511         SAVARR(LINK,200);
512         SAVARR(ODLOC,6);
513         SAVARR(PLACE,100);
514         SAVARR(PROP,100);
515         SAVWRD(KK,K);
516         if(K != 0) goto L8318;
517         K=NUL;
518         ZZWORD=RNDVOC(3,ZZWORD-MESH*2)+MESH*2;
519         if(KK > 0) return(8);
520         RSPEAK(266);
521         exit(0);
522
523 /*  Resume.  Read a suspended game back from a file. */
524
525 L8310:  KK=1;
526         if(LOC == 1 && ABB[1] == 1) goto L8305;
527         RSPEAK(268);
528         if(!YES(200,54,54)) return(2012);
529          goto L8305;
530
531 L8312:  SETPRM(1,K/10,MOD(K,10));
532         SETPRM(3,VRSION/10,MOD(VRSION,10));
533         RSPEAK(269);
534          return(2000);
535
536 L8318:  RSPEAK(270);
537         exit(0);
538
539 /*  Fly.  Snide remarks unless hovering rug is here. */
540
541 L8320:  if(PROP[RUG] != 2)SPK=224;
542         if(!HERE(RUG))SPK=225;
543         if(SPK/2 == 112) return(2011);
544         OBJ=RUG;
545
546 L9320:  if(OBJ != RUG) return(2011);
547         SPK=223;
548         if(PROP[RUG] != 2) return(2011);
549         OLDLC2=OLDLOC;
550         OLDLOC=LOC;
551         NEWLOC=PLACE[RUG]+FIXED[RUG]-LOC;
552         SPK=226;
553         if(PROP[SAPPH] >= 0)SPK=227;
554         RSPEAK(SPK);
555          return(2);
556
557 /*  Listen.  Intransitive only.  Print stuff based on objsnd/locsnd. */
558
559 L8330:  SPK=228;
560         K=LOCSND[LOC];
561         if(K == 0) goto L8332;
562         RSPEAK(IABS(K));
563         if(K < 0) return(2012);
564         SPK=0;
565 L8332:  SETPRM(1,ZZWORD-MESH*2,0);
566         /* 8335 */ for (I=1; I<=100; I++) {
567         if(!HERE(I) || OBJSND[I] == 0 || PROP[I] < 0) goto L8335;
568         PSPEAK(I,OBJSND[I]+PROP[I]);
569         SPK=0;
570         if(I == BIRD && OBJSND[I]+PROP[I] == 8)DSTROY(BIRD);
571 L8335:  /*etc*/ ;
572         } /* end loop */
573          return(2011);
574
575 /*  Z'ZZZ (word gets recomputed at startup; different each game). */
576
577 L8340:  if(!AT(RESER) && LOC != FIXED[RESER]-1) return(2011);
578         PSPEAK(RESER,PROP[RESER]+1);
579         PROP[RESER]=1-PROP[RESER];
580         if(AT(RESER)) return(2012);
581         OLDLC2=LOC;
582         NEWLOC=0;
583         RSPEAK(241);
584          return(2);
585
586 }