Addded property to Worldmap Spawnpoint to let Tux automatically start walking (or...
[supertux.git] / src / badguy / badguy.hpp
index 5152139..cf0adc2 100644 (file)
@@ -88,11 +88,45 @@ public:
   {
     start_position = vec;
   }
-  
+
   /** Count this badguy to the statistics? This value should not be changed
    * during runtime. */
   bool countMe;
 
+  /**
+   * Called when hit by a fire bullet, and is_flammable() returns true
+   */
+  virtual void ignite();
+
+  /**
+   * Called to revert a badguy when is_ignited() returns true
+   */
+  virtual void extinguish();
+
+  /**
+   * Returns whether to call ignite() when a badguy gets hit by a fire bullet
+   */
+  virtual bool is_flammable() const;
+  
+  /**
+   * Returns whether this badguys is currently on fire
+   */
+  bool is_ignited() const;
+
+  /**
+   * Called when hit by an ice bullet, and is_freezable() returns true.
+   */
+  virtual void freeze();
+
+  /**
+   * Called to unfreeze the badguy.
+   */
+  virtual void unfreeze();
+
+  virtual bool is_freezable() const;
+
+  bool is_frozen() const;
+
 protected:
   enum State {
     STATE_INIT,
@@ -101,14 +135,14 @@ protected:
     STATE_SQUISHED,
     STATE_FALLING
   };
+
   /** Called when the badguy collided with a player */
   virtual HitResponse collision_player(Player& player, const CollisionHit& hit);
   /** Called when the badguy collided with solid ground */
   virtual void collision_solid(const CollisionHit& hit);
   /** Called when the badguy collided with another badguy */
   virtual HitResponse collision_badguy(BadGuy& other, const CollisionHit& hit);
+
   /** Called when the player hit the badguy from above. You should return true
    * if the badguy was squished, false if squishing wasn't possible
    */
@@ -135,12 +169,12 @@ protected:
   void set_state(State state);
   State get_state() const
   { return state; }
-    
+
   /**
    * returns a pointer to the nearest player or 0 if no player is available
    */
   Player* get_nearest_player();
-  
+
   Physic physic;
 
   /// is the enemy activated
@@ -170,7 +204,7 @@ protected:
 
   /**
    *  Get Direction from String.
-   */ 
+   */
   Direction str2dir( std::string dir_str );
 
   /**
@@ -185,13 +219,15 @@ protected:
    */
   bool on_ground();
 
+  bool frozen;
+  bool ignited; /**< true if this badguy is currently on fire */
+
 private:
   void try_activate();
-  
+
   State state;
   Timer state_timer;
   bool on_ground_flag;
 };
 
 #endif
-