- tuer = MovDelay[x][y]/delay;
- if (!(MovDelay[x][y]%delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
-#if 0
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_AUSGANG_AUF-tuer);
-#else
- {
- int frame = getNewGraphicAnimationFrame(IMG_EXIT_OPENING,
- 29 - MovDelay[x][y]);
-
- DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_EXIT_OPENING, frame);
- }
-#endif
-
- if (!MovDelay[x][y])
- {
- Feld[x][y] = EL_EXIT_OPEN;
- DrawNewLevelField(x, y);
- }
- }
-}
-
-void AusgangstuerBlinken(int x, int y)
-{
-#if 0
- DrawGraphicAnimation(x, y, GFX_AUSGANG_AUF, 4, 4, ANIM_PINGPONG);
-#else
- DrawNewGraphicAnimation(x, y, IMG_EXIT_OPEN);
-#endif
-}
-
-void OpenSwitchgate(int x, int y)
-{
- int delay = 6;
-
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 5 * delay;
-
- if (MovDelay[x][y]) /* wait some time before next frame */
- {
- int phase;
-
- MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
-#if 0
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_SWITCHGATE_OPEN - phase);
-#else
- {
- int frame = getNewGraphicAnimationFrame(IMG_SWITCHGATE_OPENING,
- 29 - MovDelay[x][y]);
-
- DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_OPENING, frame);
- }
-#endif
-
- if (!MovDelay[x][y])
- {
- Feld[x][y] = EL_SWITCHGATE_OPEN;
- DrawNewLevelField(x, y);
- }
- }
-}
-
-void CloseSwitchgate(int x, int y)
-{
- int delay = 6;
-
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 5 * delay;
-
- if (MovDelay[x][y]) /* wait some time before next frame */
- {
- int phase;
-
- MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
-#if 0
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_SWITCHGATE_CLOSED + phase);
-#else
- {
- int frame = getNewGraphicAnimationFrame(IMG_SWITCHGATE_CLOSING,
- 29 - MovDelay[x][y]);
-
- DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_CLOSING, frame);
- }
-#endif
-
- if (!MovDelay[x][y])
- {
- Feld[x][y] = EL_SWITCHGATE_CLOSED;
- DrawNewLevelField(x, y);
- }
- }
-}
-
-void OpenTimegate(int x, int y)
-{
- int delay = 6;
-
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 5 * delay;
-
- if (MovDelay[x][y]) /* wait some time before next frame */
- {
- int phase;
-
- MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
-#if 0
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_TIMEGATE_OPEN - phase);
-#else
- {
- int frame = getNewGraphicAnimationFrame(IMG_TIMEGATE_OPENING,
- 29 - MovDelay[x][y]);
-
- DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_OPENING, frame);
- }
-#endif
-
- if (!MovDelay[x][y])
- {
- Feld[x][y] = EL_TIMEGATE_OPEN;
- DrawNewLevelField(x, y);
- }
- }
-}
-
-void CloseTimegate(int x, int y)
-{
- int delay = 6;
-
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 5 * delay;
-
- if (MovDelay[x][y]) /* wait some time before next frame */
- {
- int phase;
-
- MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
-#if 0
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_TIMEGATE_CLOSED + phase);
-#else
- {
- int frame = getNewGraphicAnimationFrame(IMG_TIMEGATE_CLOSING,
- 29 - MovDelay[x][y]);
-
- DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_CLOSING, frame);
- }
-#endif
-
- if (!MovDelay[x][y])
- {
- Feld[x][y] = EL_TIMEGATE_CLOSED;
- DrawNewLevelField(x, y);
- }
- }
-}
-
-static void CloseAllOpenTimegates()
-{
- int x, y;
-
- for (y=0; y<lev_fieldy; y++)
- {
- for (x=0; x<lev_fieldx; x++)
- {
- int element = Feld[x][y];
-
- if (element == EL_TIMEGATE_OPEN || element == EL_TIMEGATE_OPENING)
- {
- Feld[x][y] = EL_TIMEGATE_CLOSING;
- PlaySoundLevel(x, y, SND_TIMEGATE_CLOSING);
- }
- }
- }
-}
-
-void EdelsteinFunkeln(int x, int y)
-{
- if (!IN_SCR_FIELD(SCREENX(x), SCREENY(y)) || IS_MOVING(x, y))
- return;
-
- if (Feld[x][y] == EL_BD_DIAMOND)
-#if 0
- DrawGraphicAnimation(x, y, GFX_EDELSTEIN_BD, 4, 4, ANIM_REVERSE);
-#else
- DrawNewGraphicAnimation(x, y, IMG_BD_DIAMOND);
-#endif
- else
- {
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 11 * !SimpleRND(500);