Eliminated bivalve function.
[open-adventure.git] / actions.c
index 6351f0d9164dd0647c43baba63ccc260a6bd831d..c05cfb0ffd3fd2710776dd6b9ea5b464caa516a5 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -210,38 +210,6 @@ static int bigwords(token_t foo)
     }
 }
 
-static int bivalve(token_t verb, token_t obj)
-/* Clam/oyster actions */
-{
-    bool is_oyster = (obj == OYSTER);
-    if (verb == LOCK) {
-        rspeak(HUH_MAN);
-        return GO_CLEAROBJ;
-    }
-    if (!TOTING(TRIDENT)) {
-        rspeak(is_oyster ?
-               OYSTER_OPENER :
-               CLAM_OPENER);
-        return GO_CLEAROBJ;
-    }
-    if (TOTING(obj)) {
-        rspeak( is_oyster ?
-                DROP_OYSTER :
-                DROP_CLAM);
-        return GO_CLEAROBJ;
-    }
-
-    if (!is_oyster) {
-        DESTROY(CLAM);
-        drop(OYSTER, game.loc);
-        drop(PEARL, LOC_CULDESAC);
-    }
-    rspeak(is_oyster ?
-           OYSTER_OPENS :
-           PEARL_FALLS);
-    return GO_CLEAROBJ;
-}
-
 static void blast(void)
 /*  Blast.  No effect unless you've got dynamite, which is a neat trick! */
 {
@@ -946,8 +914,24 @@ static int lock(token_t verb, token_t obj)
 
     switch (obj) {
     case CLAM:
+        if (verb == LOCK)
+            rspeak(HUH_MAN);
+        else if (!TOTING(TRIDENT))
+            rspeak(OYSTER_OPENER);
+        else {
+            DESTROY(CLAM);
+            drop(OYSTER, game.loc);
+            drop(PEARL, LOC_CULDESAC);
+            rspeak(PEARL_FALLS);
+        }
+        return GO_CLEAROBJ;
     case OYSTER:
-        return bivalve(verb, obj);
+        if (verb == LOCK)
+            rspeak(HUH_MAN);
+        else
+            rspeak(OYSTER_OPENER);
+
+        return GO_CLEAROBJ;
     case DOOR:
         rspeak((game.prop[DOOR] == DOOR_UNRUSTED) ? OK_MAN : RUSTY_DOOR);
         break;
@@ -1052,9 +1036,8 @@ static int reservoir(void)
         rspeak(NOTHING_HAPPENS);
         return GO_CLEAROBJ;
     } else {
-        /* FIXME: Arithmetic on state numbers */
-        pspeak(RESER, look, game.prop[RESER] + 1, true);
-        game.prop[RESER] = 1 - game.prop[RESER];
+       state_change(RESER,
+                    game.prop[RESER] == WATERS_PARTED ? WATERS_UNPARTED : WATERS_PARTED);
         if (AT(RESER))
             return GO_CLEAROBJ;
         else {
@@ -1231,9 +1214,8 @@ static int wave(token_t verb, token_t obj)
                    CAGE_FLY :
                    FREE_FLY);
 
-        /* FIXME: Arithemetic on property values */
-        game.prop[FISSURE] = 1 - game.prop[FISSURE];
-        pspeak(FISSURE, look, 2 - game.prop[FISSURE], true);
+        state_change(FISSURE,
+           game.prop[FISSURE] == BRIDGED ? UNBRIDGED : BRIDGED);
         return GO_CLEAROBJ;
     }
 }