Fix arithmetic on message number
[open-adventure.git] / actions.c
1 #include <stdlib.h>
2 #include <stdbool.h>
3 #include "advent.h"
4 #include "database.h"
5 #include "newdb.h"
6
7 /* Limit visibility of ugly globals.  Eventually these should go away. */
8 extern long WD1, WD1X, WD2, WD2X;
9
10 /*
11  * Action handlers.  Eventually we'll do lookup through a method table
12  * that calls these.
13  */
14
15 static int fill(token_t verb, token_t);
16
17 static int attack(FILE *input, long verb, token_t obj)
18 /*  Attack.  Assume target if unambiguous.  "Throw" also links here.
19  *  Attackable objects fall into two categories: enemies (snake,
20  *  dwarf, etc.)  and others (bird, clam, machine).  Ambiguous if 2
21  *  enemies, or no enemies but 2 others. */
22 {
23     int spk = ACTSPK[verb];
24     int d = ATDWRF(game.loc);
25     if (obj == 0) {
26         if (d > 0)
27             obj=DWARF;
28         if (HERE(SNAKE))obj=obj*NOBJECTS+SNAKE;
29         if (AT(DRAGON) && game.prop[DRAGON] == 0)obj=obj*NOBJECTS+DRAGON;
30         if (AT(TROLL))obj=obj*NOBJECTS+TROLL;
31         if (AT(OGRE))obj=obj*NOBJECTS+OGRE;
32         if (HERE(BEAR) && game.prop[BEAR] == 0)obj=obj*NOBJECTS+BEAR;
33         if (obj > NOBJECTS) return GO_UNKNOWN;
34         if (obj == 0) {
35             /* Can't attack bird or machine by throwing axe. */
36             if (HERE(BIRD) && verb != THROW)obj=BIRD;
37             if (HERE(VEND) && verb != THROW)obj=obj*NOBJECTS+VEND;
38             /* Clam and oyster both treated as clam for intransitive case;
39              * no harm done. */
40             if (HERE(CLAM) || HERE(OYSTER))obj=NOBJECTS*obj+CLAM;
41             if (obj > NOBJECTS) return GO_UNKNOWN;
42         }
43     }
44     if (obj == BIRD) {
45         spk=UNHAPPY_BIRD;
46         if (game.closed)
47         {
48             RSPEAK(spk);
49             return GO_CLEAROBJ;
50         }
51         DSTROY(BIRD);
52         game.prop[BIRD]=0;
53         spk=BIRD_DEAD;
54     }
55     if (obj == VEND) {
56         PSPEAK(VEND,game.prop[VEND]+2);
57         game.prop[VEND]=3-game.prop[VEND];
58         return GO_CLEAROBJ;
59     }
60
61     if (obj == 0)spk=NO_TARGET;
62     if (obj == CLAM || obj == OYSTER)spk=SHELL_IMPERVIOUS;
63     if (obj == SNAKE)spk=SNAKE_WARNING;
64     if (obj == DWARF)spk=BARE_HANDS_QUERY;
65     if (obj == DWARF && game.closed) return GO_DWARFWAKE;
66     if (obj == DRAGON)spk=ALREADY_DEAD;
67     if (obj == TROLL)spk=ROCKY_TROLL;
68     if (obj == OGRE)spk=OGRE_DOFGE;
69     if (obj == OGRE && d > 0) {
70         RSPEAK(spk);
71         RSPEAK(KNIFE_THROWN);
72         DSTROY(OGRE);
73         int k=0;
74         for (int i=1; i < PIRATE; i++) {
75             if (game.dloc[i] == game.loc) {
76                 ++k;
77                 game.dloc[i] = LOC_LONGWEST;
78                 game.dseen[i]=false;
79             }
80         }
81         spk=spk+1+1/k;
82         RSPEAK(spk);
83         return GO_CLEAROBJ;
84     }
85     if (obj == BEAR)spk=BEAR_HANDS+(game.prop[BEAR]+1)/2;
86     if (obj != DRAGON || game.prop[DRAGON] != 0) {RSPEAK(spk); return GO_CLEAROBJ;}
87     /*  Fun stuff for dragon.  If he insists on attacking it, win!
88      *  Set game.prop to dead, move dragon to central loc (still
89      *  fixed), move rug there (not fixed), and move him there,
90      *  too.  Then do a null motion to get new description. */
91     RSPEAK(BARE_HANDS_QUERY);
92     GETIN(input,&WD1,&WD1X,&WD2,&WD2X);
93     if (WD1 != MAKEWD(25) && WD1 != MAKEWD(250519))
94         return GO_CHECKFOO;
95     PSPEAK(DRAGON,3);
96     game.prop[DRAGON]=1;
97     game.prop[RUG]=0;
98     int k=(PLAC[DRAGON]+FIXD[DRAGON])/2;
99     MOVE(DRAGON+NOBJECTS,-1);
100     MOVE(RUG+NOBJECTS,0);
101     MOVE(DRAGON,k);
102     MOVE(RUG,k);
103     DROP(BLOOD,k);
104     for (obj=1; obj<=NOBJECTS; obj++) {
105         if (game.place[obj] == PLAC[DRAGON] || game.place[obj] == FIXD[DRAGON])
106             MOVE(obj,k);
107     }
108     game.loc=k;
109     return GO_MOVE;
110 }
111
112 static int bigwords(long foo)
113 /*  FEE FIE FOE FOO (AND FUM).  Advance to next state if given in proper order.
114  *  Look up WD1 in section 3 of vocab to determine which word we've got.  Last
115  *  word zips the eggs back to the giant room (unless already there). */
116 {
117     int k=VOCAB(foo,3);
118     int spk=NOTHING_HAPPENS;
119     if (game.foobar != 1-k) {
120         if (game.foobar != 0)spk=START_OVER;
121         RSPEAK(spk);
122         return GO_CLEAROBJ;
123     } else {
124         game.foobar=k;
125         if (k != 4) {
126             RSPEAK(OK_MAN);
127             return GO_CLEAROBJ;
128         }
129         game.foobar=0;
130         if (game.place[EGGS]==PLAC[EGGS] || (TOTING(EGGS) && game.loc==PLAC[EGGS])) {
131             RSPEAK(spk);
132             return GO_CLEAROBJ;
133         } else {
134             /*  Bring back troll if we steal the eggs back from him before
135              *  crossing. */
136             if (game.place[EGGS]==0 && game.place[TROLL]==0 && game.prop[TROLL]==0)
137                 game.prop[TROLL]=1;
138             k=2;
139             if (HERE(EGGS))k=1;
140             if (game.loc == PLAC[EGGS])k=0;
141             MOVE(EGGS,PLAC[EGGS]);
142             PSPEAK(EGGS,k);
143             return GO_CLEAROBJ;
144         }
145     }
146 }
147
148 static int bivalve(token_t verb, token_t obj)
149 /* Clam/oyster actions */
150 {
151     int spk;
152     bool is_oyster = (obj == OYSTER);
153     spk= is_oyster ? OYSTER_OPENS : PEARL_FALLS;
154     if (TOTING(obj))spk= is_oyster ? DROP_OYSTER : DROP_CLAM;
155     if (!TOTING(TRIDNT))spk= is_oyster ? OYSTER_OPENER : CLAM_OPENER;
156     if (verb == LOCK)spk=HUH_MAN;
157     if (spk == PEARL_FALLS) {
158         DSTROY(CLAM);
159         DROP(OYSTER,game.loc);
160         DROP(PEARL,LOC_CULDESAC);
161     }
162     RSPEAK(spk);
163     return GO_CLEAROBJ;
164 }
165
166 static int blast(void)
167 /*  Blast.  No effect unless you've got dynamite, which is a neat trick! */
168 {
169     if (game.prop[ROD2] < 0 || !game.closed)
170     {
171         RSPEAK(REQUIRES_DYNAMITE);
172         return GO_CLEAROBJ;
173     }
174     game.bonus=133;
175     if (game.loc == LOC_NE)
176         game.bonus=134;
177     if (HERE(ROD2))
178         game.bonus=135;
179     RSPEAK(game.bonus);
180     score(0);
181     return GO_CLEAROBJ; /* pacify compiler - we never get here */
182 }
183
184 static int vbreak(token_t verb, token_t obj)
185 /*  Break.  Only works for mirror in repository and, of course, the vase. */
186 {
187     int spk = ACTSPK[verb];
188     if (obj == MIRROR)spk=TOO_FAR;
189     if (obj == VASE && game.prop[VASE] == 0) {
190         if (TOTING(VASE))DROP(VASE,game.loc);
191         game.prop[VASE]=2;
192         game.fixed[VASE]= -1;
193         spk=BREAK_VASE;
194     } else {
195         if (obj == MIRROR && game.closed) {
196             RSPEAK(BREAK_MIRROR);
197             return GO_DWARFWAKE;
198         }
199     }
200     RSPEAK(spk);
201     return GO_CLEAROBJ;
202 }
203
204 static int brief(void)
205 /*  Brief.  Intransitive only.  Suppress long descriptions after first time. */
206 {
207     game.abbnum=10000;
208     game.detail=3;
209     RSPEAK(BRIEF_CONFIRM);
210     return GO_CLEAROBJ;
211 }
212
213 static int carry(token_t verb, token_t obj)
214 /*  Carry an object.  Special cases for bird and cage (if bird in cage, can't
215  *  take one without the other).  Liquids also special, since they depend on
216  *  status of bottle.  Also various side effects, etc. */
217 {
218     int spk;
219     if (obj == INTRANSITIVE) {
220         /*  Carry, no object given yet.  OK if only one object present. */
221         if(game.atloc[game.loc] == 0 ||
222            game.link[game.atloc[game.loc]] != 0 ||
223            ATDWRF(game.loc) > 0)
224             return GO_UNKNOWN;
225         obj=game.atloc[game.loc];
226     }
227
228     if (TOTING(obj)) {RSPEAK(ALREADY_CARRYING); return GO_CLEAROBJ;}
229     spk=YOU_JOKING;
230     if (obj == PLANT && game.prop[PLANT] <= 0)spk=DEEP_ROOTS;
231     if (obj == BEAR && game.prop[BEAR] == 1)spk=BEAR_CHAINED;
232     if (obj == CHAIN && game.prop[BEAR] != 0)spk=STILL_LOCKED;
233     if (obj == URN)spk=URN_NOBUDGE;
234     if (obj == CAVITY)spk=DOUGHNUT_HOLES;
235     if (obj == BLOOD)spk=FEW_DROPS;
236     if (obj == RUG && game.prop[RUG] == 2)spk=RUG_HOVERS;
237     if (obj == SIGN)spk=HAND_PASSTHROUGH;
238     if (obj == MESSAG) {
239         RSPEAK(REMOVE_MESSAGE);
240         DSTROY(MESSAG);
241         return GO_CLEAROBJ;
242     }
243     if (game.fixed[obj] != 0) {
244         RSPEAK(spk);
245         return GO_CLEAROBJ;
246     }
247     if (obj == WATER || obj == OIL) {
248         if (!HERE(BOTTLE) || LIQUID() != obj) {
249             if (TOTING(BOTTLE) && game.prop[BOTTLE] == 1)
250                 return(fill(verb, BOTTLE));
251             if (game.prop[BOTTLE] != 1)spk=BOTTLE_FULL;
252             if (!TOTING(BOTTLE))spk=NO_CONTAINER;
253             RSPEAK(spk);
254             return GO_CLEAROBJ;
255         }
256         obj = BOTTLE;
257     }
258
259     spk=CARRY_LIMIT;
260     if (game.holdng >= INVLIMIT) {
261         RSPEAK(spk);
262         return GO_CLEAROBJ;
263     }
264     else if (obj == BIRD && game.prop[BIRD] != 1 && -1-game.prop[BIRD] != 1) {
265         if (game.prop[BIRD] == 2) {
266             DSTROY(BIRD);
267             RSPEAK(BIRD_CRAP);
268             return GO_CLEAROBJ;
269         }
270         if (!TOTING(CAGE))spk=CANNOT_CARRY;
271         if (TOTING(ROD))spk=BIRD_EVADES;
272         if (spk == CANNOT_CARRY || spk == BIRD_EVADES) {
273             RSPEAK(spk);
274             return GO_CLEAROBJ;
275         }
276         game.prop[BIRD]=1;
277     }
278     if ((obj==BIRD || obj==CAGE) && (game.prop[BIRD]==1 || -1-game.prop[BIRD]==1))
279         CARRY(BIRD+CAGE-obj,game.loc);
280     CARRY(obj,game.loc);
281     if (obj == BOTTLE && LIQUID() != 0)
282         game.place[LIQUID()] = -1;
283     if (GSTONE(obj) && game.prop[obj] != 0) {
284         game.prop[obj]=0;
285         game.prop[CAVITY]=1;
286     }
287     RSPEAK(OK_MAN);
288     return GO_CLEAROBJ;
289 }
290
291 static int chain(token_t verb)
292 /* Do something to the bear's chain */
293 {
294     int spk;
295     if (verb != LOCK) {
296         spk=CHAIN_UNLOCKED;
297         if (game.prop[BEAR] == 0)spk=BEAR_BLOCKS;
298         if (game.prop[CHAIN] == 0)spk=ALREADY_UNLOCKED;
299         if (spk != CHAIN_UNLOCKED) {RSPEAK(spk); return GO_CLEAROBJ;}
300         game.prop[CHAIN]=0;
301         game.fixed[CHAIN]=0;
302         if (game.prop[BEAR] != 3)game.prop[BEAR]=2;
303         game.fixed[BEAR]=2-game.prop[BEAR];
304     } else {
305         spk=CHAIN_LOCKED;
306         if (game.prop[CHAIN] != 0)spk=ALREADY_LOCKED;
307         if (game.loc != PLAC[CHAIN])spk=NO_LOCKSITE;
308         if (spk != CHAIN_LOCKED) {RSPEAK(spk); return GO_CLEAROBJ;}
309         game.prop[CHAIN]=2;
310         if (TOTING(CHAIN))DROP(CHAIN,game.loc);
311         game.fixed[CHAIN]= -1;
312     }
313     RSPEAK(spk);
314     return GO_CLEAROBJ;
315 }
316
317 static int discard(token_t verb, token_t obj, bool just_do_it)
318 /*  Discard object.  "Throw" also comes here for most objects.  Special cases for
319  *  bird (might attack snake or dragon) and cage (might contain bird) and vase.
320  *  Drop coins at vending machine for extra batteries. */
321 {
322     int spk = ACTSPK[verb];
323     if (!just_do_it) {
324         if (TOTING(ROD2) && obj == ROD && !TOTING(ROD))obj=ROD2;
325         if (!TOTING(obj)) {RSPEAK(spk); return GO_CLEAROBJ;}
326         if (obj == BIRD && HERE(SNAKE)) {
327             RSPEAK(BIRD_ATTACKS);
328             if (game.closed) return GO_DWARFWAKE;
329             DSTROY(SNAKE);
330             /* Set game.prop for use by travel options */
331             game.prop[SNAKE]=1;
332
333         } else if ((GSTONE(obj) && AT(CAVITY) && game.prop[CAVITY] != 0)) {
334             RSPEAK(GEM_FITS);
335             game.prop[obj]=1;
336             game.prop[CAVITY]=0;
337             if (HERE(RUG) && ((obj == EMRALD && game.prop[RUG] != 2) || (obj == RUBY &&
338                                                                          game.prop[RUG] == 2))) {
339                 spk=RUG_RISES;
340                 if (TOTING(RUG))spk=RUG_WIGGLES;
341                 if (obj == RUBY)spk=RUG_SETTLES;
342                 RSPEAK(spk);
343                 if (spk != RUG_WIGGLES) {
344                     int k = 2-game.prop[RUG];
345                     game.prop[RUG] = k;
346                     if (k == 2) k = PLAC[SAPPH];
347                     MOVE(RUG+NOBJECTS, k);
348                 }
349             }
350         } else if (obj == COINS && HERE(VEND)) {
351             DSTROY(COINS);
352             DROP(BATTER,game.loc);
353             PSPEAK(BATTER,0);
354             return GO_CLEAROBJ;
355         } else if (obj == BIRD && AT(DRAGON) && game.prop[DRAGON] == 0) {
356             RSPEAK(BIRD_BURNT);
357             DSTROY(BIRD);
358             game.prop[BIRD]=0;
359             return GO_CLEAROBJ;
360         } else if (obj == BEAR && AT(TROLL)) {
361             RSPEAK(TROLL_SCAMPERS);
362             MOVE(TROLL,0);
363             MOVE(TROLL+NOBJECTS,0);
364             MOVE(TROLL2,PLAC[TROLL]);
365             MOVE(TROLL2+NOBJECTS,FIXD[TROLL]);
366             JUGGLE(CHASM);
367             game.prop[TROLL]=2;
368         } else if (obj != VASE || game.loc == PLAC[PILLOW]) {
369             RSPEAK(OK_MAN);
370         } else {
371             game.prop[VASE]=2;
372             if (AT(PILLOW))game.prop[VASE]=0;
373             PSPEAK(VASE,game.prop[VASE]+1);
374             if (game.prop[VASE] != 0)game.fixed[VASE]= -1;
375         }
376     }
377     int k = LIQUID();
378     if (k == obj)obj=BOTTLE;
379     if (obj == BOTTLE && k != 0)
380         game.place[k]=0;
381     if (obj == CAGE && game.prop[BIRD] == 1)DROP(BIRD,game.loc);
382     DROP(obj,game.loc);
383     if (obj != BIRD) return GO_CLEAROBJ;
384     game.prop[BIRD]=0;
385     if (FOREST(game.loc))game.prop[BIRD]=2;
386     return GO_CLEAROBJ;
387 }
388
389 static int drink(token_t verb, token_t obj)
390 /*  Drink.  If no object, assume water and look for it here.  If water is in
391  *  the bottle, drink that, else must be at a water loc, so drink stream. */
392 {
393     int spk = ACTSPK[verb];
394     if (obj == 0 && LIQLOC(game.loc) != WATER && (LIQUID() != WATER || !HERE(BOTTLE)))
395         return GO_UNKNOWN;
396     if (obj != BLOOD) {
397         if (obj != 0 && obj != WATER)spk=RIDICULOUS_ATTEMPT;
398         if (spk != 110 && LIQUID() == WATER && HERE(BOTTLE)) {
399             game.prop[BOTTLE]=1;
400             game.place[WATER]=0;
401             spk=BOTTLE_EMPTY;
402         }
403     } else {
404         DSTROY(BLOOD);
405         game.prop[DRAGON]=2;
406         OBJSND[BIRD]=OBJSND[BIRD]+3;
407         spk=HEAD_BUZZES;
408     }
409     RSPEAK(spk);
410     return GO_CLEAROBJ;
411 }
412
413 static int eat(token_t verb, token_t obj)
414 /*  Eat.  Intransitive: assume food if present, else ask what.  Transitive: food
415  *  ok, some things lose appetite, rest are ridiculous. */
416 {
417     int spk = ACTSPK[verb];
418     if (obj == INTRANSITIVE) {
419         if (!HERE(FOOD))
420             return GO_UNKNOWN;
421         DSTROY(FOOD);
422         spk=THANKS_DELICIOUS;
423     } else {
424         if (obj == FOOD) {
425             DSTROY(FOOD);
426             spk=THANKS_DELICIOUS;
427         }
428         if (obj == BIRD || obj == SNAKE || obj == CLAM || obj == OYSTER || obj ==
429            DWARF || obj == DRAGON || obj == TROLL || obj == BEAR || obj ==
430            OGRE)spk=LOST_APPETITE;
431     }
432     RSPEAK(spk);
433     return GO_CLEAROBJ;
434 }
435
436 static int extinguish(token_t verb, int obj)
437 /* Extinguish.  Lamp, urn, dragon/volcano (nice try). */
438 {
439     int spk = ACTSPK[verb];
440     if (obj == INTRANSITIVE) {
441         if (HERE(LAMP) && game.prop[LAMP] == 1)obj=LAMP;
442         if (HERE(URN) && game.prop[URN] == 2)obj=obj*NOBJECTS+URN;
443         if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS) return GO_UNKNOWN;
444     }
445
446     if (obj == URN) {
447         game.prop[URN]=game.prop[URN]/2;
448         spk=URN_DARK;
449     }
450     else if (obj == LAMP) {
451         game.prop[LAMP]=0;
452         RSPEAK(LAMP_OFF);
453         spk = DARK(game.loc) ? PITCH_DARK : ARB_0;
454     }
455     else if (obj == DRAGON || obj == VOLCAN)
456         spk=BEYOND_POWER;
457     RSPEAK(spk);
458     return GO_CLEAROBJ;
459 }
460
461 static int feed(token_t verb, token_t obj)
462 /*  Feed.  If bird, no seed.  Snake, dragon, troll: quip.  If dwarf, make him
463  *  mad.  Bear, special. */
464 {
465     int spk = ACTSPK[verb];
466     if (obj == BIRD) {
467         RSPEAK(BIRD_PINING);
468         return GO_CLEAROBJ;
469     }
470     else if (obj == SNAKE || obj == DRAGON || obj == TROLL) {
471         spk=NOTHING_EDIBLE;
472         if (obj == DRAGON && game.prop[DRAGON] != 0)spk=RIDICULOUS_ATTEMPT;
473         if (obj == TROLL)spk=TROLL_VICES;
474         if (obj == SNAKE && !game.closed && HERE(BIRD)) {
475             DSTROY(BIRD);
476             game.prop[BIRD]=0;
477             spk = BIRD_DEVOURED;
478         }
479     }
480     else if (obj == DWARF) {
481         if (HERE(FOOD)) {
482             game.dflag += 2;
483             spk = REALLY_MAD;
484         }
485     }
486     else if (obj == BEAR) {
487         if (game.prop[BEAR] == 0)spk=NOTHING_EDIBLE;
488         if (game.prop[BEAR] == 3)spk=RIDICULOUS_ATTEMPT;
489         if (HERE(FOOD)) {
490             DSTROY(FOOD);
491             game.prop[BEAR]=1;
492             game.fixed[AXE]=0;
493             game.prop[AXE]=0;
494             spk=BEAR_TAMED;
495         }
496     }
497     else if (obj == OGRE) {
498         if (HERE(FOOD))
499             spk=OGRE_FULL;
500     } else {
501         spk=AM_GAME;
502     }
503     RSPEAK(spk);
504     return GO_CLEAROBJ;
505 }
506
507 int fill(token_t verb, token_t obj)
508 /*  Fill.  Bottle or urn must be empty, and liquid available.  (Vase
509  *  is nasty.) */
510 {
511     int k;
512     int spk = ACTSPK[verb];
513     if (obj == VASE) {
514         spk=ARENT_CARRYING;
515         if (LIQLOC(game.loc) == 0)spk=FILL_INVALID;
516         if (LIQLOC(game.loc) == 0 || !TOTING(VASE)) {
517             RSPEAK(spk);
518             return GO_CLEAROBJ;
519         }
520         RSPEAK(SHATTER_VASE);
521         game.prop[VASE]=2;
522         game.fixed[VASE]= -1;
523         return(discard(verb, obj, true));
524     }
525     else if (obj == URN) {
526         spk=FULL_URN;
527         if (game.prop[URN] != 0) {RSPEAK(spk); return GO_CLEAROBJ;}
528         spk=FILL_INVALID;
529         k=LIQUID();
530         if (k == 0 || !HERE(BOTTLE)) {RSPEAK(spk); return GO_CLEAROBJ;}
531         game.place[k]=0;
532         game.prop[BOTTLE]=1;
533         if (k == OIL)game.prop[URN]=1;
534         spk=WATER_URN+game.prop[URN];
535         RSPEAK(spk);
536         return GO_CLEAROBJ;
537     }
538     else if (obj != 0 && obj != BOTTLE) {
539         RSPEAK(spk);
540         return GO_CLEAROBJ;
541     }
542     else if (obj == 0 && !HERE(BOTTLE))
543         return GO_UNKNOWN;
544     spk=BOTTLED_WATER;
545     if (LIQLOC(game.loc) == 0)
546         spk=NO_LIQUID;
547     if (HERE(URN) && game.prop[URN] != 0)
548         spk=URN_NOPOUR;
549     if (LIQUID() != 0)
550         spk=BOTTLE_FULL;
551     if (spk == 107) {
552         game.prop[BOTTLE]=MOD(COND[game.loc],4)/2*2;
553         k=LIQUID();
554         if (TOTING(BOTTLE))
555             game.place[k]= -1;
556         if (k == OIL)
557             spk=BOTTLED_OIL;
558     }
559     RSPEAK(spk);
560     return GO_CLEAROBJ;
561 }
562
563 static int find(token_t verb, token_t obj)
564 /* Find.  Might be carrying it, or it might be here.  Else give caveat. */
565 {
566     int spk = ACTSPK[verb];
567     if (AT(obj) ||
568        (LIQUID() == obj && AT(BOTTLE)) ||
569        obj == LIQLOC(game.loc) ||
570        (obj == DWARF && ATDWRF(game.loc) > 0))
571         spk=YOU_HAVEIT;
572     if (game.closed)spk=NEEDED_NEreplace;
573     if (TOTING(obj))spk=ALREADY_CARRYING;
574     RSPEAK(spk);
575     return GO_CLEAROBJ;
576 }
577
578 static int fly(token_t verb, token_t obj)
579 /* Fly.  Snide remarks unless hovering rug is here. */
580 {
581     int spk = ACTSPK[verb];
582     if (obj == INTRANSITIVE) {
583         if (game.prop[RUG] != 2)spk=RUG_NOTHING2;
584         if (!HERE(RUG))spk=FLAP_ARMS;
585         if (spk == RUG_NOTHING2 || spk == FLAP_ARMS) {
586             RSPEAK(spk);
587             return GO_CLEAROBJ;
588         }
589         obj=RUG;
590     }
591
592     if (obj != RUG) {
593         RSPEAK(spk);
594         return GO_CLEAROBJ;
595     }
596     spk=RUG_NOTHING1;
597     if (game.prop[RUG] != 2) {RSPEAK(spk); return GO_CLEAROBJ;}
598     game.oldlc2=game.oldloc;
599     game.oldloc=game.loc;
600     game.newloc=game.place[RUG]+game.fixed[RUG]-game.loc;
601     spk=RUG_GOES;
602     if (game.prop[SAPPH] >= 0)spk=RUG_RETURNS;
603     RSPEAK(spk);
604     return GO_TERMINATE;
605 }
606
607 static int inven(token_t obj)
608 /* Inventory. If object, treat same as find.  Else report on current burden. */
609 {
610     int spk=NO_CARRY;
611     for (int i=1; i<=NOBJECTS; i++) {
612         if (i == BEAR || !TOTING(i))
613             continue;
614         if (spk == NO_CARRY)
615             RSPEAK(NOW_HOLDING);
616         game.blklin=false;
617         PSPEAK(i,-1);
618         game.blklin=true;
619         spk=ARB_0;
620     }
621     if (TOTING(BEAR))
622         spk=TAME_BEAR;
623     RSPEAK(spk);
624     return GO_CLEAROBJ;
625 }
626
627 int light(token_t verb, token_t obj)
628 /*  Light.  Applicable only to lamp and urn. */
629 {
630     int spk = ACTSPK[verb];
631     if (obj == INTRANSITIVE) {
632         if (HERE(LAMP) && game.prop[LAMP] == 0 && game.limit >= 0)obj=LAMP;
633         if (HERE(URN) && game.prop[URN] == 1)obj=obj*NOBJECTS+URN;
634         if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS) return GO_UNKNOWN;
635     }
636
637     if (obj == URN) {
638         spk=URN_EMPTY;
639         if (game.prop[URN] == 0)
640             {RSPEAK(spk); return GO_CLEAROBJ;}
641         spk=URN_LIT;
642         game.prop[URN]=2;
643         RSPEAK(spk);
644         return GO_CLEAROBJ;
645     } else {
646         if (obj != LAMP)
647         {
648             RSPEAK(spk);
649             return GO_CLEAROBJ;
650         }
651         spk=LAMP_OUT;
652         if (game.limit < 0) {
653             RSPEAK(spk);
654             return GO_CLEAROBJ;
655         }
656         game.prop[LAMP]=1;
657         RSPEAK(LAMP_ON);
658         if (game.wzdark)
659             return GO_TOP;
660         else
661             return GO_CLEAROBJ;
662     }
663 }
664
665 static int listen(void)
666 /*  Listen.  Intransitive only.  Print stuff based on objsnd/locsnd. */
667 {
668     int k;
669     int spk=ALL_SILENT;
670     k=LOCSND[game.loc];
671     if (k != 0) {
672         RSPEAK(labs(k));
673         if (k < 0) return GO_CLEAROBJ;
674         spk=ARB_0;
675     }
676     SETPRM(1,game.zzword,0);
677     for (int i=1; i<=NOBJECTS; i++) {
678         if (!HERE(i) || OBJSND[i] == 0 || game.prop[i] < 0)
679             continue;
680         PSPEAK(i,OBJSND[i]+game.prop[i]);
681         spk=ARB_0;
682         if (i == BIRD && OBJSND[i]+game.prop[i] == 8)
683             DSTROY(BIRD);
684     }
685     RSPEAK(spk);
686     return GO_CLEAROBJ;
687 }
688
689 static int lock(token_t verb, token_t obj)
690 /* Lock, unlock, no object given.  Assume various things if present. */
691 {
692     int spk = ACTSPK[verb];
693     if (obj == INTRANSITIVE) {
694         spk=NOTHING_LOCKED;
695         if (HERE(CLAM))obj=CLAM;
696         if (HERE(OYSTER))obj=OYSTER;
697         if (AT(DOOR))obj=DOOR;
698         if (AT(GRATE))obj=GRATE;
699         if (obj != 0 && HERE(CHAIN)) return GO_UNKNOWN;
700         if (HERE(CHAIN))obj=CHAIN;
701         if (obj == 0) {RSPEAK(spk); return GO_CLEAROBJ;}
702     }
703         
704     /*  Lock, unlock object.  Special stuff for opening clam/oyster
705      *  and for chain. */
706     if (obj == CLAM || obj == OYSTER)
707         return bivalve(verb, obj);
708     if (obj == DOOR)spk=RUSTY_DOOR;
709     if (obj == DOOR && game.prop[DOOR] == 1)spk=OK_MAN;
710     if (obj == CAGE)spk=NO_LOCK;
711     if (obj == KEYS)spk=CANNOT_UNLOCK;
712     if (obj == GRATE || obj == CHAIN) {
713         spk=NO_KEYS;
714         if (HERE(KEYS)) {
715             if (obj == CHAIN)
716                 return chain(verb);
717             if (game.closng) {
718                 spk=EXIT_CLOSED;
719                 if (!game.panic)game.clock2=15;
720                 game.panic=true;
721             } else {
722                 spk=game.prop[GRATE] ? GRATE_LOCKED : ALREADY_LOCKED;
723                 game.prop[GRATE]=1;
724                 if (verb == LOCK)game.prop[GRATE]=0;
725                 spk=game.prop[GRATE] ? GRATE_UNLOCKED : GRATE_LOCKED;
726             }
727         }
728     }
729     RSPEAK(spk);
730     return GO_CLEAROBJ;
731 }
732
733 static int pour(token_t verb, token_t obj)
734 /*  Pour.  If no object, or object is bottle, assume contents of bottle.
735  *  special tests for pouring water or oil on plant or rusty door. */
736 {
737     int spk = ACTSPK[verb];
738     if (obj == BOTTLE || obj == 0)obj=LIQUID();
739     if (obj == 0) return GO_UNKNOWN;
740     if (!TOTING(obj)) {RSPEAK(spk); return GO_CLEAROBJ;}
741     spk=CANT_POUR;
742     if (obj != OIL && obj != WATER) {RSPEAK(spk); return GO_CLEAROBJ;}
743     if (HERE(URN) && game.prop[URN] == 0)
744         return fill(verb, URN);
745     game.prop[BOTTLE]=1;
746     game.place[obj]=0;
747     spk=GROUND_WET;
748     if (!(AT(PLANT) || AT(DOOR)))
749         {RSPEAK(spk); return GO_CLEAROBJ;}
750     if (!AT(DOOR)) {
751         spk=SHAKING_LEAVES;
752         if (obj != WATER) {RSPEAK(spk); return GO_CLEAROBJ;}
753         PSPEAK(PLANT,game.prop[PLANT]+3);
754         game.prop[PLANT]=MOD(game.prop[PLANT]+1,3);
755         game.prop[PLANT2]=game.prop[PLANT];
756         return GO_MOVE;
757     } else {
758         game.prop[DOOR]=0;
759         if (obj == OIL)game.prop[DOOR]=1;
760         spk=RUSTED_HINGES+game.prop[DOOR];
761         RSPEAK(spk);
762         return GO_CLEAROBJ;
763     }
764 }
765
766 static int quit(FILE *input)
767 /*  Quit.  Intransitive only.  Verify intent and exit if that's what he wants. */
768 {
769     if (YES(input,REALLY_QUIT,OK_MAN,OK_MAN))
770         score(1);
771     return GO_CLEAROBJ;
772 }
773
774 static int read(FILE *input, token_t verb, token_t obj)
775 /*  Read.  Print stuff based on objtxt.  Oyster (?) is special case. */
776 {
777     int spk = ACTSPK[verb];
778     if (obj == INTRANSITIVE) {
779         obj = 0;
780         for (int i=1; i<=NOBJECTS; i++) {
781             if (HERE(i) && OBJTXT[i] != 0 && game.prop[i] >= 0)
782                 obj = obj * NOBJECTS + i;
783         }
784         if (obj > NOBJECTS || obj == 0 || DARK(game.loc)) return GO_UNKNOWN;
785     }
786         
787     if (DARK(game.loc)) {
788         SETPRM(1,WD1,WD1X);
789         RSPEAK(NO_SEE);
790         return GO_CLEAROBJ;
791     }
792     if (OBJTXT[obj] == 0 || game.prop[obj] < 0) {
793         RSPEAK(spk);
794         return GO_CLEAROBJ;
795     }
796     if (obj == OYSTER && !game.clshnt) {
797         game.clshnt=YES(input,CLUE_QUERY,WAYOUT_CLUE,OK_MAN);
798         return GO_CLEAROBJ;
799     }
800     PSPEAK(obj,OBJTXT[obj]+game.prop[obj]);
801     return GO_CLEAROBJ;
802 }
803
804 static int reservoir(void)
805 /*  Z'ZZZ (word gets recomputed at startup; different each game). */
806 {
807     if (!AT(RESER) && game.loc != game.fixed[RESER]-1) {
808         RSPEAK(RUB_NOGO);
809         return GO_CLEAROBJ;
810     } else {
811         PSPEAK(RESER,game.prop[RESER]+1);
812         game.prop[RESER]=1-game.prop[RESER];
813         if (AT(RESER)) return GO_CLEAROBJ;
814         game.oldlc2=game.loc;
815         game.newloc=0;
816         RSPEAK(NOT_BRIGHT);
817         return GO_TERMINATE;
818     }
819 }
820
821 static int rub(token_t verb, token_t obj)
822 /* Rub.  Yields various snide remarks except for lit urn. */
823 {
824     int spk = ACTSPK[verb];
825     if (obj != LAMP)
826         spk=PECULIAR_NOTHING;
827     if (obj == URN && game.prop[URN] == 2) {
828         DSTROY(URN);
829         DROP(AMBER,game.loc);
830         game.prop[AMBER]=1;
831         --game.tally;
832         DROP(CAVITY,game.loc);
833         spk=URN_GENIES;
834     }
835     RSPEAK(spk);
836     return GO_CLEAROBJ;
837 }
838
839 static int say(void)
840 /* Say.  Echo WD2 (or WD1 if no WD2 (SAY WHAT?, etc.).)  Magic words override. */
841 {
842     /* FIXME: ugly use of globals */
843     SETPRM(1,WD2,WD2X);
844     if (WD2 <= 0)
845         SETPRM(1,WD1,WD1X);
846     if (WD2 > 0)
847         WD1=WD2;
848     int wd=VOCAB(WD1,-1);
849     if (wd == 62 || wd == 65 || wd == 71 || wd == 2025 || wd == 2034) {
850         WD2=0;
851         return GO_LOOKUP;
852     }
853     RSPEAK(OKEY_DOKEY);
854     return GO_CLEAROBJ;
855
856 }
857
858 static int throw_support(long spk)
859 {
860     RSPEAK(spk);
861     DROP(AXE,game.loc);
862     return GO_MOVE;
863 }
864
865 static int throw(FILE *cmdin, long verb, token_t obj)
866 /*  Throw.  Same as discard unless axe.  Then same as attack except
867  *  ignore bird, and if dwarf is present then one might be killed.
868  *  (Only way to do so!)  Axe also special for dragon, bear, and
869  *  troll.  Treasures special for troll. */
870 {
871     int spk = ACTSPK[verb];
872     if (TOTING(ROD2) && obj == ROD && !TOTING(ROD))obj=ROD2;
873     if (!TOTING(obj)) {
874         RSPEAK(spk);
875         return GO_CLEAROBJ;
876     }
877     if (obj >= 50 && obj <= MAXTRS && AT(TROLL)) {
878         spk=TROLL_SATISFIED;
879         /*  Snarf a treasure for the troll. */
880         DROP(obj,0);
881         MOVE(TROLL,0);
882         MOVE(TROLL+NOBJECTS,0);
883         DROP(TROLL2,PLAC[TROLL]);
884         DROP(TROLL2+NOBJECTS,FIXD[TROLL]);
885         JUGGLE(CHASM);
886         RSPEAK(spk);
887         return GO_CLEAROBJ;
888     }
889     if (obj == FOOD && HERE(BEAR)) {
890     /* But throwing food is another story. */
891         obj=BEAR;
892         return(feed(verb, obj));
893     }
894     if (obj != AXE)
895         return(discard(verb, obj, false));
896     int i=ATDWRF(game.loc);
897     if (i <= 0) {
898         if (AT(DRAGON) && game.prop[DRAGON] == 0) {
899             spk=DRAGON_SCALES;
900             return throw_support(spk);
901         }
902         if (AT(TROLL)) {
903             spk=TROLL_RETURNS;
904             return throw_support(spk);
905         }
906         if (AT(OGRE)) {
907             spk=OGRE_DOFGE;
908             return throw_support(spk);
909         }
910         if (HERE(BEAR) && game.prop[BEAR] == 0) {
911             /* This'll teach him to throw the axe at the bear! */
912             spk=AXE_LOST;
913             DROP(AXE,game.loc);
914             game.fixed[AXE]= -1;
915             game.prop[AXE]=1;
916             JUGGLE(BEAR);
917             {RSPEAK(spk); return GO_CLEAROBJ;}
918         }
919         return(attack(cmdin, verb, 0));
920     }
921
922     if (randrange(NDWARVES+1) < game.dflag) {
923         spk=DWARF_DODGES;
924         return throw_support(spk);
925     }
926     game.dseen[i]=false;
927     game.dloc[i]=0;
928     spk=KILLED_DWARF;
929     ++game.dkill;
930     if (game.dkill == 1)spk=DWARF_SMOKE;
931
932     return throw_support(spk);
933 }
934
935 static int vscore(void)
936 /* Score.  Call scoring routine but tell it to return. */
937 {
938     score(-1);
939     return GO_CLEAROBJ;
940 }
941
942 static int wake(token_t verb, token_t obj)
943 /* Wake.  Only use is to disturb the dwarves. */
944 {
945     if (obj != DWARF || !game.closed)
946     {
947         RSPEAK(ACTSPK[verb]);
948         return GO_CLEAROBJ;
949     }
950     RSPEAK(PROD_DWARF);
951     return GO_DWARFWAKE;
952 }
953
954 static int wave(token_t verb, token_t obj)
955 /* Wave.  No effect unless waving rod at fissure or at bird. */
956 {
957     int spk = ACTSPK[verb];
958     if ((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2)))spk=ARENT_CARRYING;
959     if (obj != ROD ||
960        !TOTING(obj) ||
961        (!HERE(BIRD) && (game.closng || !AT(FISSUR)))) {
962         RSPEAK(spk);
963         return GO_CLEAROBJ;
964     }
965     if (HERE(BIRD))spk=FREE_FLY+MOD(game.prop[BIRD],2);
966     if (spk == 206 && game.loc == game.place[STEPS] && game.prop[JADE] < 0) {
967         DROP(JADE,game.loc);
968         game.prop[JADE]=0;
969         --game.tally;
970         spk=NECKLACE_FLY;
971         RSPEAK(spk);
972         return GO_CLEAROBJ;
973     } else {
974         if (game.closed) {
975             RSPEAK(spk);
976             return GO_DWARFWAKE;
977         }
978         if (game.closng || !AT(FISSUR)) {RSPEAK(spk); return GO_CLEAROBJ;}
979         if (HERE(BIRD))RSPEAK(spk);
980         game.prop[FISSUR]=1-game.prop[FISSUR];
981         PSPEAK(FISSUR,2-game.prop[FISSUR]);
982         return GO_CLEAROBJ;
983     }
984 }
985
986 int action(FILE *input, enum speechpart part, long verb, token_t obj)
987 /*  Analyse a verb.  Remember what it was, go back for object if second word
988  *  unless verb is "say", which snarfs arbitrary second word.
989  */
990 {
991     token_t spk=ACTSPK[verb];
992
993     if (part == unknown)
994     {
995         /*  Analyse an object word.  See if the thing is here, whether
996          *  we've got a verb yet, and so on.  Object must be here
997          *  unless verb is "find" or "invent(ory)" (and no new verb
998          *  yet to be analysed).  Water and oil are also funny, since
999          *  they are never actually dropped at any location, but might
1000          *  be here inside the bottle or urn or as a feature of the
1001          *  location. */
1002         if (HERE(obj))
1003             /* FALL THROUGH */;
1004         else if (obj == GRATE) {
1005             if (game.loc == LOC_START || game.loc == LOC_VALLEY || game.loc == LOC_SLIT)
1006                 obj=DPRSSN;
1007             /* FIXME: Arithmetic on location numbers */
1008             if (game.loc > LOC_BELOWGRATE && game.loc < LOC_MISTHALL)
1009                 obj=ENTRNC;
1010             if (obj != GRATE)
1011                 return GO_MOVE;
1012         }
1013         else if (obj == DWARF && ATDWRF(game.loc) > 0)
1014             /* FALL THROUGH */;
1015         else if ((LIQUID() == obj && HERE(BOTTLE)) || obj == LIQLOC(game.loc))
1016             /* FALL THROUGH */;
1017         else if (obj == OIL && HERE(URN) && game.prop[URN] != 0) {
1018             obj=URN;
1019             /* FALL THROUGH */;
1020         }
1021         else if (obj == PLANT && AT(PLANT2) && game.prop[PLANT2] != 0) {
1022             obj=PLANT2;
1023             /* FALL THROUGH */;
1024         }
1025         else if (obj == KNIFE && game.knfloc == game.loc) {
1026             game.knfloc= -1;
1027             spk=KNIVES_VANISH;
1028             RSPEAK(spk);
1029             return GO_CLEAROBJ;
1030         }
1031         else if (obj == ROD && HERE(ROD2)) {
1032             obj=ROD2;
1033             /* FALL THROUGH */;
1034         }
1035         else if ((verb == FIND || verb == INVENT) && WD2 <= 0)
1036             /* FALL THROUGH */;
1037         else {
1038             SETPRM(1,WD1,WD1X);
1039             RSPEAK(NO_SEE);
1040             return GO_CLEAROBJ;
1041         }
1042
1043         if (WD2 > 0)
1044             return GO_WORD2;
1045         if (verb != 0)
1046             part = transitive;
1047     }
1048
1049     switch(part)
1050     {
1051         case intransitive:
1052             if (WD2 > 0 && verb != SAY) return(2800);
1053             if (verb == SAY)obj=WD2;
1054             if (obj == 0 || obj == INTRANSITIVE) {
1055                 /*  Analyse an intransitive verb (ie, no object given yet). */
1056                     switch (verb-1) {
1057                     case  0: /* CARRY */ return carry(verb, INTRANSITIVE);
1058                     case  1: /* DROP  */ return GO_UNKNOWN; 
1059                     case  2: /* SAY   */ return GO_UNKNOWN; 
1060                     case  3: /* UNLOC */ return lock(verb, INTRANSITIVE);    
1061                     case  4: /* NOTHI */ {RSPEAK(OK_MAN); return(GO_CLEAROBJ);}
1062                     case  5: /* LOCK  */ return lock(verb, INTRANSITIVE);    
1063                     case  6: /* LIGHT */ return light(verb, INTRANSITIVE);    
1064                     case  7: /* EXTIN */ return extinguish(verb, INTRANSITIVE);    
1065                     case  8: /* WAVE  */ return GO_UNKNOWN; 
1066                     case  9: /* CALM  */ return GO_UNKNOWN; 
1067                     case 10: /* WALK  */ {RSPEAK(spk); return GO_CLEAROBJ;} 
1068                     case 11: /* ATTAC */ return attack(input, verb, obj);   
1069                     case 12: /* POUR  */ return pour(verb, obj);   
1070                     case 13: /* EAT   */ return eat(verb, INTRANSITIVE);   
1071                     case 14: /* DRINK */ return drink(verb, obj);   
1072                     case 15: /* RUB   */ return GO_UNKNOWN; 
1073                     case 16: /* TOSS  */ return GO_UNKNOWN; 
1074                     case 17: /* QUIT  */ return quit(input);   
1075                     case 18: /* FIND  */ return GO_UNKNOWN; 
1076                     case 19: /* INVEN */ return inven(obj);   
1077                     case 20: /* FEED  */ return GO_UNKNOWN; 
1078                     case 21: /* FILL  */ return fill(verb, obj);   
1079                     case 22: /* BLAST */ return blast();   
1080                     case 23: /* SCOR  */ return vscore();   
1081                     case 24: /* FOO   */ return bigwords(WD1);   
1082                     case 25: /* BRIEF */ return brief();   
1083                     case 26: /* READ  */ return read(input, verb, INTRANSITIVE);
1084                     case 27: /* BREAK */ return GO_UNKNOWN; 
1085                     case 28: /* WAKE  */ return GO_UNKNOWN; 
1086                     case 29: /* SUSP  */ return saveresume(input, false);   
1087                     case 30: /* RESU  */ return saveresume(input, true);   
1088                     case 31: /* FLY   */ return fly(verb, INTRANSITIVE);   
1089                     case 32: /* LISTE */ return listen();   
1090                     case 33: /* ZZZZ  */ return reservoir();   
1091                 }
1092                 BUG(23);
1093             }
1094             /* FALLTHRU */
1095         case transitive:
1096             /*  Analyse a transitive verb. */
1097             switch (verb-1) {
1098             case  0: /* CARRY */ return carry(verb, obj);    
1099                 case  1: /* DROP  */ return discard(verb, obj, false);    
1100                 case  2: /* SAY   */ return say();    
1101                 case  3: /* UNLOC */ return lock(verb, obj);    
1102                 case  4: /* NOTHI */ {RSPEAK(OK_MAN); return(GO_CLEAROBJ);}
1103                 case  5: /* LOCK  */ return lock(verb, obj);    
1104                 case  6: /* LIGHT */ return light(verb, obj);    
1105                 case  7: /* EXTI  */ return extinguish(verb, obj);    
1106                 case  8: /* WAVE  */ return wave(verb, obj);    
1107                 case  9: /* CALM  */ {RSPEAK(spk); return GO_CLEAROBJ;} 
1108                 case 10: /* WALK  */ {RSPEAK(spk); return GO_CLEAROBJ;} 
1109                 case 11: /* ATTAC */ return attack(input, verb, obj);   
1110                 case 12: /* POUR  */ return pour(verb, obj);   
1111                 case 13: /* EAT   */ return eat(verb, obj);   
1112                 case 14: /* DRINK */ return drink(verb, obj);   
1113                 case 15: /* RUB   */ return rub(verb, obj);   
1114                 case 16: /* TOSS  */ return throw(input, verb, obj);   
1115                 case 17: /* QUIT  */ {RSPEAK(spk); return GO_CLEAROBJ;} 
1116                 case 18: /* FIND  */ return find(verb, obj);   
1117                 case 19: /* INVEN */ return find(verb, obj);   
1118                 case 20: /* FEED  */ return feed(verb, obj);   
1119                 case 21: /* FILL  */ return fill(verb, obj);   
1120                 case 22: /* BLAST */ return blast();   
1121                 case 23: /* SCOR  */ {RSPEAK(spk); return GO_CLEAROBJ;} 
1122                 case 24: /* FOO   */ {RSPEAK(spk); return GO_CLEAROBJ;} 
1123                 case 25: /* BRIEF */ {RSPEAK(spk); return GO_CLEAROBJ;} 
1124                 case 26: /* READ  */ return read(input, verb, obj);   
1125                 case 27: /* BREAK */ return vbreak(verb, obj);   
1126                 case 28: /* WAKE  */ return wake(verb, obj);   
1127                 case 29: /* SUSP  */ {RSPEAK(spk); return GO_CLEAROBJ;} 
1128                 case 30: /* RESU  */ {RSPEAK(spk); return GO_CLEAROBJ;} 
1129                 case 31: /* FLY   */ return fly(verb, obj);   
1130                 case 32: /* LISTE */ {RSPEAK(spk); return GO_CLEAROBJ;} 
1131                 case 33: /* ZZZZ  */ return reservoir();   
1132             }
1133             BUG(24);
1134         case unknown:
1135             /* Unknown verb, couldn't deduce object - might need hint */
1136             SETPRM(1,WD1,WD1X);
1137             RSPEAK(WHAT_DO);
1138             return GO_CHECKHINT;
1139     default:
1140             BUG(99);
1141     }
1142 }