ScrollStepSize = 0; // will be correctly initialized by ScrollScreen()
- AllPlayersGone = FALSE;
+ game.all_players_gone = FALSE;
game.LevelSolved = FALSE;
game.GameOver = FALSE;
if (ExitX >= 0 && ExitY >= 0) // local player has left the level
{
// close exit door after last player
- if ((AllPlayersGone &&
+ if ((game.all_players_gone &&
(Feld[ExitX][ExitY] == EL_EXIT_OPEN ||
Feld[ExitX][ExitY] == EL_SP_EXIT_OPEN ||
Feld[ExitX][ExitY] == EL_STEEL_EXIT_OPEN)) ||
{
int attr_x = -1, attr_y = -1;
- if (AllPlayersGone)
+ if (game.all_players_gone)
{
attr_x = ExitX;
attr_y = ExitY;
MovDir[x][y] = MV_NONE;
if (attr_x < x)
- MovDir[x][y] |= (AllPlayersGone ? MV_RIGHT : MV_LEFT);
+ MovDir[x][y] |= (game.all_players_gone ? MV_RIGHT : MV_LEFT);
else if (attr_x > x)
- MovDir[x][y] |= (AllPlayersGone ? MV_LEFT : MV_RIGHT);
+ MovDir[x][y] |= (game.all_players_gone ? MV_LEFT : MV_RIGHT);
if (attr_y < y)
- MovDir[x][y] |= (AllPlayersGone ? MV_DOWN : MV_UP);
+ MovDir[x][y] |= (game.all_players_gone ? MV_DOWN : MV_UP);
else if (attr_y > y)
- MovDir[x][y] |= (AllPlayersGone ? MV_UP : MV_DOWN);
+ MovDir[x][y] |= (game.all_players_gone ? MV_UP : MV_DOWN);
if (element == EL_ROBOT)
{
int newx, newy;
boolean move_away = (move_pattern == MV_AWAY_FROM_PLAYER);
- if (AllPlayersGone)
+ if (game.all_players_gone)
{
attr_x = ExitX;
attr_y = ExitY;
game.friends_still_needed--;
if (!game.friends_still_needed &&
- !game.GameOver && AllPlayersGone)
+ !game.GameOver &&
+ game.all_players_gone)
LevelSolved();
return;
return;
}
- if (AllPlayersGone) // do not re-open exit door closed after last player
+ // do not re-open exit door closed after last player
+ if (game.all_players_gone)
return;
Feld[x][y] = EL_EXIT_OPENING;
return;
}
- if (AllPlayersGone) // do not re-open exit door closed after last player
+ // do not re-open exit door closed after last player
+ if (game.all_players_gone)
return;
Feld[x][y] = EL_EM_EXIT_OPENING;
return;
}
- if (AllPlayersGone) // do not re-open exit door closed after last player
+ // do not re-open exit door closed after last player
+ if (game.all_players_gone)
return;
Feld[x][y] = EL_STEEL_EXIT_OPENING;
return;
}
- if (AllPlayersGone) // do not re-open exit door closed after last player
+ // do not re-open exit door closed after last player
+ if (game.all_players_gone)
return;
Feld[x][y] = EL_EM_STEEL_EXIT_OPENING;
return;
}
- if (AllPlayersGone) // do not re-open exit door closed after last player
+ // do not re-open exit door closed after last player
+ if (game.all_players_gone)
return;
Feld[x][y] = EL_SP_EXIT_OPENING;
game_em.game_over = TRUE;
- AllPlayersGone = TRUE;
+ game.all_players_gone = TRUE;
}
if (game_em.game_over) // game lost
- AllPlayersGone = TRUE;
+ game.all_players_gone = TRUE;
}
else if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
{
game_sp.game_over = TRUE;
- AllPlayersGone = TRUE;
+ game.all_players_gone = TRUE;
}
if (game_sp.game_over) // game lost
- AllPlayersGone = TRUE;
+ game.all_players_gone = TRUE;
}
else if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
{
game_mm.game_over = TRUE;
- AllPlayersGone = TRUE;
+ game.all_players_gone = TRUE;
}
if (game_mm.game_over) // game lost
- AllPlayersGone = TRUE;
+ game.all_players_gone = TRUE;
}
}
KillPlayer(&stored_player[i]);
}
}
- else if (game.no_time_limit && !AllPlayersGone) // level w/o time limit
+ else if (game.no_time_limit && !game.all_players_gone)
{
game_panel_controls[GAME_PANEL_TIME].value = TimePlayed;
}
if (game.LevelSolved && !game.LevelSolved_GameEnd)
GameWon();
- if (AllPlayersGone && !TAPE_IS_STOPPED(tape))
+ if (game.all_players_gone && !TAPE_IS_STOPPED(tape))
TapeStop();
if (game_status != GAME_MODE_PLAYING) // status might have changed
for (i = 0; i < MAX_PLAYERS; i++)
KillPlayer(&stored_player[i]);
}
- else if (game.no_time_limit && !AllPlayersGone) // level w/o time limit
+ else if (game.no_time_limit && !game.all_players_gone)
{
game_panel_controls[GAME_PANEL_TIME].value = TimePlayed;
player->buried = TRUE;
- if (AllPlayersGone)
+ if (game.all_players_gone)
game.GameOver = TRUE;
}
if (!found)
{
- AllPlayersGone = TRUE;
+ game.all_players_gone = TRUE;
game.GameOver = TRUE;
}
void RequestQuitGame(boolean ask_if_really_quit)
{
boolean quick_quit = (!ask_if_really_quit || level_editor_test_game);
- boolean skip_request = AllPlayersGone || quick_quit;
+ boolean skip_request = game.all_players_gone || quick_quit;
RequestQuitGameExt(skip_request, quick_quit,
"Do you really want to quit the game?");
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(ScrollStepSize));
- SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(AllPlayersGone));
-
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(AmoebaCnt));
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(AmoebaCnt2));
// pause network game while waiting for request to answer
if (network.enabled &&
game_status == GAME_MODE_PLAYING &&
- !AllPlayersGone &&
+ !game.all_players_gone &&
req_state & REQUEST_WAIT_FOR_INPUT)
SendToServer_PausePlaying();
// continue network game after request
if (network.enabled &&
game_status == GAME_MODE_PLAYING &&
- !AllPlayersGone &&
+ !game.all_players_gone &&
req_state & REQUEST_WAIT_FOR_INPUT)
SendToServer_ContinuePlaying();
// pause network game while waiting for request to answer
if (network.enabled &&
game_status == GAME_MODE_PLAYING &&
- !AllPlayersGone &&
+ !game.all_players_gone &&
req_state & REQUEST_WAIT_FOR_INPUT)
SendToServer_PausePlaying();
// continue network game after request
if (network.enabled &&
game_status == GAME_MODE_PLAYING &&
- !AllPlayersGone &&
+ !game.all_players_gone &&
req_state & REQUEST_WAIT_FOR_INPUT)
SendToServer_ContinuePlaying();