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