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