projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
80145c6
)
added active animation for bomb and mine in MM engine
author
Holger Schemel
<info@artsoft.org>
Sat, 7 Jan 2023 17:04:41 +0000
(18:04 +0100)
committer
Holger Schemel
<info@artsoft.org>
Sun, 8 Jan 2023 01:14:43 +0000
(
02:14
+0100)
graphics/gfx_classic/RocksMM.png
patch
|
blob
|
history
src/conf_gfx.c
patch
|
blob
|
history
src/game_mm/export.h
patch
|
blob
|
history
src/game_mm/mm_game.c
patch
|
blob
|
history
src/game_mm/mm_main.h
patch
|
blob
|
history
src/game_mm/mm_tools.c
patch
|
blob
|
history
src/main.c
patch
|
blob
|
history
src/main.h
patch
|
blob
|
history
diff --git
a/graphics/gfx_classic/RocksMM.png
b/graphics/gfx_classic/RocksMM.png
index 3fd82443622c49061986b9796404f20d7a2e4213..47d0add242e2dec7dcfd045f30f5c09615ec4732 100644
(file)
Binary files a/graphics/gfx_classic/RocksMM.png and b/graphics/gfx_classic/RocksMM.png differ
diff --git
a/src/conf_gfx.c
b/src/conf_gfx.c
index 28a22318586abec39305fef963acbdca7e79d346..b4789635243a7cb622ecc6ae8344291c72165c76 100644
(file)
--- a/
src/conf_gfx.c
+++ b/
src/conf_gfx.c
@@
-5051,6
+5051,12
@@
struct ConfigInfo image_config[] =
{ "mm_bomb.xpos", "5" },
{ "mm_bomb.ypos", "2" },
{ "mm_bomb.frames", "1" },
{ "mm_bomb.xpos", "5" },
{ "mm_bomb.ypos", "2" },
{ "mm_bomb.frames", "1" },
+ { "mm_bomb.active", "RocksMM.png" },
+ { "mm_bomb.active.xpos", "12" },
+ { "mm_bomb.active.ypos", "1" },
+ { "mm_bomb.active.frames", "3" },
+ { "mm_bomb.active.delay", "6" },
+ { "mm_bomb.active.anim_mode", "pingpong" },
{ "mm_prism", "RocksMM.png" },
{ "mm_prism.xpos", "0" },
{ "mm_prism", "RocksMM.png" },
{ "mm_prism.xpos", "0" },
@@
-5747,6
+5753,12
@@
struct ConfigInfo image_config[] =
{ "df_mine.xpos", "4" },
{ "df_mine.ypos", "8" },
{ "df_mine.frames", "1" },
{ "df_mine.xpos", "4" },
{ "df_mine.ypos", "8" },
{ "df_mine.frames", "1" },
+ { "df_mine.active", "RocksDF.png" },
+ { "df_mine.active.xpos", "3" },
+ { "df_mine.active.ypos", "8" },
+ { "df_mine.active.frames", "3" },
+ { "df_mine.active.delay", "6" },
+ { "df_mine.active.anim_mode", "pingpong" },
// (these are only defined as elements to support ".PANEL" definitions)
{ "graphic_1", UNDEFINED_FILENAME },
// (these are only defined as elements to support ".PANEL" definitions)
{ "graphic_1", UNDEFINED_FILENAME },
diff --git
a/src/game_mm/export.h
b/src/game_mm/export.h
index f600993f4dfc0d4b9e4d607316ec988e2935b8cf..f69946245731da069b9024720821c2a837b4c9e2 100644
(file)
--- a/
src/game_mm/export.h
+++ b/
src/game_mm/export.h
@@
-112,6
+112,9
@@
struct LaserInfo
int fuse_x, fuse_y;
int dest_element;
int fuse_x, fuse_y;
int dest_element;
+ int dest_element_last;
+ int dest_element_last_x;
+ int dest_element_last_y;
boolean stops_inside_element;
boolean redraw;
boolean stops_inside_element;
boolean redraw;
diff --git
a/src/game_mm/mm_game.c
b/src/game_mm/mm_game.c
index 85a9d4092995b18fcbdd5550ab4b60d1911a7895..e817b1187613c8cb76445be6ba5b48137bd8267f 100644
(file)
--- a/
src/game_mm/mm_game.c
+++ b/
src/game_mm/mm_game.c
@@
-647,6
+647,9
@@
void InitGameEngine_MM(void)
laser.fuse_x = laser.fuse_y = -1;
laser.dest_element = EL_EMPTY;
laser.fuse_x = laser.fuse_y = -1;
laser.dest_element = EL_EMPTY;
+ laser.dest_element_last = EL_EMPTY;
+ laser.dest_element_last_x = -1;
+ laser.dest_element_last_y = -1;
laser.wall_mask = 0;
last_LX = 0;
laser.wall_mask = 0;
last_LX = 0;
@@
-921,6
+924,21
@@
void ScanLaser(void)
if (game_mm.game_over)
return;
if (game_mm.game_over)
return;
+ if (laser.dest_element_last == EL_BOMB_ACTIVE ||
+ laser.dest_element_last == EL_MINE_ACTIVE)
+ {
+ int x = laser.dest_element_last_x;
+ int y = laser.dest_element_last_y;
+ int element = laser.dest_element_last;
+
+ if (Tile[x][y] == element)
+ Tile[x][y] = (element == EL_BOMB_ACTIVE ? EL_BOMB : EL_MINE);
+
+ laser.dest_element_last = EL_EMPTY;
+ laser.dest_element_last_x = -1;
+ laser.dest_element_last_y = -1;
+ }
+
laser.overloaded = FALSE;
laser.stops_inside_element = FALSE;
laser.overloaded = FALSE;
laser.stops_inside_element = FALSE;
@@
-1559,6
+1577,12
@@
boolean HitElement(int element, int hit_mask)
{
PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
{
PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
+ Tile[ELX][ELY] = (element == EL_BOMB ? EL_BOMB_ACTIVE : EL_MINE_ACTIVE);
+
+ laser.dest_element_last = Tile[ELX][ELY];
+ laser.dest_element_last_x = ELX;
+ laser.dest_element_last_y = ELY;
+
if (element == EL_MINE)
laser.overloaded = TRUE;
}
if (element == EL_MINE)
laser.overloaded = TRUE;
}
@@
-2518,7
+2542,7
@@
static void Explode_MM(int x, int y, int phase, int mode)
Tile[x][y] = center_element;
}
Tile[x][y] = center_element;
}
- if (center_element == EL_BOMB || IS_MCDUFFIN(center_element))
+ if (center_element == EL_BOMB
_ACTIVE
|| IS_MCDUFFIN(center_element))
Store[x][y] = center_element;
else
Store[x][y] = EL_EMPTY;
Store[x][y] = center_element;
else
Store[x][y] = EL_EMPTY;
@@
-2550,7
+2574,7
@@
static void Explode_MM(int x, int y, int phase, int mode)
if (phase == last_phase)
{
if (phase == last_phase)
{
- if (Store[x][y] == EL_BOMB)
+ if (Store[x][y] == EL_BOMB
_ACTIVE
)
{
DrawLaser(0, DL_LASER_DISABLED);
InitLaser();
{
DrawLaser(0, DL_LASER_DISABLED);
InitLaser();
@@
-2597,7
+2621,7
@@
static void Bang_MM(int x, int y)
if (IS_PACMAN(element))
PlayLevelSound_MM(x, y, element, MM_ACTION_EXPLODING);
if (IS_PACMAN(element))
PlayLevelSound_MM(x, y, element, MM_ACTION_EXPLODING);
- else if (element == EL_BOMB || IS_MCDUFFIN(element))
+ else if (element == EL_BOMB
_ACTIVE
|| IS_MCDUFFIN(element))
PlayLevelSound_MM(x, y, element, MM_ACTION_EXPLODING);
else if (element == EL_KEY)
PlayLevelSound_MM(x, y, element, MM_ACTION_EXPLODING);
PlayLevelSound_MM(x, y, element, MM_ACTION_EXPLODING);
else if (element == EL_KEY)
PlayLevelSound_MM(x, y, element, MM_ACTION_EXPLODING);
@@
-3199,7
+3223,9
@@
static void GameActions_MM_Ext(void)
if (!laser.overloaded && laser.overload_value == 0 &&
element != EL_BOMB &&
if (!laser.overloaded && laser.overload_value == 0 &&
element != EL_BOMB &&
+ element != EL_BOMB_ACTIVE &&
element != EL_MINE &&
element != EL_MINE &&
+ element != EL_MINE_ACTIVE &&
element != EL_BALL_GRAY &&
element != EL_BLOCK_STONE &&
element != EL_BLOCK_WOOD &&
element != EL_BALL_GRAY &&
element != EL_BLOCK_STONE &&
element != EL_BLOCK_WOOD &&
diff --git
a/src/game_mm/mm_main.h
b/src/game_mm/mm_main.h
index 5d0718f5f4ae188e37ed43d1db9313b776a9efdb..0fb74d9e215efac28658873ccd73d46ee89f8ec6 100644
(file)
--- a/
src/game_mm/mm_main.h
+++ b/
src/game_mm/mm_main.h
@@
-653,6
+653,8
@@
extern int num_element_info;
#define EL_GRAY_BALL_OPENING 502
#define EL_ICE_WALL_SHRINKING 503
#define EL_AMOEBA_WALL_GROWING 504
#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_WALL_CHANGING 512
#define EL_WALL_CHANGING_START (EL_WALL_CHANGING + 0)
#define EL_WALL_CHANGING 512
#define EL_WALL_CHANGING_START (EL_WALL_CHANGING + 0)
diff --git
a/src/game_mm/mm_tools.c
b/src/game_mm/mm_tools.c
index a8edba4e2e152d6b0b397d70f9f4bc8c2c4169c0..d8dbe8becaa5270253801ca4a406f0255f8d1aa3 100644
(file)
--- a/
src/game_mm/mm_tools.c
+++ b/
src/game_mm/mm_tools.c
@@
-526,6
+526,10
@@
void DrawElement_MM(int x, int y, int element)
DrawGraphic_MM(x, y, IMG_MM_FUSE);
else if (element == EL_GRAY_BALL_OPENING)
DrawGraphic_MM(x, y, el_act2gfx(EL_BALL_GRAY, MM_ACTION_OPENING));
DrawGraphic_MM(x, y, IMG_MM_FUSE);
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)
+ DrawGraphic_MM(x, y, el_act2gfx(EL_BOMB, MM_ACTION_ACTIVE));
+ else if (element == EL_MINE_ACTIVE)
+ DrawGraphic_MM(x, y, el_act2gfx(EL_MINE, MM_ACTION_ACTIVE));
else
DrawGraphic_MM(x, y, el2gfx(element));
}
else
DrawGraphic_MM(x, y, el2gfx(element));
}
diff --git
a/src/main.c
b/src/main.c
index c7291eae8cefd41f054de02d4aa6147dd9028123..13cab898ed95bf930dccaa0c2d8e8b1949b29bfa 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-6772,6
+6772,16
@@
struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
"mm_pacman",
"pac man (eating down)"
},
"mm_pacman",
"pac man (eating down)"
},
+ {
+ "mm_bomb.active",
+ "mm_bomb",
+ "active bomb (MM style)"
+ },
+ {
+ "df_mine.active",
+ "df_mine",
+ "active mine"
+ },
// --------------------------------------------------------------------------
// "unreal" (and therefore not drawable) runtime elements
// --------------------------------------------------------------------------
// "unreal" (and therefore not drawable) runtime elements
diff --git
a/src/main.h
b/src/main.h
index de5e736dfa727a58eb29059aebf5b2c3ae7c7603..5800f5ef5dbdca6e94fffe4c32862d6ec4ca1117 100644
(file)
--- a/
src/main.h
+++ b/
src/main.h
@@
-2023,8
+2023,10
@@
#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_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 + 8
1
)
+#define NUM_DRAWABLE_ELEMENTS (EL_FIRST_RUNTIME_REAL + 8
3
)
#define EL_MM_RUNTIME_START EL_MM_EXIT_OPENING
#define EL_MM_RUNTIME_END EL_MM_AMOEBA_WALL_GROWING
#define EL_MM_RUNTIME_START EL_MM_EXIT_OPENING
#define EL_MM_RUNTIME_END EL_MM_AMOEBA_WALL_GROWING