YAML coverage - last object message
[open-adventure.git] / actions.c
index be822c8083493c44c4201c29933620fd9e3eb632..48de9d04a7f84763343d71627243b142e14a9470 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -101,14 +101,11 @@ static int attack(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);
-        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;
-        }
+       if (!silent_yes())
+         {
+           speak(arbitrary_messages[NASTY_DRAGON]);
+           return GO_MOVE;
+         }
         state_change(DRAGON, DRAGON_DEAD);
         game.prop[RUG] = RUG_FLOOR;
         /* Hardcoding LOC_SECRET5 as the dragon's death location is ugly.
@@ -548,9 +545,7 @@ static int discard(verb_t verb, obj_t obj)
         } else
             rspeak(OK_MAN);
 
-        game.prop[BIRD] = BIRD_UNCAGED;
-        if (FOREST(game.loc))
-            game.prop[BIRD] = BIRD_FOREST_UNCAGED;
+       game.prop[BIRD] = FOREST(game.loc) ? BIRD_FOREST_UNCAGED : BIRD_UNCAGED;
         drop(obj, game.loc);
         return GO_CLEAROBJ;
     }
@@ -995,7 +990,7 @@ static int lock(verb_t verb, obj_t obj)
         if (verb == LOCK)
             rspeak(HUH_MAN);
         else if (!TOTING(TRIDENT))
-            rspeak(OYSTER_OPENER);
+            rspeak(CLAM_OPENER);
         else {
             DESTROY(CLAM);
             drop(OYSTER, game.loc);
@@ -1006,8 +1001,12 @@ static int lock(verb_t verb, obj_t obj)
     case OYSTER:
         if (verb == LOCK)
             rspeak(HUH_MAN);
-        else
+       else if (TOTING(OYSTER))
+           rspeak(DROP_OYSTER);
+        else if (!TOTING(TRIDENT))
             rspeak(OYSTER_OPENER);
+       else
+           rspeak(OYSTER_OPENS);
         break;
     case DOOR:
         rspeak((game.prop[DOOR] == DOOR_UNRUSTED) ? OK_MAN : RUSTY_DOOR);
@@ -1346,14 +1345,14 @@ int action(struct command_t *command)
             command->obj = ROD2;
             /* FALL THROUGH */;
         } else if ((command->verb == FIND ||
-                    command->verb == INVENTORY) && command->wd2 <= 0)
+                    command->verb == INVENTORY) && (command->id2 == WORD_EMPTY || command->id2 == WORD_NOT_FOUND))
             /* FALL THROUGH */;
         else {
             sspeak(NO_SEE, command->raw1);
             return GO_CLEAROBJ;
         }
 
-        if (command->wd2 > 0)
+        if (command->id2 != WORD_EMPTY && command->id2 != WORD_NOT_FOUND)
             return GO_WORD2;
         if (command->verb != 0)
             command->part = transitive;