Proof of cobcept for state defines.
[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 && game.loc == LOC_GIANTROOM)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] == EMPTY_BOTTLE)
246                 return (fill(verb, BOTTLE));
247             else {
248                 if (game.prop[BOTTLE] != EMPTY_BOTTLE)
249                     spk = BOTTLE_FULL;
250                 if (!TOTING(BOTTLE))spk = NO_CONTAINER;
251                 rspeak(spk);
252                 return GO_CLEAROBJ;
253             }
254         }
255         obj = BOTTLE;
256     }
257
258     spk = CARRY_LIMIT;
259     if (game.holdng >= INVLIMIT) {
260         rspeak(spk);
261         return GO_CLEAROBJ;
262     } else if (obj == BIRD && game.prop[BIRD] != 1 && -1 - game.prop[BIRD] != 1) {
263         if (game.prop[BIRD] == 2) {
264             DESTROY(BIRD);
265             rspeak(BIRD_CRAP);
266             return GO_CLEAROBJ;
267         }
268         if (!TOTING(CAGE))spk = CANNOT_CARRY;
269         if (TOTING(ROD))spk = BIRD_EVADES;
270         if (spk == CANNOT_CARRY || spk == BIRD_EVADES) {
271             rspeak(spk);
272             return GO_CLEAROBJ;
273         }
274         game.prop[BIRD] = 1;
275     }
276     if ((obj == BIRD || obj == CAGE) && (game.prop[BIRD] == 1 || -1 - game.prop[BIRD] == 1))
277         CARRY(BIRD + CAGE - obj, game.loc);
278     CARRY(obj, game.loc);
279     if (obj == BOTTLE && LIQUID() != 0)
280         game.place[LIQUID()] = CARRIED;
281     if (GSTONE(obj) && game.prop[obj] != 0) {
282         game.prop[obj] = 0;
283         game.prop[CAVITY] = 1;
284     }
285     rspeak(OK_MAN);
286     return GO_CLEAROBJ;
287 }
288
289 static int chain(token_t verb)
290 /* Do something to the bear's chain */
291 {
292     int spk;
293     if (verb != LOCK) {
294         spk = CHAIN_UNLOCKED;
295         if (game.prop[BEAR] == 0)spk = BEAR_BLOCKS;
296         if (game.prop[CHAIN] == 0)spk = ALREADY_UNLOCKED;
297         if (spk != CHAIN_UNLOCKED) {
298             rspeak(spk);
299             return GO_CLEAROBJ;
300         }
301         game.prop[CHAIN] = 0;
302         game.fixed[CHAIN] = 0;
303         if (game.prop[BEAR] != 3)game.prop[BEAR] = 2;
304         game.fixed[BEAR] = 2 - game.prop[BEAR];
305     } else {
306         spk = CHAIN_LOCKED;
307         if (game.prop[CHAIN] != 0)spk = ALREADY_LOCKED;
308         if (game.loc != PLAC[CHAIN])spk = NO_LOCKSITE;
309         if (spk != CHAIN_LOCKED) {
310             rspeak(spk);
311             return GO_CLEAROBJ;
312         }
313         game.prop[CHAIN] = 2;
314         if (TOTING(CHAIN))DROP(CHAIN, game.loc);
315         game.fixed[CHAIN] = -1;
316     }
317     rspeak(spk);
318     return GO_CLEAROBJ;
319 }
320
321 static int discard(token_t verb, token_t obj, bool just_do_it)
322 /*  Discard object.  "Throw" also comes here for most objects.  Special cases for
323  *  bird (might attack snake or dragon) and cage (might contain bird) and vase.
324  *  Drop coins at vending machine for extra batteries. */
325 {
326     int spk = ACTSPK[verb];
327     if (!just_do_it) {
328         if (TOTING(ROD2) && obj == ROD && !TOTING(ROD))obj = ROD2;
329         if (!TOTING(obj)) {
330             rspeak(spk);
331             return GO_CLEAROBJ;
332         }
333         if (obj == BIRD && HERE(SNAKE)) {
334             rspeak(BIRD_ATTACKS);
335             if (game.closed) return GO_DWARFWAKE;
336             DESTROY(SNAKE);
337             /* Set game.prop for use by travel options */
338             game.prop[SNAKE] = 1;
339
340         } else if ((GSTONE(obj) && AT(CAVITY) && game.prop[CAVITY] != 0)) {
341             rspeak(GEM_FITS);
342             game.prop[obj] = 1;
343             game.prop[CAVITY] = 0;
344             if (HERE(RUG) && ((obj == EMERALD && game.prop[RUG] != 2) || (obj == RUBY &&
345                               game.prop[RUG] == 2))) {
346                 spk = RUG_RISES;
347                 if (TOTING(RUG))spk = RUG_WIGGLES;
348                 if (obj == RUBY)spk = RUG_SETTLES;
349                 rspeak(spk);
350                 if (spk != RUG_WIGGLES) {
351                     int k = 2 - game.prop[RUG];
352                     game.prop[RUG] = k;
353                     if (k == 2) k = PLAC[SAPPH];
354                     MOVE(RUG + NOBJECTS, k);
355                 }
356             }
357         } else if (obj == COINS && HERE(VEND)) {
358             DESTROY(COINS);
359             DROP(BATTERY, game.loc);
360             pspeak(BATTERY, FRESH_BATTERIES);
361             return GO_CLEAROBJ;
362         } else if (obj == BIRD && AT(DRAGON) && game.prop[DRAGON] == 0) {
363             rspeak(BIRD_BURNT);
364             DESTROY(BIRD);
365             game.prop[BIRD] = 0;
366             return GO_CLEAROBJ;
367         } else if (obj == BEAR && AT(TROLL)) {
368             rspeak(TROLL_SCAMPERS);
369             MOVE(TROLL, 0);
370             MOVE(TROLL + NOBJECTS, 0);
371             MOVE(TROLL2, PLAC[TROLL]);
372             MOVE(TROLL2 + NOBJECTS, FIXD[TROLL]);
373             JUGGLE(CHASM);
374             game.prop[TROLL] = 2;
375         } else if (obj != VASE || game.loc == PLAC[PILLOW]) {
376             rspeak(OK_MAN);
377         } else {
378             game.prop[VASE] = 2;
379             if (AT(PILLOW))game.prop[VASE] = 0;
380             pspeak(VASE, game.prop[VASE] + 1);
381             if (game.prop[VASE] != 0)game.fixed[VASE] = -1;
382         }
383     }
384     int k = LIQUID();
385     if (k == obj)obj = BOTTLE;
386     if (obj == BOTTLE && k != 0)
387         game.place[k] = LOC_NOWHERE;
388     if (obj == CAGE && game.prop[BIRD] == 1)DROP(BIRD, game.loc);
389     DROP(obj, game.loc);
390     if (obj != BIRD) return GO_CLEAROBJ;
391     game.prop[BIRD] = 0;
392     if (FOREST(game.loc))game.prop[BIRD] = 2;
393     return GO_CLEAROBJ;
394 }
395
396 static int drink(token_t verb, token_t obj)
397 /*  Drink.  If no object, assume water and look for it here.  If water is in
398  *  the bottle, drink that, else must be at a water loc, so drink stream. */
399 {
400     int spk = ACTSPK[verb];
401     if (obj == 0 && LIQLOC(game.loc) != WATER && (LIQUID() != WATER || !HERE(BOTTLE)))
402         return GO_UNKNOWN;
403     if (obj != BLOOD) {
404         if (obj != 0 && obj != WATER)spk = RIDICULOUS_ATTEMPT;
405         if (spk != RIDICULOUS_ATTEMPT && LIQUID() == WATER && HERE(BOTTLE)) {
406             game.prop[BOTTLE] = EMPTY_BOTTLE;
407             game.place[WATER] = LOC_NOWHERE;
408             spk = BOTTLE_EMPTY;
409         }
410     } else {
411         DESTROY(BLOOD);
412         game.prop[DRAGON] = 2;
413         OBJSND[BIRD] = OBJSND[BIRD] + 3;
414         spk = HEAD_BUZZES;
415     }
416     rspeak(spk);
417     return GO_CLEAROBJ;
418 }
419
420 static int eat(token_t verb, token_t obj)
421 /*  Eat.  Intransitive: assume food if present, else ask what.  Transitive: food
422  *  ok, some things lose appetite, rest are ridiculous. */
423 {
424     int spk = ACTSPK[verb];
425     if (obj == INTRANSITIVE) {
426         if (!HERE(FOOD))
427             return GO_UNKNOWN;
428         DESTROY(FOOD);
429         spk = THANKS_DELICIOUS;
430     } else {
431         if (obj == FOOD) {
432             DESTROY(FOOD);
433             spk = THANKS_DELICIOUS;
434         }
435         if (obj == BIRD || obj == SNAKE || obj == CLAM || obj == OYSTER || obj ==
436             DWARF || obj == DRAGON || obj == TROLL || obj == BEAR || obj ==
437             OGRE)spk = LOST_APPETITE;
438     }
439     rspeak(spk);
440     return GO_CLEAROBJ;
441 }
442
443 static int extinguish(token_t verb, int obj)
444 /* Extinguish.  Lamp, urn, dragon/volcano (nice try). */
445 {
446     int spk = ACTSPK[verb];
447     if (obj == INTRANSITIVE) {
448         if (HERE(LAMP) && game.prop[LAMP] == 1)obj = LAMP;
449         if (HERE(URN) && game.prop[URN] == 2)obj = obj * NOBJECTS + URN;
450         if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS) return GO_UNKNOWN;
451     }
452
453     if (obj == URN) {
454         game.prop[URN] = game.prop[URN] / 2;
455         spk = URN_DARK;
456     } else if (obj == LAMP) {
457         game.prop[LAMP] = 0;
458         rspeak(LAMP_OFF);
459         spk = DARK(game.loc) ? PITCH_DARK : NO_MESSAGE;
460     } else if (obj == DRAGON || obj == VOLCANO)
461         spk = BEYOND_POWER;
462     rspeak(spk);
463     return GO_CLEAROBJ;
464 }
465
466 static int feed(token_t verb, token_t obj)
467 /*  Feed.  If bird, no seed.  Snake, dragon, troll: quip.  If dwarf, make him
468  *  mad.  Bear, special. */
469 {
470     int spk = ACTSPK[verb];
471     if (obj == BIRD) {
472         rspeak(BIRD_PINING);
473         return GO_CLEAROBJ;
474     } else if (obj == SNAKE || obj == DRAGON || obj == TROLL) {
475         spk = NOTHING_EDIBLE;
476         if (obj == DRAGON && game.prop[DRAGON] != 0)spk = RIDICULOUS_ATTEMPT;
477         if (obj == TROLL)spk = TROLL_VICES;
478         if (obj == SNAKE && !game.closed && HERE(BIRD)) {
479             DESTROY(BIRD);
480             game.prop[BIRD] = 0;
481             spk = BIRD_DEVOURED;
482         }
483     } else if (obj == DWARF) {
484         if (HERE(FOOD)) {
485             game.dflag += 2;
486             spk = REALLY_MAD;
487         }
488     } else if (obj == BEAR) {
489         if (game.prop[BEAR] == 0)spk = NOTHING_EDIBLE;
490         if (game.prop[BEAR] == 3)spk = RIDICULOUS_ATTEMPT;
491         if (HERE(FOOD)) {
492             DESTROY(FOOD);
493             game.prop[BEAR] = 1;
494             game.fixed[AXE] = 0;
495             game.prop[AXE] = 0;
496             spk = BEAR_TAMED;
497         }
498     } else if (obj == OGRE) {
499         if (HERE(FOOD))
500             spk = OGRE_FULL;
501     } else {
502         spk = AM_GAME;
503     }
504     rspeak(spk);
505     return GO_CLEAROBJ;
506 }
507
508 int fill(token_t verb, token_t obj)
509 /*  Fill.  Bottle or urn must be empty, and liquid available.  (Vase
510  *  is nasty.) */
511 {
512     int k;
513     int spk = ACTSPK[verb];
514     if (obj == VASE) {
515         spk = ARENT_CARRYING;
516         if (LIQLOC(game.loc) == 0)spk = FILL_INVALID;
517         if (LIQLOC(game.loc) == 0 || !TOTING(VASE)) {
518             rspeak(spk);
519             return GO_CLEAROBJ;
520         }
521         rspeak(SHATTER_VASE);
522         game.prop[VASE] = 2;
523         game.fixed[VASE] = -1;
524         return (discard(verb, obj, true));
525     } else if (obj == URN) {
526         spk = FULL_URN;
527         if (game.prop[URN] != 0) {
528             rspeak(spk);
529             return GO_CLEAROBJ;
530         }
531         spk = FILL_INVALID;
532         k = LIQUID();
533         if (k == 0 || !HERE(BOTTLE)) {
534             rspeak(spk);
535             return GO_CLEAROBJ;
536         }
537         game.place[k] = LOC_NOWHERE;
538         game.prop[BOTTLE] = EMPTY_BOTTLE;
539         if (k == OIL)game.prop[URN] = 1;
540         spk = WATER_URN + game.prop[URN];
541         rspeak(spk);
542         return GO_CLEAROBJ;
543     } else if (obj != 0 && obj != BOTTLE) {
544         rspeak(spk);
545         return GO_CLEAROBJ;
546     } else if (obj == 0 && !HERE(BOTTLE))
547         return GO_UNKNOWN;
548     spk = BOTTLED_WATER;
549     if (LIQLOC(game.loc) == 0)
550         spk = NO_LIQUID;
551     if (HERE(URN) && game.prop[URN] != 0)
552         spk = URN_NOPOUR;
553     if (LIQUID() != 0)
554         spk = BOTTLE_FULL;
555     if (spk == BOTTLED_WATER) {
556         /* FIXME: Arithmetic on property values */
557         game.prop[BOTTLE] = MOD(conditions[game.loc], 4) / 2 * 2;
558         k = LIQUID();
559         if (TOTING(BOTTLE))
560             game.place[k] = CARRIED;
561         if (k == OIL)
562             spk = BOTTLED_OIL;
563     }
564     rspeak(spk);
565     return GO_CLEAROBJ;
566 }
567
568 static int find(token_t verb, token_t obj)
569 /* Find.  Might be carrying it, or it might be here.  Else give caveat. */
570 {
571     int spk = ACTSPK[verb];
572     if (AT(obj) ||
573         (LIQUID() == obj && AT(BOTTLE)) ||
574         obj == LIQLOC(game.loc) ||
575         (obj == DWARF && ATDWRF(game.loc) > 0))
576         spk = YOU_HAVEIT;
577     if (game.closed)spk = NEEDED_NEARBY;
578     if (TOTING(obj))spk = ALREADY_CARRYING;
579     rspeak(spk);
580     return GO_CLEAROBJ;
581 }
582
583 static int fly(token_t verb, token_t obj)
584 /* Fly.  Snide remarks unless hovering rug is here. */
585 {
586     int spk = ACTSPK[verb];
587     if (obj == INTRANSITIVE) {
588         if (game.prop[RUG] != 2)spk = RUG_NOTHING2;
589         if (!HERE(RUG))spk = FLAP_ARMS;
590         if (spk == RUG_NOTHING2 || spk == FLAP_ARMS) {
591             rspeak(spk);
592             return GO_CLEAROBJ;
593         }
594         obj = RUG;
595     }
596
597     if (obj != RUG) {
598         rspeak(spk);
599         return GO_CLEAROBJ;
600     }
601     spk = RUG_NOTHING1;
602     if (game.prop[RUG] != 2) {
603         rspeak(spk);
604         return GO_CLEAROBJ;
605     }
606     game.oldlc2 = game.oldloc;
607     game.oldloc = game.loc;
608     game.newloc = game.place[RUG] + game.fixed[RUG] - game.loc;
609     spk = RUG_GOES;
610     if (game.prop[SAPPH] >= 0)
611         spk = RUG_RETURNS;
612     rspeak(spk);
613     return GO_TERMINATE;
614 }
615
616 static int inven(void)
617 /* Inventory. If object, treat same as find.  Else report on current burden. */
618 {
619     int spk = NO_CARRY;
620     for (int i = 1; i <= NOBJECTS; i++) {
621         if (i == BEAR || !TOTING(i))
622             continue;
623         if (spk == NO_CARRY)
624             rspeak(NOW_HOLDING);
625         game.blklin = false;
626         pspeak(i, -1);
627         game.blklin = true;
628         spk = NO_MESSAGE;
629     }
630     if (TOTING(BEAR))
631         spk = TAME_BEAR;
632     rspeak(spk);
633     return GO_CLEAROBJ;
634 }
635
636 static int light(token_t verb, token_t obj)
637 /*  Light.  Applicable only to lamp and urn. */
638 {
639     int spk = ACTSPK[verb];
640     if (obj == INTRANSITIVE) {
641         if (HERE(LAMP) && game.prop[LAMP] == 0 && game.limit >= 0)obj = LAMP;
642         if (HERE(URN) && game.prop[URN] == 1)obj = obj * NOBJECTS + URN;
643         if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS) return GO_UNKNOWN;
644     }
645
646     if (obj == URN) {
647         if (game.prop[URN] == 0) {
648             rspeak(URN_EMPTY);
649         } else {
650             game.prop[URN] = 2;
651             rspeak(URN_LIT);
652         }
653         return GO_CLEAROBJ;
654     } else {
655         if (obj != LAMP) {
656             rspeak(spk);
657             return GO_CLEAROBJ;
658         }
659         spk = LAMP_OUT;
660         if (game.limit < 0) {
661             rspeak(spk);
662             return GO_CLEAROBJ;
663         }
664         game.prop[LAMP] = 1;
665         rspeak(LAMP_ON);
666         if (game.wzdark)
667             return GO_TOP;
668         else
669             return GO_CLEAROBJ;
670     }
671 }
672
673 static int listen(void)
674 /*  Listen.  Intransitive only.  Print stuff based on objsnd/locsnd. */
675 {
676     long k;
677     int spk = ALL_SILENT;
678     k = locations[game.loc].sound;
679     if (k != SILENT) {
680         rspeak(k);
681         if (locations[game.loc].loud)
682             return GO_CLEAROBJ;
683         else
684             spk = NO_MESSAGE;
685     }
686     for (int i = 1; i <= NOBJECTS; i++) {
687         if (!HERE(i) || OBJSND[i] == 0 || game.prop[i] < 0)
688             continue;
689         pspeak(i, OBJSND[i] + game.prop[i], game.zzword);
690         spk = NO_MESSAGE;
691         if (i == BIRD && OBJSND[i] + game.prop[i] == 8)
692             DESTROY(BIRD);
693     }
694     rspeak(spk);
695     return GO_CLEAROBJ;
696 }
697
698 static int lock(token_t verb, token_t obj)
699 /* Lock, unlock, no object given.  Assume various things if present. */
700 {
701     int spk = ACTSPK[verb];
702     if (obj == INTRANSITIVE) {
703         spk = NOTHING_LOCKED;
704         if (HERE(CLAM))obj = CLAM;
705         if (HERE(OYSTER))obj = OYSTER;
706         if (AT(DOOR))obj = DOOR;
707         if (AT(GRATE))obj = GRATE;
708         if (obj != 0 && HERE(CHAIN)) return GO_UNKNOWN;
709         if (HERE(CHAIN))obj = CHAIN;
710         if (obj == 0 || obj == INTRANSITIVE) {
711             rspeak(spk);
712             return GO_CLEAROBJ;
713         }
714     }
715
716     /*  Lock, unlock object.  Special stuff for opening clam/oyster
717      *  and for chain. */
718     if (obj == CLAM || obj == OYSTER)
719         return bivalve(verb, obj);
720     if (obj == DOOR)spk = RUSTY_DOOR;
721     if (obj == DOOR && game.prop[DOOR] == 1)spk = OK_MAN;
722     if (obj == CAGE)spk = NO_LOCK;
723     if (obj == KEYS)spk = CANNOT_UNLOCK;
724     if (obj == GRATE || obj == CHAIN) {
725         spk = NO_KEYS;
726         if (HERE(KEYS)) {
727             if (obj == CHAIN)
728                 return chain(verb);
729             if (game.closng) {
730                 spk = EXIT_CLOSED;
731                 if (!game.panic)game.clock2 = PANICTIME;
732                 game.panic = true;
733             } else {
734                 game.prop[GRATE] = (verb == LOCK) ? 0 : 1;
735                 spk = game.prop[GRATE] ? GRATE_UNLOCKED : GRATE_LOCKED;
736             }
737         }
738     }
739     rspeak(spk);
740     return GO_CLEAROBJ;
741 }
742
743 static int pour(token_t verb, token_t obj)
744 /*  Pour.  If no object, or object is bottle, assume contents of bottle.
745  *  special tests for pouring water or oil on plant or rusty door. */
746 {
747     int spk = ACTSPK[verb];
748     if (obj == BOTTLE || obj == 0)obj = LIQUID();
749     if (obj == 0) return GO_UNKNOWN;
750     if (!TOTING(obj)) {
751         rspeak(spk);
752         return GO_CLEAROBJ;
753     }
754     spk = CANT_POUR;
755     if (obj != OIL && obj != WATER) {
756         rspeak(spk);
757         return GO_CLEAROBJ;
758     }
759     if (HERE(URN) && game.prop[URN] == 0)
760         return fill(verb, URN);
761     game.prop[BOTTLE] = EMPTY_BOTTLE;
762     game.place[obj] = LOC_NOWHERE;
763     spk = GROUND_WET;
764     if (!(AT(PLANT) || AT(DOOR))) {
765         rspeak(spk);
766         return GO_CLEAROBJ;
767     }
768     if (!AT(DOOR)) {
769         spk = SHAKING_LEAVES;
770         if (obj != WATER) {
771             rspeak(spk);
772             return GO_CLEAROBJ;
773         }
774         pspeak(PLANT, game.prop[PLANT] + 3);
775         game.prop[PLANT] = MOD(game.prop[PLANT] + 1, 3);
776         game.prop[PLANT2] = game.prop[PLANT];
777         return GO_MOVE;
778     } else {
779         game.prop[DOOR] = 0;
780         if (obj == OIL)game.prop[DOOR] = 1;
781         spk = RUSTED_HINGES + game.prop[DOOR];
782         rspeak(spk);
783         return GO_CLEAROBJ;
784     }
785 }
786
787 static int quit(void)
788 /*  Quit.  Intransitive only.  Verify intent and exit if that's what he wants. */
789 {
790     if (YES(arbitrary_messages[REALLY_QUIT], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN]))
791         terminate(quitgame);
792     return GO_CLEAROBJ;
793 }
794
795 static int read(struct command_t command)
796 /*  Read.  Print stuff based on objtxt.  Oyster (?) is special case. */
797 {
798     if (command.obj == INTRANSITIVE) {
799         command.obj = 0;
800         for (int i = 1; i <= NOBJECTS; i++) {
801             if (HERE(i) && OBJTXT[i] != 0 && game.prop[i] >= 0)
802                 command.obj = command.obj * NOBJECTS + i;
803         }
804         if (command.obj > NOBJECTS || command.obj == 0 || DARK(game.loc))
805             return GO_UNKNOWN;
806     }
807
808     if (DARK(game.loc)) {
809         rspeak(NO_SEE, command.wd1, command.wd1x);
810     } else if (OBJTXT[command.obj] == 0 || game.prop[command.obj] < 0) {
811         rspeak(ACTSPK[command.verb]);
812     } else if (command.obj == OYSTER && !game.clshnt) {
813         game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
814     } else
815         pspeak(command.obj, OBJTXT[command.obj] + game.prop[command.obj]);
816     return GO_CLEAROBJ;
817 }
818
819 static int reservoir(void)
820 /*  Z'ZZZ (word gets recomputed at startup; different each game). */
821 {
822     if (!AT(RESER) && game.loc != game.fixed[RESER] - 1) {
823         rspeak(NOTHING_HAPPENS);
824         return GO_CLEAROBJ;
825     } else {
826         pspeak(RESER, game.prop[RESER] + 1);
827         game.prop[RESER] = 1 - game.prop[RESER];
828         if (AT(RESER))
829             return GO_CLEAROBJ;
830         else {
831             game.oldlc2 = game.loc;
832             game.newloc = 0;
833             rspeak(NOT_BRIGHT);
834             return GO_TERMINATE;
835         }
836     }
837 }
838
839 static int rub(token_t verb, token_t obj)
840 /* Rub.  Yields various snide remarks except for lit urn. */
841 {
842     int spk = ACTSPK[verb];
843     if (obj != LAMP)
844         spk = PECULIAR_NOTHING;
845     if (obj == URN && game.prop[URN] == 2) {
846         DESTROY(URN);
847         DROP(AMBER, game.loc);
848         game.prop[AMBER] = 1;
849         --game.tally;
850         DROP(CAVITY, game.loc);
851         spk = URN_GENIES;
852     }
853     rspeak(spk);
854     return GO_CLEAROBJ;
855 }
856
857 static int say(struct command_t *command)
858 /* Say.  Echo WD2 (or WD1 if no WD2 (SAY WHAT?, etc.).)  Magic words override. */
859 {
860     long a = command->wd1, b = command->wd1x;
861     if (command->wd2 > 0) {
862         a = command->wd2;
863         b = command->wd2x;
864         command->wd1 = command->wd2;
865     }
866     int wd = VOCAB(command->wd1, -1);
867     /* FIXME: Magic numbers */
868     if (wd == 62 || wd == 65 || wd == 71 || wd == 2025 || wd == 2034) {
869         /* FIXME: scribbles on the interpreter's command block */
870         wordclear(&command->wd2);
871         return GO_LOOKUP;
872     }
873     rspeak(OKEY_DOKEY, a, b);
874     return GO_CLEAROBJ;
875 }
876
877 static int throw_support(long spk)
878 {
879     rspeak(spk);
880     DROP(AXE, game.loc);
881     return GO_MOVE;
882 }
883
884 static int throw (FILE *cmdin, struct command_t *command)
885 /*  Throw.  Same as discard unless axe.  Then same as attack except
886  *  ignore bird, and if dwarf is present then one might be killed.
887  *  (Only way to do so!)  Axe also special for dragon, bear, and
888  *  troll.  Treasures special for troll. */
889 {
890     int spk = ACTSPK[command->verb];
891     if (TOTING(ROD2) && command->obj == ROD && !TOTING(ROD))command->obj = ROD2;
892     if (!TOTING(command->obj)) {
893         rspeak(spk);
894         return GO_CLEAROBJ;
895     }
896     if (command->obj >= MINTRS && command->obj <= MAXTRS && AT(TROLL)) {
897         spk = TROLL_SATISFIED;
898         /*  Snarf a treasure for the troll. */
899         DROP(command->obj, 0);
900         MOVE(TROLL, 0);
901         MOVE(TROLL + NOBJECTS, 0);
902         DROP(TROLL2, PLAC[TROLL]);
903         DROP(TROLL2 + NOBJECTS, FIXD[TROLL]);
904         JUGGLE(CHASM);
905         rspeak(spk);
906         return GO_CLEAROBJ;
907     }
908     if (command->obj == FOOD && HERE(BEAR)) {
909         /* But throwing food is another story. */
910         command->obj = BEAR;
911         return (feed(command->verb, command->obj));
912     }
913     if (command->obj != AXE)
914         return (discard(command->verb, command->obj, false));
915     else {
916         int i = ATDWRF(game.loc);
917         if (i <= 0) {
918             if (AT(DRAGON) && game.prop[DRAGON] == 0)
919                 return throw_support(DRAGON_SCALES);
920             if (AT(TROLL))
921                 return throw_support(TROLL_RETURNS);
922             else if (AT(OGRE))
923                 return throw_support(OGRE_DODGE);
924             else if (HERE(BEAR) && game.prop[BEAR] == 0) {
925                 /* This'll teach him to throw the axe at the bear! */
926                 DROP(AXE, game.loc);
927                 game.fixed[AXE] = -1;
928                 game.prop[AXE] = 1;
929                 JUGGLE(BEAR);
930                 rspeak(AXE_LOST);
931                 return GO_CLEAROBJ;
932             }
933             command->obj = 0;
934             return (attack(cmdin, command));
935         }
936
937         if (randrange(NDWARVES + 1) < game.dflag) {
938             return throw_support(DWARF_DODGES);
939         } else {
940             game.dseen[i] = false;
941             game.dloc[i] = 0;
942             return throw_support((++game.dkill == 1)
943                                  ? DWARF_SMOKE : KILLED_DWARF);
944         }
945     }
946 }
947
948 static int wake(token_t verb, token_t obj)
949 /* Wake.  Only use is to disturb the dwarves. */
950 {
951     if (obj != DWARF || !game.closed) {
952         rspeak(ACTSPK[verb]);
953         return GO_CLEAROBJ;
954     } else {
955         rspeak(PROD_DWARF);
956         return GO_DWARFWAKE;
957     }
958 }
959
960 static int wave(token_t verb, token_t obj)
961 /* Wave.  No effect unless waving rod at fissure or at bird. */
962 {
963     int spk = ACTSPK[verb];
964     if ((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2)))spk = ARENT_CARRYING;
965     if (obj != ROD ||
966         !TOTING(obj) ||
967         (!HERE(BIRD) && (game.closng || !AT(FISSURE)))) {
968         rspeak(spk);
969         return GO_CLEAROBJ;
970     }
971     if (HERE(BIRD))spk = FREE_FLY + MOD(game.prop[BIRD], 2);
972     if (spk == FREE_FLY && game.loc == game.place[STEPS] && game.prop[JADE] < 0) {
973         DROP(JADE, game.loc);
974         game.prop[JADE] = 0;
975         --game.tally;
976         spk = NECKLACE_FLY;
977         rspeak(spk);
978         return GO_CLEAROBJ;
979     } else {
980         if (game.closed) {
981             rspeak(spk);
982             return GO_DWARFWAKE;
983         }
984         if (game.closng || !AT(FISSURE)) {
985             rspeak(spk);
986             return GO_CLEAROBJ;
987         }
988         if (HERE(BIRD))rspeak(spk);
989         game.prop[FISSURE] = 1 - game.prop[FISSURE];
990         pspeak(FISSURE, 2 - game.prop[FISSURE]);
991         return GO_CLEAROBJ;
992     }
993 }
994
995 int action(FILE *input, struct command_t *command)
996 /*  Analyse a verb.  Remember what it was, go back for object if second word
997  *  unless verb is "say", which snarfs arbitrary second word.
998  */
999 {
1000     token_t spk = ACTSPK[command->verb];
1001
1002     if (command->part == unknown) {
1003         /*  Analyse an object word.  See if the thing is here, whether
1004          *  we've got a verb yet, and so on.  Object must be here
1005          *  unless verb is "find" or "invent(ory)" (and no new verb
1006          *  yet to be analysed).  Water and oil are also funny, since
1007          *  they are never actually dropped at any location, but might
1008          *  be here inside the bottle or urn or as a feature of the
1009          *  location. */
1010         if (HERE(command->obj))
1011             /* FALL THROUGH */;
1012         else if (command->obj == GRATE) {
1013             if (game.loc == LOC_START || game.loc == LOC_VALLEY || game.loc == LOC_SLIT)
1014                 command->obj = DPRSSN;
1015             if (game.loc == LOC_COBBLE || game.loc == LOC_DEBRIS || game.loc == LOC_AWKWARD ||
1016                 game.loc == LOC_BIRD || game.loc == LOC_PITTOP)
1017                 command->obj = ENTRNC;
1018         } else if (command->obj == DWARF && ATDWRF(game.loc) > 0)
1019             /* FALL THROUGH */;
1020         else if ((LIQUID() == command->obj && HERE(BOTTLE)) || command->obj == LIQLOC(game.loc))
1021             /* FALL THROUGH */;
1022         else if (command->obj == OIL && HERE(URN) && game.prop[URN] != 0) {
1023             command->obj = URN;
1024             /* FALL THROUGH */;
1025         } else if (command->obj == PLANT && AT(PLANT2) && game.prop[PLANT2] != 0) {
1026             command->obj = PLANT2;
1027             /* FALL THROUGH */;
1028         } else if (command->obj == KNIFE && game.knfloc == game.loc) {
1029             game.knfloc = -1;
1030             spk = KNIVES_VANISH;
1031             rspeak(spk);
1032             return GO_CLEAROBJ;
1033         } else if (command->obj == ROD && HERE(ROD2)) {
1034             command->obj = ROD2;
1035             /* FALL THROUGH */;
1036         } else if ((command->verb == FIND || command->verb == INVENT) && command->wd2 <= 0)
1037             /* FALL THROUGH */;
1038         else {
1039             rspeak(NO_SEE, command->wd1, command->wd1x);
1040             return GO_CLEAROBJ;
1041         }
1042
1043         if (command->wd2 > 0)
1044             return GO_WORD2;
1045         if (command->verb != 0)
1046             command->part = transitive;
1047     }
1048
1049     switch (command->part) {
1050     case intransitive:
1051         if (command->wd2 > 0 && command->verb != SAY)
1052             return GO_WORD2;
1053         if (command->verb == SAY)command->obj = command->wd2;
1054         if (command->obj == 0 || command->obj == INTRANSITIVE) {
1055             /*  Analyse an intransitive verb (ie, no object given yet). */
1056             switch (command->verb - 1) {
1057             case  0: /* CARRY */
1058                 return carry(command->verb, INTRANSITIVE);
1059             case  1: /* DROP  */
1060                 return GO_UNKNOWN;
1061             case  2: /* SAY   */
1062                 return GO_UNKNOWN;
1063             case  3: /* UNLOC */
1064                 return lock(command->verb, INTRANSITIVE);
1065             case  4: { /* NOTHI */
1066                 rspeak(OK_MAN);
1067                 return (GO_CLEAROBJ);
1068             }
1069             case  5: /* LOCK  */
1070                 return lock(command->verb, INTRANSITIVE);
1071             case  6: /* LIGHT */
1072                 return light(command->verb, INTRANSITIVE);
1073             case  7: /* EXTIN */
1074                 return extinguish(command->verb, INTRANSITIVE);
1075             case  8: /* WAVE  */
1076                 return GO_UNKNOWN;
1077             case  9: /* CALM  */
1078                 return GO_UNKNOWN;
1079             case 10: { /* WALK  */
1080                 rspeak(spk);
1081                 return GO_CLEAROBJ;
1082             }
1083             case 11: /* ATTAC */
1084                 return attack(input, command);
1085             case 12: /* POUR  */
1086                 return pour(command->verb, command->obj);
1087             case 13: /* EAT   */
1088                 return eat(command->verb, INTRANSITIVE);
1089             case 14: /* DRINK */
1090                 return drink(command->verb, command->obj);
1091             case 15: /* RUB   */
1092                 return GO_UNKNOWN;
1093             case 16: /* TOSS  */
1094                 return GO_UNKNOWN;
1095             case 17: /* QUIT  */
1096                 return quit();
1097             case 18: /* FIND  */
1098                 return GO_UNKNOWN;
1099             case 19: /* INVEN */
1100                 return inven();
1101             case 20: /* FEED  */
1102                 return GO_UNKNOWN;
1103             case 21: /* FILL  */
1104                 return fill(command->verb, command->obj);
1105             case 22: /* BLAST */
1106                 blast();
1107                 return GO_CLEAROBJ;
1108             case 23: /* SCOR  */
1109                 score(scoregame);
1110                 return GO_CLEAROBJ;
1111             case 24: /* FOO   */
1112                 return bigwords(command->wd1);
1113             case 25: /* BRIEF */
1114                 return brief();
1115             case 26: /* READ  */
1116                 command->obj = INTRANSITIVE;
1117                 return read(*command);
1118             case 27: /* BREAK */
1119                 return GO_UNKNOWN;
1120             case 28: /* WAKE  */
1121                 return GO_UNKNOWN;
1122             case 29: /* SUSP  */
1123                 return suspend();
1124             case 30: /* RESU  */
1125                 return resume();
1126             case 31: /* FLY   */
1127                 return fly(command->verb, INTRANSITIVE);
1128             case 32: /* LISTE */
1129                 return listen();
1130             case 33: /* ZZZZ  */
1131                 return reservoir();
1132             }
1133             BUG(INTRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST);
1134         }
1135     /* FALLTHRU */
1136     case transitive:
1137         /*  Analyse a transitive verb. */
1138         switch (command->verb - 1) {
1139         case  0: /* CARRY */
1140             return carry(command->verb, command->obj);
1141         case  1: /* DROP  */
1142             return discard(command->verb, command->obj, false);
1143         case  2: /* SAY   */
1144             return say(command);
1145         case  3: /* UNLOC */
1146             return lock(command->verb, command->obj);
1147         case  4: { /* NOTHI */
1148             rspeak(OK_MAN);
1149             return (GO_CLEAROBJ);
1150         }
1151         case  5: /* LOCK  */
1152             return lock(command->verb, command->obj);
1153         case  6: /* LIGHT */
1154             return light(command->verb, command->obj);
1155         case  7: /* EXTI  */
1156             return extinguish(command->verb, command->obj);
1157         case  8: /* WAVE  */
1158             return wave(command->verb, command->obj);
1159         case  9: { /* CALM  */
1160             rspeak(spk);
1161             return GO_CLEAROBJ;
1162         }
1163         case 10: { /* WALK  */
1164             rspeak(spk);
1165             return GO_CLEAROBJ;
1166         }
1167         case 11: /* ATTAC */
1168             return attack(input, command);
1169         case 12: /* POUR  */
1170             return pour(command->verb, command->obj);
1171         case 13: /* EAT   */
1172             return eat(command->verb, command->obj);
1173         case 14: /* DRINK */
1174             return drink(command->verb, command->obj);
1175         case 15: /* RUB   */
1176             return rub(command->verb, command->obj);
1177         case 16: /* TOSS  */
1178             return throw(input, command);
1179         case 17: { /* QUIT  */
1180             rspeak(spk);
1181             return GO_CLEAROBJ;
1182         }
1183         case 18: /* FIND  */
1184             return find(command->verb, command->obj);
1185         case 19: /* INVEN */
1186             return find(command->verb, command->obj);
1187         case 20: /* FEED  */
1188             return feed(command->verb, command->obj);
1189         case 21: /* FILL  */
1190             return fill(command->verb, command->obj);
1191         case 22: /* BLAST */
1192             blast();
1193             return GO_CLEAROBJ;
1194         case 23: { /* SCOR  */
1195             rspeak(spk);
1196             return GO_CLEAROBJ;
1197         }
1198         case 24: { /* FOO   */
1199             rspeak(spk);
1200             return GO_CLEAROBJ;
1201         }
1202         case 25: { /* BRIEF */
1203             rspeak(spk);
1204             return GO_CLEAROBJ;
1205         }
1206         case 26: /* READ  */
1207             return read(*command);
1208         case 27: /* BREAK */
1209             return vbreak(command->verb, command->obj);
1210         case 28: /* WAKE  */
1211             return wake(command->verb, command->obj);
1212         case 29: { /* SUSP  */
1213             rspeak(spk);
1214             return GO_CLEAROBJ;
1215         }
1216         case 30: { /* RESU  */
1217             rspeak(spk);
1218             return GO_CLEAROBJ;
1219         }
1220         case 31: /* FLY   */
1221             return fly(command->verb, command->obj);
1222         case 32: { /* LISTE */
1223             rspeak(spk);
1224             return GO_CLEAROBJ;
1225         }
1226         case 33: /* ZZZZ  */
1227             return reservoir();
1228         }
1229         BUG(TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST);
1230     case unknown:
1231         /* Unknown verb, couldn't deduce object - might need hint */
1232         rspeak(WHAT_DO, command->wd1, command->wd1x);
1233         return GO_CHECKHINT;
1234     default:
1235         BUG(SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN);
1236     }
1237 }