4 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __SCRIPTING_PLAYER_H__
21 #define __SCRIPTING_PLAYER_H__
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 invicible for a short amount of time
46 virtual void make_invincible() = 0;
48 * Deactivate user input for Tux
50 virtual void deactivate() = 0;
52 * Give control back to user
54 virtual void activate() = 0;
58 virtual void walk(float speed) = 0;
60 * Set player visible or not visible
62 virtual void set_visible(bool visible) = 0;
64 * returns true if the player is currently visible (that is he was not set
65 * inivisible 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;