EL_BETON,
EL_FELSBODEN,
- EL_SIEB2_LEER,
+ EL_SIEB2_INAKTIV,
EL_AUSGANG_ZU,
EL_AUSGANG_AUF,
EL_BETON,
EL_MAUERWERK,
EL_FELSBODEN,
- EL_SIEB_LEER,
+ EL_SIEB_INAKTIV,
EL_EDELSTEIN,
EL_DIAMANT,
{ EL_AMOEBE_NORM, &level.tempo_amoebe, TEXT_SPEED },
{ EL_AMOEBE_VOLL, &level.tempo_amoebe, TEXT_SPEED },
{ EL_AMOEBE_BD, &level.tempo_amoebe, TEXT_SPEED },
- { EL_SIEB_LEER, &level.dauer_sieb, TEXT_DURATION },
+ { EL_SIEB_INAKTIV, &level.dauer_sieb, TEXT_DURATION },
{ EL_ABLENK_AUS, &level.dauer_ablenk, TEXT_DURATION },
{ -1, NULL, NULL }
};
break;
#endif
+#if 1
+ case XK_m:
+ if (MoveSpeed == 8)
+ {
+ MoveSpeed = 4;
+ ScrollStepSize = TILEX/4;
+ }
+ else
+ {
+ MoveSpeed = 8;
+ ScrollStepSize = TILEX/8;
+ }
+ printf("MoveSpeed == %d\n", MoveSpeed);
+ break;
+#endif
+
case XK_f:
ScrollStepSize = TILEX/8;
printf("ScrollStepSize == %d (1/8)\n", ScrollStepSize);
ScreenMovPos = 0;
ScreenGfxPos = 0;
- AllPlayersGone = SiebAktiv = FALSE;
+ AllPlayersGone = FALSE;
+ SiebAktiv = FALSE;
+ SiebCount = 0;
for (i=0; i<MAX_NUM_AMOEBA; i++)
AmoebaCnt[i] = AmoebaCnt2[i] = 0;
if (!lastline && object_hit) /* check which object was hit */
{
if (CAN_CHANGE(element) &&
- (smashed == EL_SIEB_LEER || smashed == EL_SIEB2_LEER) && !SiebAktiv)
- SiebAktiv = level.dauer_sieb * FRAMES_PER_SECOND;
+ (smashed == EL_SIEB_INAKTIV || smashed == EL_SIEB2_INAKTIV))
+ {
+ int x, y;
+ int activated_magic_wall =
+ (smashed == EL_SIEB_INAKTIV ? EL_SIEB_LEER : EL_SIEB2_LEER);
+
+ /* activate magic wall / mill */
+
+ for (y=0; y<lev_fieldy; y++)
+ for (x=0; x<lev_fieldx; x++)
+ if (Feld[x][y] == smashed)
+ Feld[x][y] = activated_magic_wall;
+
+ SiebCount = level.dauer_sieb * FRAMES_PER_SECOND;
+ SiebAktiv = TRUE;
+ }
if (IS_PLAYER(x, y+1))
{
Store2[x][y] = 0;
}
}
- else if (SiebAktiv && CAN_CHANGE(element) &&
+ else if (CAN_CHANGE(element) &&
(Feld[x][y+1] == EL_SIEB_LEER || Feld[x][y+1] == EL_SIEB2_LEER))
{
InitMovingField(x, y, MV_DOWN);
void SiebAktivieren(int x, int y, int typ)
{
- if (!(SiebAktiv % 4) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y),
- (typ == 1 ? GFX_SIEB_VOLL :
- GFX_SIEB2_VOLL) + 3 - (SiebAktiv % 16) / 4);
+ int graphic = (typ == 1 ? GFX_SIEB_VOLL : GFX_SIEB2_VOLL) + 3;
+
+ DrawGraphicAnimation(x, y, graphic, 4, 4, ANIM_REVERSE);
}
void AusgangstuerPruefen(int x, int y)
if (SiebAktiv)
{
- if (!(SiebAktiv%4))
+ if (!(SiebCount % 4))
PlaySoundLevel(sieb_x, sieb_y, SND_MIEP);
- SiebAktiv--;
- if (!SiebAktiv)
+
+ if (SiebCount > 0)
{
- for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
+ SiebCount--;
+ if (!SiebCount)
{
- element = Feld[x][y];
- if (element == EL_SIEB_LEER || element == EL_SIEB_VOLL)
+ for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
{
- Feld[x][y] = EL_SIEB_TOT;
- DrawLevelField(x, y);
- }
- else if (element == EL_SIEB2_LEER || element == EL_SIEB2_VOLL)
- {
- Feld[x][y] = EL_SIEB2_TOT;
- DrawLevelField(x, y);
+ element = Feld[x][y];
+ if (element == EL_SIEB_LEER || element == EL_SIEB_VOLL)
+ {
+ Feld[x][y] = EL_SIEB_TOT;
+ DrawLevelField(x, y);
+ }
+ else if (element == EL_SIEB2_LEER || element == EL_SIEB2_VOLL)
+ {
+ Feld[x][y] = EL_SIEB2_TOT;
+ DrawLevelField(x, y);
+ }
}
+
+ SiebAktiv = FALSE;
}
}
}
- if (TimeLeft>0 && TimeFrames>=(1000/GameFrameDelay) && !tape.pausing)
+ if (TimeLeft > 0 && TimeFrames >= (1000 / GameFrameDelay) && !tape.pausing)
{
TimeFrames = 0;
TimeLeft--;
jy = player->jy = new_jy;
StorePlayer[jx][jy] = player->element_nr;
- player->MovPos = (dx > 0 || dy > 0 ? -1 : 1) * 7*TILEX/8;
+ player->MovPos = (dx > 0 || dy > 0 ? -1 : 1) * (TILEX - TILEX / MoveSpeed);
ScrollFigure(player, SCROLL_INIT);
/* should only happen if pre-1.2 tape recordings are played */
/* this is only for backward compatibility */
+ int old_move_speed = MoveSpeed;
+
#if DEBUG
printf("THIS SHOULD ONLY HAPPEN WITH PRE-1.2 LEVEL TAPES.\n");
#endif
+ /* scroll remaining steps with finest movement resolution */
+ MoveSpeed = 8;
+
while (player->MovPos)
{
ScrollFigure(player, SCROLL_GO_ON);
DrawAllPlayers();
BackToFront();
}
+
+ MoveSpeed = old_move_speed;
}
if (player->last_move_dir & (MV_LEFT | MV_RIGHT))
else if (!FrameReached(&player->actual_frame_counter, 1))
return;
- player->MovPos += (player->MovPos > 0 ? -1 : 1) * TILEX/8;
+ player->MovPos += (player->MovPos > 0 ? -1 : 1) * TILEX / MoveSpeed;
player->GfxPos = ScrollStepSize * (player->MovPos / ScrollStepSize);
if (Feld[last_jx][last_jy] == EL_PLAYER_IS_LEAVING)
if (ScreenMovPos)
{
- ScreenMovPos += (ScreenMovPos > 0 ? -1 : 1) * TILEX/8;
+ ScreenMovPos += (ScreenMovPos > 0 ? -1 : 1) * TILEX / MoveSpeed;
ScreenGfxPos = ScrollStepSize * (ScreenMovPos / ScrollStepSize);
redraw_mask |= REDRAW_FIELD;
}
EL_AMOEBE_BD,
EL_MORAST_VOLL,
EL_MORAST_LEER,
- EL_SIEB_VOLL,
+ EL_SIEB_INAKTIV,
EL_SIEB_LEER,
+ EL_SIEB_VOLL,
EL_SIEB_TOT,
- EL_SIEB2_VOLL,
+ EL_SIEB2_INAKTIV,
EL_SIEB2_LEER,
+ EL_SIEB2_VOLL,
EL_SIEB2_TOT,
EL_LIFE,
EL_LIFE_ASYNC,
EL_FELSBODEN,
EL_FELSBROCKEN,
EL_EDELSTEIN_BD,
- EL_SIEB2_LEER,
+ EL_SIEB2_INAKTIV,
EL_AUSGANG_ZU,
EL_AUSGANG_AUF,
EL_BETON,
EL_BADEWANNE3,
EL_BADEWANNE4,
EL_BADEWANNE5,
+ EL_SIEB_INAKTIV,
EL_SIEB_TOT,
+ EL_SIEB2_INAKTIV,
EL_SIEB2_TOT,
EL_AMOEBA2DIAM,
EL_BLOCKED,
int ZX,ZY, ExitX,ExitY;
int AllPlayersGone;
int FrameCounter, TimeFrames, TimeLeft;
-int MampferMax, MampferNr, SiebAktiv;
+int MampferMax, MampferNr;
+boolean SiebAktiv;
+int SiebCount;
boolean network_player_action_received = FALSE;
extern int ZX,ZY, ExitX,ExitY;
extern int AllPlayersGone;
extern int FrameCounter, TimeFrames, TimeLeft;
-extern int MampferMax, MampferNr, SiebAktiv;
+extern int MampferMax, MampferNr;
+extern boolean SiebAktiv;
+extern int SiebCount;
extern boolean network_player_action_received;
#define EL_MORAST_VOLL 17
#define EL_TROPFEN 18
#define EL_BOMBE 19
-#define EL_SIEB_LEER 20
-#define EL_SIEB_VOLL 21
+#define EL_SIEB_INAKTIV 20
+
+#define EL_UNUSED_21 21
+
#define EL_SALZSAEURE 22
#define EL_AMOEBE_NASS 23
#define EL_AMOEBE_NORM 24
#define EL_ERZ_EDEL_BD 58
#define EL_ERZ_EDEL_GELB 59
#define EL_MAMPFER2 60
-#define EL_SIEB2_LEER 61
-#define EL_SIEB2_VOLL 62
+#define EL_SIEB2_INAKTIV 61
+
+#define EL_UNUSED_62 62
+
#define EL_DYNABOMB 63
#define EL_DYNABOMB_NR 64
#define EL_DYNABOMB_SZ 65
#define EL_BADEWANNE3 102
#define EL_BADEWANNE4 103
#define EL_BADEWANNE5 104
-#define EL_SIEB_TOT 105
-#define EL_AUSGANG_ACT 106
+
+#define EL_UNUSED_105 105
+#define EL_UNUSED_106 106
+
#define EL_AUSGANG_AUF 107
-#define EL_SIEB2_TOT 108
+
+#define EL_UNUSED_108 108
+
#define EL_AMOEBA2DIAM 109
#define EL_MAULWURF 110
#define EL_PINGUIN 111
#define EL_UNUSED_254 254
#define EL_UNUSED_255 255
-/* "unreal" runtime elements */
-#define EL_BLOCKED 300
-#define EL_EXPLODING 301
-#define EL_CRACKINGNUT 302
-#define EL_BLURB_LEFT 303
-#define EL_BLURB_RIGHT 304
-#define EL_AMOEBING 305
-#define EL_MAUERND 306
-#define EL_BURNING 307
-#define EL_PLAYER_IS_LEAVING 308
+/* "real" (and therefore drawable) runtime elements */
+#define EL_SIEB_LEER 300
+#define EL_SIEB2_LEER 301
+#define EL_SIEB_VOLL 302
+#define EL_SIEB2_VOLL 303
+#define EL_SIEB_TOT 304
+#define EL_SIEB2_TOT 305
+#define EL_AUSGANG_ACT 306
+
+/* "unreal" (and therefore not drawable) runtime elements */
+#define EL_BLOCKED 400
+#define EL_EXPLODING 401
+#define EL_CRACKINGNUT 402
+#define EL_BLURB_LEFT 403
+#define EL_BLURB_RIGHT 404
+#define EL_AMOEBING 405
+#define EL_MAUERND 406
+#define EL_BURNING 407
+#define EL_PLAYER_IS_LEAVING 408
/* game graphics:
** 0 - 209: graphics from "RocksScreen"
#define GFX_SOKOBAN_FELD_VOLL 123
#define GFX_GEBLUBBER 124
/* Zeile 8 (128) */
-#define GFX_SIEB_LEER 128
-#define GFX_SIEB_VOLL GFX_SIEB_LEER
-#define GFX_SIEB_TOT GFX_SIEB_LEER
+#define GFX_SIEB_INAKTIV 128
+#define GFX_SIEB_LEER GFX_SIEB_INAKTIV
+#define GFX_SIEB_VOLL GFX_SIEB_INAKTIV
+#define GFX_SIEB_TOT GFX_SIEB_INAKTIV
#define GFX_ERZ_EDEL 132
#define GFX_ERZ_DIAM 133
#define GFX_ERZ_EDEL_ROT 134
#define GFX_MAUER_L1 GFX_MAUER_LEFT
#define GFX_MAUER_L 170
#define GFX_MAUER_LEBT 171
-#define GFX_SIEB2_LEER 172
-#define GFX_SIEB2_VOLL GFX_SIEB2_LEER
-#define GFX_SIEB2_TOT GFX_SIEB2_LEER
+#define GFX_SIEB2_INAKTIV 172
+#define GFX_SIEB2_LEER GFX_SIEB2_INAKTIV
+#define GFX_SIEB2_VOLL GFX_SIEB2_INAKTIV
+#define GFX_SIEB2_TOT GFX_SIEB2_INAKTIV
/* Zeile 11 (176) */
#define GFX_AUSGANG_ZU 176
#define GFX_AUSGANG_ACT 177
GFX_DIAMANT,1,10, HA_NEXT,
GFX_LIFE,1,100, HA_NEXT,
GFX_LIFE_ASYNC,1,100, HA_NEXT,
- GFX_SIEB_LEER,4,2, HA_NEXT,
- GFX_SIEB2_LEER,4,2, HA_NEXT,
+ GFX_SIEB_INAKTIV,4,2, HA_NEXT,
+ GFX_SIEB2_INAKTIV,4,2, HA_NEXT,
GFX_AUSGANG_ZU,1,100, GFX_AUSGANG_ACT,4,2,
GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2,
GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT,
}
if (setup.soft_scrolling ||
- ABS(ScreenGfxPos) + ScrollStepSize == TILEX ||
- ABS(ScreenGfxPos) == ScrollStepSize ||
+ ABS(ScreenMovPos) + ScrollStepSize == TILEX ||
+ ABS(ScreenMovPos) == ScrollStepSize ||
redraw_tiles > REDRAWTILES_THRESHOLD)
+ {
XCopyArea(display, buffer, window, gc, fx, fy, SXSIZE, SYSIZE, SX, SY);
+
+#ifdef DEBUG
+#if 0
+ printf("redrawing all (ScreenGfxPos == %d) because %s\n",
+ ScreenGfxPos,
+ (setup.soft_scrolling ?
+ "setup.soft_scrolling" :
+ ABS(ScreenGfxPos) + ScrollStepSize == TILEX ?
+ "ABS(ScreenGfxPos) + ScrollStepSize == TILEX" :
+ ABS(ScreenGfxPos) == ScrollStepSize ?
+ "ABS(ScreenGfxPos) == ScrollStepSize" :
+ "redraw_tiles > REDRAWTILES_THRESHOLD"));
+#endif
+#endif
+ }
}
redraw_mask &= ~REDRAW_MAIN;
}
if (element != EL_SP_INFOTRON)
graphic += phase * (element == EL_FELSBROCKEN ? 2 : 1);
}
- else if ((element == EL_SIEB_LEER || element == EL_SIEB2_LEER ||
- element == EL_SIEB_VOLL || element == EL_SIEB2_VOLL) && SiebAktiv)
+ else if (element == EL_SIEB_LEER || element == EL_SIEB2_LEER ||
+ element == EL_SIEB_VOLL || element == EL_SIEB2_VOLL)
{
- graphic += 3 - (SiebAktiv % 8) / 2;
+ graphic += 3 + getGraphicAnimationPhase(4, 4, ANIM_REVERSE);
}
else if (IS_AMOEBOID(element))
{
case EL_MORAST_VOLL: return GFX_MORAST_VOLL;
case EL_TROPFEN: return GFX_TROPFEN;
case EL_BOMBE: return GFX_BOMBE;
+ case EL_SIEB_INAKTIV: return GFX_SIEB_INAKTIV;
case EL_SIEB_LEER: return GFX_SIEB_LEER;
case EL_SIEB_VOLL: return GFX_SIEB_VOLL;
case EL_SIEB_TOT: return GFX_SIEB_TOT;
case EL_ERZ_EDEL_ROT: return GFX_ERZ_EDEL_ROT;
case EL_ERZ_EDEL_LILA: return GFX_ERZ_EDEL_LILA;
case EL_MAMPFER2: return GFX_MAMPFER2;
+ case EL_SIEB2_INAKTIV: return GFX_SIEB2_INAKTIV;
case EL_SIEB2_LEER: return GFX_SIEB2_LEER;
case EL_SIEB2_VOLL: return GFX_SIEB2_VOLL;
case EL_SIEB2_TOT: return GFX_SIEB2_TOT;