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