2 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef HEADER_SUPERTUX_SCRIPTING_PLAYER_HPP
18 #define HEADER_SUPERTUX_SCRIPTING_PLAYER_HPP
36 * This can be "grow", "fireflower" or "iceflower" at the moment
38 virtual bool add_bonus(const std::string& bonus) = 0;
42 virtual void add_coins(int count) = 0;
44 * Make tux invincible for a short amount of time
46 virtual void make_invincible() = 0;
48 * Deactivate user/scripting input for Tux
50 virtual void deactivate() = 0;
52 * Give control back to user/scripting
54 virtual void activate() = 0;
58 virtual void walk(float speed) = 0;
60 * Set player visible or invisible
62 virtual void set_visible(bool visible) = 0;
64 * returns true if the player is currently visible (that is he was not set
65 * invisible by the set_visible method)
67 virtual bool get_visible() = 0;
70 * Hurts a player, if completely=true then the player will be killed even
71 * if he had grow or fireflower bonus
73 virtual void kill(bool completely) = 0;
76 * Switches ghost mode on/off.
77 * Lets Tux float around and through solid objects.
79 virtual void set_ghost_mode(bool enable) = 0;
82 * Returns whether ghost mode is currently enabled
84 virtual bool get_ghost_mode() = 0;
87 * play cheer animation.
88 * This might need some space and behave in an unpredictable way. Best to use this at level end.
90 virtual void do_cheer() = 0;
93 * duck down if possible.
94 * this won't last long as long as input is enabled.
96 virtual void do_duck() = 0;
99 * stand back up if possible.
101 virtual void do_standup() = 0;
104 * do a backflip if possible.
106 virtual void do_backflip() = 0;
109 * jump in the air if possible
110 * sensible values for yspeed are negative - unless we want to jump into the ground of course
112 virtual void do_jump(float yspeed) = 0;
115 * Orders the current GameSession to start a sequence
117 virtual void trigger_sequence(std::string sequence_name) = 0;
120 * Uses a scriptable controller for all user input (or restores controls)
122 virtual void use_scripting_controller(bool use_or_release) = 0;
125 * Instructs the scriptable controller to press or release a button
127 virtual void do_scripting_controller(std::string control, bool pressed) = 0;