Jettison MAKEWD(), GETTXT(), vocab(), GETIN(), and the old db compiler.
[open-adventure.git] / actions.c
index f287bc8b3f9e8a7eefd274bd2ac60b03b79ae032..f746dee1edfe8003c719d45b22aafb16dfba121f 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -1,12 +1,17 @@
 #include <stdlib.h>
 #include <stdbool.h>
 #include "advent.h"
-#include "database.h"
 #include "newdb.h"
 
 static int fill(token_t, token_t);
 
-static int attack(FILE *input, struct command_t *command)
+static void state_change(long obj, long state)
+{
+    game.prop[obj] = state;
+    pspeak(obj, change, state);
+}
+
+static int attack(struct command_t *command)
 /*  Attack.  Assume target if unambiguous.  "Throw" also links here.
  *  Attackable objects fall into two categories: enemies (snake,
  *  dwarf, etc.)  and others (bird, clam, machine).  Ambiguous if 2
@@ -14,7 +19,7 @@ static int attack(FILE *input, struct command_t *command)
 {
     vocab_t verb = command->verb;
     vocab_t obj = command->obj;
-    int spk = actspk[verb];
+    long spk = actions[verb].message;
     if (obj == 0 || obj == INTRANSITIVE) {
         if (atdwrf(game.loc) > 0)
             obj = DWARF;
@@ -22,7 +27,8 @@ static int attack(FILE *input, struct command_t *command)
         if (AT(DRAGON) && game.prop[DRAGON] == 0)obj = obj * NOBJECTS + DRAGON;
         if (AT(TROLL))obj = obj * NOBJECTS + TROLL;
         if (AT(OGRE))obj = obj * NOBJECTS + OGRE;
-        if (HERE(BEAR) && game.prop[BEAR] == 0)obj = obj * NOBJECTS + BEAR;
+        if (HERE(BEAR) && game.prop[BEAR] == UNTAMED_BEAR)
+           obj = obj * NOBJECTS + BEAR;
         if (obj > NOBJECTS) return GO_UNKNOWN;
         if (obj == 0) {
             /* Can't attack bird or machine by throwing axe. */
@@ -44,9 +50,8 @@ static int attack(FILE *input, struct command_t *command)
         DESTROY(BIRD);
         spk = BIRD_DEAD;
     } else if (obj == VEND) {
-       bool blocking = (game.prop[VEND] == VEND_BLOCKS);
-        game.prop[VEND] = blocking ? VEND_UNBLOCKS : VEND_BLOCKS;
-        rspeak(blocking ? MACHINE_SWINGOUT : MACHINE_SWINGBACK);
+       state_change(VEND,
+                    game.prop[VEND]==VEND_BLOCKS ? VEND_UNBLOCKS : VEND_BLOCKS);
         return GO_CLEAROBJ;
     }
 
@@ -80,9 +85,17 @@ static int attack(FILE *input, struct command_t *command)
          *  fixed), move rug there (not fixed), and move him there,
          *  too.  Then do a null motion to get new description. */
         rspeak(BARE_HANDS_QUERY);
-        GETIN(input, &command->wd1, &command->wd1x, &command->wd2, &command->wd2x);
-        if (command->wd1 != MAKEWD(WORD_YINIT) && command->wd1 != MAKEWD(WORD_YES))
-            return GO_CHECKFOO;
+       if(silent_yes())
+         {
+           // FIXME: setting wd1 is a workaround for broken logic
+           command->wd1 = token_to_packed("Y");
+         }
+       else
+         {
+           // FIXME: setting wd1 is a workaround for broken logic
+           command->wd1 = token_to_packed("N");
+           return GO_CHECKFOO;
+         }
         pspeak(DRAGON, look, 3);
         game.prop[DRAGON] = 1;
         game.prop[RUG] = 0;
@@ -109,7 +122,10 @@ static int bigwords(token_t foo)
  *  Look up foo in section 3 of vocab to determine which word we've got.  Last
  *  word zips the eggs back to the giant room (unless already there). */
 {
-    int k = vocab(foo, 3);
+    //int k = vocab(foo, 3);
+    char word[6];
+    packed_to_token(foo, word);
+    int k = (int) get_special_vocab_id(word);
     int spk = NOTHING_HAPPENS;
     if (game.foobar != 1 - k) {
         if (game.foobar != 0 && game.loc == LOC_GIANTROOM)spk = START_OVER;
@@ -177,7 +193,7 @@ static void blast(void)
 static int vbreak(token_t verb, token_t obj)
 /*  Break.  Only works for mirror in repository and, of course, the vase. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (obj == MIRROR)spk = TOO_FAR;
     if (obj == VASE && game.prop[VASE] == 0) {
         if (TOTING(VASE))drop(VASE, game.loc);
@@ -224,8 +240,10 @@ static int vcarry(token_t verb, token_t obj)
     }
     spk = YOU_JOKING;
     if (obj == PLANT && game.prop[PLANT] <= 0)spk = DEEP_ROOTS;
-    if (obj == BEAR && game.prop[BEAR] == 1)spk = BEAR_CHAINED;
-    if (obj == CHAIN && game.prop[BEAR] != 0)spk = STILL_LOCKED;
+    if (obj == BEAR && game.prop[BEAR] == SITTING_BEAR)
+       spk = BEAR_CHAINED;
+    if (obj == CHAIN && game.prop[BEAR] != UNTAMED_BEAR)
+       spk = STILL_LOCKED;
     if (obj == URN)spk = URN_NOBUDGE;
     if (obj == CAVITY)spk = DOUGHNUT_HOLES;
     if (obj == BLOOD)spk = FEW_DROPS;
@@ -280,7 +298,7 @@ static int vcarry(token_t verb, token_t obj)
         game.place[LIQUID()] = CARRIED;
     if (GSTONE(obj) && game.prop[obj] != 0) {
         game.prop[obj] = 0;
-        game.prop[CAVITY] = 1;
+        game.prop[CAVITY] = CAVITY_EMPTY;
     }
     rspeak(OK_MAN);
     return GO_CLEAROBJ;
@@ -292,26 +310,33 @@ static int chain(token_t verb)
     int spk;
     if (verb != LOCK) {
         spk = CHAIN_UNLOCKED;
-        if (game.prop[BEAR] == 0)spk = BEAR_BLOCKS;
-        if (game.prop[CHAIN] == 0)spk = ALREADY_UNLOCKED;
+        if (game.prop[BEAR] == UNTAMED_BEAR)
+           spk = BEAR_BLOCKS;
+        if (game.prop[CHAIN] == 0)
+           spk = ALREADY_UNLOCKED;
         if (spk != CHAIN_UNLOCKED) {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
         game.prop[CHAIN] = 0;
         game.fixed[CHAIN] = 0;
-        if (game.prop[BEAR] != 3)game.prop[BEAR] = 2;
+        if (game.prop[BEAR] != BEAR_DEAD)
+           game.prop[BEAR] = CONTENTED_BEAR;
+       /* FIXME: Arithmetic on state numbers */
         game.fixed[BEAR] = 2 - game.prop[BEAR];
     } else {
         spk = CHAIN_LOCKED;
-        if (game.prop[CHAIN] != 0)spk = ALREADY_LOCKED;
-        if (game.loc != objects[CHAIN].plac)spk = NO_LOCKSITE;
+        if (game.prop[CHAIN] != 0)
+           spk = ALREADY_LOCKED;
+        if (game.loc != objects[CHAIN].plac)
+           spk = NO_LOCKSITE;
         if (spk != CHAIN_LOCKED) {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
         game.prop[CHAIN] = 2;
-        if (TOTING(CHAIN))drop(CHAIN, game.loc);
+        if (TOTING(CHAIN))
+           drop(CHAIN, game.loc);
         game.fixed[CHAIN] = -1;
     }
     rspeak(spk);
@@ -323,7 +348,7 @@ static int discard(token_t verb, token_t obj, bool just_do_it)
  *  bird (might attack snake or dragon) and cage (might contain bird) and vase.
  *  Drop coins at vending machine for extra batteries. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (!just_do_it) {
         if (TOTING(ROD2) && obj == ROD && !TOTING(ROD))obj = ROD2;
         if (!TOTING(obj)) {
@@ -335,12 +360,12 @@ static int discard(token_t verb, token_t obj, bool just_do_it)
             if (game.closed) return GO_DWARFWAKE;
             DESTROY(SNAKE);
             /* Set game.prop for use by travel options */
-            game.prop[SNAKE] = 1;
+            game.prop[SNAKE] = SNAKE_CHASED;
 
-        } else if ((GSTONE(obj) && AT(CAVITY) && game.prop[CAVITY] != 0)) {
+        } else if ((GSTONE(obj) && AT(CAVITY) && game.prop[CAVITY] != CAVITY_FULL)) {
             rspeak(GEM_FITS);
             game.prop[obj] = 1;
-            game.prop[CAVITY] = 0;
+            game.prop[CAVITY] = CAVITY_FULL;
             if (HERE(RUG) && ((obj == EMERALD && game.prop[RUG] != 2) || (obj == RUBY &&
                               game.prop[RUG] == 2))) {
                 spk = RUG_RISES;
@@ -398,7 +423,7 @@ static int drink(token_t verb, token_t obj)
 /*  Drink.  If no object, assume water and look for it here.  If water is in
  *  the bottle, drink that, else must be at a water loc, so drink stream. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (obj == 0 && LIQLOC(game.loc) != WATER && (LIQUID() != WATER || !HERE(BOTTLE)))
         return GO_UNKNOWN;
     if (obj != BLOOD) {
@@ -422,7 +447,7 @@ static int eat(token_t verb, token_t obj)
 /*  Eat.  Intransitive: assume food if present, else ask what.  Transitive: food
  *  ok, some things lose appetite, rest are ridiculous. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (obj == INTRANSITIVE) {
         if (!HERE(FOOD))
             return GO_UNKNOWN;
@@ -444,7 +469,7 @@ static int eat(token_t verb, token_t obj)
 static int extinguish(token_t verb, int obj)
 /* Extinguish.  Lamp, urn, dragon/volcano (nice try). */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (obj == INTRANSITIVE) {
         if (HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT)
            obj = LAMP;
@@ -456,8 +481,7 @@ static int extinguish(token_t verb, int obj)
         game.prop[URN] = game.prop[URN] / 2;
         spk = URN_DARK;
     } else if (obj == LAMP) {
-        game.prop[LAMP] = LAMP_DARK;
-        rspeak(LAMP_OFF);
+       state_change(LAMP, LAMP_DARK);
         spk = DARK(game.loc) ? PITCH_DARK : NO_MESSAGE;
     } else if (obj == DRAGON || obj == VOLCANO)
         spk = BEYOND_POWER;
@@ -469,7 +493,7 @@ static int feed(token_t verb, token_t obj)
 /*  Feed.  If bird, no seed.  Snake, dragon, troll: quip.  If dwarf, make him
  *  mad.  Bear, special. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (obj == BIRD) {
         rspeak(BIRD_PINING);
         return GO_CLEAROBJ;
@@ -487,11 +511,13 @@ static int feed(token_t verb, token_t obj)
             spk = REALLY_MAD;
         }
     } else if (obj == BEAR) {
-        if (game.prop[BEAR] == 0)spk = NOTHING_EDIBLE;
-        if (game.prop[BEAR] == 3)spk = RIDICULOUS_ATTEMPT;
+        if (game.prop[BEAR] == UNTAMED_BEAR)
+           spk = NOTHING_EDIBLE;
+        if (game.prop[BEAR] == BEAR_DEAD)
+           spk = RIDICULOUS_ATTEMPT;
         if (HERE(FOOD)) {
             DESTROY(FOOD);
-            game.prop[BEAR] = 1;
+            game.prop[BEAR] = SITTING_BEAR;
             game.fixed[AXE] = 0;
             game.prop[AXE] = 0;
             spk = BEAR_TAMED;
@@ -511,7 +537,7 @@ int fill(token_t verb, token_t obj)
  *  is nasty.) */
 {
     int k;
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (obj == VASE) {
         spk = ARENT_CARRYING;
         if (LIQLOC(game.loc) == 0)spk = FILL_INVALID;
@@ -569,7 +595,7 @@ int fill(token_t verb, token_t obj)
 static int find(token_t verb, token_t obj)
 /* Find.  Might be carrying it, or it might be here.  Else give caveat. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (AT(obj) ||
         (LIQUID() == obj && AT(BOTTLE)) ||
         obj == LIQLOC(game.loc) ||
@@ -584,7 +610,7 @@ static int find(token_t verb, token_t obj)
 static int fly(token_t verb, token_t obj)
 /* Fly.  Snide remarks unless hovering rug is here. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (obj == INTRANSITIVE) {
         if (game.prop[RUG] != 2)spk = RUG_NOTHING2;
         if (!HERE(RUG))spk = FLAP_ARMS;
@@ -637,7 +663,7 @@ static int inven(void)
 static int light(token_t verb, token_t obj)
 /*  Light.  Applicable only to lamp and urn. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (obj == INTRANSITIVE) {
         if (HERE(LAMP) && game.prop[LAMP] == LAMP_DARK && game.limit >= 0)
            obj = LAMP;
@@ -663,8 +689,7 @@ static int light(token_t verb, token_t obj)
             rspeak(spk);
             return GO_CLEAROBJ;
         }
-        game.prop[LAMP] = LAMP_BRIGHT;
-        rspeak(LAMP_ON);
+       state_change(LAMP, LAMP_BRIGHT);
         if (game.wzdark)
             return GO_TOP;
         else
@@ -691,7 +716,8 @@ static int listen(void)
        int mi =  game.prop[i];
        if (i == BIRD)
            mi += 3 * game.blooded;
-        pspeak(i, hear, mi, game.zzword);
+       long packed_zzword = token_to_packed(game.zzword);
+        pspeak(i, hear, mi, packed_zzword);
         spk = NO_MESSAGE;
        /* FIXME: Magic number, sensitive to bird state logic */
        if (i == BIRD && game.prop[i] == 5)
@@ -704,7 +730,7 @@ static int listen(void)
 static int lock(token_t verb, token_t obj)
 /* Lock, unlock, no object given.  Assume various things if present. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (obj == INTRANSITIVE) {
         spk = NOTHING_LOCKED;
         if (HERE(CLAM))obj = CLAM;
@@ -737,8 +763,8 @@ static int lock(token_t verb, token_t obj)
                 if (!game.panic)game.clock2 = PANICTIME;
                 game.panic = true;
             } else {
-                game.prop[GRATE] = (verb == LOCK) ? GRATE_CLOSED : GRATE_OPEN;
-                spk = game.prop[GRATE] ? GRATE_UNLOCKED : GRATE_LOCKED;
+               state_change(GRATE, (verb == LOCK) ? GRATE_CLOSED : GRATE_OPEN);
+               return GO_CLEAROBJ;
             }
         }
     }
@@ -750,7 +776,7 @@ static int pour(token_t verb, token_t obj)
 /*  Pour.  If no object, or object is bottle, assume contents of bottle.
  *  special tests for pouring water or oil on plant or rusty door. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (obj == BOTTLE || obj == 0)obj = LIQUID();
     if (obj == 0) return GO_UNKNOWN;
     if (!TOTING(obj)) {
@@ -816,7 +842,7 @@ static int read(struct command_t command)
     } else if (command.obj == OYSTER && !game.clshnt && game.closed) {
         game.clshnt = yes(arbitrary_messages[CLUE_QUERY], arbitrary_messages[WAYOUT_CLUE], arbitrary_messages[OK_MAN]);
     } else if (objects[command.obj].texts[0] == NULL || game.prop[command.obj] < 0) {
-        rspeak(actspk[command.verb]);
+        rspeak(actions[command.verb].message);
     } else
         pspeak(command.obj, study, game.prop[command.obj]);
     return GO_CLEAROBJ;
@@ -845,7 +871,7 @@ static int reservoir(void)
 static int rub(token_t verb, token_t obj)
 /* Rub.  Yields various snide remarks except for lit urn. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if (obj != LAMP)
         spk = PECULIAR_NOTHING;
     if (obj == URN && game.prop[URN] == 2) {
@@ -869,7 +895,10 @@ static int say(struct command_t *command)
         b = command->wd2x;
         command->wd1 = command->wd2;
     }
-    int wd = vocab(command->wd1, -1);
+    //int wd = vocab(command->wd1, -1);
+    char word1[6];
+    packed_to_token(command->wd1, word1);
+    int wd = (int) get_vocab_id(word1);
     /* FIXME: Magic numbers */
     if (wd == 62 || wd == 65 || wd == 71 || wd == 2025 || wd == 2034) {
         /* FIXME: scribbles on the interpreter's command block */
@@ -887,13 +916,13 @@ static int throw_support(long spk)
     return GO_MOVE;
 }
 
-static int throw (FILE *cmdin, struct command_t *command)
+static int throw (struct command_t *command)
 /*  Throw.  Same as discard unless axe.  Then same as attack except
  *  ignore bird, and if dwarf is present then one might be killed.
  *  (Only way to do so!)  Axe also special for dragon, bear, and
  *  troll.  Treasures special for troll. */
 {
-    int spk = actspk[command->verb];
+    int spk = actions[command->verb].message;
     if (TOTING(ROD2) && command->obj == ROD && !TOTING(ROD))command->obj = ROD2;
     if (!TOTING(command->obj)) {
         rspeak(spk);
@@ -927,7 +956,7 @@ static int throw (FILE *cmdin, struct command_t *command)
                 return throw_support(TROLL_RETURNS);
             else if (AT(OGRE))
                 return throw_support(OGRE_DODGE);
-            else if (HERE(BEAR) && game.prop[BEAR] == 0) {
+            else if (HERE(BEAR) && game.prop[BEAR] == UNTAMED_BEAR) {
                 /* This'll teach him to throw the axe at the bear! */
                 drop(AXE, game.loc);
                 game.fixed[AXE] = -1;
@@ -937,7 +966,7 @@ static int throw (FILE *cmdin, struct command_t *command)
                 return GO_CLEAROBJ;
             }
             command->obj = 0;
-            return (attack(cmdin, command));
+            return (attack(command));
         }
 
         if (randrange(NDWARVES + 1) < game.dflag) {
@@ -955,7 +984,7 @@ static int wake(token_t verb, token_t obj)
 /* Wake.  Only use is to disturb the dwarves. */
 {
     if (obj != DWARF || !game.closed) {
-        rspeak(actspk[verb]);
+        rspeak(actions[verb].message);
         return GO_CLEAROBJ;
     } else {
         rspeak(PROD_DWARF);
@@ -966,7 +995,7 @@ static int wake(token_t verb, token_t obj)
 static int wave(token_t verb, token_t obj)
 /* Wave.  No effect unless waving rod at fissure or at bird. */
 {
-    int spk = actspk[verb];
+    int spk = actions[verb].message;
     if ((!TOTING(obj)) && (obj != ROD || !TOTING(ROD2)))spk = ARENT_CARRYING;
     if (obj != ROD ||
         !TOTING(obj) ||
@@ -1000,12 +1029,12 @@ static int wave(token_t verb, token_t obj)
     }
 }
 
-int action(FILE *input, struct command_t *command)
+int action(struct command_t *command)
 /*  Analyse a verb.  Remember what it was, go back for object if second word
  *  unless verb is "say", which snarfs arbitrary second word.
  */
 {
-    token_t spk = actspk[command->verb];
+    token_t spk = actions[command->verb].message;
 
     if (command->part == unknown) {
         /*  Analyse an object word.  See if the thing is here, whether
@@ -1041,7 +1070,7 @@ int action(FILE *input, struct command_t *command)
         } else if (command->obj == ROD && HERE(ROD2)) {
             command->obj = ROD2;
             /* FALL THROUGH */;
-        } else if ((command->verb == FIND || command->verb == INVENT) && command->wd2 <= 0)
+        } else if ((command->verb == FIND || command->verb == INVENTORY) && command->wd2 <= 0)
             /* FALL THROUGH */;
         else {
             rspeak(NO_SEE, command->wd1, command->wd1x);
@@ -1061,185 +1090,187 @@ int action(FILE *input, struct command_t *command)
         if (command->verb == SAY)command->obj = command->wd2;
         if (command->obj == 0 || command->obj == INTRANSITIVE) {
             /*  Analyse an intransitive verb (ie, no object given yet). */
-            switch (command->verb - 1) {
-            case  0: /* CARRY */
+            switch (command->verb) {
+            case CARRY:
                 return vcarry(command->verb, INTRANSITIVE);
-            case  1: /* DROP  */
+            case  DROP:
                 return GO_UNKNOWN;
-            case  2: /* SAY   */
+            case  SAY:
                 return GO_UNKNOWN;
-            case  3: /* UNLOC */
+            case  UNLOCK:
                 return lock(command->verb, INTRANSITIVE);
-            case  4: { /* NOTHI */
+            case  NOTHING: {
                 rspeak(OK_MAN);
                 return (GO_CLEAROBJ);
             }
-            case  5: /* LOCK  */
+            case  LOCK:
                 return lock(command->verb, INTRANSITIVE);
-            case  6: /* LIGHT */
+            case  LIGHT:
                 return light(command->verb, INTRANSITIVE);
-            case  7: /* EXTIN */
+            case  EXTINGUISH:
                 return extinguish(command->verb, INTRANSITIVE);
-            case  8: /* WAVE  */
+            case  WAVE:
                 return GO_UNKNOWN;
-            case  9: /* CALM  */
+            case  TAME:
                 return GO_UNKNOWN;
-            case 10: { /* WALK  */
+            case GO: {
                 rspeak(spk);
                 return GO_CLEAROBJ;
             }
-            case 11: /* ATTAC */
-                return attack(input, command);
-            case 12: /* POUR  */
+            case ATTACK:
+                return attack(command);
+            case POUR:
                 return pour(command->verb, command->obj);
-            case 13: /* EAT   */
+            case EAT:
                 return eat(command->verb, INTRANSITIVE);
-            case 14: /* DRINK */
+            case DRINK:
                 return drink(command->verb, command->obj);
-            case 15: /* RUB   */
+            case RUB:
                 return GO_UNKNOWN;
-            case 16: /* TOSS  */
+            case THROW:
                 return GO_UNKNOWN;
-            case 17: /* QUIT  */
+            case QUIT:
                 return quit();
-            case 18: /* FIND  */
+            case FIND:
                 return GO_UNKNOWN;
-            case 19: /* INVEN */
+            case INVENTORY:
                 return inven();
-            case 20: /* FEED  */
+            case FEED:
                 return GO_UNKNOWN;
-            case 21: /* FILL  */
+            case FILL:
                 return fill(command->verb, command->obj);
-            case 22: /* BLAST */
+            case BLAST:
                 blast();
                 return GO_CLEAROBJ;
-            case 23: /* SCOR  */
+            case SCORE:
                 score(scoregame);
                 return GO_CLEAROBJ;
-            case 24: /* FOO   */
+            case GIANTWORDS:
                 return bigwords(command->wd1);
-            case 25: /* BRIEF */
+            case BRIEF:
                 return brief();
-            case 26: /* READ  */
+            case READ:
                command->obj = INTRANSITIVE;
                 return read(*command);
-            case 27: /* BREAK */
+            case BREAK:
                 return GO_UNKNOWN;
-            case 28: /* WAKE  */
+            case WAKE:
                 return GO_UNKNOWN;
-            case 29: /* SUSP  */
+            case SAVE:
                 return suspend();
-            case 30: /* RESU  */
+            case RESUME:
                 return resume();
-            case 31: /* FLY   */
+            case FLY:
                 return fly(command->verb, INTRANSITIVE);
-            case 32: /* LISTE */
+            case LISTEN:
                 return listen();
-            case 33: /* ZZZZ  */
+            case PART:
                 return reservoir();
+           default:
+               BUG(INTRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE
             }
-            BUG(INTRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST);
         }
     /* FALLTHRU */
     case transitive:
         /*  Analyse a transitive verb. */
-        switch (command->verb - 1) {
-        case  0: /* CARRY */
+        switch (command->verb) {
+        case  CARRY:
             return vcarry(command->verb, command->obj);
-        case  1: /* DROP  */
+        case  DROP:
             return discard(command->verb, command->obj, false);
-        case  2: /* SAY   */
+        case  SAY:
             return say(command);
-        case  3: /* UNLOC */
+        case  UNLOCK:
             return lock(command->verb, command->obj);
-        case  4: { /* NOTHI */
+        case  NOTHING: {
             rspeak(OK_MAN);
             return (GO_CLEAROBJ);
         }
-        case  5: /* LOCK  */
+        case  LOCK:
             return lock(command->verb, command->obj);
-        case  6: /* LIGHT */
+        case LIGHT:
             return light(command->verb, command->obj);
-        case  7: /* EXTI  */
+        case EXTINGUISH:
             return extinguish(command->verb, command->obj);
-        case  8: /* WAVE  */
+        case WAVE:
             return wave(command->verb, command->obj);
-        case  9: { /* CALM  */
+        case TAME: {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
-        case 10: { /* WALK  */
+       case GO: {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
-        case 11: /* ATTAC */
-            return attack(input, command);
-        case 12: /* POUR  */
+        case ATTACK:
+            return attack(command);
+        case POUR:
             return pour(command->verb, command->obj);
-        case 13: /* EAT   */
+        case EAT:
             return eat(command->verb, command->obj);
-        case 14: /* DRINK */
+        case DRINK:
             return drink(command->verb, command->obj);
-        case 15: /* RUB   */
+        case RUB:
             return rub(command->verb, command->obj);
-        case 16: /* TOSS  */
-            return throw(input, command);
-        case 17: { /* QUIT  */
+        case THROW:
+            return throw(command);
+        case QUIT: {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
-        case 18: /* FIND  */
+        case FIND:
             return find(command->verb, command->obj);
-        case 19: /* INVEN */
+        case INVENTORY:
             return find(command->verb, command->obj);
-        case 20: /* FEED  */
+        case FEED:
             return feed(command->verb, command->obj);
-        case 21: /* FILL  */
+        case FILL:
             return fill(command->verb, command->obj);
-        case 22: /* BLAST */
+        case BLAST:
             blast();
             return GO_CLEAROBJ;
-        case 23: { /* SCOR  */
+        case SCORE: {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
-        case 24: { /* FOO   */
+        case GIANTWORDS: {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
-        case 25: { /* BRIEF */
+        case BRIEF: {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
-        case 26: /* READ  */
+        case READ:
             return read(*command);
-        case 27: /* BREAK */
+        case BREAK:
             return vbreak(command->verb, command->obj);
-        case 28: /* WAKE  */
+        case WAKE:
             return wake(command->verb, command->obj);
-        case 29: { /* SUSP  */
+        case SAVE: {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
-        case 30: { /* RESU  */
+        case RESUME: {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
-        case 31: /* FLY   */
+        case FLY:
             return fly(command->verb, command->obj);
-        case 32: { /* LISTE */
+        case LISTEN: {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
-        case 33: /* ZZZZ  */
+       case PART:
             return reservoir();
-        }
-        BUG(TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST);
+    default:
+        BUG(TRANSITIVE_ACTION_VERB_EXCEEDS_GOTO_LIST); // LCOV_EXCL_LINE
+    }
     case unknown:
         /* Unknown verb, couldn't deduce object - might need hint */
         rspeak(WHAT_DO, command->wd1, command->wd1x);
         return GO_CHECKHINT;
     default:
-        BUG(SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN);
+        BUG(SPEECHPART_NOT_TRANSITIVE_OR_INTRANSITIVE_OR_UNKNOWN); // LCOV_EXCL_LINE
     }
 }