X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fghosttree.hpp;h=7e57d5c19d5010f4183bed5b75cee1b8acf0e529;hb=13c84268f16872f9b442251c4175a3a1a7a7899a;hp=d451c389d2ce0416bc429feacfc12f56fc969e37;hpb=0367f6faa0e560086bcb48e352616759b8c6b137;p=supertux.git diff --git a/src/badguy/ghosttree.hpp b/src/badguy/ghosttree.hpp index d451c389d..7e57d5c19 100644 --- a/src/badguy/ghosttree.hpp +++ b/src/badguy/ghosttree.hpp @@ -23,6 +23,7 @@ #include "badguy.hpp" class TreeWillOWisp; +class Lantern; class GhostTree : public BadGuy { @@ -30,23 +31,44 @@ public: GhostTree(const lisp::Lisp& lisp); ~GhostTree(); + virtual bool is_flammable() const { return false; } + virtual bool is_freezable() const { return false; } + virtual void kill_fall() { } + void activate(); void active_update(float elapsed_time); void willowisp_died(TreeWillOWisp* willowisp); + virtual void draw(DrawingContext& context); + + virtual bool collides(GameObject& other, const CollisionHit& hit); + virtual HitResponse collision(GameObject& other, const CollisionHit& hit); + + void die(); private: + enum MyState { + STATE_IDLE, STATE_SUCKING, STATE_SWALLOWING, STATE_DYING + }; + MyState mystate; Timer willowisp_timer; float willo_spawn_y; float willo_radius; float willo_speed; int willo_color; + std::auto_ptr glow_sprite; Timer colorchange_timer; Timer suck_timer; Timer root_timer; int treecolor; + Color suck_lantern_color; + + Lantern* suck_lantern; /**< Lantern that is currently being sucked in */ std::vector willowisps; + + bool is_color_deadly(Color color) const; + void spawn_lantern(); }; #endif