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 * Face Tux in the proper direction
62 virtual void set_dir(bool right) = 0;
64 * Set player visible or invisible
66 virtual void set_visible(bool visible) = 0;
68 * returns true if the player is currently visible (that is he was not set
69 * invisible by the set_visible method)
71 virtual bool get_visible() = 0;
74 * Hurts a player, if completely=true then the player will be killed even
75 * if he had grow or fireflower bonus
77 virtual void kill(bool completely) = 0;
80 * Switches ghost mode on/off.
81 * Lets Tux float around and through solid objects.
83 virtual void set_ghost_mode(bool enable) = 0;
86 * Returns whether ghost mode is currently enabled
88 virtual bool get_ghost_mode() = 0;
91 * start kick animation
93 virtual void kick() = 0;
96 * play cheer animation.
97 * This might need some space and behave in an unpredictable way. Best to use this at level end.
99 virtual void do_cheer() = 0;
102 * duck down if possible.
103 * this won't last long as long as input is enabled.
105 virtual void do_duck() = 0;
108 * stand back up if possible.
110 virtual void do_standup() = 0;
113 * do a backflip if possible.
115 virtual void do_backflip() = 0;
118 * jump in the air if possible
119 * sensible values for yspeed are negative - unless we want to jump into the ground of course
121 virtual void do_jump(float yspeed) = 0;
124 * Orders the current GameSession to start a sequence
126 virtual void trigger_sequence(std::string sequence_name) = 0;
129 * Uses a scriptable controller for all user input (or restores controls)
131 virtual void use_scripting_controller(bool use_or_release) = 0;
134 * Instructs the scriptable controller to press or release a button
136 virtual void do_scripting_controller(std::string control, bool pressed) = 0;