Unfalsify coverage check
[open-adventure.git] / actions.c
index aa488e018bf39a74bae0f07759761998d216d95f..480b0f56a321fd871671db186c10e9f8b5e67b69 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -559,7 +559,7 @@ static int extinguish(token_t verb, int obj)
         if (game.prop[URN] != URN_EMPTY) {
             state_change(URN, URN_DARK);
         } else {
-         pspeak(URN, change, URN_DARK, true);
+            pspeak(URN, change, URN_DARK, true);
         }
 
     } else if (obj == LAMP) {
@@ -639,7 +639,7 @@ int fill(token_t verb, token_t obj)
         return (discard(verb, obj, true));
     } else if (obj == URN) {
         spk = FULL_URN;
-        if (game.prop[URN] != 0) {
+        if (game.prop[URN] != URN_EMPTY) {
             rspeak(spk);
             return GO_CLEAROBJ;
         }
@@ -652,7 +652,7 @@ int fill(token_t verb, token_t obj)
         game.place[k] = LOC_NOWHERE;
         game.prop[BOTTLE] = EMPTY_BOTTLE;
         if (k == OIL)
-            game.prop[URN] = 1;
+            game.prop[URN] = URN_DARK;
         spk = WATER_URN + game.prop[URN];
         rspeak(spk);
         return GO_CLEAROBJ;
@@ -664,7 +664,7 @@ int fill(token_t verb, token_t obj)
     spk = BOTTLED_WATER;
     if (LIQLOC(game.loc) == 0)
         spk = NO_LIQUID;
-    if (HERE(URN) && game.prop[URN] != 0)
+    if (HERE(URN) && game.prop[URN] != URN_EMPTY)
         spk = URN_NOPOUR;
     if (LIQUID() != 0)
         spk = BOTTLE_FULL;
@@ -941,7 +941,7 @@ static int read(struct command_t command)
     } else if (objects[command.obj].texts[0] == NULL || game.prop[command.obj] < 0) {
         rspeak(actions[command.verb].message);
     } else
-      pspeak(command.obj, study, game.prop[command.obj], true);
+        pspeak(command.obj, study, game.prop[command.obj], true);
     return GO_CLEAROBJ;
 }
 
@@ -952,7 +952,7 @@ static int reservoir(void)
         rspeak(NOTHING_HAPPENS);
         return GO_CLEAROBJ;
     } else {
-      pspeak(RESER, look, game.prop[RESER] + 1, true);
+        pspeak(RESER, look, game.prop[RESER] + 1, true);
         game.prop[RESER] = 1 - game.prop[RESER];
         if (AT(RESER))
             return GO_CLEAROBJ;
@@ -968,18 +968,18 @@ static int reservoir(void)
 static int rub(token_t verb, token_t obj)
 /* Rub.  Yields various snide remarks except for lit urn. */
 {
-    int spk = actions[verb].message;
-    if (obj != LAMP)
-        spk = PECULIAR_NOTHING;
     if (obj == URN && game.prop[URN] == URN_LIT) {
         DESTROY(URN);
         drop(AMBER, game.loc);
-        game.prop[AMBER] = 1;
+        game.prop[AMBER] = AMBER_IN_ROCK;
         --game.tally;
         drop(CAVITY, game.loc);
-        spk = URN_GENIES;
+        rspeak(URN_GENIES);
+    } else if (obj != LAMP) {
+        rspeak(PECULIAR_NOTHING);
+    } else {
+        rspeak(actions[verb].message);
     }
-    rspeak(spk);
     return GO_CLEAROBJ;
 }
 
@@ -992,12 +992,11 @@ static int say(struct command_t *command)
         b = command->wd2x;
         command->wd1 = command->wd2;
     }
-    //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 == XYZZY || wd == PLUGH || wd == PLOVER || wd == ACTION_WORD(GIANTWORDS) || wd == ACTION_WORD(PART)) {
+    if (wd == MOTION_WORD(XYZZY) || wd == MOTION_WORD(PLUGH) || wd == MOTION_WORD(PLOVER) || wd == ACTION_WORD(GIANTWORDS) || wd == ACTION_WORD(PART)) {
         /* FIXME: scribbles on the interpreter's command block */
         wordclear(&command->wd2);
         return GO_LOOKUP;