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))
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) ||
#if 1
-#if 1
+#if 0
if (IS_EXPLOSION_PROOF(element))
continue;
#else
}
/* save walkable background elements while explosion on same tile */
-#if 1
+#if 0
if (IS_INDESTRUCTIBLE(element))
Back[x][y] = element;
#else
- if (IS_INDESTRUCTIBLE(element) && IS_WALKABLE(element))
+ if (IS_WALKABLE(element) && IS_INDESTRUCTIBLE(element))
Back[x][y] = element;
#endif
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)
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;
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;
}
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 &&
{
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 :
- EL_INVISIBLE_SAND);
+ element == EL_INVISIBLE_SAND_ACTIVE ? EL_INVISIBLE_SAND :
+ element);
}
static void RedrawAllLightSwitchesAndInvisibleElements()
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);
if (Stop[x][y])
return;
- /* !!! this should be handled more generic (not only for more) !!! */
+ /* !!! this should be handled more generic (not only for mole) !!! */
if (element != EL_MOLE && GfxAction[x][y] != ACTION_DIGGING)
GfxAction[x][y] = ACTION_DEFAULT;
return;
}
+#if 0
GfxAction[x][y] = ACTION_MOVING;
+#endif
}
/* now make next step */
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 ||
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 (!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)
{
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])
if (!change->only_complete || complete_change)
{
+ boolean something_has_changed = FALSE;
+
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++)
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]);
+ something_has_changed = 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)
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))
{
#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 ||
(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 (Feld[last_jx][last_jy] == EL_EMPTY)
Feld[last_jx][last_jy] = EL_PLAYER_IS_LEAVING;
+#if 0
DrawPlayer(player);
+#endif
return;
}
else if (!FrameReached(&player->actual_frame_counter, 1))
if (player->MovPos == 0)
CheckGravityMovement(player);
- DrawPlayer(player);
+#if 0
+ DrawPlayer(player); /* needed here only to cleanup last field */
+#endif
if (player->MovPos == 0)
{
!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)
+ level.gravity = !level.gravity;
+
/* automatically move to the next field with double speed */
player->programmed_action = move_direction;
DOUBLE_PLAYER_SPEED(player);
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));
+#endif
player->is_digging = TRUE;
}
PlaySoundLevelElementAction(x, y, element, ACTION_PUSHING);
InitMovingField(x, y, move_direction);
+ GfxAction[x][y] = ACTION_PUSHING;
if (mode == DF_SNAP)
ContinueMoving(x, y);
else if (audio.music_available)
{
setup.sound = setup.sound_music = TRUE;
+
+ SetAudioMode(setup.sound);
PlayMusic(level_nr);
}
break;
if (setup.sound_loops)
setup.sound_loops = FALSE;
else if (audio.loops_available)
+ {
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)
+ {
setup.sound = setup.sound_simple = TRUE;
+ SetAudioMode(setup.sound);
+ }
break;
default: