{
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,
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
*/
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
/**
* Get Direction from String.
- */
+ */
Direction str2dir( std::string dir_str );
/**
*/
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
-