+#if 1
+
+#if 1
+ last_phase = element_info[center_element].explosion_delay + 1;
+#else
+ last_phase = element_info[center_element].explosion_delay;
+#endif
+
+#if 0
+ printf("::: %d -> %d\n", center_element, last_phase);
+#endif
+#endif
+
+ 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 1
+#if 1
+ if (!IN_LEV_FIELD(x, y) ||
+ (mode & EX_TYPE_SINGLE_TILE && (x != ex || y != ey)) ||
+ (mode == EX_TYPE_CROSS && (x != ex && y != ey)))
+ continue;
+#else
+ if (!IN_LEV_FIELD(x, y) ||
+ (mode != EX_TYPE_NORMAL && (x != ex || y != ey)))
+ continue;
+#endif
+#else
+ if (!IN_LEV_FIELD(x, y) ||
+ ((mode != EX_TYPE_NORMAL ||
+ center_element == EL_AMOEBA_TO_DIAMOND) &&
+ (x != ex || y != ey)))
+ continue;
+#endif
+
+ element = Feld[x][y];
+
+ if (IS_MOVING(x, y) || IS_BLOCKED(x, y))
+ {
+ element = MovingOrBlocked2Element(x, y);
+
+ if (!IS_EXPLOSION_PROOF(element))
+ RemoveMovingField(x, y);
+ }
+
+#if 1
+
+#if 0
+ if (IS_EXPLOSION_PROOF(element))
+ continue;
+#else
+ /* indestructible elements can only explode in center (but not flames) */
+#if 1
+ if ((IS_EXPLOSION_PROOF(element) && (x != ex || y != ey ||
+ mode == EX_TYPE_BORDER)) ||
+ element == EL_FLAMES)
+ continue;
+#else
+ if ((IS_EXPLOSION_PROOF(element) && (x != ex || y != ey)) ||
+ element == EL_FLAMES)
+ continue;
+#endif
+#endif
+
+#else
+ if ((IS_INDESTRUCTIBLE(element) &&
+ (game.engine_version < VERSION_IDENT(2,2,0,0) ||
+ (!IS_WALKABLE_OVER(element) && !IS_WALKABLE_UNDER(element)))) ||
+ element == EL_FLAMES)
+ continue;
+#endif
+
+#if 1
+ if (IS_PLAYER(x, y) && SHIELD_ON(PLAYERINFO(x, y)) &&
+ (game.engine_version < VERSION_IDENT(3,1,0,0) ||
+ (x == ex && y == ey && mode != EX_TYPE_BORDER)))
+#else
+ if (IS_PLAYER(x, y) && SHIELD_ON(PLAYERINFO(x, y)))
+#endif
+ {
+ if (IS_ACTIVE_BOMB(element))
+ {
+ /* re-activate things under the bomb like gate or penguin */
+#if 1
+ Feld[x][y] = (Back[x][y] ? Back[x][y] : EL_EMPTY);
+ Back[x][y] = 0;
+#else
+ Feld[x][y] = (Store[x][y] ? Store[x][y] : EL_EMPTY);
+ Store[x][y] = 0;
+#endif
+
+#if 0
+ printf("::: %d,%d: %d %s [%d, %d]\n", x, y, Feld[x][y],
+ element_info[Feld[x][y]].token_name,
+ Store[x][y], Store2[x][y]);
+#endif
+ }
+
+ continue;
+ }
+
+ /* save walkable background elements while explosion on same tile */
+#if 0
+ if (IS_INDESTRUCTIBLE(element))
+ Back[x][y] = element;
+#else
+#if 1
+#if 1
+ if (IS_WALKABLE(element) && IS_INDESTRUCTIBLE(element) &&
+ (x != ex || y != ey || mode == EX_TYPE_BORDER))
+ Back[x][y] = element;
+#else
+ if (IS_WALKABLE(element) && IS_INDESTRUCTIBLE(element) &&
+ (x != ex || y != ey))
+ Back[x][y] = element;
+#endif
+#else
+ if (IS_WALKABLE(element) && IS_INDESTRUCTIBLE(element))
+ Back[x][y] = element;
+#endif
+#endif
+
+ /* ignite explodable elements reached by other explosion */
+ if (element == EL_EXPLOSION)
+ element = Store2[x][y];
+
+#if 1
+ if (AmoebaNr[x][y] &&
+ (element == EL_AMOEBA_FULL ||
+ element == EL_BD_AMOEBA ||
+ element == EL_AMOEBA_GROWING))
+ {
+ AmoebaCnt[AmoebaNr[x][y]]--;
+ AmoebaCnt2[AmoebaNr[x][y]]--;
+ }
+
+ RemoveField(x, y);
+#endif
+
+ if (IS_PLAYER(ex, ey) && !PLAYER_EXPLOSION_PROTECTED(ex, ey))
+ {
+ switch(StorePlayer[ex][ey])
+ {
+ case EL_PLAYER_2:
+ Store[x][y] = EL_PLAYER_IS_EXPLODING_2;
+ break;
+ case EL_PLAYER_3:
+ Store[x][y] = EL_PLAYER_IS_EXPLODING_3;
+ break;
+ case EL_PLAYER_4:
+ Store[x][y] = EL_PLAYER_IS_EXPLODING_4;
+ break;
+ case EL_PLAYER_1:
+ default:
+ Store[x][y] = EL_PLAYER_IS_EXPLODING_1;
+ break;
+ }
+
+#if 1
+ if (PLAYERINFO(ex, ey)->use_murphy_graphic)
+ Store[x][y] = EL_EMPTY;
+#else
+ if (game.emulation == EMU_SUPAPLEX)
+ Store[x][y] = EL_EMPTY;
+#endif
+ }
+ else if (center_element == EL_MOLE)
+ Store[x][y] = EL_EMERALD_RED;
+ else if (center_element == EL_PENGUIN)
+ Store[x][y] = EL_EMERALD_PURPLE;
+ else if (center_element == EL_BUG)
+ Store[x][y] = ((x == ex && y == ey) ? EL_DIAMOND : EL_EMERALD);
+ else if (center_element == EL_BD_BUTTERFLY)
+ Store[x][y] = EL_BD_DIAMOND;
+ else if (center_element == EL_SP_ELECTRON)
+ Store[x][y] = EL_SP_INFOTRON;
+ 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][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_DIAMOND;
+ else if (element == EL_WALL_BD_DIAMOND)
+ Store[x][y] = EL_BD_DIAMOND;
+ else if (element == EL_WALL_EMERALD_YELLOW)
+ Store[x][y] = EL_EMERALD_YELLOW;
+ else if (element == EL_WALL_EMERALD_RED)
+ Store[x][y] = EL_EMERALD_RED;
+ else if (element == EL_WALL_EMERALD_PURPLE)
+ Store[x][y] = EL_EMERALD_PURPLE;
+ else if (element == EL_WALL_PEARL)
+ Store[x][y] = EL_PEARL;
+ else if (element == EL_WALL_CRYSTAL)
+ Store[x][y] = EL_CRYSTAL;
+ else if (IS_CUSTOM_ELEMENT(element) && !CAN_EXPLODE(element))
+ Store[x][y] = element_info[element].content[1][1];
+ else
+ Store[x][y] = EL_EMPTY;
+
+ if (x != ex || y != ey || mode == EX_TYPE_BORDER ||
+ center_element == EL_AMOEBA_TO_DIAMOND)
+ Store2[x][y] = element;
+
+#if 0
+ printf("::: %d,%d: %d %s\n", x, y, Store2[x][y],
+ element_info[Store2[x][y]].token_name);
+#endif
+
+#if 0
+ if (AmoebaNr[x][y] &&
+ (element == EL_AMOEBA_FULL ||
+ element == EL_BD_AMOEBA ||
+ element == EL_AMOEBA_GROWING))
+ {
+ AmoebaCnt[AmoebaNr[x][y]]--;
+ AmoebaCnt2[AmoebaNr[x][y]]--;
+ }
+
+#if 1
+ RemoveField(x, y);
+#else
+ MovDir[x][y] = MovPos[x][y] = 0;
+ GfxDir[x][y] = MovDir[x][y];
+ AmoebaNr[x][y] = 0;
+#endif
+#endif
+
+ Feld[x][y] = EL_EXPLOSION;
+#if 1
+ GfxElement[x][y] = center_element;
+#else
+ GfxElement[x][y] = EL_UNDEFINED;
+#endif
+
+ ExplodePhase[x][y] = 1;
+#if 1
+ ExplodeDelay[x][y] = last_phase;
+#endif
+
+#if 0
+#if 1
+ GfxFrame[x][y] = 0; /* animation does not start until next frame */
+#else
+ GfxFrame[x][y] = -1; /* animation does not start until next frame */
+#endif
+#endif
+
+ Stop[x][y] = TRUE;
+ }
+
+ if (center_element == EL_YAMYAM)
+ game.yamyam_content_nr =
+ (game.yamyam_content_nr + 1) % level.num_yamyam_contents;
+
+#if 0
+ printf("::: %d,%d: %d %s [%d]\n", ex + 1, ey, Feld[ex + 1][ey],
+ element_info[Feld[ex + 1][ey]].token_name, Store2[ex + 1][ey]);
+#endif
+
+ return;
+ }
+
+ if (Stop[ex][ey])
+ return;
+
+ x = ex;
+ y = ey;
+
+#if 1
+ if (phase == 1)
+ GfxFrame[x][y] = 0; /* restart explosion animation */
+#endif
+
+#if 0
+ printf(":X: phase == %d [%d]\n", phase, GfxFrame[x][y]);
+#endif
+
+#if 1
+ last_phase = ExplodeDelay[x][y];
+#endif
+
+ ExplodePhase[x][y] = (phase < last_phase ? phase + 1 : 0);
+
+#ifdef DEBUG
+
+ /* activate this even in non-DEBUG version until cause for crash in
+ getGraphicAnimationFrame() (see below) is found and eliminated */
+#endif
+#if 1
+
+ if (GfxElement[x][y] == EL_UNDEFINED)
+ {
+ printf("\n\n");
+ printf("Explode(): x = %d, y = %d: GfxElement == EL_UNDEFINED\n", x, y);
+ printf("Explode(): This should never happen!\n");
+ printf("\n\n");
+
+ GfxElement[x][y] = EL_EMPTY;
+ }
+#endif
+
+#if 1
+
+ border_element = Store2[x][y];
+#if 1
+ if (IS_PLAYER(x, y) && !PLAYER_EXPLOSION_PROTECTED(x, y))
+ border_element = StorePlayer[x][y];
+#else
+ if (IS_PLAYER(x, y))
+ border_element = StorePlayer[x][y];
+#endif
+
+#if 0
+ printf("::: %d,%d: %d %s [%d]\n", x, y, border_element,
+ element_info[border_element].token_name, Store2[x][y]);
+#endif
+
+#if 0
+ printf("::: phase == %d\n", phase);
+#endif
+
+ if (phase == element_info[border_element].ignition_delay ||
+ phase == last_phase)
+ {
+ boolean border_explosion = FALSE;
+
+#if 1
+#if 1
+ if (IS_PLAYER(x, y) && PLAYERINFO(x, y)->present &&
+ !PLAYER_EXPLOSION_PROTECTED(x, y))
+#else
+ if (IS_PLAYER(x, y) && PLAYERINFO(x, y)->present)
+#endif
+#else
+ if (IS_PLAYER(x, y))
+#endif
+ {
+ KillHeroUnlessExplosionProtected(x, y);
+ border_explosion = TRUE;
+
+#if 0
+ if (phase == last_phase)
+ printf("::: IS_PLAYER\n");
+#endif
+ }
+ else if (CAN_EXPLODE_BY_EXPLOSION(border_element))
+ {
+#if 0
+ printf("::: %d,%d: %d %s\n", x, y, border_element,
+ element_info[border_element].token_name);
+#endif
+
+ Feld[x][y] = Store2[x][y];
+ Store2[x][y] = 0;
+ Bang(x, y);
+ border_explosion = TRUE;
+
+#if 0
+ if (phase == last_phase)
+ printf("::: CAN_EXPLODE_BY_EXPLOSION\n");
+#endif
+ }
+ else if (border_element == EL_AMOEBA_TO_DIAMOND)
+ {
+ AmoebeUmwandeln(x, y);
+ Store2[x][y] = 0;
+ border_explosion = TRUE;
+
+#if 0
+ if (phase == last_phase)
+ printf("::: EL_AMOEBA_TO_DIAMOND [%d, %d] [%d]\n",
+ element_info[border_element].explosion_delay,
+ element_info[border_element].ignition_delay,
+ phase);
+#endif
+ }
+
+#if 1
+ /* if an element just explodes due to another explosion (chain-reaction),
+ do not immediately end the new explosion when it was the last frame of
+ the explosion (as it would be done in the following "if"-statement!) */
+ if (border_explosion && phase == last_phase)
+ return;
+#endif
+ }
+
+#else
+
+ if (phase == first_phase_after_start)
+ {
+ int element = Store2[x][y];
+
+ if (element == EL_BLACK_ORB)
+ {
+ Feld[x][y] = Store2[x][y];
+ Store2[x][y] = 0;
+ Bang(x, y);
+ }
+ }
+ else if (phase == half_phase)
+ {
+ int element = Store2[x][y];
+
+ if (IS_PLAYER(x, y))
+ KillHeroUnlessExplosionProtected(x, y);
+ else if (CAN_EXPLODE_BY_EXPLOSION(element))
+ {
+ Feld[x][y] = Store2[x][y];
+ Store2[x][y] = 0;
+ Bang(x, y);
+ }
+ else if (element == EL_AMOEBA_TO_DIAMOND)
+ AmoebeUmwandeln(x, y);
+ }
+#endif
+
+ if (phase == last_phase)
+ {
+ int element;
+
+#if 0
+ printf("::: done: phase == %d\n", phase);
+#endif
+
+#if 0
+ printf("::: explosion %d,%d done [%d]\n", x, y, FrameCounter);
+#endif
+
+ element = Feld[x][y] = Store[x][y];
+ Store[x][y] = Store2[x][y] = 0;
+ GfxElement[x][y] = EL_UNDEFINED;
+
+ /* player can escape from explosions and might therefore be still alive */
+ if (element >= EL_PLAYER_IS_EXPLODING_1 &&
+ element <= EL_PLAYER_IS_EXPLODING_4)
+ Feld[x][y] = (stored_player[element - EL_PLAYER_IS_EXPLODING_1].active ?
+ EL_EMPTY :
+ element == EL_PLAYER_IS_EXPLODING_1 ? EL_EMERALD_YELLOW :
+ element == EL_PLAYER_IS_EXPLODING_2 ? EL_EMERALD_RED :
+ element == EL_PLAYER_IS_EXPLODING_3 ? EL_EMERALD :
+ EL_EMERALD_PURPLE);
+
+ /* restore probably existing indestructible background element */
+ if (Back[x][y] && IS_INDESTRUCTIBLE(Back[x][y]))
+ element = Feld[x][y] = Back[x][y];
+ Back[x][y] = 0;
+
+ MovDir[x][y] = MovPos[x][y] = MovDelay[x][y] = 0;
+ GfxDir[x][y] = MV_NO_MOVING;
+ ChangeDelay[x][y] = 0;
+ ChangePage[x][y] = -1;
+
+#if 1
+ InitField_WithBug2(x, y, FALSE);
+#else
+ InitField(x, y, FALSE);
+#if 1
+ /* !!! not needed !!! */
+#if 1
+ if (game.engine_version < VERSION_IDENT(3,1,0,0) &&
+ CAN_MOVE(Feld[x][y]) && Feld[x][y] != EL_MOLE)
+ InitMovDir(x, y);
+#else
+ if (CAN_MOVE(element))
+ InitMovDir(x, y);
+#endif
+#endif
+#endif
+ DrawLevelField(x, y);
+
+ TestIfElementTouchesCustomElement(x, y);
+
+ if (GFX_CRUMBLED(element))
+ DrawLevelFieldCrumbledSandNeighbours(x, y);
+
+ if (IS_PLAYER(x, y) && !PLAYERINFO(x, y)->present)
+ StorePlayer[x][y] = 0;
+
+ if (ELEM_IS_PLAYER(element))
+ RelocatePlayer(x, y, element);
+ }
+#if 1
+ else if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+#else
+ else if (phase >= delay && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+#endif
+ {
+#if 1
+ int graphic = el_act2img(GfxElement[x][y], ACTION_EXPLODING);
+#else
+ int stored = Store[x][y];
+ int graphic = (game.emulation != EMU_SUPAPLEX ? IMG_EXPLOSION :
+ stored == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON :
+ IMG_SP_EXPLOSION);
+#endif
+#if 1
+ int frame = getGraphicAnimationFrame(graphic, GfxFrame[x][y]);
+#else
+ int frame = getGraphicAnimationFrame(graphic, phase - delay);
+#endif
+
+#if 0
+ printf("::: phase == %d [%d]\n", phase, GfxFrame[x][y]);
+#endif
+
+#if 0
+ printf("::: %d / %d [%d - %d]\n",
+ GfxFrame[x][y], phase - delay, phase, delay);
+#endif
+
+#if 0
+ printf("::: %d ['%s'] -> %d\n", GfxElement[x][y],
+ element_info[GfxElement[x][y]].token_name,
+ graphic);
+#endif
+
+ if (phase == delay)
+ DrawLevelFieldCrumbledSand(x, y);
+
+ if (IS_WALKABLE_OVER(Back[x][y]) && Back[x][y] != EL_EMPTY)
+ {
+ DrawLevelElement(x, y, Back[x][y]);
+ DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic, frame);
+ }
+ else if (IS_WALKABLE_UNDER(Back[x][y]))
+ {
+ DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+ DrawLevelElementThruMask(x, y, Back[x][y]);
+ }
+ else if (!IS_WALKABLE_INSIDE(Back[x][y]))
+ DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+ }
+}
+
+void DynaExplode(int ex, int ey)
+{
+ int i, j;
+ int dynabomb_element = Feld[ex][ey];
+ int dynabomb_size = 1;
+ boolean dynabomb_xl = FALSE;
+ struct PlayerInfo *player;
+ static int xy[4][2] =
+ {
+ { 0, -1 },
+ { -1, 0 },
+ { +1, 0 },
+ { 0, +1 }
+ };
+
+ if (IS_ACTIVE_BOMB(dynabomb_element))
+ {
+ player = &stored_player[dynabomb_element - EL_DYNABOMB_PLAYER_1_ACTIVE];
+ dynabomb_size = player->dynabomb_size;
+ dynabomb_xl = player->dynabomb_xl;
+ player->dynabombs_left++;
+ }
+
+ Explode(ex, ey, EX_PHASE_START, EX_TYPE_CENTER);
+
+ for (i = 0; i < NUM_DIRECTIONS; i++)
+ {
+ for (j = 1; j <= dynabomb_size; j++)
+ {
+ int x = ex + j * xy[i][0];
+ int y = ey + j * xy[i][1];
+ int element;
+
+ if (!IN_LEV_FIELD(x, y) || IS_INDESTRUCTIBLE(Feld[x][y]))
+ break;
+
+ element = Feld[x][y];
+
+ /* do not restart explosions of fields with active bombs */
+ if (element == EL_EXPLOSION && IS_ACTIVE_BOMB(Store2[x][y]))
+ continue;
+
+ Explode(x, y, EX_PHASE_START, EX_TYPE_BORDER);
+
+#if 1
+#if 1
+ if (element != EL_EMPTY && element != EL_EXPLOSION &&
+ !IS_DIGGABLE(element) && !dynabomb_xl)
+ break;
+#else
+ if (element != EL_EMPTY && element != EL_EXPLOSION &&
+ !CAN_GROW_INTO(element) && !dynabomb_xl)
+ break;
+#endif
+#else
+ /* !!! extend EL_SAND to anything diggable (but maybe not SP_BASE) !!! */
+ if (element != EL_EMPTY && element != EL_EXPLOSION &&
+ element != EL_SAND && !dynabomb_xl)
+ break;
+#endif
+ }
+ }
+}
+
+void Bang(int x, int y)
+{
+#if 1
+ int element = MovingOrBlocked2Element(x, y);
+#else
+ int element = Feld[x][y];
+#endif
+
+#if 1
+ if (IS_PLAYER(x, y) && !PLAYER_EXPLOSION_PROTECTED(x, y))
+#else
+ if (IS_PLAYER(x, y))
+#endif
+ {
+ struct PlayerInfo *player = PLAYERINFO(x, y);
+
+ element = Feld[x][y] = (player->use_murphy_graphic ? EL_SP_MURPHY :
+ player->element_nr);
+ }
+
+#if 0
+#if 1
+ PlayLevelSoundAction(x, y, ACTION_EXPLODING);
+#else
+ if (game.emulation == EMU_SUPAPLEX)
+ PlayLevelSound(x, y, SND_SP_ELEMENT_EXPLODING);
+ else
+ PlayLevelSound(x, y, SND_ELEMENT_EXPLODING);
+#endif
+#endif
+
+#if 0
+ if (IS_PLAYER(x, y)) /* remove objects that might cause smaller explosion */
+ element = EL_EMPTY;
+#endif
+
+ switch(element)
+ {
+ case EL_BUG:
+ case EL_SPACESHIP:
+ case EL_BD_BUTTERFLY:
+ case EL_BD_FIREFLY:
+ case EL_YAMYAM:
+ case EL_DARK_YAMYAM:
+ case EL_ROBOT:
+ case EL_PACMAN:
+ case EL_MOLE:
+ RaiseScoreElement(element);
+ Explode(x, y, EX_PHASE_START, EX_TYPE_NORMAL);
+ break;
+ case EL_DYNABOMB_PLAYER_1_ACTIVE:
+ case EL_DYNABOMB_PLAYER_2_ACTIVE:
+ case EL_DYNABOMB_PLAYER_3_ACTIVE:
+ case EL_DYNABOMB_PLAYER_4_ACTIVE:
+ case EL_DYNABOMB_INCREASE_NUMBER:
+ case EL_DYNABOMB_INCREASE_SIZE:
+ case EL_DYNABOMB_INCREASE_POWER:
+ DynaExplode(x, y);
+ break;
+ case EL_PENGUIN:
+ case EL_LAMP:
+ case EL_LAMP_ACTIVE:
+#if 1
+ case EL_AMOEBA_TO_DIAMOND:
+#endif
+ if (IS_PLAYER(x, y))
+ Explode(x, y, EX_PHASE_START, EX_TYPE_NORMAL);
+ else
+ Explode(x, y, EX_PHASE_START, EX_TYPE_CENTER);
+ break;
+ default:
+#if 1
+ if (element_info[element].explosion_type == EXPLODES_CROSS)
+#else
+ if (CAN_EXPLODE_CROSS(element))
+#endif
+#if 1
+ Explode(x, y, EX_PHASE_START, EX_TYPE_CROSS);
+#else
+ DynaExplode(x, y);
+#endif
+#if 1
+ else if (element_info[element].explosion_type == EXPLODES_1X1)
+#else
+ else if (CAN_EXPLODE_1X1(element))
+#endif
+ Explode(x, y, EX_PHASE_START, EX_TYPE_CENTER);
+ else
+ Explode(x, y, EX_PHASE_START, EX_TYPE_NORMAL);
+ break;
+ }
+
+ CheckTriggeredElementChange(x, y, element, CE_OTHER_IS_EXPLODING);
+}
+
+void SplashAcid(int x, int y)
+{
+#if 1
+ if (IN_LEV_FIELD(x - 1, y - 1) && IS_FREE(x - 1, y - 1) &&
+ (!IN_LEV_FIELD(x - 1, y - 2) ||
+ !CAN_FALL(MovingOrBlocked2Element(x - 1, y - 2))))
+ Feld[x - 1][y - 1] = EL_ACID_SPLASH_LEFT;
+
+ if (IN_LEV_FIELD(x + 1, y - 1) && IS_FREE(x + 1, y - 1) &&
+ (!IN_LEV_FIELD(x + 1, y - 2) ||
+ !CAN_FALL(MovingOrBlocked2Element(x + 1, y - 2))))
+ Feld[x + 1][y - 1] = EL_ACID_SPLASH_RIGHT;
+
+ PlayLevelSound(x, y, SND_ACID_SPLASHING);
+#else
+ /* input: position of element entering acid (obsolete) */
+
+ int element = Feld[x][y];
+
+ if (!IN_LEV_FIELD(x, y + 1) || Feld[x][y + 1] != EL_ACID)
+ return;
+
+ if (element != EL_ACID_SPLASH_LEFT &&
+ element != EL_ACID_SPLASH_RIGHT)
+ {
+ PlayLevelSound(x, y, SND_ACID_SPLASHING);
+
+ if (IN_LEV_FIELD(x - 1, y) && IS_FREE(x - 1, y) &&
+ (!IN_LEV_FIELD(x - 1, y - 1) ||
+ !CAN_FALL(MovingOrBlocked2Element(x - 1, y - 1))))
+ Feld[x - 1][y] = EL_ACID_SPLASH_LEFT;
+
+ if (IN_LEV_FIELD(x + 1, y) && IS_FREE(x + 1, y) &&
+ (!IN_LEV_FIELD(x + 1, y - 1) ||
+ !CAN_FALL(MovingOrBlocked2Element(x + 1, y - 1))))
+ Feld[x + 1][y] = EL_ACID_SPLASH_RIGHT;
+ }
+#endif
+}
+
+static void InitBeltMovement()
+{
+ static int belt_base_element[4] =
+ {
+ EL_CONVEYOR_BELT_1_LEFT,
+ EL_CONVEYOR_BELT_2_LEFT,
+ EL_CONVEYOR_BELT_3_LEFT,
+ EL_CONVEYOR_BELT_4_LEFT
+ };
+ static int belt_base_active_element[4] =
+ {
+ EL_CONVEYOR_BELT_1_LEFT_ACTIVE,
+ EL_CONVEYOR_BELT_2_LEFT_ACTIVE,
+ EL_CONVEYOR_BELT_3_LEFT_ACTIVE,
+ EL_CONVEYOR_BELT_4_LEFT_ACTIVE
+ };
+
+ int x, y, i, j;
+
+ /* set frame order for belt animation graphic according to belt direction */
+ for (i = 0; i < NUM_BELTS; i++)
+ {
+ int belt_nr = i;
+
+ for (j = 0; j < NUM_BELT_PARTS; j++)
+ {
+ int element = belt_base_active_element[belt_nr] + j;
+ int graphic = el2img(element);
+
+ if (game.belt_dir[i] == MV_LEFT)
+ graphic_info[graphic].anim_mode &= ~ANIM_REVERSE;
+ else
+ graphic_info[graphic].anim_mode |= ANIM_REVERSE;
+ }
+ }
+
+ for (y = 0; y < lev_fieldy; y++)
+ {
+ for (x = 0; x < lev_fieldx; x++)
+ {
+ int element = Feld[x][y];
+
+ for (i = 0; i < NUM_BELTS; i++)
+ {
+ if (IS_BELT(element) && game.belt_dir[i] != MV_NO_MOVING)
+ {
+ int e_belt_nr = getBeltNrFromBeltElement(element);
+ int belt_nr = i;
+
+ if (e_belt_nr == belt_nr)
+ {
+ int belt_part = Feld[x][y] - belt_base_element[belt_nr];