Eliminate setting of OBJTXT sell for oyster - OBJTXT is now static.
[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         spk = BIRD_DEAD;
46     } else if (obj == VEND) {
47         pspeak(VEND, game.prop[VEND] + 2);
48         game.prop[VEND] = 3 - game.prop[VEND];
49         return GO_CLEAROBJ;
50     }
51
52     if (obj == 0)spk = NO_TARGET;
53     if (obj == CLAM || obj == OYSTER)spk = SHELL_IMPERVIOUS;
54     if (obj == SNAKE)spk = SNAKE_WARNING;
55     if (obj == DWARF)spk = BARE_HANDS_QUERY;
56     if (obj == DWARF && game.closed) return GO_DWARFWAKE;
57     if (obj == DRAGON)spk = ALREADY_DEAD;
58     if (obj == TROLL)spk = ROCKY_TROLL;
59     if (obj == OGRE)spk = OGRE_DODGE;
60     if (obj == OGRE && ATDWRF(game.loc) > 0) {
61         rspeak(spk);
62         rspeak(KNIFE_THROWN);
63         DESTROY(OGRE);
64         int dwarves = 0;
65         for (int i = 1; i < PIRATE; i++) {
66             if (game.dloc[i] == game.loc) {
67                 ++dwarves;
68                 game.dloc[i] = LOC_LONGWEST;
69                 game.dseen[i] = false;
70             }
71         }
72         spk = (dwarves > 1) ? OGRE_PANIC1 : OGRE_PANIC2;
73     } else if (obj == BEAR)
74         /* FIXME: Arithmetic on message numbers */
75         spk = BEAR_HANDS + (game.prop[BEAR] + 1) / 2;
76     else if (obj == DRAGON && game.prop[DRAGON] == 0) {
77         /*  Fun stuff for dragon.  If he insists on attacking it, win!
78          *  Set game.prop to dead, move dragon to central loc (still
79          *  fixed), move rug there (not fixed), and move him there,
80          *  too.  Then do a null motion to get new description. */
81         rspeak(BARE_HANDS_QUERY);
82         GETIN(input, &command->wd1, &command->wd1x, &command->wd2, &command->wd2x);
83         if (command->wd1 != MAKEWD(WORD_YINIT) && command->wd1 != MAKEWD(WORD_YES))
84             return GO_CHECKFOO;
85         pspeak(DRAGON, 3);
86         game.prop[DRAGON] = 1;
87         game.prop[RUG] = 0;
88         int k = (PLAC[DRAGON] + FIXD[DRAGON]) / 2;
89         MOVE(DRAGON + NOBJECTS, -1);
90         MOVE(RUG + NOBJECTS, 0);
91         MOVE(DRAGON, k);
92         MOVE(RUG, k);
93         DROP(BLOOD, k);
94         for (obj = 1; obj <= NOBJECTS; obj++) {
95             if (game.place[obj] == PLAC[DRAGON] || game.place[obj] == FIXD[DRAGON])
96                 MOVE(obj, k);
97         }
98         game.loc = k;
99         return GO_MOVE;
100     }
101
102     rspeak(spk);
103     return GO_CLEAROBJ;
104 }
105
106 static int bigwords(token_t foo)
107 /*  FEE FIE FOE FOO (AND FUM).  Advance to next state if given in proper order.
108  *  Look up foo in section 3 of vocab to determine which word we've got.  Last
109  *  word zips the eggs back to the giant room (unless already there). */
110 {
111     int k = VOCAB(foo, 3);
112     int spk = NOTHING_HAPPENS;
113     if (game.foobar != 1 - k) {
114         if (game.foobar != 0 && game.loc == LOC_GIANTROOM)spk = START_OVER;
115         rspeak(spk);
116         return GO_CLEAROBJ;
117     } else {
118         game.foobar = k;
119         if (k != 4) {
120             rspeak(OK_MAN);
121             return GO_CLEAROBJ;
122         }
123         game.foobar = 0;
124         if (game.place[EGGS] == PLAC[EGGS] || (TOTING(EGGS) && game.loc == PLAC[EGGS])) {
125             rspeak(spk);
126             return GO_CLEAROBJ;
127         } else {
128             /*  Bring back troll if we steal the eggs back from him before
129              *  crossing. */
130             if (game.place[EGGS] == LOC_NOWHERE && game.place[TROLL] == LOC_NOWHERE && game.prop[TROLL] == 0)
131                 game.prop[TROLL] = 1;
132             k = 2;
133             if (HERE(EGGS))k = 1;
134             if (game.loc == PLAC[EGGS])k = 0;
135             MOVE(EGGS, PLAC[EGGS]);
136             pspeak(EGGS, k);
137             return GO_CLEAROBJ;
138         }
139     }
140 }
141
142 static int bivalve(token_t verb, token_t obj)
143 /* Clam/oyster actions */
144 {
145     int spk;
146     bool is_oyster = (obj == OYSTER);
147     spk = is_oyster ? OYSTER_OPENS : PEARL_FALLS;
148     if (TOTING(obj))spk = is_oyster ? DROP_OYSTER : DROP_CLAM;
149     if (!TOTING(TRIDENT))spk = is_oyster ? OYSTER_OPENER : CLAM_OPENER;
150     if (verb == LOCK)spk = HUH_MAN;
151     if (spk == PEARL_FALLS) {
152         DESTROY(CLAM);
153         DROP(OYSTER, game.loc);
154         DROP(PEARL, LOC_CULDESAC);
155     }
156     rspeak(spk);
157     return GO_CLEAROBJ;
158 }
159
160 static void blast(void)
161 /*  Blast.  No effect unless you've got dynamite, which is a neat trick! */
162 {
163     if (game.prop[ROD2] < 0 || !game.closed)
164         rspeak(REQUIRES_DYNAMITE);
165     else {
166         game.bonus = VICTORY_MESSAGE;
167         if (game.loc == LOC_NE)
168             game.bonus = DEFEAT_MESSAGE;
169         if (HERE(ROD2))
170             game.bonus = SPLATTER_MESSAGE;
171         rspeak(game.bonus);
172         terminate(endgame);
173     }
174 }
175
176 static int vbreak(token_t verb, token_t obj)
177 /*  Break.  Only works for mirror in repository and, of course, the vase. */
178 {
179     int spk = ACTSPK[verb];
180     if (obj == MIRROR)spk = TOO_FAR;
181     if (obj == VASE && game.prop[VASE] == 0) {
182         if (TOTING(VASE))DROP(VASE, game.loc);
183         game.prop[VASE] = 2;
184         game.fixed[VASE] = -1;
185         spk = BREAK_VASE;
186     } else {
187         if (obj == MIRROR && game.closed) {
188             rspeak(BREAK_MIRROR);
189             return GO_DWARFWAKE;
190         }
191     }
192     rspeak(spk);
193     return GO_CLEAROBJ;
194 }
195
196 static int brief(void)
197 /*  Brief.  Intransitive only.  Suppress long descriptions after first time. */
198 {
199     game.abbnum = 10000;
200     game.detail = 3;
201     rspeak(BRIEF_CONFIRM);
202     return GO_CLEAROBJ;
203 }
204
205 static int carry(token_t verb, token_t obj)
206 /*  Carry an object.  Special cases for bird and cage (if bird in cage, can't
207  *  take one without the other).  Liquids also special, since they depend on
208  *  status of bottle.  Also various side effects, etc. */
209 {
210     int spk;
211     if (obj == INTRANSITIVE) {
212         /*  Carry, no object given yet.  OK if only one object present. */
213         if (game.atloc[game.loc] == 0 ||
214             game.link[game.atloc[game.loc]] != 0 ||
215             ATDWRF(game.loc) > 0)
216             return GO_UNKNOWN;
217         obj = game.atloc[game.loc];
218     }
219
220     if (TOTING(obj)) {
221         rspeak(ALREADY_CARRYING);
222         return GO_CLEAROBJ;
223     }
224     spk = YOU_JOKING;
225     if (obj == PLANT && game.prop[PLANT] <= 0)spk = DEEP_ROOTS;
226     if (obj == BEAR && game.prop[BEAR] == 1)spk = BEAR_CHAINED;
227     if (obj == CHAIN && game.prop[BEAR] != 0)spk = STILL_LOCKED;
228     if (obj == URN)spk = URN_NOBUDGE;
229     if (obj == CAVITY)spk = DOUGHNUT_HOLES;
230     if (obj == BLOOD)spk = FEW_DROPS;
231     if (obj == RUG && game.prop[RUG] == 2)spk = RUG_HOVERS;
232     if (obj == SIGN)spk = HAND_PASSTHROUGH;
233     if (obj == MESSAG) {
234         rspeak(REMOVE_MESSAGE);
235         DESTROY(MESSAG);
236         return GO_CLEAROBJ;
237     }
238     if (game.fixed[obj] != 0) {
239         rspeak(spk);
240         return GO_CLEAROBJ;
241     }
242     if (obj == WATER || obj == OIL) {
243         if (!HERE(BOTTLE) || LIQUID() != obj) {
244             if (TOTING(BOTTLE) && game.prop[BOTTLE] == EMPTY_BOTTLE)
245                 return (fill(verb, BOTTLE));
246             else {
247                 if (game.prop[BOTTLE] != EMPTY_BOTTLE)
248                     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] != BIRD_CAGED && -1 - game.prop[BIRD] != BIRD_CAGED) {
262         if (game.prop[BIRD] == BIRD_FOREST_UNCAGED) {
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] = BIRD_CAGED;
274     }
275     if ((obj == BIRD || obj == CAGE) && (game.prop[BIRD] == BIRD_CAGED || -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, FRESH_BATTERIES);
360             return GO_CLEAROBJ;
361         } else if (obj == BIRD && AT(DRAGON) && game.prop[DRAGON] == 0) {
362             rspeak(BIRD_BURNT);
363             DESTROY(BIRD);
364             return GO_CLEAROBJ;
365         } else if (obj == BEAR && AT(TROLL)) {
366             rspeak(TROLL_SCAMPERS);
367             MOVE(TROLL, 0);
368             MOVE(TROLL + NOBJECTS, 0);
369             MOVE(TROLL2, PLAC[TROLL]);
370             MOVE(TROLL2 + NOBJECTS, FIXD[TROLL]);
371             JUGGLE(CHASM);
372             game.prop[TROLL] = 2;
373         } else if (obj != VASE || game.loc == PLAC[PILLOW]) {
374             rspeak(OK_MAN);
375         } else {
376             game.prop[VASE] = 2;
377             if (AT(PILLOW))game.prop[VASE] = 0;
378             pspeak(VASE, game.prop[VASE] + 1);
379             if (game.prop[VASE] != 0)game.fixed[VASE] = -1;
380         }
381     }
382     int k = LIQUID();
383     if (k == obj)obj = BOTTLE;
384     if (obj == BOTTLE && k != 0)
385         game.place[k] = LOC_NOWHERE;
386     if (obj == CAGE && game.prop[BIRD] == BIRD_CAGED)
387         DROP(BIRD, game.loc);
388     DROP(obj, game.loc);
389     if (obj != BIRD) return GO_CLEAROBJ;
390     game.prop[BIRD] = BIRD_UNCAGED;
391     if (FOREST(game.loc))
392         game.prop[BIRD] = BIRD_FOREST_UNCAGED;
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         game.blooded = true;
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] == LAMP_BRIGHT)
449             obj = LAMP;
450         if (HERE(URN) && game.prop[URN] == 2)obj = obj * NOBJECTS + URN;
451         if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS) return GO_UNKNOWN;
452     }
453
454     if (obj == URN) {
455         game.prop[URN] = game.prop[URN] / 2;
456         spk = URN_DARK;
457     } else if (obj == LAMP) {
458         game.prop[LAMP] = LAMP_DARK;
459         rspeak(LAMP_OFF);
460         spk = DARK(game.loc) ? PITCH_DARK : NO_MESSAGE;
461     } else if (obj == DRAGON || obj == VOLCANO)
462         spk = BEYOND_POWER;
463     rspeak(spk);
464     return GO_CLEAROBJ;
465 }
466
467 static int feed(token_t verb, token_t obj)
468 /*  Feed.  If bird, no seed.  Snake, dragon, troll: quip.  If dwarf, make him
469  *  mad.  Bear, special. */
470 {
471     int spk = ACTSPK[verb];
472     if (obj == BIRD) {
473         rspeak(BIRD_PINING);
474         return GO_CLEAROBJ;
475     } else if (obj == SNAKE || obj == DRAGON || obj == TROLL) {
476         spk = NOTHING_EDIBLE;
477         if (obj == DRAGON && game.prop[DRAGON] != 0)spk = RIDICULOUS_ATTEMPT;
478         if (obj == TROLL)spk = TROLL_VICES;
479         if (obj == SNAKE && !game.closed && HERE(BIRD)) {
480             DESTROY(BIRD);
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] == LAMP_DARK && game.limit >= 0)
642             obj = LAMP;
643         if (HERE(URN) && game.prop[URN] == 1)obj = obj * NOBJECTS + URN;
644         if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS) return GO_UNKNOWN;
645     }
646
647     if (obj == URN) {
648         if (game.prop[URN] == 0) {
649             rspeak(URN_EMPTY);
650         } else {
651             game.prop[URN] = 2;
652             rspeak(URN_LIT);
653         }
654         return GO_CLEAROBJ;
655     } else {
656         if (obj != LAMP) {
657             rspeak(spk);
658             return GO_CLEAROBJ;
659         }
660         spk = LAMP_OUT;
661         if (game.limit < 0) {
662             rspeak(spk);
663             return GO_CLEAROBJ;
664         }
665         game.prop[LAMP] = LAMP_BRIGHT;
666         rspeak(LAMP_ON);
667         if (game.wzdark)
668             return GO_TOP;
669         else
670             return GO_CLEAROBJ;
671     }
672 }
673
674 static int listen(void)
675 /*  Listen.  Intransitive only.  Print stuff based on objsnd/locsnd. */
676 {
677     long k;
678     int spk = ALL_SILENT;
679     k = locations[game.loc].sound;
680     if (k != SILENT) {
681         rspeak(k);
682         if (locations[game.loc].loud)
683             return GO_CLEAROBJ;
684         else
685             spk = NO_MESSAGE;
686     }
687     for (int i = 1; i <= NOBJECTS; i++) {
688         if (!HERE(i) || OBJSND[i] == 0 || game.prop[i] < 0)
689             continue;
690         int mi =  OBJSND[i] + game.prop[i];
691         if (i == BIRD)
692             mi += 3 * game.blooded;
693         pspeak(i, mi, game.zzword);
694         spk = NO_MESSAGE;
695         if (i == BIRD && OBJSND[i] + game.prop[i] == 8)
696             DESTROY(BIRD);
697     }
698     rspeak(spk);
699     return GO_CLEAROBJ;
700 }
701
702 static int lock(token_t verb, token_t obj)
703 /* Lock, unlock, no object given.  Assume various things if present. */
704 {
705     int spk = ACTSPK[verb];
706     if (obj == INTRANSITIVE) {
707         spk = NOTHING_LOCKED;
708         if (HERE(CLAM))obj = CLAM;
709         if (HERE(OYSTER))obj = OYSTER;
710         if (AT(DOOR))obj = DOOR;
711         if (AT(GRATE))obj = GRATE;
712         if (obj != 0 && HERE(CHAIN)) return GO_UNKNOWN;
713         if (HERE(CHAIN))obj = CHAIN;
714         if (obj == 0 || obj == INTRANSITIVE) {
715             rspeak(spk);
716             return GO_CLEAROBJ;
717         }
718     }
719
720     /*  Lock, unlock object.  Special stuff for opening clam/oyster
721      *  and for chain. */
722     if (obj == CLAM || obj == OYSTER)
723         return bivalve(verb, obj);
724     if (obj == DOOR)spk = RUSTY_DOOR;
725     if (obj == DOOR && game.prop[DOOR] == 1)spk = OK_MAN;
726     if (obj == CAGE)spk = NO_LOCK;
727     if (obj == KEYS)spk = CANNOT_UNLOCK;
728     if (obj == GRATE || obj == CHAIN) {
729         spk = NO_KEYS;
730         if (HERE(KEYS)) {
731             if (obj == CHAIN)
732                 return chain(verb);
733             if (game.closng) {
734                 spk = EXIT_CLOSED;
735                 if (!game.panic)game.clock2 = PANICTIME;
736                 game.panic = true;
737             } else {
738                 game.prop[GRATE] = (verb == LOCK) ? GRATE_CLOSED : GRATE_OPEN;
739                 spk = game.prop[GRATE] ? GRATE_UNLOCKED : GRATE_LOCKED;
740             }
741         }
742     }
743     rspeak(spk);
744     return GO_CLEAROBJ;
745 }
746
747 static int pour(token_t verb, token_t obj)
748 /*  Pour.  If no object, or object is bottle, assume contents of bottle.
749  *  special tests for pouring water or oil on plant or rusty door. */
750 {
751     int spk = ACTSPK[verb];
752     if (obj == BOTTLE || obj == 0)obj = LIQUID();
753     if (obj == 0) return GO_UNKNOWN;
754     if (!TOTING(obj)) {
755         rspeak(spk);
756         return GO_CLEAROBJ;
757     }
758     spk = CANT_POUR;
759     if (obj != OIL && obj != WATER) {
760         rspeak(spk);
761         return GO_CLEAROBJ;
762     }
763     if (HERE(URN) && game.prop[URN] == 0)
764         return fill(verb, URN);
765     game.prop[BOTTLE] = EMPTY_BOTTLE;
766     game.place[obj] = LOC_NOWHERE;
767     spk = GROUND_WET;
768     if (!(AT(PLANT) || AT(DOOR))) {
769         rspeak(spk);
770         return GO_CLEAROBJ;
771     }
772     if (!AT(DOOR)) {
773         spk = SHAKING_LEAVES;
774         if (obj != WATER) {
775             rspeak(spk);
776             return GO_CLEAROBJ;
777         }
778         pspeak(PLANT, game.prop[PLANT] + 3);
779         game.prop[PLANT] = MOD(game.prop[PLANT] + 1, 3);
780         game.prop[PLANT2] = game.prop[PLANT];
781         return GO_MOVE;
782     } else {
783         game.prop[DOOR] = 0;
784         if (obj == OIL)game.prop[DOOR] = 1;
785         spk = RUSTED_HINGES + game.prop[DOOR];
786         rspeak(spk);
787         return GO_CLEAROBJ;
788     }
789 }
790
791 static int quit(void)
792 /*  Quit.  Intransitive only.  Verify intent and exit if that's what he wants. */
793 {
794     if (YES(arbitrary_messages[REALLY_QUIT], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN]))
795         terminate(quitgame);
796     return GO_CLEAROBJ;
797 }
798
799 static int read(struct command_t command)
800 /*  Read.  Print stuff based on objtxt.  Oyster (?) is special case. */
801 {
802     if (command.obj == INTRANSITIVE) {
803         command.obj = 0;
804         for (int i = 1; i <= NOBJECTS; i++) {
805             if (HERE(i) && OBJTXT[i] != 0 && game.prop[i] >= 0)
806                 command.obj = command.obj * NOBJECTS + i;
807         }
808         if (command.obj > NOBJECTS || command.obj == 0 || DARK(game.loc))
809             return GO_UNKNOWN;
810     }
811
812     if (DARK(game.loc)) {
813         rspeak(NO_SEE, command.wd1, command.wd1x);
814     } else if (command.obj == OYSTER && !game.clshnt && game.closed) {
815         game.clshnt = YES(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
816     } else if (OBJTXT[command.obj] == 0 || game.prop[command.obj] < 0) {
817         rspeak(ACTSPK[command.verb]);
818     } else
819         pspeak(command.obj, OBJTXT[command.obj] + game.prop[command.obj]);
820     return GO_CLEAROBJ;
821 }
822
823 static int reservoir(void)
824 /*  Z'ZZZ (word gets recomputed at startup; different each game). */
825 {
826     if (!AT(RESER) && game.loc != game.fixed[RESER] - 1) {
827         rspeak(NOTHING_HAPPENS);
828         return GO_CLEAROBJ;
829     } else {
830         pspeak(RESER, game.prop[RESER] + 1);
831         game.prop[RESER] = 1 - game.prop[RESER];
832         if (AT(RESER))
833             return GO_CLEAROBJ;
834         else {
835             game.oldlc2 = game.loc;
836             game.newloc = 0;
837             rspeak(NOT_BRIGHT);
838             return GO_TERMINATE;
839         }
840     }
841 }
842
843 static int rub(token_t verb, token_t obj)
844 /* Rub.  Yields various snide remarks except for lit urn. */
845 {
846     int spk = ACTSPK[verb];
847     if (obj != LAMP)
848         spk = PECULIAR_NOTHING;
849     if (obj == URN && game.prop[URN] == 2) {
850         DESTROY(URN);
851         DROP(AMBER, game.loc);
852         game.prop[AMBER] = 1;
853         --game.tally;
854         DROP(CAVITY, game.loc);
855         spk = URN_GENIES;
856     }
857     rspeak(spk);
858     return GO_CLEAROBJ;
859 }
860
861 static int say(struct command_t *command)
862 /* Say.  Echo WD2 (or WD1 if no WD2 (SAY WHAT?, etc.).)  Magic words override. */
863 {
864     long a = command->wd1, b = command->wd1x;
865     if (command->wd2 > 0) {
866         a = command->wd2;
867         b = command->wd2x;
868         command->wd1 = command->wd2;
869     }
870     int wd = VOCAB(command->wd1, -1);
871     /* FIXME: Magic numbers */
872     if (wd == 62 || wd == 65 || wd == 71 || wd == 2025 || wd == 2034) {
873         /* FIXME: scribbles on the interpreter's command block */
874         wordclear(&command->wd2);
875         return GO_LOOKUP;
876     }
877     rspeak(OKEY_DOKEY, a, b);
878     return GO_CLEAROBJ;
879 }
880
881 static int throw_support(long spk)
882 {
883     rspeak(spk);
884     DROP(AXE, game.loc);
885     return GO_MOVE;
886 }
887
888 static int throw (FILE *cmdin, struct command_t *command)
889 /*  Throw.  Same as discard unless axe.  Then same as attack except
890  *  ignore bird, and if dwarf is present then one might be killed.
891  *  (Only way to do so!)  Axe also special for dragon, bear, and
892  *  troll.  Treasures special for troll. */
893 {
894     int spk = ACTSPK[command->verb];
895     if (TOTING(ROD2) && command->obj == ROD && !TOTING(ROD))command->obj = ROD2;
896     if (!TOTING(command->obj)) {
897         rspeak(spk);
898         return GO_CLEAROBJ;
899     }
900     if (command->obj >= MINTRS && command->obj <= MAXTRS && AT(TROLL)) {
901         spk = TROLL_SATISFIED;
902         /*  Snarf a treasure for the troll. */
903         DROP(command->obj, 0);
904         MOVE(TROLL, 0);
905         MOVE(TROLL + NOBJECTS, 0);
906         DROP(TROLL2, PLAC[TROLL]);
907         DROP(TROLL2 + NOBJECTS, FIXD[TROLL]);
908         JUGGLE(CHASM);
909         rspeak(spk);
910         return GO_CLEAROBJ;
911     }
912     if (command->obj == FOOD && HERE(BEAR)) {
913         /* But throwing food is another story. */
914         command->obj = BEAR;
915         return (feed(command->verb, command->obj));
916     }
917     if (command->obj != AXE)
918         return (discard(command->verb, command->obj, false));
919     else {
920         int i = ATDWRF(game.loc);
921         if (i <= 0) {
922             if (AT(DRAGON) && game.prop[DRAGON] == 0)
923                 return throw_support(DRAGON_SCALES);
924             if (AT(TROLL))
925                 return throw_support(TROLL_RETURNS);
926             else if (AT(OGRE))
927                 return throw_support(OGRE_DODGE);
928             else if (HERE(BEAR) && game.prop[BEAR] == 0) {
929                 /* This'll teach him to throw the axe at the bear! */
930                 DROP(AXE, game.loc);
931                 game.fixed[AXE] = -1;
932                 game.prop[AXE] = 1;
933                 JUGGLE(BEAR);
934                 rspeak(AXE_LOST);
935                 return GO_CLEAROBJ;
936             }
937             command->obj = 0;
938             return (attack(cmdin, command));
939         }
940
941         if (randrange(NDWARVES + 1) < game.dflag) {
942             return throw_support(DWARF_DODGES);
943         } else {
944             game.dseen[i] = false;
945             game.dloc[i] = 0;
946             return throw_support((++game.dkill == 1)
947                                  ? DWARF_SMOKE : KILLED_DWARF);
948         }
949     }
950 }
951
952 static int wake(token_t verb, token_t obj)
953 /* Wake.  Only use is to disturb the dwarves. */
954 {
955     if (obj != DWARF || !game.closed) {
956         rspeak(ACTSPK[verb]);
957         return GO_CLEAROBJ;
958     } else {
959         rspeak(PROD_DWARF);
960         return GO_DWARFWAKE;
961     }
962 }
963
964 static int wave(token_t verb, token_t obj)
965 /* Wave.  No effect unless waving rod at fissure or at bird. */
966 {
967     int spk = ACTSPK[verb];
968     if ((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2)))spk = ARENT_CARRYING;
969     if (obj != ROD ||
970         !TOTING(obj) ||
971         (!HERE(BIRD) && (game.closng || !AT(FISSURE)))) {
972         rspeak(spk);
973         return GO_CLEAROBJ;
974     }
975     /* FIXME: Arithemetic on proprty values */
976     if (HERE(BIRD))
977         spk = FREE_FLY + MOD(game.prop[BIRD], 2);
978     if (spk == FREE_FLY && game.loc == game.place[STEPS] && game.prop[JADE] < 0) {
979         DROP(JADE, game.loc);
980         game.prop[JADE] = 0;
981         --game.tally;
982         spk = NECKLACE_FLY;
983         rspeak(spk);
984         return GO_CLEAROBJ;
985     } else {
986         if (game.closed) {
987             rspeak(spk);
988             return GO_DWARFWAKE;
989         }
990         if (game.closng || !AT(FISSURE)) {
991             rspeak(spk);
992             return GO_CLEAROBJ;
993         }
994         if (HERE(BIRD))rspeak(spk);
995         game.prop[FISSURE] = 1 - game.prop[FISSURE];
996         pspeak(FISSURE, 2 - game.prop[FISSURE]);
997         return GO_CLEAROBJ;
998     }
999 }
1000
1001 int action(FILE *input, struct command_t *command)
1002 /*  Analyse a verb.  Remember what it was, go back for object if second word
1003  *  unless verb is "say", which snarfs arbitrary second word.
1004  */
1005 {
1006     token_t spk = ACTSPK[command->verb];
1007
1008     if (command->part == unknown) {
1009         /*  Analyse an object word.  See if the thing is here, whether
1010          *  we've got a verb yet, and so on.  Object must be here
1011          *  unless verb is "find" or "invent(ory)" (and no new verb
1012          *  yet to be analysed).  Water and oil are also funny, since
1013          *  they are never actually dropped at any location, but might
1014          *  be here inside the bottle or urn or as a feature of the
1015          *  location. */
1016         if (HERE(command->obj))
1017             /* FALL THROUGH */;
1018         else if (command->obj == GRATE) {
1019             if (game.loc == LOC_START || game.loc == LOC_VALLEY || game.loc == LOC_SLIT)
1020                 command->obj = DPRSSN;
1021             if (game.loc == LOC_COBBLE || game.loc == LOC_DEBRIS || game.loc == LOC_AWKWARD ||
1022                 game.loc == LOC_BIRD || game.loc == LOC_PITTOP)
1023                 command->obj = ENTRNC;
1024         } else if (command->obj == DWARF && ATDWRF(game.loc) > 0)
1025             /* FALL THROUGH */;
1026         else if ((LIQUID() == command->obj && HERE(BOTTLE)) || command->obj == LIQLOC(game.loc))
1027             /* FALL THROUGH */;
1028         else if (command->obj == OIL && HERE(URN) && game.prop[URN] != 0) {
1029             command->obj = URN;
1030             /* FALL THROUGH */;
1031         } else if (command->obj == PLANT && AT(PLANT2) && game.prop[PLANT2] != 0) {
1032             command->obj = PLANT2;
1033             /* FALL THROUGH */;
1034         } else if (command->obj == KNIFE && game.knfloc == game.loc) {
1035             game.knfloc = -1;
1036             spk = KNIVES_VANISH;
1037             rspeak(spk);
1038             return GO_CLEAROBJ;
1039         } else if (command->obj == ROD && HERE(ROD2)) {
1040             command->obj = ROD2;
1041             /* FALL THROUGH */;
1042         } else if ((command->verb == FIND || command->verb == INVENT) && command->wd2 <= 0)
1043             /* FALL THROUGH */;
1044         else {
1045             rspeak(NO_SEE, command->wd1, command->wd1x);
1046             return GO_CLEAROBJ;
1047         }
1048
1049         if (command->wd2 > 0)
1050             return GO_WORD2;
1051         if (command->verb != 0)
1052             command->part = transitive;
1053     }
1054
1055     switch (command->part) {
1056     case intransitive:
1057         if (command->wd2 > 0 && command->verb != SAY)
1058             return GO_WORD2;
1059         if (command->verb == SAY)command->obj = command->wd2;
1060         if (command->obj == 0 || command->obj == INTRANSITIVE) {
1061             /*  Analyse an intransitive verb (ie, no object given yet). */
1062             switch (command->verb - 1) {
1063             case  0: /* CARRY */
1064                 return carry(command->verb, INTRANSITIVE);
1065             case  1: /* DROP  */
1066                 return GO_UNKNOWN;
1067             case  2: /* SAY   */
1068                 return GO_UNKNOWN;
1069             case  3: /* UNLOC */
1070                 return lock(command->verb, INTRANSITIVE);
1071             case  4: { /* NOTHI */
1072                 rspeak(OK_MAN);
1073                 return (GO_CLEAROBJ);
1074             }
1075             case  5: /* LOCK  */
1076                 return lock(command->verb, INTRANSITIVE);
1077             case  6: /* LIGHT */
1078                 return light(command->verb, INTRANSITIVE);
1079             case  7: /* EXTIN */
1080                 return extinguish(command->verb, INTRANSITIVE);
1081             case  8: /* WAVE  */
1082                 return GO_UNKNOWN;
1083             case  9: /* CALM  */
1084                 return GO_UNKNOWN;
1085             case 10: { /* WALK  */
1086                 rspeak(spk);
1087                 return GO_CLEAROBJ;
1088             }
1089             case 11: /* ATTAC */
1090                 return attack(input, command);
1091             case 12: /* POUR  */
1092                 return pour(command->verb, command->obj);
1093             case 13: /* EAT   */
1094                 return eat(command->verb, INTRANSITIVE);
1095             case 14: /* DRINK */
1096                 return drink(command->verb, command->obj);
1097             case 15: /* RUB   */
1098                 return GO_UNKNOWN;
1099             case 16: /* TOSS  */
1100                 return GO_UNKNOWN;
1101             case 17: /* QUIT  */
1102                 return quit();
1103             case 18: /* FIND  */
1104                 return GO_UNKNOWN;
1105             case 19: /* INVEN */
1106                 return inven();
1107             case 20: /* FEED  */
1108                 return GO_UNKNOWN;
1109             case 21: /* FILL  */
1110                 return fill(command->verb, command->obj);
1111             case 22: /* BLAST */
1112                 blast();
1113                 return GO_CLEAROBJ;
1114             case 23: /* SCOR  */
1115                 score(scoregame);
1116                 return GO_CLEAROBJ;
1117             case 24: /* FOO   */
1118                 return bigwords(command->wd1);
1119             case 25: /* BRIEF */
1120                 return brief();
1121             case 26: /* READ  */
1122                 command->obj = INTRANSITIVE;
1123                 return read(*command);
1124             case 27: /* BREAK */
1125                 return GO_UNKNOWN;
1126             case 28: /* WAKE  */
1127                 return GO_UNKNOWN;
1128             case 29: /* SUSP  */
1129                 return suspend();
1130             case 30: /* RESU  */
1131                 return resume();
1132             case 31: /* FLY   */
1133                 return fly(command->verb, INTRANSITIVE);
1134             case 32: /* LISTE */
1135                 return listen();
1136             case 33: /* ZZZZ  */
1137                 return reservoir();
1138             }
1139             BUG(INTRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST);
1140         }
1141     /* FALLTHRU */
1142     case transitive:
1143         /*  Analyse a transitive verb. */
1144         switch (command->verb - 1) {
1145         case  0: /* CARRY */
1146             return carry(command->verb, command->obj);
1147         case  1: /* DROP  */
1148             return discard(command->verb, command->obj, false);
1149         case  2: /* SAY   */
1150             return say(command);
1151         case  3: /* UNLOC */
1152             return lock(command->verb, command->obj);
1153         case  4: { /* NOTHI */
1154             rspeak(OK_MAN);
1155             return (GO_CLEAROBJ);
1156         }
1157         case  5: /* LOCK  */
1158             return lock(command->verb, command->obj);
1159         case  6: /* LIGHT */
1160             return light(command->verb, command->obj);
1161         case  7: /* EXTI  */
1162             return extinguish(command->verb, command->obj);
1163         case  8: /* WAVE  */
1164             return wave(command->verb, command->obj);
1165         case  9: { /* CALM  */
1166             rspeak(spk);
1167             return GO_CLEAROBJ;
1168         }
1169         case 10: { /* WALK  */
1170             rspeak(spk);
1171             return GO_CLEAROBJ;
1172         }
1173         case 11: /* ATTAC */
1174             return attack(input, command);
1175         case 12: /* POUR  */
1176             return pour(command->verb, command->obj);
1177         case 13: /* EAT   */
1178             return eat(command->verb, command->obj);
1179         case 14: /* DRINK */
1180             return drink(command->verb, command->obj);
1181         case 15: /* RUB   */
1182             return rub(command->verb, command->obj);
1183         case 16: /* TOSS  */
1184             return throw(input, command);
1185         case 17: { /* QUIT  */
1186             rspeak(spk);
1187             return GO_CLEAROBJ;
1188         }
1189         case 18: /* FIND  */
1190             return find(command->verb, command->obj);
1191         case 19: /* INVEN */
1192             return find(command->verb, command->obj);
1193         case 20: /* FEED  */
1194             return feed(command->verb, command->obj);
1195         case 21: /* FILL  */
1196             return fill(command->verb, command->obj);
1197         case 22: /* BLAST */
1198             blast();
1199             return GO_CLEAROBJ;
1200         case 23: { /* SCOR  */
1201             rspeak(spk);
1202             return GO_CLEAROBJ;
1203         }
1204         case 24: { /* FOO   */
1205             rspeak(spk);
1206             return GO_CLEAROBJ;
1207         }
1208         case 25: { /* BRIEF */
1209             rspeak(spk);
1210             return GO_CLEAROBJ;
1211         }
1212         case 26: /* READ  */
1213             return read(*command);
1214         case 27: /* BREAK */
1215             return vbreak(command->verb, command->obj);
1216         case 28: /* WAKE  */
1217             return wake(command->verb, command->obj);
1218         case 29: { /* SUSP  */
1219             rspeak(spk);
1220             return GO_CLEAROBJ;
1221         }
1222         case 30: { /* RESU  */
1223             rspeak(spk);
1224             return GO_CLEAROBJ;
1225         }
1226         case 31: /* FLY   */
1227             return fly(command->verb, command->obj);
1228         case 32: { /* LISTE */
1229             rspeak(spk);
1230             return GO_CLEAROBJ;
1231         }
1232         case 33: /* ZZZZ  */
1233             return reservoir();
1234         }
1235         BUG(TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST);
1236     case unknown:
1237         /* Unknown verb, couldn't deduce object - might need hint */
1238         rspeak(WHAT_DO, command->wd1, command->wd1x);
1239         return GO_CHECKHINT;
1240     default:
1241         BUG(SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN);
1242     }
1243 }