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_;
s_int8 offy() const
Returns the Y offset of the mapcharacter.
Class to write data from a Gzip compressed file.
s_int8 put_state(ogzstream &file) const
Saves the mapcharacter's state into an opened file.
Displays neat little text speech bubbles.
Class to read data from a Gzip compressed file.
void set_schedule_active(bool a)
Sets whether the schedule is active or not.
Declares the animationframe and animation classes.
~mapcharacter()
Destructor.
s_int8 offx() const
Returns the X offset of the mapcharacter.
#define u_int16
16 bits long unsigned integer
u_int16 posx() const
Returns the X position of the mapcharacter.
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.
bool go_south()
Walk to South (if possible).
s_int8 save(string fname) const
Saves an mapcharacter into an file, in game format, with alpha and mask values.
mapcharacter * whosnext() const
Return a pointer to the mapcharacter that is right next to this mapcharacter, i.e the mapcharacter th...
void look_invert(u_int16 p)
Look at the opposite position of p.
bool can_go_west() const
Returns whether it is possible or not to go to West from the current mapcharacter's position...
bool is_schedule_activated() const
Returns whether the schedule is activated or not.
void stand_south()
Look to South.
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.
bool can_go_south() const
Returns whether it is possible or not to go to South from the current mapcharacter's position...
void remove_from_map()
Removes the mapcharacter from the landmap he was on (if any).
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.
string filename() const
Returns the current file name of the mapcharacter.
mapcharacter()
Default constructor.
Allows you to display a landmap on a specified area of a surface.
landmap * mymap() const
Returns a pointer to the landmap the mapcharacter is on.
void stand()
Stand to the current direction.
bool can_go_north() const
Returns whether it is possible or not to go to North from the current mapcharacter's position...
Implements "drawing zones" for drawing operations.
void stand_east()
Look to East.
void stand_west()
Look to West.
#define s_int16
16 bits long signed integer
u_int16 submap() const
Returns the index of the submap where the mapcharacter is.
void clear()
Puts the mapcharacter back to it's post-constructor state.
bool is_action_activated() const
Returns whether the action is activated or not.
A* pathfinding algorithm implementation class.
Map where the world takes place.
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.
bool go_west()
Walk to West (if possible).
bool go_north()
Walk to North (if possible).
u_int16 posy() const
Returns the Y position of the mapcharacter.
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.
u_int16 currentmove() const
Returns the current move of the mapcharacter.
Base class for objects that want to register events.
string action_file() const
Returns the name of the mapcharacter's current action.
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...
s_int8 put(ogzstream &file) const
Saves an mapcharacter into an opened file, in game format, with alpha and mask values.
#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.
void draw(s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const
Draw the object on the screen.
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.
bool can_go_east() const
Returns whether it is possible or not to go to East from the current mapcharacter's position...
void set_action(string file, PyObject *args=NULL)
Action control.
string schedule_file() const
Returns the name of the mapcharacter's current schedule.
bool has_attribute(const std::string &name)
Tests whether the object contains a certain attribute (i.e.