static void IncrementSokobanFieldsNeeded(void)
{
if (level.sb_fields_needed)
- local_player->sokoban_fields_still_needed++;
+ game.sokoban_fields_still_needed++;
}
static void IncrementSokobanObjectsNeeded(void)
{
if (level.sb_objects_needed)
- local_player->sokoban_objects_still_needed++;
+ game.sokoban_objects_still_needed++;
}
static void DecrementSokobanFieldsNeeded(void)
{
- if (local_player->sokoban_fields_still_needed > 0)
- local_player->sokoban_fields_still_needed--;
+ if (game.sokoban_fields_still_needed > 0)
+ game.sokoban_fields_still_needed--;
}
static void DecrementSokobanObjectsNeeded(void)
{
- if (local_player->sokoban_objects_still_needed > 0)
- local_player->sokoban_objects_still_needed--;
+ if (game.sokoban_objects_still_needed > 0)
+ game.sokoban_objects_still_needed--;
}
static void InitPlayerField(int x, int y, int element, boolean init_game)
break;
case EL_LAMP:
- local_player->lights_still_needed++;
+ game.lights_still_needed++;
break;
case EL_PENGUIN:
- local_player->friends_still_needed++;
+ game.friends_still_needed++;
break;
case EL_PIG:
level.native_sp_level->game_sp->infotrons_still_needed :
level.game_engine_type == GAME_ENGINE_TYPE_MM ?
game_mm.kettles_still_needed :
- local_player->gems_still_needed);
+ game.gems_still_needed);
int exit_closed = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
level.native_em_level->lev->required > 0 :
level.game_engine_type == GAME_ENGINE_TYPE_SP ?
level.game_engine_type == GAME_ENGINE_TYPE_MM ?
game_mm.kettles_still_needed > 0 ||
game_mm.lights_still_needed > 0 :
- local_player->gems_still_needed > 0 ||
- local_player->sokoban_fields_still_needed > 0 ||
- local_player->sokoban_objects_still_needed > 0 ||
- local_player->lights_still_needed > 0);
+ game.gems_still_needed > 0 ||
+ game.sokoban_fields_still_needed > 0 ||
+ game.sokoban_objects_still_needed > 0 ||
+ game.lights_still_needed > 0);
int health = (game.LevelSolved ?
game.LevelSolved_CountingHealth :
level.game_engine_type == GAME_ENGINE_TYPE_MM ?
(local_player->dynabomb_xl ? EL_DYNABOMB_INCREASE_POWER : EL_EMPTY);
game_panel_controls[GAME_PANEL_PENGUINS].value =
- local_player->friends_still_needed;
+ game.friends_still_needed;
game_panel_controls[GAME_PANEL_SOKOBAN_OBJECTS].value =
- local_player->sokoban_objects_still_needed;
+ game.sokoban_objects_still_needed;
game_panel_controls[GAME_PANEL_SOKOBAN_FIELDS].value =
- local_player->sokoban_fields_still_needed;
+ game.sokoban_fields_still_needed;
game_panel_controls[GAME_PANEL_ROBOT_WHEEL].value =
(game.robot_wheel_active ? EL_ROBOT_WHEEL_ACTIVE : EL_ROBOT_WHEEL);
player->health = MAX_HEALTH;
player->health_final = MAX_HEALTH;
- player->gems_still_needed = level.gems_needed;
- player->sokoban_fields_still_needed = 0;
- player->sokoban_objects_still_needed = 0;
- player->lights_still_needed = 0;
- player->players_still_needed = 0;
- player->friends_still_needed = 0;
-
for (j = 0; j < MAX_NUM_KEYS; j++)
player->key[j] = FALSE;
game.switchgate_pos = 0;
game.wind_direction = level.wind_direction_initial;
+ game.gems_still_needed = level.gems_needed;
+ game.sokoban_fields_still_needed = 0;
+ game.sokoban_objects_still_needed = 0;
+ game.lights_still_needed = 0;
+ game.players_still_needed = 0;
+ game.friends_still_needed = 0;
+
game.lenses_time_left = 0;
game.magnify_time_left = 0;
for (i = 0; i < MAX_PLAYERS; i++)
if (stored_player[i].active)
- local_player->players_still_needed++;
+ game.players_still_needed++;
if (level.solved_by_one_player)
- local_player->players_still_needed = 1;
+ game.players_still_needed = 1;
// when recording the game, store which players take part in the game
if (tape.recording)
static void LevelSolved(void)
{
if (level.game_engine_type == GAME_ENGINE_TYPE_RND &&
- local_player->players_still_needed > 0)
+ game.players_still_needed > 0)
return;
game.LevelSolved = TRUE;
if (IN_SCR_FIELD(SCREENX(newx), SCREENY(newy)))
DrawGraphicThruMask(SCREENX(newx),SCREENY(newy), el2img(element), 0);
- local_player->friends_still_needed--;
- if (!local_player->friends_still_needed &&
+ game.friends_still_needed--;
+ if (!game.friends_still_needed &&
!local_player->GameOver && AllPlayersGone)
LevelSolved();
static void CheckExit(int x, int y)
{
- if (local_player->gems_still_needed > 0 ||
- local_player->sokoban_fields_still_needed > 0 ||
- local_player->sokoban_objects_still_needed > 0 ||
- local_player->lights_still_needed > 0)
+ if (game.gems_still_needed > 0 ||
+ game.sokoban_fields_still_needed > 0 ||
+ game.sokoban_objects_still_needed > 0 ||
+ game.lights_still_needed > 0)
{
int element = Feld[x][y];
int graphic = el2img(element);
static void CheckExitEM(int x, int y)
{
- if (local_player->gems_still_needed > 0 ||
- local_player->sokoban_fields_still_needed > 0 ||
- local_player->sokoban_objects_still_needed > 0 ||
- local_player->lights_still_needed > 0)
+ if (game.gems_still_needed > 0 ||
+ game.sokoban_fields_still_needed > 0 ||
+ game.sokoban_objects_still_needed > 0 ||
+ game.lights_still_needed > 0)
{
int element = Feld[x][y];
int graphic = el2img(element);
static void CheckExitSteel(int x, int y)
{
- if (local_player->gems_still_needed > 0 ||
- local_player->sokoban_fields_still_needed > 0 ||
- local_player->sokoban_objects_still_needed > 0 ||
- local_player->lights_still_needed > 0)
+ if (game.gems_still_needed > 0 ||
+ game.sokoban_fields_still_needed > 0 ||
+ game.sokoban_objects_still_needed > 0 ||
+ game.lights_still_needed > 0)
{
int element = Feld[x][y];
int graphic = el2img(element);
static void CheckExitSteelEM(int x, int y)
{
- if (local_player->gems_still_needed > 0 ||
- local_player->sokoban_fields_still_needed > 0 ||
- local_player->sokoban_objects_still_needed > 0 ||
- local_player->lights_still_needed > 0)
+ if (game.gems_still_needed > 0 ||
+ game.sokoban_fields_still_needed > 0 ||
+ game.sokoban_objects_still_needed > 0 ||
+ game.lights_still_needed > 0)
{
int element = Feld[x][y];
int graphic = el2img(element);
static void CheckExitSP(int x, int y)
{
- if (local_player->gems_still_needed > 0)
+ if (game.gems_still_needed > 0)
{
int element = Feld[x][y];
int graphic = el2img(element);
action_arg == CA_ARG_NUMBER_CE_SCORE ? ei->collect_score :
action_arg == CA_ARG_NUMBER_CE_DELAY ? GET_CE_DELAY_VALUE(change) :
action_arg == CA_ARG_NUMBER_LEVEL_TIME ? level_time_value :
- action_arg == CA_ARG_NUMBER_LEVEL_GEMS ? local_player->gems_still_needed :
+ action_arg == CA_ARG_NUMBER_LEVEL_GEMS ? game.gems_still_needed :
action_arg == CA_ARG_NUMBER_LEVEL_SCORE ? local_player->score :
action_arg == CA_ARG_ELEMENT_CV_TARGET ? GET_NEW_CE_VALUE(target_element):
action_arg == CA_ARG_ELEMENT_CV_TRIGGER ? change->actual_trigger_ce_value:
-1);
int action_arg_number_old =
- (action_type == CA_SET_LEVEL_GEMS ? local_player->gems_still_needed :
+ (action_type == CA_SET_LEVEL_GEMS ? game.gems_still_needed :
action_type == CA_SET_LEVEL_TIME ? TimeLeft :
action_type == CA_SET_LEVEL_SCORE ? local_player->score :
action_type == CA_SET_CE_VALUE ? CustomValue[x][y] :
case CA_SET_LEVEL_GEMS:
{
- local_player->gems_still_needed = action_arg_number_new;
+ game.gems_still_needed = action_arg_number_new;
game.snapshot.collected_item = TRUE;
- game_panel_controls[GAME_PANEL_GEMS].value =
- local_player->gems_still_needed;
+ game_panel_controls[GAME_PANEL_GEMS].value = game.gems_still_needed;
DisplayGameControlValues();
{
ExitPlayer(player);
- if ((local_player->friends_still_needed == 0 ||
+ if ((game.friends_still_needed == 0 ||
IS_SP_ELEMENT(Feld[jx][jy])) &&
AllPlayersGone)
LevelSolved();
DrawPlayer(player); // needed here only to cleanup last field
RemovePlayer(player);
- if (local_player->players_still_needed > 0)
- local_player->players_still_needed--;
+ if (game.players_still_needed > 0)
+ game.players_still_needed--;
// also set if some players not yet gone, but not needed to solve level
- if (local_player->players_still_needed == 0)
+ if (game.players_still_needed == 0)
AllPlayersGone = TRUE;
}
}
else if (collect_count > 0)
{
- local_player->gems_still_needed -= collect_count;
- if (local_player->gems_still_needed < 0)
- local_player->gems_still_needed = 0;
+ game.gems_still_needed -= collect_count;
+ if (game.gems_still_needed < 0)
+ game.gems_still_needed = 0;
game.snapshot.collected_item = TRUE;
- game_panel_controls[GAME_PANEL_GEMS].value = local_player->gems_still_needed;
+ game_panel_controls[GAME_PANEL_GEMS].value = game.gems_still_needed;
DisplayGameControlValues();
}
ACTION_FILLING);
if (sokoban_task_solved &&
- local_player->sokoban_fields_still_needed == 0 &&
- local_player->sokoban_objects_still_needed == 0 &&
+ game.sokoban_fields_still_needed == 0 &&
+ game.sokoban_objects_still_needed == 0 &&
(game.emulation == EMU_SOKOBAN || level.auto_exit_sokoban))
{
- local_player->players_still_needed = 0;
+ game.players_still_needed = 0;
LevelSolved();
else if (element == EL_LAMP)
{
Feld[x][y] = EL_LAMP_ACTIVE;
- local_player->lights_still_needed--;
+ game.lights_still_needed--;
ResetGfxAnimation(x, y);
TEST_DrawLevelField(x, y);