added active animation for gray ball in MM engine
authorHolger Schemel <info@artsoft.org>
Thu, 23 Feb 2023 11:52:30 +0000 (12:52 +0100)
committerHolger Schemel <info@artsoft.org>
Thu, 23 Feb 2023 15:02:35 +0000 (16:02 +0100)
src/conf_gfx.c
src/game_mm/mm_game.c
src/game_mm/mm_main.h
src/game_mm/mm_tools.c
src/main.c
src/main.h

index 75bce21f6aa2db8d51ea35d6eca6107d40b7ac85..3f64eeca6aa418ab88fe76bde8c16d96d6231463 100644 (file)
@@ -5144,6 +5144,12 @@ struct ConfigInfo image_config[] =
   { "mm_gray_ball.xpos",                       "15"                    },
   { "mm_gray_ball.ypos",                       "2"                     },
   { "mm_gray_ball.frames",                     "1"                     },
+  { "mm_gray_ball.active",                     "RocksMM.png"           },
+  { "mm_gray_ball.active.xpos",                        "15"                    },
+  { "mm_gray_ball.active.ypos",                        "1"                     },
+  { "mm_gray_ball.active.frames",              "2"                     },
+  { "mm_gray_ball.active.delay",               "20"                    },
+  { "mm_gray_ball.active.vertical",            "true"                  },
   { "mm_gray_ball.EDITOR",                     "RocksMM.png"           },
   { "mm_gray_ball.EDITOR.xpos",                        "15"                    },
   { "mm_gray_ball.EDITOR.ypos",                        "1"                     },
index 49aa2d29dc391cb966b1d410b1567a263ee116ab..2713e32092363f71e80cc2db49f09fb78f627433 100644 (file)
@@ -951,6 +951,7 @@ static void DeactivateLaserTargetElement(void)
 {
   if (laser.dest_element_last == EL_BOMB_ACTIVE ||
       laser.dest_element_last == EL_MINE_ACTIVE ||
+      laser.dest_element_last == EL_GRAY_BALL_ACTIVE ||
       laser.dest_element_last == EL_GRAY_BALL_OPENING)
   {
     int x = laser.dest_element_last_x;
@@ -1668,11 +1669,13 @@ boolean HitElement(int element, int hit_mask)
     return TRUE;
   }
 
-  if (element == EL_BOMB || element == EL_MINE)
+  if (element == EL_BOMB || element == EL_MINE || element == EL_BALL_GRAY)
   {
     PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
 
-    Tile[ELX][ELY] = (element == EL_BOMB ? EL_BOMB_ACTIVE : EL_MINE_ACTIVE);
+    Tile[ELX][ELY] = (element == EL_BOMB ? EL_BOMB_ACTIVE :
+                     element == EL_MINE ? EL_MINE_ACTIVE :
+                     EL_GRAY_BALL_ACTIVE);
 
     laser.dest_element_last = Tile[ELX][ELY];
     laser.dest_element_last_x = ELX;
@@ -3335,7 +3338,7 @@ static void GameActions_MM_Ext(void)
             IS_MIRROR_FIXED(element) ||
             element == EL_PRISM)
       DrawFieldTwinkle(x, y);
-    else if (element == EL_GRAY_BALL_OPENING ||
+    else if (element == EL_GRAY_BALL_ACTIVE ||
             element == EL_BOMB_ACTIVE ||
             element == EL_MINE_ACTIVE)
       DrawFieldAnimated_MM(x, y);
@@ -3404,6 +3407,7 @@ static void GameActions_MM_Ext(void)
       element != EL_MINE &&
       element != EL_MINE_ACTIVE &&
       element != EL_BALL_GRAY &&
+      element != EL_GRAY_BALL_ACTIVE &&
       element != EL_BLOCK_STONE &&
       element != EL_BLOCK_WOOD &&
       element != EL_FUSE_ON &&
@@ -3548,12 +3552,7 @@ static void GameActions_MM_Ext(void)
 
     Tile[ELX][ELY] = EL_GRAY_BALL_OPENING;
 
-    // !!! CHECK AGAIN: Laser on Polarizer !!!
-    ScanLaser();
-
     laser.dest_element_last = Tile[ELX][ELY];
-    laser.dest_element_last_x = ELX;
-    laser.dest_element_last_y = ELY;
 
     return;
 
index f8b775fc872074beb300d3b4689033166409da34..7efed84d1e1a78287ca65f78b0d6abce12963064 100644 (file)
@@ -663,15 +663,16 @@ extern int                num_element_info;
 // "real" (and therefore drawable) runtime elements
 #define EL_EXIT_OPENING                500
 #define EL_EXIT_CLOSING                501
-#define EL_GRAY_BALL_OPENING   502
-#define EL_ICE_WALL_SHRINKING  503
-#define EL_AMOEBA_WALL_GROWING 504
-#define EL_BOMB_ACTIVE         505
-#define EL_MINE_ACTIVE         506
-#define EL_ENVELOPE_1_OPENING  507
-#define EL_ENVELOPE_2_OPENING  508
-#define EL_ENVELOPE_3_OPENING  509
-#define EL_ENVELOPE_4_OPENING  510
+#define EL_GRAY_BALL_ACTIVE    502
+#define EL_GRAY_BALL_OPENING   503
+#define EL_ICE_WALL_SHRINKING  504
+#define EL_AMOEBA_WALL_GROWING 505
+#define EL_BOMB_ACTIVE         506
+#define EL_MINE_ACTIVE         507
+#define EL_ENVELOPE_1_OPENING  508
+#define EL_ENVELOPE_2_OPENING  509
+#define EL_ENVELOPE_3_OPENING  510
+#define EL_ENVELOPE_4_OPENING  511
 
 #define EL_ENVELOPE_OPENING_START      EL_ENVELOPE_1_OPENING
 #define EL_ENVELOPE_OPENING_END                EL_ENVELOPE_4_OPENING
index 4e9254a7c7a29383abed7a33a993c21d0590208f..f097e2c121ed839b44369423b29cae2b934bc69f 100644 (file)
@@ -524,6 +524,8 @@ void DrawElement_MM(int x, int y, int element)
           laser.fuse_x == x &&
           laser.fuse_y == y)
     DrawGraphic_MM(x, y, IMG_MM_FUSE);
+  else if (element == EL_GRAY_BALL_ACTIVE)
+    DrawGraphic_MM(x, y, el_act2gfx(EL_BALL_GRAY, MM_ACTION_ACTIVE));
   else if (element == EL_GRAY_BALL_OPENING)
     DrawGraphic_MM(x, y, el_act2gfx(EL_BALL_GRAY, MM_ACTION_OPENING));
   else if (element == EL_BOMB_ACTIVE)
index 9e5828d39aa0daac8590ab16c15e029623e9236c..2364905b9f6b50aa7b17cc67338c6d8b6f9f7fc8 100644 (file)
@@ -6736,6 +6736,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
     "mm_exit",
     "-"
   },
+  {
+    "mm_gray_ball.active",
+    "mm_gray_ball",
+    "-",
+  },
   {
     "mm_gray_ball.opening",
     "mm_gray_ball",
index 2de42bed7865f03342f65c2b2d0bdabbf85ef128..26e0570ad0bdc3c62abc727ae35dd98b39372f12 100644 (file)
 #define EL_EMC_SPRING_BUMPER_ACTIVE    (EL_FIRST_RUNTIME_REAL + 71)
 #define EL_MM_EXIT_OPENING             (EL_FIRST_RUNTIME_REAL + 72)
 #define EL_MM_EXIT_CLOSING             (EL_FIRST_RUNTIME_REAL + 73)
-#define EL_MM_GRAY_BALL_OPENING                (EL_FIRST_RUNTIME_REAL + 74)
-#define EL_MM_ICE_WALL_SHRINKING       (EL_FIRST_RUNTIME_REAL + 75)
-#define EL_MM_AMOEBA_WALL_GROWING      (EL_FIRST_RUNTIME_REAL + 76)
-#define EL_MM_PACMAN_EATING_RIGHT      (EL_FIRST_RUNTIME_REAL + 77)
-#define EL_MM_PACMAN_EATING_UP         (EL_FIRST_RUNTIME_REAL + 78)
-#define EL_MM_PACMAN_EATING_LEFT       (EL_FIRST_RUNTIME_REAL + 79)
-#define EL_MM_PACMAN_EATING_DOWN       (EL_FIRST_RUNTIME_REAL + 80)
-#define EL_MM_BOMB_ACTIVE              (EL_FIRST_RUNTIME_REAL + 81)
-#define EL_DF_MINE_ACTIVE              (EL_FIRST_RUNTIME_REAL + 82)
-
-#define NUM_DRAWABLE_ELEMENTS          (EL_FIRST_RUNTIME_REAL + 83)
+#define EL_MM_GRAY_BALL_ACTIVE         (EL_FIRST_RUNTIME_REAL + 74)
+#define EL_MM_GRAY_BALL_OPENING                (EL_FIRST_RUNTIME_REAL + 75)
+#define EL_MM_ICE_WALL_SHRINKING       (EL_FIRST_RUNTIME_REAL + 76)
+#define EL_MM_AMOEBA_WALL_GROWING      (EL_FIRST_RUNTIME_REAL + 77)
+#define EL_MM_PACMAN_EATING_RIGHT      (EL_FIRST_RUNTIME_REAL + 78)
+#define EL_MM_PACMAN_EATING_UP         (EL_FIRST_RUNTIME_REAL + 79)
+#define EL_MM_PACMAN_EATING_LEFT       (EL_FIRST_RUNTIME_REAL + 80)
+#define EL_MM_PACMAN_EATING_DOWN       (EL_FIRST_RUNTIME_REAL + 81)
+#define EL_MM_BOMB_ACTIVE              (EL_FIRST_RUNTIME_REAL + 82)
+#define EL_DF_MINE_ACTIVE              (EL_FIRST_RUNTIME_REAL + 83)
+
+#define NUM_DRAWABLE_ELEMENTS          (EL_FIRST_RUNTIME_REAL + 84)
 
 #define EL_MM_RUNTIME_START            EL_MM_EXIT_OPENING
 #define EL_MM_RUNTIME_END              EL_MM_AMOEBA_WALL_GROWING