From: Holger Schemel Date: Thu, 23 Feb 2023 11:52:30 +0000 (+0100) Subject: added active animation for gray ball in MM engine X-Git-Tag: 4.3.5.2~42 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=f2ba8f4f956e63e7b22d06d55c05034e5c70c0da;p=rocksndiamonds.git added active animation for gray ball in MM engine --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 75bce21f..3f64eeca 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -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" }, diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 49aa2d29..2713e320 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -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; diff --git a/src/game_mm/mm_main.h b/src/game_mm/mm_main.h index f8b775fc..7efed84d 100644 --- a/src/game_mm/mm_main.h +++ b/src/game_mm/mm_main.h @@ -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 diff --git a/src/game_mm/mm_tools.c b/src/game_mm/mm_tools.c index 4e9254a7..f097e2c1 100644 --- a/src/game_mm/mm_tools.c +++ b/src/game_mm/mm_tools.c @@ -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) diff --git a/src/main.c b/src/main.c index 9e5828d3..2364905b 100644 --- a/src/main.c +++ b/src/main.c @@ -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", diff --git a/src/main.h b/src/main.h index 2de42bed..26e0570a 100644 --- a/src/main.h +++ b/src/main.h @@ -2027,17 +2027,18 @@ #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