X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fscripting%2Fplayer.hpp;h=8b36aa7f5160e5e78c6fb3b71d374f0a1545baed;hb=714a30abd887def6331a193216387e66cbfbd1bb;hp=047ea82e7b7c75df35d9ed57e38eb840fd6d13ba;hpb=d963f8dc3d2c4e432d3eeecd15351169e10243da;p=supertux.git diff --git a/src/scripting/player.hpp b/src/scripting/player.hpp index 047ea82e7..8b36aa7f5 100644 --- a/src/scripting/player.hpp +++ b/src/scripting/player.hpp @@ -35,7 +35,7 @@ public: * Set tux bonus. * This can be "grow", "fireflower" or "iceflower" at the moment */ - virtual void add_bonus(const std::string& bonus) = 0; + virtual bool add_bonus(const std::string& bonus) = 0; /** * Give tux more coins */ @@ -65,9 +65,55 @@ public: * inivisible by the set_visible method) */ virtual bool get_visible() = 0; + + /** + * Hurts a player, if completely=true then the player will be killed even + * if he had grow or fireflower bonus + */ + virtual void kill(bool completely) = 0; + + /** + * Switches ghost mode on/off. + * Lets Tux float around and through solid objects. + */ + virtual void set_ghost_mode(bool enable) = 0; + + /** + * Returns whether ghost mode is currently enabled + */ + virtual bool get_ghost_mode() = 0; + + /** + * play cheer animation. + * This might need some space and behave in an unpredictable way. Best to use this at level end. + */ + virtual void do_cheer() = 0; + + /** + * duck down if possible. + * this won't last long as long as input is enabled. + */ + virtual void do_duck() = 0; + + /** + * stand back up if possible. + */ + virtual void do_standup() = 0; + + /** + * do a backflip if possible. + */ + virtual void do_backflip() = 0; + + /** + * jump in the air if possible + * sensible values for yspeed are negative - unless we want to jump into the ground of course + */ + virtual void do_jump(float yspeed) = 0; + + }; } #endif -