OpenCores
URL https://opencores.org/ocsvn/ion/ion/trunk

Subversion Repositories ion

[/] [ion/] [trunk/] [src/] [adventure/] [actions1.c] - Blame information for rev 249

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 90 ja_rd
#include "misc.h"
2
#include "main.h"
3
#include "share.h"
4
#include "funcs.h"
5
 
6
#define TRUE  (0==0)
7
#define FALSE (0!=0)
8
 
9
extern carry(), discard(long), attack(), throw(), feed(), fill();
10
 
11
/* This stuff was broken off as part of an effort to get the main program
12
 * to compile without running out of memory.  We're called with a number
13
 * that says what label the caller wanted to "goto", and we return a
14
 * similar label number for the caller to "goto".
15
 */
16
 
17
/*  ANALYSE A VERB.  REMEMBER WHAT IT WAS, GO BACK FOR OBJECT IF SECOND WORD
18
 *  UNLESS VERB IS "SAY", WHICH SNARFS ARBITRARY SECOND WORD. */
19
 
20
action(STARTAT)long STARTAT; {
21
        switch(STARTAT) {
22
           case 4000: goto L4000;
23
           case 4090: goto L4090;
24
           case 5000: goto L5000;
25
           }
26
        BUG(99);
27
 
28
L4000:  VERB=K;
29
        SPK=ACTSPK[VERB];
30
        if(WD2 > 0 && VERB != SAY) return(2800);
31
        if(VERB == SAY)OBJ=WD2;
32
        if(OBJ > 0) goto L4090;
33
 
34
/*  ANALYSE AN INTRANSITIVE VERB (IE, NO OBJECT GIVEN YET). */
35
 
36
L4080:  switch (VERB-1) { case 0: goto L8010; case 1: return(8000); case 2:
37
                return(8000); case 3: goto L8040; case 4: return(2009); case 5: goto L8040;
38
                case 6: goto L8070; case 7: goto L8080; case 8: return(8000); case
39
                9: return(8000); case 10: return(2011); case 11: goto L9120; case 12:
40
                goto L9130; case 13: goto L8140; case 14: goto L9150; case 15:
41
                return(8000); case 16: return(8000); case 17: goto L8180; case 18:
42
                return(8000); case 19: goto L8200; case 20: return(8000); case 21:
43
                goto L9220; case 22: goto L9230; case 23: goto L8240; case 24:
44
                goto L8250; case 25: goto L8260; case 26: goto L8270; case 27:
45
                return(8000); case 28: return(8000); case 29: goto L8300; case 30:
46
                goto L8310; case 31: goto L8320; case 32: goto L8330; case 33:
47
                goto L8340; }
48
/*           TAKE DROP  SAY OPEN NOTH LOCK   ON  OFF WAVE CALM
49
 *           WALK KILL POUR  EAT DRNK  RUB TOSS QUIT FIND INVN
50
 *           FEED FILL BLST SCOR  FOO  BRF READ BREK WAKE SUSP
51
 *           RESU FLY  LSTN ZZZZ */
52
        BUG(23);
53
 
54
/*  ANALYSE A TRANSITIVE VERB. */
55
 
56
L4090:  switch (VERB-1) { case 0: goto L9010; case 1: goto L9020; case 2: goto
57
                L9030; case 3: goto L9040; case 4: return(2009); case 5: goto L9040;
58
                case 6: goto L9070; case 7: goto L9080; case 8: goto L9090; case
59
                9: return(2011); case 10: return(2011); case 11: goto L9120; case 12:
60
                goto L9130; case 13: goto L9140; case 14: goto L9150; case 15:
61
                goto L9160; case 16: goto L9170; case 17: return(2011); case 18:
62
                goto L9190; case 19: goto L9190; case 20: goto L9210; case 21:
63
                goto L9220; case 22: goto L9230; case 23: return(2011); case 24:
64
                return(2011); case 25: return(2011); case 26: goto L9270; case 27:
65
                goto L9280; case 28: goto L9290; case 29: return(2011); case 30:
66
                return(2011); case 31: goto L9320; case 32: return(2011); case 33:
67
                goto L8340; }
68
/*           TAKE DROP  SAY OPEN NOTH LOCK   ON  OFF WAVE CALM
69
 *           WALK KILL POUR  EAT DRNK  RUB TOSS QUIT FIND INVN
70
 *           FEED FILL BLST SCOR  FOO  BRF READ BREK WAKE SUSP
71
 *           RESU FLY  LSTN ZZZZ */
72
        BUG(24);
73
 
74
/*  ANALYSE AN OBJECT WORD.  SEE IF THE THING IS HERE, WHETHER WE'VE GOT A VERB
75
 *  YET, AND SO ON.  OBJECT MUST BE HERE UNLESS VERB IS "FIND" OR "INVENT(ORY)"
76
 *  (AND NO NEW VERB YET TO BE ANALYSED).  WATER AND OIL ARE ALSO FUNNY, SINCE
77
 *  THEY ARE NEVER ACTUALLY DROPPED AT ANY LOCATION, BUT MIGHT BE HERE INSIDE
78
 *  THE BOTTLE OR URN OR AS A FEATURE OF THE LOCATION. */
79
 
80
L5000:  OBJ=K;
81
        if(!HERE(K)) goto L5100;
82
L5010:  if(WD2 > 0) return(2800);
83
        if(VERB != 0) goto L4090;
84
        SETPRM(1,WD1,WD1X);
85
        RSPEAK(255);
86
         return(2600);
87
 
88
L5100:  if(K != GRATE) goto L5110;
89
        if(LOC == 1 || LOC == 4 || LOC == 7)K=DPRSSN;
90
        if(LOC > 9 && LOC < 15)K=ENTRNC;
91
        if(K != GRATE) return(8);
92
L5110:  if(K == DWARF && ATDWRF(LOC) > 0) goto L5010;
93
        if((LIQ(0) == K && HERE(BOTTLE)) || K == LIQLOC(LOC)) goto L5010;
94
        if(OBJ != OIL || !HERE(URN) || PROP[URN] == 0) goto L5120;
95
        OBJ=URN;
96
         goto L5010;
97
L5120:  if(OBJ != PLANT || !AT(PLANT2) || PROP[PLANT2] == 0) goto L5130;
98
        OBJ=PLANT2;
99
         goto L5010;
100
L5130:  if(OBJ != KNIFE || KNFLOC != LOC) goto L5140;
101
        KNFLOC= -1;
102
        SPK=116;
103
         return(2011);
104
L5140:  if(OBJ != ROD || !HERE(ROD2)) goto L5190;
105
        OBJ=ROD2;
106
         goto L5010;
107
L5190:  if((VERB == FIND || VERB == INVENT) && WD2 <= 0) goto L5010;
108
        SETPRM(1,WD1,WD1X);
109
        RSPEAK(256);
110
         return(2012);
111
 
112
 
113
 
114
 
115
/*  ROUTINES FOR PERFORMING THE VARIOUS ACTION VERBS */
116
 
117
/*  STATEMENT NUMBERS IN THIS SECTION ARE 8000 FOR INTRANSITIVE VERBS, 9000 FOR
118
 *  TRANSITIVE, PLUS TEN TIMES THE VERB NUMBER.  MANY INTRANSITIVE VERBS USE THE
119
 *  TRANSITIVE CODE, AND SOME VERBS USE CODE FOR OTHER VERBS, AS NOTED BELOW. */
120
 
121
/*  CARRY, NO OBJECT GIVEN YET.  OK IF ONLY ONE OBJECT PRESENT. */
122
 
123
L8010:  if(ATLOC[LOC] == 0 || LINK[ATLOC[LOC]] != 0 || ATDWRF(LOC) > 0) return(8000);
124
        OBJ=ATLOC[LOC];
125
 
126
/*  TRANSITIVE CARRY/DROP ARE IN SEPARATE FILE. */
127
 
128
L9010:  return(carry());
129
L9020:  return(discard(FALSE));
130
 
131
/*  SAY.  ECHO WD2 (OR WD1 IF NO WD2 (SAY WHAT?, ETC.).)  MAGIC WORDS OVERRIDE. */
132
 
133
L9030:  SETPRM(1,WD2,WD2X);
134
        if(WD2 <= 0)SETPRM(1,WD1,WD1X);
135
        if(WD2 > 0)WD1=WD2;
136
        I=VOCAB(WD1,-1);
137
        if(I == 62 || I == 65 || I == 71 || I == 2025 || I == 2034) goto L9035;
138
        RSPEAK(258);
139
         return(2012);
140
 
141
L9035:  WD2=0;
142
        OBJ=0;
143
         return(2630);
144
 
145
/*  LOCK, UNLOCK, NO OBJECT GIVEN.  ASSUME VARIOUS THINGS IF PRESENT. */
146
 
147
L8040:  SPK=28;
148
        if(HERE(CLAM))OBJ=CLAM;
149
        if(HERE(OYSTER))OBJ=OYSTER;
150
        if(AT(DOOR))OBJ=DOOR;
151
        if(AT(GRATE))OBJ=GRATE;
152
        if(OBJ != 0 && HERE(CHAIN)) return(8000);
153
        if(HERE(CHAIN))OBJ=CHAIN;
154
        if(OBJ == 0) return(2011);
155
 
156
/*  LOCK, UNLOCK OBJECT.  SPECIAL STUFF FOR OPENING CLAM/OYSTER AND FOR CHAIN. */
157
 
158
L9040:  if(OBJ == CLAM || OBJ == OYSTER) goto L9046;
159
        if(OBJ == DOOR)SPK=111;
160
        if(OBJ == DOOR && PROP[DOOR] == 1)SPK=54;
161
        if(OBJ == CAGE)SPK=32;
162
        if(OBJ == KEYS)SPK=55;
163
        if(OBJ == GRATE || OBJ == CHAIN)SPK=31;
164
        if(SPK != 31 || !HERE(KEYS)) return(2011);
165
        if(OBJ == CHAIN) goto L9048;
166
        if(!CLOSNG) goto L9043;
167
        K=130;
168
        if(!PANIC)CLOCK2=15;
169
        PANIC=TRUE;
170
         return(2010);
171
 
172
L9043:  K=34+PROP[GRATE];
173
        PROP[GRATE]=1;
174
        if(VERB == LOCK)PROP[GRATE]=0;
175
        K=K+2*PROP[GRATE];
176
         return(2010);
177
 
178
/*  CLAM/OYSTER. */
179
L9046:  K=0;
180
        if(OBJ == OYSTER)K=1;
181
        SPK=124+K;
182
        if(TOTING(OBJ))SPK=120+K;
183
        if(!TOTING(TRIDNT))SPK=122+K;
184
        if(VERB == LOCK)SPK=61;
185
        if(SPK != 124) return(2011);
186
        DSTROY(CLAM);
187
        DROP(OYSTER,LOC);
188
        DROP(PEARL,105);
189
         return(2011);
190
 
191
/*  CHAIN. */
192
L9048:  if(VERB == LOCK) goto L9049;
193
        SPK=171;
194
        if(PROP[BEAR] == 0)SPK=41;
195
        if(PROP[CHAIN] == 0)SPK=37;
196
        if(SPK != 171) return(2011);
197
        PROP[CHAIN]=0;
198
        FIXED[CHAIN]=0;
199
        if(PROP[BEAR] != 3)PROP[BEAR]=2;
200
        FIXED[BEAR]=2-PROP[BEAR];
201
         return(2011);
202
 
203
L9049:  SPK=172;
204
        if(PROP[CHAIN] != 0)SPK=34;
205
        if(LOC != PLAC[CHAIN])SPK=173;
206
        if(SPK != 172) return(2011);
207
        PROP[CHAIN]=2;
208
        if(TOTING(CHAIN))DROP(CHAIN,LOC);
209
        FIXED[CHAIN]= -1;
210
         return(2011);
211
 
212
/*  LIGHT.  APPLICABLE ONLY TO LAMP AND URN. */
213
 
214
L8070:  if(HERE(LAMP) && PROP[LAMP] == 0 && LIMIT >= 0)OBJ=LAMP;
215
        if(HERE(URN) && PROP[URN] == 1)OBJ=OBJ*100+URN;
216
        if(OBJ == 0 || OBJ > 100) return(8000);
217
 
218
L9070:  if(OBJ == URN) goto L9073;
219
        if(OBJ != LAMP) return(2011);
220
        SPK=184;
221
        if(LIMIT < 0) return(2011);
222
        PROP[LAMP]=1;
223
        RSPEAK(39);
224
        if(WZDARK) return(2000);
225
         return(2012);
226
 
227
L9073:  SPK=38;
228
        if(PROP[URN] == 0) return(2011);
229
        SPK=209;
230
        PROP[URN]=2;
231
         return(2011);
232
 
233
/*  EXTINGUISH.  LAMP, URN, DRAGON/VOLCANO (NICE TRY). */
234
 
235
L8080:  if(HERE(LAMP) && PROP[LAMP] == 1)OBJ=LAMP;
236
        if(HERE(URN) && PROP[URN] == 2)OBJ=OBJ*100+URN;
237
        if(OBJ == 0 || OBJ > 100) return(8000);
238
 
239
L9080:  if(OBJ == URN) goto L9083;
240
        if(OBJ == LAMP) goto L9086;
241
        if(OBJ == DRAGON || OBJ == VOLCAN)SPK=146;
242
         return(2011);
243
 
244
L9083:  PROP[URN]=PROP[URN]/2;
245
        SPK=210;
246
         return(2011);
247
 
248
L9086:  PROP[LAMP]=0;
249
        RSPEAK(40);
250
        if(DARK(0))RSPEAK(16);
251
         return(2012);
252
 
253
/*  WAVE.  NO EFFECT UNLESS WAVING ROD AT FISSURE OR AT BIRD. */
254
 
255
L9090:  if((!TOTING(OBJ)) && (OBJ != ROD || !TOTING(ROD2)))SPK=29;
256
        if(OBJ != ROD || !TOTING(OBJ) || (!HERE(BIRD) && (CLOSNG || !AT(FISSUR))))
257
                return(2011);
258
        if(HERE(BIRD))SPK=206+MOD(PROP[BIRD],2);
259
        if(SPK == 206 && LOC == PLACE[STEPS] && PROP[JADE] < 0) goto L9094;
260
        if(CLOSED) return(18999);
261
        if(CLOSNG || !AT(FISSUR)) return(2011);
262
        if(HERE(BIRD))RSPEAK(SPK);
263
        PROP[FISSUR]=1-PROP[FISSUR];
264
        PSPEAK(FISSUR,2-PROP[FISSUR]);
265
         return(2012);
266
 
267
L9094:  DROP(JADE,LOC);
268
        PROP[JADE]=0;
269
        TALLY=TALLY-1;
270
        SPK=208;
271
         return(2011);
272
 
273
/*  ATTACK ALSO MOVED INTO SEPARATE MODULE. */
274
 
275
L9120:  return(attack());
276
 
277
/*  POUR.  IF NO OBJECT, OR OBJECT IS BOTTLE, ASSUME CONTENTS OF BOTTLE.
278
 *  SPECIAL TESTS FOR POURING WATER OR OIL ON PLANT OR RUSTY DOOR. */
279
 
280
L9130:  if(OBJ == BOTTLE || OBJ == 0)OBJ=LIQ(0);
281
        if(OBJ == 0) return(8000);
282
        if(!TOTING(OBJ)) return(2011);
283
        SPK=78;
284
        if(OBJ != OIL && OBJ != WATER) return(2011);
285
        if(HERE(URN) && PROP[URN] == 0) goto L9134;
286
        PROP[BOTTLE]=1;
287
        PLACE[OBJ]=0;
288
        SPK=77;
289
        if(!(AT(PLANT) || AT(DOOR))) return(2011);
290
 
291
        if(AT(DOOR)) goto L9132;
292
        SPK=112;
293
        if(OBJ != WATER) return(2011);
294
        PSPEAK(PLANT,PROP[PLANT]+3);
295
        PROP[PLANT]=MOD(PROP[PLANT]+1,3);
296
        PROP[PLANT2]=PROP[PLANT];
297
        K=NUL;
298
         return(8);
299
 
300
L9132:  PROP[DOOR]=0;
301
        if(OBJ == OIL)PROP[DOOR]=1;
302
        SPK=113+PROP[DOOR];
303
         return(2011);
304
 
305
L9134:  OBJ=URN;
306
         goto L9220;
307
 
308
/*  EAT.  INTRANSITIVE: ASSUME FOOD IF PRESENT, ELSE ASK WHAT.  TRANSITIVE: FOOD
309
 *  OK, SOME THINGS LOSE APPETITE, REST ARE RIDICULOUS. */
310
 
311
L8140:  if(!HERE(FOOD)) return(8000);
312
L8142:  DSTROY(FOOD);
313
        SPK=72;
314
         return(2011);
315
 
316
L9140:  if(OBJ == FOOD) goto L8142;
317
        if(OBJ == BIRD || OBJ == SNAKE || OBJ == CLAM || OBJ == OYSTER || OBJ ==
318
                DWARF || OBJ == DRAGON || OBJ == TROLL || OBJ == BEAR || OBJ ==
319
                OGRE)SPK=71;
320
         return(2011);
321
 
322
/*  DRINK.  IF NO OBJECT, ASSUME WATER AND LOOK FOR IT HERE.  IF WATER IS IN
323
 *  THE BOTTLE, DRINK THAT, ELSE MUST BE AT A WATER LOC, SO DRINK STREAM. */
324
 
325
L9150:  if(OBJ == 0 && LIQLOC(LOC) != WATER && (LIQ(0) != WATER || !HERE(BOTTLE)))
326
                return(8000);
327
        if(OBJ == BLOOD) goto L9153;
328
        if(OBJ != 0 && OBJ != WATER)SPK=110;
329
        if(SPK == 110 || LIQ(0) != WATER || !HERE(BOTTLE)) return(2011);
330
        PROP[BOTTLE]=1;
331
        PLACE[WATER]=0;
332
        SPK=74;
333
         return(2011);
334
 
335
L9153:  DSTROY(BLOOD);
336
        PROP[DRAGON]=2;
337
        OBJSND[BIRD]=OBJSND[BIRD]+3;
338
        SPK=240;
339
         return(2011);
340
 
341
/*  RUB.  YIELDS VARIOUS SNIDE REMARKS EXCEPT FOR LIT URN. */
342
 
343
L9160:  if(OBJ != LAMP)SPK=76;
344
        if(OBJ != URN || PROP[URN] != 2) return(2011);
345
        DSTROY(URN);
346
        DROP(AMBER,LOC);
347
        PROP[AMBER]=1;
348
        TALLY=TALLY-1;
349
        DROP(CAVITY,LOC);
350
        SPK=216;
351
         return(2011);
352
 
353
/*  THROW MOVED INTO SEPARATE MODULE. */
354
 
355
L9170:  return(throw());
356
 
357
/*  QUIT.  INTRANSITIVE ONLY.  VERIFY INTENT AND EXIT IF THAT'S WHAT HE WANTS. */
358
 
359
L8180:  if(YES(22,54,54)) score(1);
360
         return(2012);
361
 
362
/*  FIND.  MIGHT BE CARRYING IT, OR IT MIGHT BE HERE.  ELSE GIVE CAVEAT. */
363
 
364
L9190:  if(AT(OBJ) || (LIQ(0) == OBJ && AT(BOTTLE)) || K == LIQLOC(LOC) || (OBJ ==
365
                DWARF && ATDWRF(LOC) > 0))SPK=94;
366
        if(CLOSED)SPK=138;
367
        if(TOTING(OBJ))SPK=24;
368
         return(2011);
369
 
370
/*  INVENTORY.  IF OBJECT, TREAT SAME AS FIND.  ELSE REPORT ON CURRENT BURDEN. */
371
 
372
L8200:  SPK=98;
373
        /* 8201 */ for (I=1; I<=100; I++) {
374
        if(I == BEAR || !TOTING(I)) goto L8201;
375
        if(SPK == 98)RSPEAK(99);
376
        BLKLIN=FALSE;
377
        PSPEAK(I,-1);
378
        BLKLIN=TRUE;
379
        SPK=0;
380
L8201:  /*etc*/ ;
381
        } /* end loop */
382
        if(TOTING(BEAR))SPK=141;
383
         return(2011);
384
 
385
/* FEED/FILL ARE IN THE OTHER MODULE. */
386
 
387
L9210:  return(feed());
388
L9220:  return(fill());
389
 
390
/*  BLAST.  NO EFFECT UNLESS YOU'VE GOT DYNAMITE, WHICH IS A NEAT TRICK! */
391
 
392
L9230:  if(PROP[ROD2] < 0 || !CLOSED) return(2011);
393
        BONUS=133;
394
        if(LOC == 115)BONUS=134;
395
        if(HERE(ROD2))BONUS=135;
396
        RSPEAK(BONUS);
397
         score(0);
398
 
399
/*  SCORE.  CALL SCORING ROUTINE BUT TELL IT TO RETURN. */
400
 
401
L8240:  score(-1);
402
        SETPRM(1,SCORE,MXSCOR);
403
        SETPRM(3,TURNS,TURNS);
404
        RSPEAK(259);
405
         return(2012);
406
 
407
/*  FEE FIE FOE FOO (AND FUM).  ADVANCE TO NEXT STATE IF GIVEN IN PROPER ORDER.
408
 *  LOOK UP WD1 IN SECTION 3 OF VOCAB TO DETERMINE WHICH WORD WE'VE GOT.  LAST
409
 *  WORD ZIPS THE EGGS BACK TO THE GIANT ROOM (UNLESS ALREADY THERE). */
410
 
411
L8250:  K=VOCAB(WD1,3);
412
        SPK=42;
413
        if(FOOBAR == 1-K) goto L8252;
414
        if(FOOBAR != 0)SPK=151;
415
         return(2011);
416
 
417
L8252:  FOOBAR=K;
418
        if(K != 4) return(2009);
419
        FOOBAR=0;
420
        if(PLACE[EGGS] == PLAC[EGGS] || (TOTING(EGGS) && LOC == PLAC[EGGS]))
421
                return(2011);
422
/*  BRING BACK TROLL IF WE STEAL THE EGGS BACK FROM HIM BEFORE CROSSING. */
423
        if(PLACE[EGGS] == 0 && PLACE[TROLL] == 0 && PROP[TROLL] ==
424
                0)PROP[TROLL]=1;
425
        K=2;
426
        if(HERE(EGGS))K=1;
427
        if(LOC == PLAC[EGGS])K=0;
428
        MOVE(EGGS,PLAC[EGGS]);
429
        PSPEAK(EGGS,K);
430
         return(2012);
431
 
432
/*  BRIEF.  INTRANSITIVE ONLY.  SUPPRESS LONG DESCRIPTIONS AFTER FIRST TIME. */
433
 
434
L8260:  SPK=156;
435
        ABBNUM=10000;
436
        DETAIL=3;
437
         return(2011);
438
 
439
/*  READ.  PRINT STUFF BASED ON OBJTXT.  OYSTER (?) IS SPECIAL CASE. */
440
 
441
L8270:  /* 8275 */ for (I=1; I<=100; I++) {
442
L8275:  if(HERE(I) && OBJTXT[I] != 0 && PROP[I] >= 0)OBJ=OBJ*100+I;
443
        } /* end loop */
444
        if(OBJ > 100 || OBJ == 0 || DARK(0)) return(8000);
445
 
446
L9270:  if(DARK(0)) goto L5190;
447
        if(OBJTXT[OBJ] == 0 || PROP[OBJ] < 0) return(2011);
448
        if(OBJ == OYSTER && !CLSHNT) goto L9275;
449
        PSPEAK(OBJ,OBJTXT[OBJ]+PROP[OBJ]);
450
         return(2012);
451
 
452
L9275:  CLSHNT=YES(192,193,54);
453
         return(2012);
454
 
455
/*  BREAK.  ONLY WORKS FOR MIRROR IN REPOSITORY AND, OF COURSE, THE VASE. */
456
 
457
L9280:  if(OBJ == MIRROR)SPK=148;
458
        if(OBJ == VASE && PROP[VASE] == 0) goto L9282;
459
        if(OBJ != MIRROR || !CLOSED) return(2011);
460
        SPK=197;
461
         return(18999);
462
 
463
L9282:  SPK=198;
464
        if(TOTING(VASE))DROP(VASE,LOC);
465
        PROP[VASE]=2;
466
        FIXED[VASE]= -1;
467
         return(2011);
468
 
469
/*  WAKE.  ONLY USE IS TO DISTURB THE DWARVES. */
470
 
471
L9290:  if(OBJ != DWARF || !CLOSED) return(2011);
472
        SPK=199;
473
         return(18999);
474
 
475
/*  SUSPEND.  OFFER TO SAVE THINGS IN A FILE, BUT CHARGING SOME POINTS (SO
476
 *  CAN'T WIN BY USING SAVED GAMES TO RETRY BATTLES OR TO START OVER AFTER
477
 *  LEARNING ZZWORD). */
478
 
479
L8300:  SPK=201;
480
        RSPEAK(260);
481
        if(!YES(200,54,54)) return(2012);
482
        SAVED=SAVED+5;
483
        KK= -1;
484
 
485
/*  THIS NEXT PART IS SHARED WITH THE "RESUME" CODE.  THE TWO CASES ARE
486
 *  DISTINGUISHED BY THE VALUE OF KK (-1 FOR SUSPEND, +1 FOR RESUME). */
487
 
488
L8305:  DATIME(I,K);
489
        K=I+650*K;
490
        SAVWRD(KK,K);
491
        K=VRSION;
492
        SAVWRD(0,K);
493
        if(K != VRSION) goto L8312;
494
/*  HEREWITH ARE ALL THE VARIABLES WHOSE VALUES CAN CHANGE DURING A GAME,
495
 *  OMITTING A FEW (SUCH AS I, J, ATTACK) WHOSE VALUES BETWEEN TURNS ARE
496
 *  IRRELEVANT AND SOME WHOSE VALUES WHEN A GAME IS
497
 *  SUSPENDED OR RESUMED ARE GUARANTEED TO MATCH.  IF UNSURE WHETHER A VALUE
498
 *  NEEDS TO BE SAVED, INCLUDE IT.  OVERKILL CAN'T HURT.  PAD THE LAST SAVWDS
499
 *  WITH JUNK VARIABLES TO BRING IT UP TO 7 VALUES. */
500
        SAVWDS(ABBNUM,BLKLIN,BONUS,CLOCK1,CLOCK2,CLOSED,CLOSNG);
501
        SAVWDS(DETAIL,DFLAG,DKILL,DTOTAL,FOOBAR,HOLDNG,IWEST);
502
        SAVWDS(KNFLOC,LIMIT,LL,LMWARN,LOC,NEWLOC,NUMDIE);
503
        SAVWDS(OBJ,OLDLC2,OLDLOC,OLDOBJ,PANIC,SAVED,SETUP);
504
        SAVWDS(SPK,TALLY,THRESH,TRNDEX,TRNLUZ,TURNS,OBJTXT[OYSTER]);
505
        SAVWDS(VERB,WD1,WD1X,WD2,WZDARK,ZZWORD,OBJSND[BIRD]);
506
        SAVWDS(OBJTXT[SIGN],CLSHNT,NOVICE,K,K,K,K);
507
        SAVARR(ABB,LOCSIZ);
508
        SAVARR(ATLOC,LOCSIZ);
509
        SAVARR(DLOC,6);
510
        SAVARR(DSEEN,6);
511
        SAVARR(FIXED,100);
512
        SAVARR(HINTED,HNTSIZ);
513
        SAVARR(HINTLC,HNTSIZ);
514
        SAVARR(LINK,200);
515
        SAVARR(ODLOC,6);
516
        SAVARR(PLACE,100);
517
        SAVARR(PROP,100);
518
        SAVWRD(KK,K);
519
        if(K != 0) goto L8318;
520
        K=NUL;
521
        ZZWORD=RNDVOC(3,ZZWORD-MESH*2)+MESH*2;
522
        if(KK > 0) return(8);
523
        RSPEAK(266);
524
        exit(FALSE);
525
 
526
/*  RESUME.  READ A SUSPENDED GAME BACK FROM A FILE. */
527
 
528
L8310:  KK=1;
529
        if(LOC == 1 && ABB[1] == 1) goto L8305;
530
        RSPEAK(268);
531
        if(!YES(200,54,54)) return(2012);
532
         goto L8305;
533
 
534
L8312:  SETPRM(1,K/10,MOD(K,10));
535
        SETPRM(3,VRSION/10,MOD(VRSION,10));
536
        RSPEAK(269);
537
         return(2000);
538
 
539
L8318:  RSPEAK(270);
540
        exit(FALSE);
541
 
542
/*  FLY.  SNIDE REMARKS UNLESS HOVERING RUG IS HERE. */
543
 
544
L8320:  if(PROP[RUG] != 2)SPK=224;
545
        if(!HERE(RUG))SPK=225;
546
        if(SPK/2 == 112) return(2011);
547
        OBJ=RUG;
548
 
549
L9320:  if(OBJ != RUG) return(2011);
550
        SPK=223;
551
        if(PROP[RUG] != 2) return(2011);
552
        OLDLC2=OLDLOC;
553
        OLDLOC=LOC;
554
        NEWLOC=PLACE[RUG]+FIXED[RUG]-LOC;
555
        SPK=226;
556
        if(PROP[SAPPH] >= 0)SPK=227;
557
        RSPEAK(SPK);
558
         return(2);
559
 
560
/*  LISTEN.  INTRANSITIVE ONLY.  PRINT STUFF BASED ON OBJSND/LOCSND. */
561
 
562
L8330:  SPK=228;
563
        K=LOCSND[LOC];
564
        if(K == 0) goto L8332;
565
        RSPEAK(IABS(K));
566
        if(K < 0) return(2012);
567
        SPK=0;
568
L8332:  SETPRM(1,ZZWORD-MESH*2,0);
569
        /* 8335 */ for (I=1; I<=100; I++) {
570
        if(!HERE(I) || OBJSND[I] == 0 || PROP[I] < 0) goto L8335;
571
        PSPEAK(I,OBJSND[I]+PROP[I]);
572
        SPK=0;
573
        if(I == BIRD && OBJSND[I]+PROP[I] == 8)DSTROY(BIRD);
574
L8335:  /*etc*/ ;
575
        } /* end loop */
576
         return(2011);
577
 
578
/*  Z'ZZZ (WORD GETS RECOMPUTED AT STARTUP; DIFFERENT EACH GAME). */
579
 
580
L8340:  if(!AT(RESER) && LOC != FIXED[RESER]-1) return(2011);
581
        PSPEAK(RESER,PROP[RESER]+1);
582
        PROP[RESER]=1-PROP[RESER];
583
        if(AT(RESER)) return(2012);
584
        OLDLC2=LOC;
585
        NEWLOC=0;
586
        RSPEAK(241);
587
         return(2);
588
 
589
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.