Go to the documentation of this file.
30 #ifndef MAPCHARACTER_H_
31 #define MAPCHARACTER_H_
37 #define MAPCHAR_DIR "gfx/mapcharacters/"
112 #define NO_MOVE 65535
473 void speak (
const string & text);
477 return (saying != NULL);
594 void set_callback (PyObject *callback, PyObject *args = NULL);
596 bool goal_reached ();
599 void time_callback (
string delay, PyObject *cb, PyObject *args = NULL);
600 void time_callback_string (
string delay,
string cb, PyObject *args = NULL);
623 void set_schedule (
string file, PyObject * args = NULL);
633 return schedule_file_;
644 return schedule_activated;
655 schedule_activated = a;
667 bool do_stuff (
string method, PyObject *args = NULL);
690 void set_action (
string file, PyObject * args = NULL);
711 return action_activated;
721 action_activated = a;
801 void leave_position ();
841 vector <animation *> anim;
851 bool schedule_activated;
852 bool action_activated;
855 PyObject * schedule_args;
856 PyObject * action_args;
858 string schedule_file_;
void set_schedule_active(bool a)
Sets whether the schedule is active or not.
void set_schedule(string file, PyObject *args=NULL)
Schedule control.
Declares the animationframe and animation classes.
Displays neat little text speech bubbles.
void draw(s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const
Draw the object on the screen.
bool can_go_east() const
Returns whether it is possible or not to go to East from the current mapcharacter's position.
u_int16 currentmove() const
Returns the current move of the mapcharacter.
void look_invert(u_int16 p)
Look at the opposite position of p.
void clear()
Puts the mapcharacter back to it's post-constructor state.
bool can_go_south() const
Returns whether it is possible or not to go to South from the current mapcharacter's position.
Class where drawables can actually be drawn to.
bool go_south()
Walk to South (if possible).
u_int16 submap() const
Returns the index of the submap where the mapcharacter is.
Class to read data from a Gzip compressed file.
void set_action_active(bool a)
Sets whether the action is active or not.
Map where the world takes place.
Base class for objects that want to register events.
bool update()
Updates the mapcharacter's state and launchs his schedule.
void stand_west()
Look to West.
~mapcharacter()
Destructor.
Class to write data from a Gzip compressed file.
s_int8 load(string fname)
Loads a mapcharacter from it's filename.
mapcharacter * whosnext() const
Return a pointer to the mapcharacter that is right next to this mapcharacter, i.e the mapcharacter th...
bool is_action_activated() const
Returns whether the action is activated or not.
s_int8 offx() const
Returns the X offset of the mapcharacter.
string filename() const
Returns the current file name of the mapcharacter.
bool go_north()
Walk to North (if possible).
s_int8 get(igzstream &file)
Loads a mapcharacter from an opened file.
u_int16 posy() const
Returns the Y position of the mapcharacter.
string action_file() const
Returns the name of the mapcharacter's current action.
Declares the character_base class.
#define s_int16
16 bits long signed integer
mapcharacter()
Default constructor.
u_int16 posx() const
Returns the X position of the mapcharacter.
string schedule_file() const
Returns the name of the mapcharacter's current schedule.
bool go_west()
Walk to West (if possible).
void set_offset(s_int8 x, s_int8 y)
Sets the offset of the mapcharacter on it's current mapsquare.
#define s_int8
8 bits long signed integer
void jump_to(u_int16 smap, u_int16 x, u_int16 y, u_int16 pos=NO_MOVE)
Remove the mapcharacter from it's current place and put him to a new one.
s_int8 put(ogzstream &file) const
Saves an mapcharacter into an opened file, in game format, with alpha and mask values.
Base character class containing attributes and dialog stuff.
void set_map(landmap *m)
Puts the mapcharacter on a landmap.
void stand_south()
Look to South.
Implements "drawing zones" for drawing operations.
s_int8 put_state(ogzstream &file) const
Saves the mapcharacter's state into an opened file.
void stand_north()
Look to North.
void remove_from_map()
Removes the mapcharacter from the landmap he was on (if any).
landmap * mymap() const
Returns a pointer to the landmap the mapcharacter is on.
bool is_schedule_activated() const
Returns whether the schedule is activated or not.
s_int8 get_state(igzstream &file)
Restore the mapcharacter's state from an opened file.
Representation of characters on a landmap.
void stand()
Stand to the current direction.
Declares the text_bubble class.
animation * get_animation(u_int16 nbr)
Returns a pointer to an animation corresponding to a movment.
void launch_action(mapcharacter *requester)
Run the mapcharacter's action, passing requester as the "requester" parameter for the action's Python...
void set_action(string file, PyObject *args=NULL)
Action control.
#define u_int16
16 bits long unsigned integer
Declares the event_list class.
s_int8 offy() const
Returns the Y offset of the mapcharacter.
mapcharacter & operator=(const mapcharacter &m)
Mapcharacter copy (similar to copy ()).
s_int8 save(string fname) const
Saves an mapcharacter into an file, in game format, with alpha and mask values.
bool has_attribute(const std::string &name)
Tests whether the object contains a certain attribute (i.e.
void remove_from_pos()
Removes the mapcharacter from the place he was on the map.
A* pathfinding algorithm implementation class.
void copy(const mapcharacter &src)
Synonym of operator = to guarantee its access from Python.
Area of mapsquare_walkables, for use with mapcharacter and mapobject classes.
bool do_stuff(string method, PyObject *args=NULL)
Tell the character to do something.
void stand_east()
Look to East.
bool can_go_north() const
Returns whether it is possible or not to go to North from the current mapcharacter's position.
Stores the C++ <-> Python callback binding.
Allows you to display a landmap on a specified area of a surface.
Class that handles animated elements, their update and their playback.
bool go_east()
Walk to East (if possible).
bool can_go_west() const
Returns whether it is possible or not to go to West from the current mapcharacter's position.