TYPE_INTEGER,
&setup.default_game_engine_type, "default_game_engine_type"
},
+ {
+ TYPE_SWITCH,
+ &setup.bd_multiple_lives, "bd_multiple_lives"
+ },
{
TYPE_SWITCH,
&setup.bd_skip_uncovering, "bd_skip_uncovering"
si->game_speed_extended = FALSE;
si->game_frame_delay = GAME_FRAME_DELAY;
si->default_game_engine_type = GAME_ENGINE_TYPE_RND;
+ si->bd_multiple_lives = FALSE;
si->bd_skip_uncovering = FALSE;
si->bd_skip_hatching = FALSE;
si->bd_scroll_delay = TRUE;
int score = (game.LevelSolved ?
game.LevelSolved_CountingScore :
level.game_engine_type == GAME_ENGINE_TYPE_BD ?
- game_bd.score :
+ game_bd.global_score :
level.game_engine_type == GAME_ENGINE_TYPE_EM ?
game_em.lev->score :
level.game_engine_type == GAME_ENGINE_TYPE_SP ?
if (!game.restart_level)
CloseDoor(DOOR_CLOSE_1);
+ if (level.game_engine_type == GAME_ENGINE_TYPE_BD)
+ {
+ if (setup.bd_multiple_lives && game_status == GAME_MODE_MAIN)
+ {
+ // new BD game with multiple lives started, so set initial number of lives and global score
+ game_bd.global_lives = level.native_bd_level->caveset->initial_lives;
+ game_bd.global_score = 0;
+ }
+ else if (!setup.bd_multiple_lives)
+ {
+ // new BD game with normal, single life started (resetting global score is important here)
+ game_bd.global_lives = 0;
+ game_bd.global_score = 0;
+ }
+ }
+
if (restarting)
{
// force fading out global animations displayed during game play
time = time_final;
score = score_final;
+ if (level.game_engine_type == GAME_ENGINE_TYPE_BD && setup.bd_multiple_lives)
+ score = game_bd.global_score;
+
LevelSolved_DisplayFinalGameValues(time, score, health);
}
{
boolean restart_game = FALSE;
- if (setup.ask_on_game_over)
+ if (level.game_engine_type == GAME_ENGINE_TYPE_BD && setup.bd_multiple_lives &&
+ game_bd.global_lives > 0)
+ {
+ // do not restart intermission after game over (but continue with next level)
+ if (!level.bd_intermission)
+ {
+ // only decrement number of lives for normal levels, not for intermissions
+ game_bd.global_lives--;
+
+ // do not handle game end if game over and playing with remaining multiple lives
+ if (game_bd.global_lives > 0)
+ restart_game = TRUE;
+ }
+ }
+ else if (setup.ask_on_game_over)
{
// do not handle game end if game over and automatically asking for game restart
// (this is a special case: player pressed "return" key or fire button shortly before
if (!setup.ask_on_game_over)
return FALSE;
+ // do not ask to play again if playing BD game with multiple lifes
+ if (level.game_engine_type == GAME_ENGINE_TYPE_BD && setup.bd_multiple_lives &&
+ game_bd.global_lives > 0)
+ return FALSE;
+
game.RestartGameRequested = TRUE;
RequestRestartGame();
// only add a life, if lives is > 0.
// lives == 0 is a test run or a snapshot, no bonus life then.
// also, obey max number of bonus lives.
+ game_bd.global_lives++;
game->player_lives++;
}
}
int i;
i = game->player_score / gd_caveset_data->bonus_life_score;
+ game_bd.global_score += increment;
game->player_score += increment;
game->cave_score += increment;
// needed for saving score time
int frames_played;
+
+ // global lives and score over more than one game
+ int global_lives;
+ int global_score;
};
struct LevelInfo_BD
game_bd.time_left = time_left;
game_bd.gems_still_needed = gems_still_needed;
- game_bd.score = game_bd.game->player_score;
+ game_bd.score = game_bd.game->player_score; // use cave score here
if (game.no_level_time_limit)
game_bd.time_left = getTimePlayed_BD();
{
// update time and score in panel while counting bonus time
game.LevelSolved_CountingTime = game_bd.time_left;
- game.LevelSolved_CountingScore = game_bd.score;
+ game.LevelSolved_CountingScore = game_bd.global_score; // use global score here
}
}
boolean game_speed_extended;
int game_frame_delay;
int default_game_engine_type;
+ boolean bd_multiple_lives;
boolean bd_skip_uncovering;
boolean bd_skip_hatching;
boolean bd_scroll_delay;
{ TYPE_ECS_AGA, &setup.prefer_aga_graphics, "Game Graphics Style:" },
{ TYPE_EMPTY, NULL, "" },
{ TYPE_HEADLINE, NULL, "Boulder Dash" },
+ { TYPE_SWITCH, &setup.bd_multiple_lives, "Play with multiple lives:" },
{ TYPE_SWITCH, &setup.bd_skip_uncovering, "Skip (un)covering screen:" },
{ TYPE_SWITCH, &setup.bd_skip_hatching, "Skip hatching player:" },
{ TYPE_SWITCH, &setup.bd_scroll_delay, "Scroll Delay:" },