player->MovDir = MV_NO_MOVING;
player->MovPos = 0;
- player->Pushing = FALSE;
- player->Switching = FALSE;
player->GfxPos = 0;
player->GfxDir = MV_NO_MOVING;
player->GfxAction = ACTION_DEFAULT;
player->Frame = 0;
player->StepFrame = 0;
- player->switch_x = -1;
- player->switch_y = -1;
-
player->use_murphy_graphic = FALSE;
- player->use_disk_red_graphic = FALSE;
player->actual_frame_counter = 0;
player->last_move_dir = MV_NO_MOVING;
- player->is_moving = FALSE;
player->is_waiting = FALSE;
+ player->is_moving = FALSE;
player->is_digging = FALSE;
+ player->is_snapping = FALSE;
player->is_collecting = FALSE;
+ player->is_pushing = FALSE;
+ player->is_switching = FALSE;
+
+ player->switch_x = -1;
+ player->switch_y = -1;
player->show_envelope = 0;
player->push_delay = 0;
player->push_delay_value = 5;
- player->snapped = FALSE;
-
player->last_jx = player->last_jy = 0;
player->jx = player->jy = 0;
ChangePage[x][y] = -1;
Store[x][y] = Store2[x][y] = StorePlayer[x][y] = Back[x][y] = 0;
AmoebaNr[x][y] = 0;
- JustStopped[x][y] = 0;
+ WasJustMoving[x][y] = 0;
+ WasJustFalling[x][y] = 0;
Stop[x][y] = FALSE;
Pushed[x][y] = FALSE;
int newx = x + dx;
int newy = y + dy;
- if (!JustStopped[x][y] || direction != MovDir[x][y])
+ if (!WasJustMoving[x][y] || direction != MovDir[x][y])
ResetGfxAnimation(x, y);
MovDir[newx][newy] = MovDir[x][y] = direction;
{
struct PlayerInfo *player = &stored_player[i];
- if (player->active && player->Pushing && player->MovPos)
+ if (player->active && player->is_pushing && player->MovPos)
{
int next_jx = player->jx + (player->jx - player->last_jx);
int next_jy = player->jy + (player->jy - player->last_jy);
#endif
}
#if 1
-
-#if 0
- /* TEST: bug where player gets not killed by falling rock ... */
- else if (CAN_SMASH(element) &&
- (Feld[x][y + 1] == EL_BLOCKED ||
- IS_PLAYER(x, y + 1)) &&
- JustStopped[x][y] && !Pushed[x][y + 1])
+ else if ((game.engine_version < RELEASE_IDENT(2,2,0,7) &&
+ CAN_SMASH(element) && WasJustMoving[x][y] && !Pushed[x][y + 1] &&
+ (Feld[x][y + 1] == EL_BLOCKED)) ||
+ (game.engine_version >= VERSION_IDENT(3,0,7) &&
+ CAN_SMASH(element) && WasJustFalling[x][y] &&
+ (Feld[x][y + 1] == EL_BLOCKED || IS_PLAYER(x, y + 1))))
#else
#if 1
else if (game.engine_version < RELEASE_IDENT(2,2,0,7) &&
CAN_SMASH(element) && Feld[x][y + 1] == EL_BLOCKED &&
- JustStopped[x][y] && !Pushed[x][y + 1])
+ WasJustMoving[x][y] && !Pushed[x][y + 1])
#else
else if (CAN_SMASH(element) && Feld[x][y + 1] == EL_BLOCKED &&
- JustStopped[x][y])
+ WasJustMoving[x][y])
#endif
#endif
{
- /* calling "Impact()" here is not only completely unneccessary
- (because it already gets called from "ContinueMoving()" in
- all relevant situations), but also completely bullshit, because
- "JustStopped" also indicates a finished *horizontal* movement;
- we must keep this trash for backwards compatibility with older
- tapes */
+ /* this is needed for a special case not covered by calling "Impact()"
+ from "ContinueMoving()": if an element moves to a tile directly below
+ another element which was just falling on that tile (which was empty
+ in the previous frame), the falling element above would just stop
+ instead of smashing the element below (in previous version, the above
+ element was just checked for "moving" instead of "falling", resulting
+ in incorrect smashes caused by horizontal movement of the above
+ element; also, the case of the player being the element to smash was
+ simply not covered here... :-/ ) */
Impact(x, y);
}
-#endif
else if (IS_FREE(x, y + 1) && element == EL_SPRING && use_spring_bug)
{
if (MovDir[x][y] == MV_NO_MOVING)
}
else if (IS_FREE(x, y + 1) || Feld[x][y + 1] == EL_DIAMOND_BREAKING)
{
- if (JustStopped[x][y]) /* prevent animation from being restarted */
+ if (WasJustFalling[x][y]) /* prevent animation from being restarted */
MovDir[x][y] = MV_DOWN;
InitMovingField(x, y, MV_DOWN);
else if (IS_SLIPPERY(Feld[x][y + 1]) && !Store[x][y + 1])
#else
else if (IS_SLIPPERY(Feld[x][y + 1]) && !Store[x][y + 1] &&
- !IS_FALLING(x, y + 1) && !JustStopped[x][y + 1] &&
+ !IS_FALLING(x, y + 1) && !WasJustMoving[x][y + 1] &&
element != EL_DX_SUPABOMB)
#endif
#else
else if (((IS_SLIPPERY(Feld[x][y + 1]) && !IS_PLAYER(x, y + 1)) ||
(IS_EM_SLIPPERY_WALL(Feld[x][y + 1]) && IS_GEM(element))) &&
- !IS_FALLING(x, y + 1) && !JustStopped[x][y + 1] &&
+ !IS_FALLING(x, y + 1) && !WasJustMoving[x][y + 1] &&
element != EL_DX_SUPABOMB && element != EL_SP_DISK_ORANGE)
#endif
{
*/
if (!CAN_MOVE(element) ||
- (CAN_FALL(element) && MovDir[newx][newy] == MV_DOWN))
+ (CAN_FALL(element) && direction == MV_DOWN))
MovDir[newx][newy] = 0;
+
#endif
#endif
/* prevent pushed element from moving on in pushed direction */
if (pushed && CAN_MOVE(element) &&
element_info[element].move_pattern & MV_ANY_DIRECTION &&
- !(element_info[element].move_pattern & MovDir[newx][newy]))
+ !(element_info[element].move_pattern & direction))
TurnRound(newx, newy);
if (!pushed) /* special case: moving object pushed by player */
- JustStopped[newx][newy] = 3;
+ {
+ WasJustMoving[newx][newy] = 3;
+
+ if (CAN_FALL(element) && direction == MV_DOWN)
+ WasJustFalling[newx][newy] = 3;
+ }
if (DONT_TOUCH(element)) /* object may be nasty to player or others */
{
int x = player->jx;
int y = player->jy;
- if (player->active && player->Pushing && player->is_moving &&
+ if (player->active && player->is_pushing && player->is_moving &&
IS_MOVING(x, y))
{
ContinueMoving(x, y);
#endif
Stop[x][y] = FALSE;
- if (JustStopped[x][y] > 0)
- JustStopped[x][y]--;
+ if (WasJustMoving[x][y] > 0)
+ WasJustMoving[x][y]--;
+ if (WasJustFalling[x][y] > 0)
+ WasJustFalling[x][y]--;
GfxFrame[x][y]++;
#if 1
InitPlayerGfxAnimation(player, ACTION_DEFAULT);
#else
- if (!(moved & MF_MOVING) && !player->Pushing)
+ if (!(moved & MF_MOVING) && !player->is_pushing)
player->Frame = 0;
#endif
#endif
player->last_move_dir = player->MovDir;
player->is_moving = TRUE;
#if 1
- player->snapped = FALSE;
+ player->is_snapping = FALSE;
#endif
#if 1
- player->Switching = FALSE;
+ player->is_switching = FALSE;
#endif
}
if (player->MovPos == 0) /* last pushing move finished */
- player->Pushing = FALSE;
+ player->is_pushing = FALSE;
if (mode == DF_NO_PUSH) /* player just stopped pushing */
{
- player->Switching = FALSE;
+ player->is_switching = FALSE;
player->push_delay = 0;
return MF_NO_ACTION;
switch (element)
{
-#if 0
- case EL_ROBOT_WHEEL:
- Feld[x][y] = EL_ROBOT_WHEEL_ACTIVE;
- ZX = x;
- ZY = y;
- DrawLevelField(x, y);
- PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVATING);
- return MF_ACTION;
- break;
-#endif
-
-#if 0
- case EL_SP_TERMINAL:
- {
- int xx, yy;
-
- PlaySoundLevel(x, y, SND_SP_TERMINAL_ACTIVATING);
-
- for (yy=0; yy<lev_fieldy; yy++)
- {
- for (xx=0; xx<lev_fieldx; xx++)
- {
- if (Feld[xx][yy] == EL_SP_DISK_YELLOW)
- Bang(xx, yy);
- else if (Feld[xx][yy] == EL_SP_TERMINAL)
- Feld[xx][yy] = EL_SP_TERMINAL_ACTIVE;
- }
- }
-
- return MF_ACTION;
- }
- break;
-#endif
-
-#if 0
- case EL_CONVEYOR_BELT_1_SWITCH_LEFT:
- case EL_CONVEYOR_BELT_1_SWITCH_MIDDLE:
- case EL_CONVEYOR_BELT_1_SWITCH_RIGHT:
- case EL_CONVEYOR_BELT_2_SWITCH_LEFT:
- case EL_CONVEYOR_BELT_2_SWITCH_MIDDLE:
- case EL_CONVEYOR_BELT_2_SWITCH_RIGHT:
- case EL_CONVEYOR_BELT_3_SWITCH_LEFT:
- case EL_CONVEYOR_BELT_3_SWITCH_MIDDLE:
- case EL_CONVEYOR_BELT_3_SWITCH_RIGHT:
- case EL_CONVEYOR_BELT_4_SWITCH_LEFT:
- case EL_CONVEYOR_BELT_4_SWITCH_MIDDLE:
- case EL_CONVEYOR_BELT_4_SWITCH_RIGHT:
-#if 1
- if (!PLAYER_SWITCHING(player, x, y))
-#else
- if (!player->Switching)
-#endif
- {
- player->Switching = TRUE;
- player->switch_x = x;
- player->switch_y = y;
-
- ToggleBeltSwitch(x, y);
- PlaySoundLevel(x, y, SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING);
- }
- return MF_ACTION;
- break;
-#endif
-
-#if 0
- case EL_SWITCHGATE_SWITCH_UP:
- case EL_SWITCHGATE_SWITCH_DOWN:
-#if 1
- if (!PLAYER_SWITCHING(player, x, y))
-#else
- if (!player->Switching)
-#endif
- {
- player->Switching = TRUE;
- player->switch_x = x;
- player->switch_y = y;
-
- ToggleSwitchgateSwitch(x, y);
- PlaySoundLevel(x, y, SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING);
- }
- return MF_ACTION;
- break;
-#endif
-
-#if 0
- case EL_LIGHT_SWITCH:
- case EL_LIGHT_SWITCH_ACTIVE:
-#if 1
- if (!PLAYER_SWITCHING(player, x, y))
-#else
- if (!player->Switching)
-#endif
- {
- player->Switching = TRUE;
- player->switch_x = x;
- player->switch_y = y;
-
- ToggleLightSwitch(x, y);
- PlaySoundLevel(x, y, element == EL_LIGHT_SWITCH ?
- SND_LIGHT_SWITCH_ACTIVATING :
- SND_LIGHT_SWITCH_DEACTIVATING);
- }
- return MF_ACTION;
- break;
-#endif
-
-#if 0
- case EL_TIMEGATE_SWITCH:
- ActivateTimegateSwitch(x, y);
- PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVATING);
-
- return MF_ACTION;
- break;
-#endif
-
-#if 0
- case EL_BALLOON_SWITCH_LEFT:
- case EL_BALLOON_SWITCH_RIGHT:
- case EL_BALLOON_SWITCH_UP:
- case EL_BALLOON_SWITCH_DOWN:
- case EL_BALLOON_SWITCH_ANY:
- if (element == EL_BALLOON_SWITCH_ANY)
- game.balloon_dir = move_direction;
- else
- game.balloon_dir = (element == EL_BALLOON_SWITCH_LEFT ? MV_LEFT :
- element == EL_BALLOON_SWITCH_RIGHT ? MV_RIGHT :
- element == EL_BALLOON_SWITCH_UP ? MV_UP :
- element == EL_BALLOON_SWITCH_DOWN ? MV_DOWN :
- MV_NO_MOVING);
- PlaySoundLevel(x, y, SND_CLASS_BALLOON_SWITCH_ACTIVATING);
-
- return MF_ACTION;
- break;
-#endif
-
case EL_SP_PORT_LEFT:
case EL_SP_PORT_RIGHT:
case EL_SP_PORT_UP:
}
break;
-#if 0
- case EL_LAMP:
- Feld[x][y] = EL_LAMP_ACTIVE;
- local_player->lights_still_needed--;
- DrawLevelField(x, y);
- PlaySoundLevel(x, y, SND_LAMP_ACTIVATING);
- return MF_ACTION;
- break;
-#endif
-
-#if 0
- case EL_TIME_ORB_FULL:
- Feld[x][y] = EL_TIME_ORB_EMPTY;
- TimeLeft += 10;
- DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FONT_TEXT_2);
- DrawLevelField(x, y);
- PlaySoundStereo(SND_TIME_ORB_FULL_COLLECTING, SOUND_MIDDLE);
- return MF_ACTION;
- break;
-#endif
-
default:
if (IS_WALKABLE(element))
if (player->inventory_size < MAX_INVENTORY_SIZE)
player->inventory_element[player->inventory_size++] = element;
- player->use_disk_red_graphic = (element == EL_SP_DISK_RED);
-
DrawText(DX_DYNAMITE, DY_DYNAMITE,
int2str(local_player->inventory_size, 3), FONT_TEXT_2);
}
if (element == EL_SPRING && MovDir[x][y] != MV_NO_MOVING)
return MF_NO_ACTION;
#endif
- if (!player->Pushing &&
+ if (!player->is_pushing &&
game.engine_version >= RELEASE_IDENT(2,2,0,7))
player->push_delay_value = GET_NEW_PUSH_DELAY(element);
- player->Pushing = TRUE;
+ player->is_pushing = TRUE;
if (!(IN_LEV_FIELD(nextx, nexty) &&
(IS_FREE(nextx, nexty) ||
if (game.engine_version < RELEASE_IDENT(2,2,0,7))
player->push_delay_value = GET_NEW_PUSH_DELAY(element);
-#if 1
CheckTriggeredElementSideChange(x, y, element, dig_side,
CE_OTHER_GETS_PUSHED);
CheckElementSideChange(x, y, element, dig_side,
CE_PUSHED_BY_PLAYER, -1);
-#else
- CheckTriggeredElementChange(x, y, element, CE_OTHER_GETS_PUSHED);
- CheckElementChange(x, y, element, CE_PUSHED_BY_PLAYER);
-#endif
break;
}
if (PLAYER_SWITCHING(player, x, y))
return MF_ACTION;
-#if 1
+ player->is_switching = TRUE;
+ player->switch_x = x;
+ player->switch_y = y;
+
PlaySoundLevelElementAction(x, y, element, ACTION_ACTIVATING);
-#endif
if (element == EL_ROBOT_WHEEL)
{
ZY = y;
DrawLevelField(x, y);
-
-#if 0
- PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVATING);
-#endif
}
else if (element == EL_SP_TERMINAL)
{
int xx, yy;
-#if 0
- PlaySoundLevel(x, y, SND_SP_TERMINAL_ACTIVATING);
-#endif
-
- for (yy=0; yy<lev_fieldy; yy++)
+ for (yy=0; yy < lev_fieldy; yy++) for (xx=0; xx < lev_fieldx; xx++)
{
- for (xx=0; xx<lev_fieldx; xx++)
- {
- if (Feld[xx][yy] == EL_SP_DISK_YELLOW)
- Bang(xx, yy);
- else if (Feld[xx][yy] == EL_SP_TERMINAL)
- Feld[xx][yy] = EL_SP_TERMINAL_ACTIVE;
- }
+ if (Feld[xx][yy] == EL_SP_DISK_YELLOW)
+ Bang(xx, yy);
+ else if (Feld[xx][yy] == EL_SP_TERMINAL)
+ Feld[xx][yy] = EL_SP_TERMINAL_ACTIVE;
}
}
else if (IS_BELT_SWITCH(element))
{
-#if 0
- if (!PLAYER_SWITCHING(player, x, y))
-#endif
- {
- player->Switching = TRUE;
- player->switch_x = x;
- player->switch_y = y;
-
- ToggleBeltSwitch(x, y);
-
-#if 0
- PlaySoundLevel(x, y, SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING);
-#endif
- }
+ ToggleBeltSwitch(x, y);
}
else if (element == EL_SWITCHGATE_SWITCH_UP ||
element == EL_SWITCHGATE_SWITCH_DOWN)
{
-#if 0
- if (!PLAYER_SWITCHING(player, x, y))
-#endif
- {
- player->Switching = TRUE;
- player->switch_x = x;
- player->switch_y = y;
-
- ToggleSwitchgateSwitch(x, y);
-
-#if 0
- PlaySoundLevel(x, y, SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING);
-#endif
- }
+ ToggleSwitchgateSwitch(x, y);
}
else if (element == EL_LIGHT_SWITCH ||
element == EL_LIGHT_SWITCH_ACTIVE)
{
-#if 0
- if (!PLAYER_SWITCHING(player, x, y))
-#endif
- {
- player->Switching = TRUE;
- player->switch_x = x;
- player->switch_y = y;
-
- ToggleLightSwitch(x, y);
+ ToggleLightSwitch(x, y);
#if 0
- PlaySoundLevel(x, y, element == EL_LIGHT_SWITCH ?
- SND_LIGHT_SWITCH_ACTIVATING :
- SND_LIGHT_SWITCH_DEACTIVATING);
+ PlaySoundLevel(x, y, element == EL_LIGHT_SWITCH ?
+ SND_LIGHT_SWITCH_ACTIVATING :
+ SND_LIGHT_SWITCH_DEACTIVATING);
#endif
- }
}
else if (element == EL_TIMEGATE_SWITCH)
{
ActivateTimegateSwitch(x, y);
-
-#if 0
- PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVATING);
-#endif
}
else if (element == EL_BALLOON_SWITCH_LEFT ||
element == EL_BALLOON_SWITCH_RIGHT ||
element == EL_BALLOON_SWITCH_UP ? MV_UP :
element == EL_BALLOON_SWITCH_DOWN ? MV_DOWN :
MV_NO_MOVING);
-
-#if 0
- PlaySoundLevel(x, y, SND_CLASS_BALLOON_SWITCH_ACTIVATING);
-#endif
}
else if (element == EL_LAMP)
{
local_player->lights_still_needed--;
DrawLevelField(x, y);
-
-#if 0
- PlaySoundLevel(x, y, SND_LAMP_ACTIVATING);
-#endif
}
else if (element == EL_TIME_ORB_FULL)
{
}
else
{
-#if 1
if (!PLAYER_SWITCHING(player, x, y))
-#else
- if (!player->Switching)
-#endif
{
- player->Switching = TRUE;
+ player->is_switching = TRUE;
player->switch_x = x;
player->switch_y = y;
if (!dx && !dy)
{
if (player->MovPos == 0)
- player->Pushing = FALSE;
+ player->is_pushing = FALSE;
- player->snapped = FALSE;
+ player->is_snapping = FALSE;
if (player->MovPos == 0)
{
+ player->is_moving = FALSE;
player->is_digging = FALSE;
player->is_collecting = FALSE;
-#if 1
- player->is_moving = FALSE;
-#endif
}
-#if 0
- printf("::: trying to snap...\n");
-#endif
-
return FALSE;
}
- if (player->snapped)
+ if (player->is_snapping)
return FALSE;
player->MovDir = snap_direction;
-#if 1
+ player->is_moving = FALSE;
player->is_digging = FALSE;
player->is_collecting = FALSE;
-#if 1
- player->is_moving = FALSE;
-#endif
-#endif
if (DigField(player, x, y, 0, 0, DF_SNAP) == MF_NO_ACTION)
return FALSE;
- player->snapped = TRUE;
-#if 1
+ player->is_snapping = TRUE;
+
+ player->is_moving = FALSE;
player->is_digging = FALSE;
player->is_collecting = FALSE;
-#if 1
- player->is_moving = FALSE;
-#endif
-#endif
DrawLevelField(x, y);
BackToFront();
{
int new_element = player->inventory_element[--player->inventory_size];
-#if 1
Feld[jx][jy] = (new_element == EL_DYNAMITE ? EL_DYNAMITE_ACTIVE :
new_element == EL_SP_DISK_RED ? EL_SP_DISK_RED_ACTIVE :
new_element);
-#else
- Feld[jx][jy] = (player->use_disk_red_graphic ? EL_SP_DISK_RED_ACTIVE :
- EL_DYNAMITE_ACTIVE);
-#endif
DrawText(DX_DYNAMITE, DY_DYNAMITE,
int2str(local_player->inventory_size, 3), FONT_TEXT_2);
void DrawPlayer(struct PlayerInfo *player)
{
+ int jx = player->jx;
+ int jy = player->jy;
+ int move_dir = player->MovDir;
#if 0
- int jx = player->jx, jy = player->jy;
- int last_jx = player->last_jx, last_jy = player->last_jy;
- int next_jx = jx + (jx - last_jx), next_jy = jy + (jy - last_jy);
- int sx = SCREENX(jx), sy = SCREENY(jy);
- int sxx = 0, syy = 0;
- int element = Feld[jx][jy], last_element = Feld[last_jx][last_jy];
- int graphic;
- int frame = 0;
+ int last_jx = player->last_jx;
+ int last_jy = player->last_jy;
+ int next_jx = jx + (jx - last_jx);
+ int next_jy = jy + (jy - last_jy);
boolean player_is_moving = (last_jx != jx || last_jy != jy ? TRUE : FALSE);
- int move_dir = player->MovDir;
- int action = ACTION_DEFAULT;
#else
- int jx = player->jx, jy = player->jy;
- int move_dir = player->MovDir;
int dx = (move_dir == MV_LEFT ? -1 : move_dir == MV_RIGHT ? +1 : 0);
int dy = (move_dir == MV_UP ? -1 : move_dir == MV_DOWN ? +1 : 0);
int last_jx = (player->is_moving ? jx - dx : jx);
int last_jy = (player->is_moving ? jy - dy : jy);
int next_jx = jx + dx;
int next_jy = jy + dy;
+ boolean player_is_moving = (player->MovPos ? TRUE : FALSE);
+#endif
int sx = SCREENX(jx), sy = SCREENY(jy);
int sxx = 0, syy = 0;
int element = Feld[jx][jy], last_element = Feld[last_jx][last_jy];
int graphic;
- int frame = 0;
- boolean player_is_moving = (player->MovPos ? TRUE : FALSE);
int action = ACTION_DEFAULT;
-#endif
+ int frame = 0;
if (!player->active || !IN_SCR_FIELD(SCREENX(last_jx), SCREENY(last_jy)))
return;
#if DEBUG
- if (!IN_LEV_FIELD(jx,jy))
+ if (!IN_LEV_FIELD(jx, jy))
{
printf("DrawPlayerField(): x = %d, y = %d\n",jx,jy);
printf("DrawPlayerField(): sx = %d, sy = %d\n",sx,sy);
if (element == EL_EXPLOSION)
return;
- action = (player->Pushing ? ACTION_PUSHING :
- player->is_digging ? ACTION_DIGGING :
+ action = (player->is_pushing ? ACTION_PUSHING :
+ player->is_digging ? ACTION_DIGGING :
player->is_collecting ? ACTION_COLLECTING :
- player->is_moving ? ACTION_MOVING :
- player->snapped ? ACTION_SNAPPING : ACTION_DEFAULT);
+ player->is_moving ? ACTION_MOVING :
+ player->is_snapping ? ACTION_SNAPPING : ACTION_DEFAULT);
#if 0
printf("::: '%s'\n", element_action_info[action].suffix);
else
DrawLevelField(last_jx, last_jy);
- if (player->Pushing && IN_SCR_FIELD(SCREENX(next_jx), SCREENY(next_jy)))
- {
-#if 1
-#if 1
+ if (player->is_pushing && IN_SCR_FIELD(SCREENX(next_jx), SCREENY(next_jy)))
DrawLevelElement(next_jx, next_jy, EL_EMPTY);
-#else
- if (player->GfxPos)
- {
- if (Feld[next_jx][next_jy] == EL_SOKOBAN_FIELD_FULL)
- DrawLevelElement(next_jx, next_jy, EL_SOKOBAN_FIELD_EMPTY);
- else
- DrawLevelElement(next_jx, next_jy, EL_EMPTY);
- }
- else
- DrawLevelField(next_jx, next_jy);
-#endif
-#endif
- }
}
if (!IN_SCR_FIELD(sx, sy))
{
if (player_is_moving && GfxElement[jx][jy] != EL_UNDEFINED)
{
-#if 1
if (GFX_CRUMBLED(GfxElement[jx][jy]))
DrawLevelFieldCrumbledSandDigging(jx, jy, move_dir, player->StepFrame);
-#else
- if (GfxElement[jx][jy] == EL_SAND)
- DrawLevelFieldCrumbledSandDigging(jx, jy, move_dir, player->StepFrame);
-#endif
else
{
int old_element = GfxElement[jx][jy];
if (player->use_murphy_graphic)
{
static int last_horizontal_dir = MV_LEFT;
- int direction;
if (move_dir == MV_LEFT || move_dir == MV_RIGHT)
last_horizontal_dir = move_dir;
- direction = (player->snapped ? move_dir : last_horizontal_dir);
+ graphic = el_act_dir2img(EL_SP_MURPHY, player->GfxAction, move_dir);
- graphic = el_act_dir2img(EL_SP_MURPHY, player->GfxAction, direction);
+ if (graphic == IMG_SP_MURPHY) /* undefined => use special graphic */
+ {
+ int direction = (player->is_snapping ? move_dir : last_horizontal_dir);
+
+ graphic = el_act_dir2img(EL_SP_MURPHY, player->GfxAction, direction);
+ }
}
else
graphic = el_act_dir2img(player->element_nr, player->GfxAction, move_dir);
#if 0
printf("::: %d, %d [%d, %d] [%d]\n",
- player->Pushing, player_is_moving, player->GfxAction,
+ player->is_pushing, player_is_moving, player->GfxAction,
player->is_moving, player_is_moving);
#endif
#if 1
- if (player->Pushing && player->is_moving)
+ if (player->is_pushing && player->is_moving)
#else
- if (player->Pushing && player_is_moving)
+ if (player->is_pushing && player_is_moving)
#endif
{
int px = SCREENX(next_jx), py = SCREENY(next_jy);
if (Back[next_jx][next_jy])
DrawLevelElement(next_jx, next_jy, Back[next_jx][next_jy]);
-#if 1
if ((sxx || syy) && element == EL_SOKOBAN_OBJECT)
DrawGraphicShiftedThruMask(px, py, sxx, syy, IMG_SOKOBAN_OBJECT, 0,
NO_CUTTING);
-#else
- if ((sxx || syy) &&
- (element == EL_SOKOBAN_FIELD_EMPTY ||
- Feld[next_jx][next_jy] == EL_SOKOBAN_FIELD_FULL))
- DrawGraphicShiftedThruMask(px, py, sxx, syy, IMG_SOKOBAN_OBJECT, 0,
- NO_CUTTING);
-#endif
else
{
-#if 1
int element = MovingOrBlocked2Element(next_jx, next_jy);
-#else
-#if 1
- int element = Feld[jx][jy];
-#else
- int element = Feld[next_jx][next_jy];
-#endif
-#endif
-
-#if 1
- int graphic = el2img(element);
- int frame = 0;
-
-#if 0
- if ((sxx || syy) && IS_PUSHABLE(element))
-#endif
- {
- graphic = el_act_dir2img(element, ACTION_PUSHING, move_dir);
- frame = getGraphicAnimationFrame(graphic, player->Frame);
- }
-
-#if 0
- printf("::: pushing %d: %d ...\n", sxx, frame);
-#endif
+ int graphic = el_act_dir2img(element, ACTION_PUSHING, move_dir);
+ int frame = getGraphicAnimationFrame(graphic, player->Frame);
DrawGraphicShifted(px, py, sxx, syy, graphic, frame,
NO_CUTTING, NO_MASKING);
-#endif
}
}
if (player_is_moving && last_element == EL_EXPLOSION)
{
-#if 1
int graphic = el_act2img(GfxElement[last_jx][last_jy], ACTION_EXPLODING);
-#else
- int stored = Store[last_jx][last_jy];
- int graphic = (game.emulation != EMU_SUPAPLEX ? IMG_EXPLOSION :
- stored == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON :
- IMG_SP_EXPLOSION);
-#endif
int delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2);
int phase = ExplodePhase[last_jx][last_jy] - 1;
int frame = getGraphicAnimationFrame(graphic, phase - delay);