-#else
-
-void GameWon()
-{
- int hi_pos;
- boolean raise_level = FALSE;
-
- if (local_player->MovPos)
- return;
-
- if (tape.auto_play) /* tape might already be stopped here */
- tape.auto_play_level_solved = TRUE;
-
- local_player->LevelSolved = FALSE;
-
- PlaySoundStereo(SND_GAME_WINNING, SOUND_MIDDLE);
-
- if (TimeLeft)
- {
- if (!tape.playing && setup.sound_loops)
- PlaySoundExt(SND_GAME_LEVELTIME_BONUS, SOUND_MAX_VOLUME, SOUND_MIDDLE,
- SND_CTRL_PLAY_LOOP);
-
- while (TimeLeft > 0)
- {
- if (!tape.playing && !setup.sound_loops)
- PlaySoundStereo(SND_GAME_LEVELTIME_BONUS, SOUND_MIDDLE);
-
- if (TimeLeft > 100 && TimeLeft % 10 == 0)
- {
- TimeLeft -= 10;
- RaiseScore(level.score[SC_TIME_BONUS] * 10);
- }
- else
- {
- TimeLeft--;
- RaiseScore(level.score[SC_TIME_BONUS]);
- }
-
- DrawGameValue_Time(TimeLeft);
-
- BackToFront();
-
- if (!tape.playing)
- Delay(10);
- }
-
- if (!tape.playing && setup.sound_loops)
- StopSound(SND_GAME_LEVELTIME_BONUS);
- }
- else if (level.time == 0) /* level without time limit */
- {
- if (!tape.playing && setup.sound_loops)
- PlaySoundExt(SND_GAME_LEVELTIME_BONUS, SOUND_MAX_VOLUME, SOUND_MIDDLE,
- SND_CTRL_PLAY_LOOP);
-
- while (TimePlayed < 999)
- {
- if (!tape.playing && !setup.sound_loops)
- PlaySoundStereo(SND_GAME_LEVELTIME_BONUS, SOUND_MIDDLE);
-
- if (TimePlayed < 900 && TimePlayed % 10 == 0)
- {
- TimePlayed += 10;
- RaiseScore(level.score[SC_TIME_BONUS] * 10);
- }
- else
- {
- TimePlayed++;
- RaiseScore(level.score[SC_TIME_BONUS]);
- }
-
- DrawGameValue_Time(TimePlayed);
-
- BackToFront();
-
- if (!tape.playing)
- Delay(10);
- }
-
- if (!tape.playing && setup.sound_loops)
- StopSound(SND_GAME_LEVELTIME_BONUS);
- }
-
- /* close exit door after last player */
- if (AllPlayersGone && ExitX >= 0 && ExitY >= 0 &&
- (Feld[ExitX][ExitY] == EL_EXIT_OPEN ||
- Feld[ExitX][ExitY] == EL_SP_EXIT_OPEN))
- {
- int element = Feld[ExitX][ExitY];
-
- Feld[ExitX][ExitY] = (element == EL_EXIT_OPEN ? EL_EXIT_CLOSING :
- EL_SP_EXIT_CLOSING);
-
- PlayLevelSoundElementAction(ExitX, ExitY, element, ACTION_CLOSING);
- }
-
- /* player disappears */
- if (ExitX >= 0 && ExitY >= 0)
- DrawLevelField(ExitX, ExitY);
-
- BackToFront();
-
- if (tape.playing)
- return;
-
- CloseDoor(DOOR_CLOSE_1);
-
- if (tape.recording)
- {
- TapeStop();
- SaveTape(tape.level_nr); /* Ask to save tape */
- }
-
- if (level_nr == leveldir_current->handicap_level)
- {
- leveldir_current->handicap_level++;
- SaveLevelSetup_SeriesInfo();
- }
-
- if (level_editor_test_game)
- local_player->score = -1; /* no highscore when playing from editor */
- else if (level_nr < leveldir_current->last_level)
- raise_level = TRUE; /* advance to next level */
-
- if ((hi_pos = NewHiScore()) >= 0)
- {
- game_status = GAME_MODE_SCORES;
- DrawHallOfFame(hi_pos);
- if (raise_level)
- {
- level_nr++;
- TapeErase();
- }
- }
- else
- {
- game_status = GAME_MODE_MAIN;
- if (raise_level)
- {
- level_nr++;
- TapeErase();
- }
- DrawMainMenu();
- }
-
- BackToFront();
-}
-
-#endif
-