Finished up code for basic functionality of earthflower powerup.
[supertux.git] / src / object / player.hpp
index bcbbcbc..4d178aa 100644 (file)
@@ -45,8 +45,8 @@ static const float TUX_BACKFLIP_TIME = 2.1f; // minimum air time that backflip r
 class Camera;
 class PlayerStatus;
 
-class Player : public MovingObject, 
-               public scripting::Player, 
+class Player : public MovingObject,
+               public scripting::Player,
                public ScriptInterface
 {
 public:
@@ -169,7 +169,7 @@ public:
    * Adds velocity to the player until given end speed is reached
    */
   void add_velocity(const Vector& velocity, const Vector& end_speed);
-  
+
   /**
    * Returns the current velocity of the player
    */
@@ -180,6 +180,8 @@ public:
   bool is_dead() const
   { return dead; }
   bool is_big();
+  bool is_stone()
+  { return stone; }
 
   void set_visible(bool visible);
   bool get_visible();
@@ -222,7 +224,7 @@ public:
    * Orders the current GameSession to start a sequence
    */
   void trigger_sequence(std::string sequence_name);
-  
+
   /**
    * Requests that the player start climbing the given Climbable
    */
@@ -262,7 +264,7 @@ private:
   bool deactivated;
 
   Controller* controller;
-  std::auto_ptr<CodeController> scripting_controller; /**< This controller is used when the Player is controlled via scripting */
+  std::unique_ptr<CodeController> scripting_controller; /**< This controller is used when the Player is controlled via scripting */
   PlayerStatus* player_status;
   bool duck;
   bool dead;
@@ -274,12 +276,16 @@ private:
   int  backflip_direction;
   Direction peekingX;
   Direction peekingY;
+  float ability_time;
+  bool stone;
   bool swimming;
   float speedlimit;
   Controller* scripting_controller_old; /**< Saves the old controller while the scripting_controller is used */
   bool jump_early_apex;
   bool on_ice;
   bool ice_this_frame;
+  SpritePtr lightsprite;
+  SpritePtr powersprite;
 
 public:
   Direction dir;
@@ -300,6 +306,8 @@ public:
   Timer safe_timer;
   Timer kick_timer;
   Timer shooting_timer;   // used to show the arm when Tux is shooting
+  Timer ability_timer;  // maximum lengh of time that special abilities can last
+  Timer cooldown_timer; // minimum time period between successive uses of a special ability
   Timer dying_timer;
   bool growing;
   Timer backflip_timer;