Happy Easter! Played with fireflower bonus: Carrying multiple fireflowers now means...
[supertux.git] / src / player_status.cpp
index 109b772..432640c 100644 (file)
@@ -1,7 +1,8 @@
 //  $Id$
 //
-//  SuperTux -  A Jump'n Run
+//  SuperTux
 //  Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
@@ -38,6 +39,8 @@ PlayerStatus* player_status = 0;
 PlayerStatus::PlayerStatus()
   : coins(START_COINS),
     bonus(NO_BONUS),
+    max_fire_bullets(0),
+    max_ice_bullets(0),
     score_multiplier(1),
     max_score_multiplier(1)
 {
@@ -112,6 +115,9 @@ PlayerStatus::write(lisp::Writer& writer)
       log_warning << "Unknown bonus type." << std::endl;
       writer.write_string("bonus", "none");
   }
+  writer.write_int("fireflowers", max_fire_bullets);
+  writer.write_int("iceflowers", max_ice_bullets);
+  
   writer.write_bool("key-brass", keys & KEY_BRASS);
   writer.write_bool("key-iron", keys & KEY_IRON);
   writer.write_bool("key-bronze", keys & KEY_BRONZE);
@@ -142,6 +148,9 @@ PlayerStatus::read(const lisp::Lisp& lisp)
       bonus = NO_BONUS;
     }
   }
+  lisp.get("fireflowers", max_fire_bullets);
+  lisp.get("iceflowers", max_ice_bullets);
+
   bool val = false;
   if(lisp.get("key-brass", val) && val == true)
     set_keys(KEY_BRASS);