Do not base endgame bonus on arbitrary messages
[open-adventure.git] / actions.c
index 0e6dd7ad69836045cfb6d3785a070d773a4bfecf..cb034d16605a98205aec8ce92c9b781a3bb62833 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -236,13 +236,16 @@ static void blast(void)
         !game.closed)
         rspeak(REQUIRES_DYNAMITE);
     else {
-        if (HERE(ROD2))
-            game.bonus = SPLATTER_MESSAGE;
-        else if (game.loc == LOC_NE)
-            game.bonus = DEFEAT_MESSAGE;
-        else
-            game.bonus = VICTORY_MESSAGE;
-        rspeak(game.bonus);
+        if (HERE(ROD2)) {
+            game.bonus = splatter;
+            rspeak(SPLATTER_MESSAGE);
+        } else if (game.loc == LOC_NE) {
+            game.bonus = defeat;
+            rspeak(DEFEAT_MESSAGE);
+        } else {
+            game.bonus = victory;
+            rspeak(VICTORY_MESSAGE);
+        }
         terminate(endgame);
     }
 }
@@ -477,15 +480,13 @@ static int discard(verb_t verb, obj_t obj)
         game.prop[CAVITY] = CAVITY_FULL;
         if (HERE(RUG) && ((obj == EMERALD && game.prop[RUG] != RUG_HOVER) ||
                           (obj == RUBY && game.prop[RUG] == RUG_HOVER))) {
-            int spk;
             if (obj == RUBY)
-                spk = RUG_SETTLES;
+                rspeak(RUG_SETTLES);
             else if (TOTING(RUG))
-                spk = RUG_WIGGLES;
+                rspeak(RUG_WIGGLES);
             else
-                spk = RUG_RISES;
-            rspeak(spk);
-            if (spk != RUG_WIGGLES) {
+                rspeak(RUG_RISES);
+            if (!TOTING(RUG) || obj == RUBY) {
                 int k = (game.prop[RUG] == RUG_HOVER) ? RUG_FLOOR : RUG_HOVER;
                 game.prop[RUG] = k;
                 if (k == RUG_HOVER)