void GameWon()
{
+ static int time_count_steps;
static int time, time_final;
static int score, score_final;
static int health, health_final;
TapeStop();
- game_over_delay_1 = game_over_delay_value_1;
+ game_over_delay_1 = 0;
game_over_delay_2 = 0;
game_over_delay_3 = game_over_delay_value_3;
score = score_final = local_player->score_final;
health = health_final = local_player->health_final;
- if (TimeLeft > 0)
+ if (level.score[SC_TIME_BONUS] > 0)
{
- time_final = 0;
- score_final += TimeLeft * level.score[SC_TIME_BONUS];
- }
- else if (game.no_time_limit && TimePlayed < 999)
- {
- time_final = 999;
- score_final += (999 - TimePlayed) * level.score[SC_TIME_BONUS];
- }
+ if (TimeLeft > 0)
+ {
+ time_final = 0;
+ score_final += TimeLeft * level.score[SC_TIME_BONUS];
+ }
+ else if (game.no_time_limit && TimePlayed < 999)
+ {
+ time_final = 999;
+ score_final += (999 - TimePlayed) * level.score[SC_TIME_BONUS];
+ }
- if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
- {
- health_final = 0;
- score_final += health * level.score[SC_TIME_BONUS];
+ time_count_steps = MAX(1, ABS(time_final - time) / 100);
- game_over_delay_2 = game_over_delay_value_2;
- }
+ game_over_delay_1 = game_over_delay_value_1;
+
+ if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
+ {
+ health_final = 0;
+ score_final += health * level.score[SC_TIME_BONUS];
- local_player->score_final = score_final;
- local_player->health_final = health_final;
+ game_over_delay_2 = game_over_delay_value_2;
+ }
+
+ local_player->score_final = score_final;
+ local_player->health_final = health_final;
+ }
if (level_editor_test_game)
{
{
int time_to_go = ABS(time_final - time);
int time_count_dir = (time < time_final ? +1 : -1);
- int time_count_steps = (time_to_go > 100 && time_to_go % 10 == 0 ? 10 : 1);
+
+ if (time_to_go < time_count_steps)
+ time_count_steps = 1;
time += time_count_steps * time_count_dir;
score += time_count_steps * level.score[SC_TIME_BONUS];