added game over messages for Deflektor style levels in MM game engine
authorHolger Schemel <info@artsoft.org>
Sun, 12 Mar 2023 20:18:03 +0000 (21:18 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 12 Mar 2023 20:19:14 +0000 (21:19 +0100)
src/game_mm/mm_game.c
src/game_mm/mm_main.h

index d57c5a3b0911f66ff6f1f05ee6bfcf734b23fd52..5cdc8ed3114712b6e97fd8f11d1ce9c22a8f8b21 100644 (file)
@@ -808,13 +808,21 @@ static void GameOver_MM(int game_over_cause)
 {
   game_mm.game_over = TRUE;
   game_mm.game_over_cause = game_over_cause;
-  game_mm.game_over_message = (game_over_cause == GAME_OVER_BOMB ?
-                              "Bomb killed Mc Duffin!" :
-                              game_over_cause == GAME_OVER_NO_ENERGY ?
-                              "Out of magic energy!" :
-                              game_over_cause == GAME_OVER_OVERLOADED ?
-                              "Magic spell hit Mc Duffin!" :
-                              NULL);
+  game_mm.game_over_message = (game_mm.has_mcduffin ?
+                              (game_over_cause == GAME_OVER_BOMB ?
+                               "Bomb killed Mc Duffin!" :
+                               game_over_cause == GAME_OVER_NO_ENERGY ?
+                               "Out of magic energy!" :
+                               game_over_cause == GAME_OVER_OVERLOADED ?
+                               "Magic spell hit Mc Duffin!" :
+                               NULL) :
+                              (game_over_cause == GAME_OVER_BOMB ?
+                               "Bomb destroyed laser cannon!" :
+                               game_over_cause == GAME_OVER_NO_ENERGY ?
+                               "Out of laser energy!" :
+                               game_over_cause == GAME_OVER_OVERLOADED ?
+                               "Laser beam hit laser cannon!" :
+                               NULL));
 
   SetTileCursorActive(FALSE);
 }
@@ -2824,11 +2832,9 @@ static void Explode_MM(int x, int y, int phase, int mode)
 
       Bang_MM(laser.start_edge.x, laser.start_edge.y);
 
-      GameOver_MM(GAME_OVER_DELAYED);
-
       laser.overloaded = FALSE;
     }
-    else if (IS_MCDUFFIN(center_element))
+    else if (IS_MCDUFFIN(center_element) || IS_LASER(center_element))
     {
       GameOver_MM(GAME_OVER_BOMB);
     }
index 7350890b92ed4b4fbd8397b1bf02c786bf9c69b8..1404fb03401b6ee1411ae48903655c0dc566b06e 100644 (file)
@@ -735,7 +735,6 @@ extern int          num_element_info;
 #define GAME_OVER_NO_ENERGY    1
 #define GAME_OVER_OVERLOADED   2
 #define GAME_OVER_BOMB         3
-#define GAME_OVER_DELAYED      4
 
 #define PROGRAM_VERSION_MAJOR  2
 #define PROGRAM_VERSION_MINOR  0