projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20030807-1-src
[rocksndiamonds.git]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index 150182acf867b13d662dc4dd023d61ec5600ec87..f5b3ab7b883d783c088bd11a20379611c4fc3a75 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-1032,6
+1032,7
@@
void InitGame()
game.switchgate_pos = 0;
game.balloon_dir = MV_NO_MOVING;
game.explosions_delayed = TRUE;
game.switchgate_pos = 0;
game.balloon_dir = MV_NO_MOVING;
game.explosions_delayed = TRUE;
+ game.current_gravity = level.initial_gravity;
for (i=0; i<4; i++)
{
for (i=0; i<4; i++)
{
@@
-1893,7
+1894,7
@@
void Explode(int ex, int ey, int phase, int mode)
PlaySoundLevelAction(ex, ey, ACTION_EXPLODING);
/* remove things displayed in background while burning dynamite */
PlaySoundLevelAction(ex, ey, ACTION_EXPLODING);
/* remove things displayed in background while burning dynamite */
- if (!IS_INDESTRUCTIBLE(Back[ex][ey]))
+ if (
Back[ex][ey] != EL_EMPTY &&
!IS_INDESTRUCTIBLE(Back[ex][ey]))
Back[ex][ey] = 0;
if (IS_MOVING(ex, ey) || IS_BLOCKED(ex, ey))
Back[ex][ey] = 0;
if (IS_MOVING(ex, ey) || IS_BLOCKED(ex, ey))
@@
-1906,6
+1907,8
@@
void Explode(int ex, int ey, int phase, int mode)
for (y = ey - 1; y <= ey + 1; y++) for(x = ex - 1; x <= ex + 1; x++)
{
for (y = ey - 1; y <= ey + 1; y++) for(x = ex - 1; x <= ex + 1; x++)
{
+ int xx = x - ex + 1;
+ int yy = y - ey + 1;
int element;
if (!IN_LEV_FIELD(x, y) ||
int element;
if (!IN_LEV_FIELD(x, y) ||
@@
-1918,12
+1921,23
@@
void Explode(int ex, int ey, int phase, int mode)
if (IS_MOVING(x, y) || IS_BLOCKED(x, y))
{
element = MovingOrBlocked2Element(x, y);
if (IS_MOVING(x, y) || IS_BLOCKED(x, y))
{
element = MovingOrBlocked2Element(x, y);
- RemoveMovingField(x, y);
+
+ if (!IS_EXPLOSION_PROOF(element))
+ RemoveMovingField(x, y);
}
#if 1
}
#if 1
+
+#if 0
if (IS_EXPLOSION_PROOF(element))
continue;
if (IS_EXPLOSION_PROOF(element))
continue;
+#else
+ /* indestructible elements can only explode in center (but not flames) */
+ if ((IS_EXPLOSION_PROOF(element) && (x != ex || y != ey)) ||
+ element == EL_FLAMES)
+ continue;
+#endif
+
#else
if ((IS_INDESTRUCTIBLE(element) &&
(game.engine_version < VERSION_IDENT(2,2,0) ||
#else
if ((IS_INDESTRUCTIBLE(element) &&
(game.engine_version < VERSION_IDENT(2,2,0) ||
@@
-1945,8
+1959,13
@@
void Explode(int ex, int ey, int phase, int mode)
}
/* save walkable background elements while explosion on same tile */
}
/* save walkable background elements while explosion on same tile */
+#if 0
if (IS_INDESTRUCTIBLE(element))
Back[x][y] = element;
if (IS_INDESTRUCTIBLE(element))
Back[x][y] = element;
+#else
+ if (IS_WALKABLE(element) && IS_INDESTRUCTIBLE(element))
+ Back[x][y] = element;
+#endif
/* ignite explodable elements reached by other explosion */
if (element == EL_EXPLOSION)
/* ignite explodable elements reached by other explosion */
if (element == EL_EXPLOSION)
@@
-2000,11
+2019,10
@@
void Explode(int ex, int ey, int phase, int mode)
else if (center_element == EL_AMOEBA_TO_DIAMOND)
Store[x][y] = level.amoeba_content;
else if (center_element == EL_YAMYAM)
else if (center_element == EL_AMOEBA_TO_DIAMOND)
Store[x][y] = level.amoeba_content;
else if (center_element == EL_YAMYAM)
- Store[x][y] =
- level.yamyam_content[game.yamyam_content_nr][x - ex + 1][y - ey + 1];
- else if (IS_CUSTOM_ELEMENT(center_element))
- Store[x][y] =
- element_info[center_element].content[x - ex + 1][y - ey + 1];
+ Store[x][y] = level.yamyam_content[game.yamyam_content_nr][xx][yy];
+ else if (IS_CUSTOM_ELEMENT(center_element) &&
+ element_info[center_element].content[xx][yy] != EL_EMPTY)
+ Store[x][y] = element_info[center_element].content[xx][yy];
else if (element == EL_WALL_EMERALD)
Store[x][y] = EL_EMERALD;
else if (element == EL_WALL_DIAMOND)
else if (element == EL_WALL_EMERALD)
Store[x][y] = EL_EMERALD;
else if (element == EL_WALL_DIAMOND)
@@
-2021,6
+2039,8
@@
void Explode(int ex, int ey, int phase, int mode)
Store[x][y] = EL_PEARL;
else if (element == EL_WALL_CRYSTAL)
Store[x][y] = EL_CRYSTAL;
Store[x][y] = EL_PEARL;
else if (element == EL_WALL_CRYSTAL)
Store[x][y] = EL_CRYSTAL;
+ else if (IS_CUSTOM_ELEMENT(element))
+ Store[x][y] = element_info[element].content[1][1];
else
Store[x][y] = EL_EMPTY;
else
Store[x][y] = EL_EMPTY;
@@
-2117,6
+2137,9
@@
void Explode(int ex, int ey, int phase, int mode)
InitMovDir(x, y);
DrawLevelField(x, y);
InitMovDir(x, y);
DrawLevelField(x, y);
+ if (CAN_BE_CRUMBLED(element))
+ DrawLevelFieldCrumbledSandNeighbours(x, y);
+
if (IS_PLAYER(x, y) && !PLAYERINFO(x,y)->present)
StorePlayer[x][y] = 0;
}
if (IS_PLAYER(x, y) && !PLAYERINFO(x,y)->present)
StorePlayer[x][y] = 0;
}
@@
-2193,6
+2216,7
@@
void DynaExplode(int ex, int ey)
Explode(x, y, EX_PHASE_START, EX_BORDER);
Explode(x, y, EX_PHASE_START, EX_BORDER);
+ /* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */
if (element != EL_EMPTY &&
element != EL_SAND &&
element != EL_EXPLOSION &&
if (element != EL_EMPTY &&
element != EL_SAND &&
element != EL_EXPLOSION &&
@@
-2503,14
+2527,16
@@
static int getInvisibleActiveFromInvisibleElement(int element)
{
return (element == EL_INVISIBLE_STEELWALL ? EL_INVISIBLE_STEELWALL_ACTIVE :
element == EL_INVISIBLE_WALL ? EL_INVISIBLE_WALL_ACTIVE :
{
return (element == EL_INVISIBLE_STEELWALL ? EL_INVISIBLE_STEELWALL_ACTIVE :
element == EL_INVISIBLE_WALL ? EL_INVISIBLE_WALL_ACTIVE :
- EL_INVISIBLE_SAND_ACTIVE);
+ element == EL_INVISIBLE_SAND ? EL_INVISIBLE_SAND_ACTIVE :
+ element);
}
static int getInvisibleFromInvisibleActiveElement(int element)
{
return (element == EL_INVISIBLE_STEELWALL_ACTIVE ? EL_INVISIBLE_STEELWALL :
element == EL_INVISIBLE_WALL_ACTIVE ? EL_INVISIBLE_WALL :
}
static int getInvisibleFromInvisibleActiveElement(int element)
{
return (element == EL_INVISIBLE_STEELWALL_ACTIVE ? EL_INVISIBLE_STEELWALL :
element == EL_INVISIBLE_WALL_ACTIVE ? EL_INVISIBLE_WALL :
- EL_INVISIBLE_SAND);
+ element == EL_INVISIBLE_SAND_ACTIVE ? EL_INVISIBLE_SAND :
+ element);
}
static void RedrawAllLightSwitchesAndInvisibleElements()
}
static void RedrawAllLightSwitchesAndInvisibleElements()
@@
-2676,7
+2702,7
@@
void Impact(int x, int y)
return;
}
#if 1
return;
}
#if 1
- else if (impact && CheckElementChange(x, y, element,
ACTION
_IMPACT))
+ else if (impact && CheckElementChange(x, y, element,
CE
_IMPACT))
{
PlaySoundLevelElementAction(x, y, element, ACTION_IMPACT);
{
PlaySoundLevelElementAction(x, y, element, ACTION_IMPACT);
@@
-2768,6
+2794,13
@@
void Impact(int x, int y)
Bang(x, y + 1);
return;
}
Bang(x, y + 1);
return;
}
+#if 0
+ else if (CAN_SMASH_ENEMIES(element) && IS_CLASSIC_ENEMY(smashed))
+ {
+ Bang(x, y + 1);
+ return;
+ }
+#endif
else if (CAN_SMASH_EVERYTHING(element))
{
if (IS_CLASSIC_ENEMY(smashed) ||
else if (CAN_SMASH_EVERYTHING(element))
{
if (IS_CLASSIC_ENEMY(smashed) ||
@@
-3417,7
+3450,9
@@
void StartMoving(int x, int y)
if (Stop[x][y])
return;
if (Stop[x][y])
return;
- GfxAction[x][y] = ACTION_DEFAULT;
+ /* !!! this should be handled more generic (not only for mole) !!! */
+ if (element != EL_MOLE && GfxAction[x][y] != ACTION_DIGGING)
+ GfxAction[x][y] = ACTION_DEFAULT;
if (CAN_FALL(element) && y < lev_fieldy - 1)
{
if (CAN_FALL(element) && y < lev_fieldy - 1)
{
@@
-3812,7
+3847,10
@@
void StartMoving(int x, int y)
return;
}
return;
}
- GfxAction[x][y] = ACTION_MOVING;
+ /* special case of "moving" animation of waiting elements (FIX THIS !!!);
+ for all other elements GfxAction will be set by InitMovingField() */
+ if (element == EL_BD_BUTTERFLY || element == EL_BD_FIREFLY)
+ GfxAction[x][y] = ACTION_MOVING;
}
/* now make next step */
}
/* now make next step */
@@
-3996,6
+4034,11
@@
void StartMoving(int x, int y)
{
Feld[newx][newy] = EL_AMOEBA_SHRINKING;
PlaySoundLevel(x, y, SND_MOLE_DIGGING);
{
Feld[newx][newy] = EL_AMOEBA_SHRINKING;
PlaySoundLevel(x, y, SND_MOLE_DIGGING);
+
+ ResetGfxAnimation(x, y);
+ GfxAction[x][y] = ACTION_DIGGING;
+ DrawLevelField(x, y);
+
MovDelay[newx][newy] = 0; /* start amoeba shrinking delay */
return; /* wait for shrinking amoeba */
}
MovDelay[newx][newy] = 0; /* start amoeba shrinking delay */
return; /* wait for shrinking amoeba */
}
@@
-4020,7
+4063,8
@@
void StartMoving(int x, int y)
TurnRound(x, y);
#if 1
TurnRound(x, y);
#if 1
- DrawLevelElementAnimation(x, y, element);
+ if (GFX_ELEMENT(element) != EL_SAND) /* !!! FIX THIS (crumble) !!! */
+ DrawLevelElementAnimation(x, y, element);
#else
if (element == EL_BUG ||
element == EL_SPACESHIP ||
#else
if (element == EL_BUG ||
element == EL_SPACESHIP ||
@@
-4514,6
+4558,7
@@
void AmoebeAbleger(int ax, int ay)
if (!IN_LEV_FIELD(x, y))
return;
if (!IN_LEV_FIELD(x, y))
return;
+ /* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */
if (IS_FREE(x, y) ||
Feld[x][y] == EL_SAND || Feld[x][y] == EL_QUICKSAND_EMPTY)
{
if (IS_FREE(x, y) ||
Feld[x][y] == EL_SAND || Feld[x][y] == EL_QUICKSAND_EMPTY)
{
@@
-4538,6
+4583,7
@@
void AmoebeAbleger(int ax, int ay)
if (!IN_LEV_FIELD(x, y))
continue;
if (!IN_LEV_FIELD(x, y))
continue;
+ /* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */
if (IS_FREE(x, y) ||
Feld[x][y] == EL_SAND || Feld[x][y] == EL_QUICKSAND_EMPTY)
{
if (IS_FREE(x, y) ||
Feld[x][y] == EL_SAND || Feld[x][y] == EL_QUICKSAND_EMPTY)
{
@@
-4682,6
+4728,7
@@
void Life(int ax, int ay)
changed = TRUE;
}
}
changed = TRUE;
}
}
+ /* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */
else if (IS_FREE(xx, yy) || Feld[xx][yy] == EL_SAND)
{ /* free border field */
if (nachbarn >= life[2] && nachbarn <= life[3])
else if (IS_FREE(xx, yy) || Feld[xx][yy] == EL_SAND)
{ /* free border field */
if (nachbarn >= life[2] && nachbarn <= life[3])
@@
-5119,6
+5166,10
@@
static void ChangeElementNowExt(int x, int y, int target_element)
if (CAN_BE_CRUMBLED(Feld[x][y]))
DrawLevelFieldCrumbledSandNeighbours(x, y);
if (CAN_BE_CRUMBLED(Feld[x][y]))
DrawLevelFieldCrumbledSandNeighbours(x, y);
+
+ TestIfBadThingTouchesHero(x, y);
+ TestIfPlayerTouchesCustomElement(x, y);
+ TestIfElementTouchesCustomElement(x, y);
}
static void ChangeElementNow(int x, int y, int element)
}
static void ChangeElementNow(int x, int y, int element)
@@
-5173,6
+5224,9
@@
static void ChangeElementNow(int x, int y, int element)
e = Feld[ex][ey];
e = Feld[ex][ey];
+ if (IS_MOVING(ex, ey) || IS_BLOCKED(ex, ey))
+ e = MovingOrBlocked2Element(ex, ey);
+
half_destructible = (IS_FREE(ex, ey) || IS_DIGGABLE(e));
if ((change->power <= CP_NON_DESTRUCTIVE && !IS_FREE(ex, ey)) ||
half_destructible = (IS_FREE(ex, ey) || IS_DIGGABLE(e));
if ((change->power <= CP_NON_DESTRUCTIVE && !IS_FREE(ex, ey)) ||
@@
-5186,8
+5240,10
@@
static void ChangeElementNow(int x, int y, int element)
if (!change->only_complete || complete_change)
{
if (!change->only_complete || complete_change)
{
+ boolean something_has_changed = FALSE;
+
if (change->only_complete && change->use_random_change &&
if (change->only_complete && change->use_random_change &&
- RND(
change->random) != 0
)
+ RND(
100) < change->random
)
return;
for (yy = 0; yy < 3; yy++) for(xx = 0; xx < 3 ; xx++)
return;
for (yy = 0; yy < 3; yy++) for(xx = 0; xx < 3 ; xx++)
@@
-5196,21
+5252,31
@@
static void ChangeElementNow(int x, int y, int element)
int ey = y + yy - 1;
if (can_change[xx][yy] && (!change->use_random_change ||
int ey = y + yy - 1;
if (can_change[xx][yy] && (!change->use_random_change ||
- RND(
change->random) == 0
))
+ RND(
100) < change->random
))
{
{
+ if (IS_MOVING(ex, ey) || IS_BLOCKED(ex, ey))
+ RemoveMovingField(ex, ey);
+
ChangeElementNowExt(ex, ey, change->content[xx][yy]);
ChangeElementNowExt(ex, ey, change->content[xx][yy]);
+ something_has_changed = TRUE;
+
/* for symmetry reasons, stop newly created border elements */
if (ex != x || ey != y)
Stop[ex][ey] = TRUE;
}
}
/* for symmetry reasons, stop newly created border elements */
if (ex != x || ey != y)
Stop[ex][ey] = TRUE;
}
}
- return;
+ if (something_has_changed)
+ PlaySoundLevelElementAction(x, y, element, ACTION_CHANGING);
}
}
}
}
+ else
+ {
+ ChangeElementNowExt(x, y, change->target_element);
- ChangeElementNowExt(x, y, change->target_element);
+ PlaySoundLevelElementAction(x, y, element, ACTION_CHANGING);
+ }
}
static void ChangeElement(int x, int y)
}
static void ChangeElement(int x, int y)
@@
-5543,6
+5609,16
@@
void GameActions()
GfxFrame[x][y]++;
GfxFrame[x][y]++;
+#if 1
+ /* reset finished pushing action (not done in ContinueMoving() to allow
+ continous pushing animation for elements without push delay) */
+ if (GfxAction[x][y] == ACTION_PUSHING && !IS_MOVING(x, y))
+ {
+ ResetGfxAnimation(x, y);
+ DrawLevelField(x, y);
+ }
+#endif
+
#if DEBUG
if (IS_BLOCKED(x, y))
{
#if DEBUG
if (IS_BLOCKED(x, y))
{
@@
-5616,9
+5692,10
@@
void GameActions()
#if 1
graphic = el_act_dir2img(element, GfxAction[x][y], MovDir[x][y]);
#if 0
#if 1
graphic = el_act_dir2img(element, GfxAction[x][y], MovDir[x][y]);
#if 0
- if (element == EL_PACMAN)
- printf("::: %d, %d, %d\n",
- IS_ANIMATED(graphic), IS_MOVING(x, y), Stop[x][y]);
+ if (element == EL_MOLE)
+ printf("::: %d, %d, %d [%d]\n",
+ IS_ANIMATED(graphic), IS_MOVING(x, y), Stop[x][y],
+ GfxAction[x][y]);
#endif
#if 0
if (element == EL_YAMYAM)
#endif
#if 0
if (element == EL_YAMYAM)
@@
-5634,7
+5711,7
@@
void GameActions()
DrawLevelGraphicAnimationIfNeeded(x, y, graphic);
#if 0
DrawLevelGraphicAnimationIfNeeded(x, y, graphic);
#if 0
- if (element == EL_
YAMYAM
)
+ if (element == EL_
MOLE
)
printf("::: %d, %d\n", graphic, GfxFrame[x][y]);
#endif
}
printf("::: %d, %d\n", graphic, GfxFrame[x][y]);
#endif
}
@@
-5741,6
+5818,7
@@
void GameActions()
#endif
element = Feld[x][y];
#endif
element = Feld[x][y];
+ /* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */
if (!IS_PLAYER(x,y) &&
(element == EL_EMPTY ||
element == EL_SAND ||
if (!IS_PLAYER(x,y) &&
(element == EL_EMPTY ||
element == EL_SAND ||
@@
-6010,7
+6088,7
@@
void ScrollLevel(int dx, int dy)
static void CheckGravityMovement(struct PlayerInfo *player)
{
static void CheckGravityMovement(struct PlayerInfo *player)
{
- if (
level.
gravity && !player->programmed_action)
+ if (
game.current_
gravity && !player->programmed_action)
{
int move_dir_vertical = player->action & (MV_UP | MV_DOWN);
int move_dir_horizontal = player->action & (MV_LEFT | MV_RIGHT);
{
int move_dir_vertical = player->action & (MV_UP | MV_DOWN);
int move_dir_horizontal = player->action & (MV_LEFT | MV_RIGHT);
@@
-6028,6
+6106,7
@@
static void CheckGravityMovement(struct PlayerInfo *player)
(IN_LEV_FIELD(new_jx, new_jy) &&
(Feld[new_jx][new_jy] == EL_SP_BASE ||
Feld[new_jx][new_jy] == EL_SAND));
(IN_LEV_FIELD(new_jx, new_jy) &&
(Feld[new_jx][new_jy] == EL_SP_BASE ||
Feld[new_jx][new_jy] == EL_SAND));
+ /* !!! extend EL_SAND to anything diggable !!! */
if (field_under_player_is_free &&
!player_is_moving_to_valid_field &&
if (field_under_player_is_free &&
!player_is_moving_to_valid_field &&
@@
-6298,7
+6377,9
@@
void ScrollFigure(struct PlayerInfo *player, int mode)
if (Feld[last_jx][last_jy] == EL_EMPTY)
Feld[last_jx][last_jy] = EL_PLAYER_IS_LEAVING;
if (Feld[last_jx][last_jy] == EL_EMPTY)
Feld[last_jx][last_jy] = EL_PLAYER_IS_LEAVING;
+#if 0
DrawPlayer(player);
DrawPlayer(player);
+#endif
return;
}
else if (!FrameReached(&player->actual_frame_counter, 1))
return;
}
else if (!FrameReached(&player->actual_frame_counter, 1))
@@
-6314,7
+6395,9
@@
void ScrollFigure(struct PlayerInfo *player, int mode)
if (player->MovPos == 0)
CheckGravityMovement(player);
if (player->MovPos == 0)
CheckGravityMovement(player);
- DrawPlayer(player);
+#if 0
+ DrawPlayer(player); /* needed here only to cleanup last field */
+#endif
if (player->MovPos == 0)
{
if (player->MovPos == 0)
{
@@
-6376,6
+6459,7
@@
void ScrollScreen(struct PlayerInfo *player, int mode)
void TestIfPlayerTouchesCustomElement(int x, int y)
{
void TestIfPlayerTouchesCustomElement(int x, int y)
{
+ static boolean check_changing = FALSE;
static int xy[4][2] =
{
{ 0, -1 },
static int xy[4][2] =
{
{ 0, -1 },
@@
-6386,6
+6470,12
@@
void TestIfPlayerTouchesCustomElement(int x, int y)
boolean center_is_player = (IS_PLAYER(x, y));
int i;
boolean center_is_player = (IS_PLAYER(x, y));
int i;
+ /* prevent TestIfPlayerTouchesCustomElement() from looping */
+ if (check_changing)
+ return;
+
+ check_changing = TRUE;
+
for (i=0; i<4; i++)
{
int xx = x + xy[i][0];
for (i=0; i<4; i++)
{
int xx = x + xy[i][0];
@@
-6407,10
+6497,13
@@
void TestIfPlayerTouchesCustomElement(int x, int y)
break;
}
}
break;
}
}
+
+ check_changing = FALSE;
}
void TestIfElementTouchesCustomElement(int x, int y)
{
}
void TestIfElementTouchesCustomElement(int x, int y)
{
+ static boolean check_changing = FALSE;
static int xy[4][2] =
{
{ 0, -1 },
static int xy[4][2] =
{
{ 0, -1 },
@@
-6421,6
+6514,12
@@
void TestIfElementTouchesCustomElement(int x, int y)
boolean center_is_custom = (IS_CUSTOM_ELEMENT(Feld[x][y]));
int i;
boolean center_is_custom = (IS_CUSTOM_ELEMENT(Feld[x][y]));
int i;
+ /* prevent TestIfElementTouchesCustomElement() from looping */
+ if (check_changing)
+ return;
+
+ check_changing = TRUE;
+
for (i=0; i<4; i++)
{
int xx = x + xy[i][0];
for (i=0; i<4; i++)
{
int xx = x + xy[i][0];
@@
-6441,6
+6540,8
@@
void TestIfElementTouchesCustomElement(int x, int y)
CheckElementChange(xx, yy, Feld[xx][yy], CE_OTHER_IS_TOUCHING);
}
}
CheckElementChange(xx, yy, Feld[xx][yy], CE_OTHER_IS_TOUCHING);
}
}
+
+ check_changing = FALSE;
}
void TestIfGoodThingHitsBadThing(int good_x, int good_y, int good_move_dir)
}
void TestIfGoodThingHitsBadThing(int good_x, int good_y, int good_move_dir)
@@
-6981,6
+7082,12
@@
int DigField(struct PlayerInfo *player,
!IS_FREE(nextx, nexty))
return MF_NO_ACTION;
!IS_FREE(nextx, nexty))
return MF_NO_ACTION;
+ if (element == EL_SP_GRAVITY_PORT_LEFT ||
+ element == EL_SP_GRAVITY_PORT_RIGHT ||
+ element == EL_SP_GRAVITY_PORT_UP ||
+ element == EL_SP_GRAVITY_PORT_DOWN)
+ game.current_gravity = !game.current_gravity;
+
/* automatically move to the next field with double speed */
player->programmed_action = move_direction;
DOUBLE_PLAYER_SPEED(player);
/* automatically move to the next field with double speed */
player->programmed_action = move_direction;
DOUBLE_PLAYER_SPEED(player);
@@
-7111,8
+7218,12
@@
int DigField(struct PlayerInfo *player,
if (mode != DF_SNAP)
{
if (mode != DF_SNAP)
{
+#if 1
+ GfxElement[x][y] = GFX_ELEMENT(element);
+#else
GfxElement[x][y] =
(CAN_BE_CRUMBLED(element) ? EL_SAND : GFX_ELEMENT(element));
GfxElement[x][y] =
(CAN_BE_CRUMBLED(element) ? EL_SAND : GFX_ELEMENT(element));
+#endif
player->is_digging = TRUE;
}
player->is_digging = TRUE;
}
@@
-7268,6
+7379,7
@@
int DigField(struct PlayerInfo *player,
PlaySoundLevelElementAction(x, y, element, ACTION_PUSHING);
InitMovingField(x, y, move_direction);
PlaySoundLevelElementAction(x, y, element, ACTION_PUSHING);
InitMovingField(x, y, move_direction);
+ GfxAction[x][y] = ACTION_PUSHING;
if (mode == DF_SNAP)
ContinueMoving(x, y);
if (mode == DF_SNAP)
ContinueMoving(x, y);
@@
-7826,6
+7938,8
@@
static void HandleGameButtons(struct GadgetInfo *gi)
else if (audio.music_available)
{
setup.sound = setup.sound_music = TRUE;
else if (audio.music_available)
{
setup.sound = setup.sound_music = TRUE;
+
+ SetAudioMode(setup.sound);
PlayMusic(level_nr);
}
break;
PlayMusic(level_nr);
}
break;
@@
-7834,14
+7948,20
@@
static void HandleGameButtons(struct GadgetInfo *gi)
if (setup.sound_loops)
setup.sound_loops = FALSE;
else if (audio.loops_available)
if (setup.sound_loops)
setup.sound_loops = FALSE;
else if (audio.loops_available)
+ {
setup.sound = setup.sound_loops = TRUE;
setup.sound = setup.sound_loops = TRUE;
+ SetAudioMode(setup.sound);
+ }
break;
case SOUND_CTRL_ID_SIMPLE:
if (setup.sound_simple)
setup.sound_simple = FALSE;
else if (audio.sound_available)
break;
case SOUND_CTRL_ID_SIMPLE:
if (setup.sound_simple)
setup.sound_simple = FALSE;
else if (audio.sound_available)
+ {
setup.sound = setup.sound_simple = TRUE;
setup.sound = setup.sound_simple = TRUE;
+ SetAudioMode(setup.sound);
+ }
break;
default:
break;
default: