Show combos when a new record is reached.
authorRicardo Cruz <rick2@aeiou.pt>
Sun, 31 Oct 2004 15:23:11 +0000 (15:23 +0000)
committerRicardo Cruz <rick2@aeiou.pt>
Sun, 31 Oct 2004 15:23:11 +0000 (15:23 +0000)
SVN-Revision: 2080

src/player.cpp
src/scene.cpp
src/scene.h
src/worldmap.cpp

index 9bfde51..83fd5d1 100644 (file)
@@ -352,12 +352,15 @@ Player::action(float elapsed_time)
           /* Reset score multiplier (for multi-hits): */
           if (!invincible_timer.started())
             {
-            /*if(player_status.score_multiplier > 2)
-              {  // show a message
+            if(player_status.score_multiplier > player_status.max_score_multiplier)
+              {
+              player_status.max_score_multiplier = player_status.score_multiplier;
+
+              // show a message
               char str[124];
-              sprintf(str, _("%d bad guys in a row!"), player_status.score_multiplier-1);
+              sprintf(str, _("New max combo: %d"), player_status.max_score_multiplier-1);
               Sector::current()->add_floating_text(base, str);
-              }*/
+              }
             player_status.score_multiplier = 1;
             }
         }
@@ -1266,25 +1269,6 @@ Player::bounce(BadGuy* badguy)
   flapping = false;
   falling_from_flap = false;
   
-  if(player_status.score_multiplier >= 5)
-    {  // show a message
-    char str[124];
-//      if (player_status.score_multiplier <= 4) {sprintf(str, _("Combo x%d"), player_status.score_multiplier);}
-      if (player_status.score_multiplier == 5)
-        sprintf(str, _("Good! x%d"), player_status.score_multiplier);
-      else if (player_status.score_multiplier == 6)
-        sprintf(str, _("Great! x%d"), player_status.score_multiplier);
-      else if (player_status.score_multiplier == 7)
-        sprintf(str, _("Awesome! x%d"), player_status.score_multiplier);
-      else if (player_status.score_multiplier == 8)
-        sprintf(str, _("Incredible! x%d"), player_status.score_multiplier);
-      else if (player_status.score_multiplier == 9)
-        sprintf(str, _("Godlike! ;-) x%d"), player_status.score_multiplier);
-      else
-        sprintf(str, _("Unbelievable!! x%d"), player_status.score_multiplier);
-    Sector::current()->add_floating_text(base, str);
-    }
-
   if (input.jump)
     physic.set_velocity_y(5.2);
   else
index b2fdf45..a235035 100644 (file)
@@ -28,7 +28,8 @@ PlayerStatus::PlayerStatus()
   : distros(0),
     lives(START_LIVES),
     bonus(NO_BONUS),
-    score_multiplier(1)
+    score_multiplier(1),
+    max_score_multiplier(1)
 {
 }
 
@@ -38,6 +39,7 @@ void PlayerStatus::reset()
   lives = START_LIVES;
   bonus = NO_BONUS;
   score_multiplier = 1;
+  max_score_multiplier = 1;
 }
 
 std::string bonus_to_string(PlayerStatus::BonusType b)
index bb7e1d3..23bbb28 100644 (file)
@@ -34,6 +34,7 @@ struct PlayerStatus
   BonusType bonus;
 
   int  score_multiplier;
+  int max_score_multiplier;
 
   PlayerStatus();
 
index d746f8f..360cc3c 100644 (file)
@@ -1257,6 +1257,7 @@ WorldMap::savegame(const std::string& filename)
   writer->write_string("map", map_filename);
   writer->write_int("lives", player_status.lives);
   writer->write_int("distros", player_status.lives);
+  writer->write_int("max-score-multiplier", player_status.max_score_multiplier);
 
   writer->start_list("tux");
 
@@ -1330,6 +1331,7 @@ WorldMap::loadgame(const std::string& filename)
 
   reader.read_int("lives", player_status.lives);
   reader.read_int("distros", player_status.distros);
+  reader.read_int("max-score-multiplier", player_status.max_score_multiplier);
 
   if (player_status.lives < 0)
     player_status.lives = START_LIVES;