projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changed code for more generic explosion for MM engine
[rocksndiamonds.git]
/
src
/
game_mm
/
mm_game.c
diff --git
a/src/game_mm/mm_game.c
b/src/game_mm/mm_game.c
index bd957ee37952a2a59d22c566956d730bbac12e55..cda5e6aee9db15eba2061ac419ba873fe2125ae9 100644
(file)
--- a/
src/game_mm/mm_game.c
+++ b/
src/game_mm/mm_game.c
@@
-1691,6
+1691,8
@@
static boolean HitElement(int element, int hit_mask)
element == EL_MINE ? EL_MINE_ACTIVE :
EL_GRAY_BALL_ACTIVE);
element == EL_MINE ? EL_MINE_ACTIVE :
EL_GRAY_BALL_ACTIVE);
+ GfxFrame[ELX][ELY] = 0; // restart animation
+
laser.dest_element_last = Tile[ELX][ELY];
laser.dest_element_last_x = ELX;
laser.dest_element_last_y = ELY;
laser.dest_element_last = Tile[ELX][ELY];
laser.dest_element_last_x = ELX;
laser.dest_element_last_y = ELY;
@@
-2458,7
+2460,7
@@
static boolean HitAbsorbingWalls(int element, int hit_mask)
if (IS_90_ANGLE(laser.current_angle))
mask += mask * (2 + IS_HORIZ_ANGLE(laser.current_angle) * 2);
if (IS_90_ANGLE(laser.current_angle))
mask += mask * (2 + IS_HORIZ_ANGLE(laser.current_angle) * 2);
- laser.dest_element = element2 | EL_WALL_AMOEBA;
+ laser.dest_element = element2 | EL_WALL_AMOEBA
_BASE
;
laser.wall_mask = mask;
}
laser.wall_mask = mask;
}
@@
-2605,7
+2607,7
@@
static void MeltIce(int x, int y)
{
int phase;
int wall_mask = Store2[x][y];
{
int phase;
int wall_mask = Store2[x][y];
- int real_element = Tile[x][y] - EL_WALL_CHANGING
+ EL_WALL_IC
E;
+ int real_element = Tile[x][y] - EL_WALL_CHANGING
_BASE + EL_WALL_ICE_BAS
E;
MovDelay[x][y]--;
phase = frames - MovDelay[x][y] / delay - 1;
MovDelay[x][y]--;
phase = frames - MovDelay[x][y] / delay - 1;
@@
-2617,7
+2619,7
@@
static void MeltIce(int x, int y)
DrawWalls_MM(x, y, Tile[x][y]);
DrawWalls_MM(x, y, Tile[x][y]);
- if (Tile[x][y] == EL_WALL_ICE)
+ if (Tile[x][y] == EL_WALL_ICE
_BASE
)
Tile[x][y] = EL_EMPTY;
ScanLaser_FromLastMirror();
Tile[x][y] = EL_EMPTY;
ScanLaser_FromLastMirror();
@@
-2643,7
+2645,7
@@
static void GrowAmoeba(int x, int y)
{
int phase;
int wall_mask = Store2[x][y];
{
int phase;
int wall_mask = Store2[x][y];
- int real_element = Tile[x][y] - EL_WALL_CHANGING
+ EL_WALL_AMOEBA
;
+ int real_element = Tile[x][y] - EL_WALL_CHANGING
_BASE + EL_WALL_AMOEBA_BASE
;
MovDelay[x][y]--;
phase = MovDelay[x][y] / delay;
MovDelay[x][y]--;
phase = MovDelay[x][y] / delay;
@@
-2708,12
+2710,13
@@
static void Explode_MM(int x, int y, int phase, int mode)
int num_phase = 9, delay = 2;
int last_phase = num_phase * delay;
int half_phase = (num_phase / 2) * delay;
int num_phase = 9, delay = 2;
int last_phase = num_phase * delay;
int half_phase = (num_phase / 2) * delay;
+ int center_element;
laser.redraw = TRUE;
if (phase == EX_PHASE_START) // initialize 'Store[][]' field
{
laser.redraw = TRUE;
if (phase == EX_PHASE_START) // initialize 'Store[][]' field
{
-
int
center_element = Tile[x][y];
+ center_element = Tile[x][y];
if (IS_MOVING(x, y) || IS_BLOCKED(x, y))
{
if (IS_MOVING(x, y) || IS_BLOCKED(x, y))
{
@@
-2724,8
+2727,8
@@
static void Explode_MM(int x, int y, int phase, int mode)
Tile[x][y] = center_element;
}
Tile[x][y] = center_element;
}
- Store[x][y] =
center_element
;
- Store2[x][y] =
mode
;
+ Store[x][y] =
EL_EMPTY
;
+ Store2[x][y] =
center_element
;
Tile[x][y] = EL_EXPLODING_OPAQUE;
Tile[x][y] = EL_EXPLODING_OPAQUE;
@@
-2745,7
+2748,9
@@
static void Explode_MM(int x, int y, int phase, int mode)
ExplodePhase[x][y] = (phase < last_phase ? phase + 1 : 0);
ExplodePhase[x][y] = (phase < last_phase ? phase + 1 : 0);
- if (phase == half_phase)
+ center_element = Store2[x][y];
+
+ if (phase == half_phase && Store[x][y] == EL_EMPTY)
{
Tile[x][y] = EL_EXPLODING_TRANSP;
{
Tile[x][y] = EL_EXPLODING_TRANSP;
@@
-2755,7
+2760,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_ACTIVE)
+ if (
center_element
== EL_BOMB_ACTIVE)
{
DrawLaser(0, DL_LASER_DISABLED);
InitLaser();
{
DrawLaser(0, DL_LASER_DISABLED);
InitLaser();
@@
-2766,12
+2771,12
@@
static void Explode_MM(int x, int y, int phase, int mode)
laser.overloaded = FALSE;
}
laser.overloaded = FALSE;
}
- else if (IS_MCDUFFIN(
Store[x][y]
))
+ else if (IS_MCDUFFIN(
center_element
))
{
GameOver_MM(GAME_OVER_BOMB);
}
{
GameOver_MM(GAME_OVER_BOMB);
}
- Tile[x][y] =
EL_EMPTY
;
+ Tile[x][y] =
Store[x][y]
;
Store[x][y] = Store2[x][y] = 0;
MovDir[x][y] = MovPos[x][y] = MovDelay[x][y] = 0;
Store[x][y] = Store2[x][y] = 0;
MovDir[x][y] = MovPos[x][y] = MovDelay[x][y] = 0;
@@
-3296,9
+3301,9
@@
static void GameActions_MM_Ext(void)
OpenGrayBall(x, y);
else if (IS_ENVELOPE_OPENING(element))
OpenEnvelope(x, y);
OpenGrayBall(x, y);
else if (IS_ENVELOPE_OPENING(element))
OpenEnvelope(x, y);
- else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_ICE)
+ else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_ICE
_BASE
)
MeltIce(x, y);
MeltIce(x, y);
- else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_AMOEBA)
+ else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_AMOEBA
_BASE
)
GrowAmoeba(x, y);
else if (IS_MIRROR(element) ||
IS_MIRROR_FIXED(element) ||
GrowAmoeba(x, y);
else if (IS_MIRROR(element) ||
IS_MIRROR_FIXED(element) ||
@@
-3474,12
+3479,12
@@
static void GameActions_MM_Ext(void)
game_mm.ball_choice_pos++;
int new_element = native_mm_level.ball_content[element_pos];
game_mm.ball_choice_pos++;
int new_element = native_mm_level.ball_content[element_pos];
- int new_element_
unmapped = unmap
_element(new_element);
+ int new_element_
base = map_wall_to_base
_element(new_element);
- if (IS_WALL(new_element_
unmapped
))
+ if (IS_WALL(new_element_
base
))
{
// always use completely filled wall element
{
// always use completely filled wall element
- new_element = new_element_
unmapped
| 0x000f;
+ new_element = new_element_
base
| 0x000f;
}
else if (native_mm_level.rotate_ball_content &&
get_num_elements(new_element) > 1)
}
else if (native_mm_level.rotate_ball_content &&
get_num_elements(new_element) > 1)
@@
-3503,8
+3508,8
@@
static void GameActions_MM_Ext(void)
{
PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_SHRINKING);
{
PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_SHRINKING);
- Tile[ELX][ELY] = Tile[ELX][ELY] - EL_WALL_ICE
+ EL_WALL_CHANGING
;
- Store[ELX][ELY] = EL_WALL_ICE;
+ Tile[ELX][ELY] = Tile[ELX][ELY] - EL_WALL_ICE
_BASE + EL_WALL_CHANGING_BASE
;
+ Store[ELX][ELY] = EL_WALL_ICE
_BASE
;
Store2[ELX][ELY] = laser.wall_mask;
laser.dest_element = Tile[ELX][ELY];
Store2[ELX][ELY] = laser.wall_mask;
laser.dest_element = Tile[ELX][ELY];
@@
-3593,8
+3598,8
@@
static void GameActions_MM_Ext(void)
PlayLevelSound_MM(x, y, element, MM_ACTION_GROWING);
PlayLevelSound_MM(x, y, element, MM_ACTION_GROWING);
- Tile[x][y] = Tile[x][y] - EL_WALL_AMOEBA
+ EL_WALL_CHANGING
;
- Store[x][y] = EL_WALL_AMOEBA;
+ Tile[x][y] = Tile[x][y] - EL_WALL_AMOEBA
_BASE + EL_WALL_CHANGING_BASE
;
+ Store[x][y] = EL_WALL_AMOEBA
_BASE
;
Store2[x][y] = wall_mask;
return;
Store2[x][y] = wall_mask;
return;