enigma-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Enigma-cvs] enigma/src game.cc,1.56,1.57


From: Ralf Westram <address@hidden>
Subject: [Enigma-cvs] enigma/src game.cc,1.56,1.57
Date: Mon, 17 Nov 2003 09:51:19 +0000

Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv13913/src

Modified Files:
        game.cc 
Log Message:
- avoid cheating (using ESC or F1) in TimeHunt Mode



Index: game.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/game.cc,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** game.cc     16 Nov 2003 19:25:40 -0000      1.56
--- game.cc     17 Nov 2003 09:51:16 -0000      1.57
***************
*** 273,277 ****
              sound::PlaySound("finished");
              player::LevelFinished(); // remove player-controlled actors
!             
              int    difficulty = GetDifficulty();
              int    level_time     = int(current_state_dtime); // time spend 
in state INGAME!
--- 273,277 ----
              sound::PlaySound("finished");
              player::LevelFinished(); // remove player-controlled actors
! 
              int    difficulty = GetDifficulty();
              int    level_time     = int(current_state_dtime); // time spend 
in state INGAME!
***************
*** 283,305 ****
              if (par_time > 0) {
                  if (best_user_time<0 || best_user_time>par_time) {
!                     if (level_time == par_time) 
                          text = string("Exactly the par time by 
")+par_name+"!";
!                     else if (level_time<par_time) 
                          text = "Great! A new par time!";
!                     else if (options::GetBool("TimeHunting")) 
                          newstate = LEVELREPEAT;
                  }
              }
              if (text.length() == 0 && best_user_time>0) {
!                 if (level_time == best_user_time) 
                      text = "Best time!";
!                 else if (level_time<best_user_time) 
                      text = "New best time!";
!                 else if (options::GetBool("TimeHunting")) 
                      newstate = LEVELREPEAT;
              }
              if (text.length() == 0) {
!                 if (options::GetBool("TimeHunting") 
!                     && (par_time>0 || best_user_time>0)) 
                  {
                      bool with_par = best_user_time == -1 || (par_time >0 && 
par_time<best_user_time);
--- 283,305 ----
              if (par_time > 0) {
                  if (best_user_time<0 || best_user_time>par_time) {
!                     if (level_time == par_time)
                          text = string("Exactly the par time by 
")+par_name+"!";
!                     else if (level_time<par_time)
                          text = "Great! A new par time!";
!                     else if (options::GetBool("TimeHunting"))
                          newstate = LEVELREPEAT;
                  }
              }
              if (text.length() == 0 && best_user_time>0) {
!                 if (level_time == best_user_time)
                      text = "Best time!";
!                 else if (level_time<best_user_time)
                      text = "New best time!";
!                 else if (options::GetBool("TimeHunting"))
                      newstate = LEVELREPEAT;
              }
              if (text.length() == 0) {
!                 if (options::GetBool("TimeHunting")
!                     && (par_time>0 || best_user_time>0))
                  {
                      bool with_par = best_user_time == -1 || (par_time >0 && 
par_time<best_user_time);
***************
*** 653,657 ****
  {
      SetMouseSpeed (static_cast<int> (speed + 0.5));
!     display::GetStatusBar()->show_text(strf("Mouse speed: %d", 
(int)GetMouseSpeed()), 
                                         display::TEXT_2SECONDS);
  }
--- 653,657 ----
  {
      SetMouseSpeed (static_cast<int> (speed + 0.5));
!     display::GetStatusBar()->show_text(strf("Mouse speed: %d", 
(int)GetMouseSpeed()),
                                         display::TEXT_2SECONDS);
  }
***************
*** 661,664 ****
--- 661,665 ----
      case SDLK_ESCAPE:
          show_menu();
+         if (options::GetBool("TimeHunting")) change_state(RESTARTGAME); // 
avoid cheating
          break;
  
***************
*** 668,671 ****
--- 669,673 ----
      case SDLK_F1:
          show_help();
+         if (options::GetBool("TimeHunting")) change_state(RESTARTGAME); // 
avoid cheating
          break;
  
***************
*** 923,927 ****
  
      for (unsigned i = 0; i < lp->size() && i <= max_available; i++) {
!         if (lp->get_status (i, levelstat) && levelstat.finished != 0) 
              max_available++;  // for each solved level, an additional level 
is available;
      }
--- 925,929 ----
  
      for (unsigned i = 0; i < lp->size() && i <= max_available; i++) {
!         if (lp->get_status (i, levelstat) && levelstat.finished != 0)
              max_available++;  // for each solved level, an additional level 
is available;
      }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]