Adonthell
0.4
|
Class holding game characters. More...
#include <character.h>
Public Member Functions | |
character () | |
Default constructor. | |
~character () | |
Destructor. | |
![]() | |
mapcharacter () | |
Default constructor. | |
~mapcharacter () | |
Destructor. | |
void | clear () |
Puts the mapcharacter back to it's post-constructor state. | |
string | filename () const |
Returns the current file name of the mapcharacter. | |
animation * | get_animation (u_int16 nbr) |
Returns a pointer to an animation corresponding to a movment. | |
mapcharacter & | operator= (const mapcharacter &m) |
Mapcharacter copy (similar to copy ()). | |
void | copy (const mapcharacter &src) |
Synonym of operator = to guarantee its access from Python. | |
bool | update () |
Updates the mapcharacter's state and launchs his schedule. | |
void | draw (s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const |
Draw the object on the screen. | |
void | draw_bubble (s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const |
s_int8 | get (igzstream &file) |
Loads a mapcharacter from an opened file. | |
s_int8 | load (string fname) |
Loads a mapcharacter from it's filename. | |
s_int8 | put (ogzstream &file) const |
Saves an mapcharacter into an opened file, in game format, with alpha and mask values. | |
s_int8 | save (string fname) const |
Saves an mapcharacter into an file, in game format, with alpha and mask values. | |
s_int8 | get_state (igzstream &file) |
Restore the mapcharacter's state from an opened file. | |
s_int8 | put_state (ogzstream &file) const |
Saves the mapcharacter's state into an opened file. | |
void | set_map (landmap *m) |
Puts the mapcharacter on a landmap. | |
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. | |
void | stand_north () |
Look to North. | |
void | stand_south () |
Look to South. | |
void | stand_east () |
Look to East. | |
void | stand_west () |
Look to West. | |
void | stand () |
Stand to the current direction. | |
bool | go_north () |
Walk to North (if possible). | |
bool | go_south () |
Walk to South (if possible). | |
bool | go_east () |
Walk to East (if possible). | |
bool | go_west () |
Walk to West (if possible). | |
bool | can_go_north () const |
Returns whether it is possible or not to go to North from the current mapcharacter's position. | |
bool | can_go_south () const |
Returns whether it is possible or not to go to South from the current mapcharacter's position. | |
bool | can_go_east () const |
Returns whether it is possible or not to go to East from the current mapcharacter's position. | |
bool | can_go_west () const |
Returns whether it is possible or not to go to West from the current mapcharacter's position. | |
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 that is on the square this mapcharacter is looking at. | |
void | speak (const string &text) |
bool | is_speaking () |
text_bubble * | get_bubble () |
void | set_offset (s_int8 x, s_int8 y) |
Sets the offset of the mapcharacter on it's current mapsquare. | |
void | remove_from_pos () |
Removes the mapcharacter from the place he was on the map. | |
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. | |
u_int16 | submap () const |
Returns the index of the submap where the mapcharacter is. | |
u_int16 | posx () const |
Returns the X position of the mapcharacter. | |
u_int16 | posy () const |
Returns the Y position of the mapcharacter. | |
s_int8 | offx () const |
Returns the X offset of the mapcharacter. | |
s_int8 | offy () const |
Returns the Y offset of the mapcharacter. | |
u_int16 | currentmove () const |
Returns the current move of the mapcharacter. | |
bool | set_goal (u_int16 x, u_int16 y, u_int16 dir=NO_MOVE) |
void | set_callback (PyObject *callback, PyObject *args=NULL) |
bool | follow_path () |
bool | goal_reached () |
void | stop_moving () |
void | time_callback (string delay, PyObject *cb, PyObject *args=NULL) |
void | time_callback_string (string delay, string cb, PyObject *args=NULL) |
void | set_schedule (string file, PyObject *args=NULL) |
Schedule control. | |
string | schedule_file () const |
Returns the name of the mapcharacter's current schedule. | |
bool | is_schedule_activated () const |
Returns whether the schedule is activated or not. | |
void | set_schedule_active (bool a) |
Sets whether the schedule is active or not. | |
bool | do_stuff (string method, PyObject *args=NULL) |
Tell the character to do something. | |
void | set_action (string file, PyObject *args=NULL) |
Action control. | |
string | action_file () const |
Returns the name of the mapcharacter's current action. | |
bool | is_action_activated () const |
Returns whether the action is activated or not. | |
void | set_action_active (bool a) |
Sets whether the action is active or not. | |
void | launch_action (mapcharacter *requester) |
Run the mapcharacter's action, passing requester as the "requester" parameter for the action's Python script. | |
![]() | |
mapsquare_walkable_area () | |
Default constructor. | |
~mapsquare_walkable_area () | |
Destructor. | |
mapsquare_walkable_area & | operator= (const mapsquare_walkable_area &mo) |
Area copy (similar to copy ()). | |
void | copy (const mapsquare_walkable_area &src) |
Synonym of operator = to guarantee its access from Python. | |
u_int16 | area_length () const |
Returns the length of the area. | |
u_int16 | area_height () const |
Returns the height of the area. | |
mapsquare_walkable * | get_square (u_int16 x, u_int16 y) const |
Returns a pointer to a desired square. | |
void | resize_area (u_int16 nl, u_int16 nh) |
Resize the area. | |
u_int16 | base_x () const |
Returns the X offset of the base square of this object. | |
u_int16 | base_y () const |
Returns the Y offset of the base square of this object. | |
void | set_base (u_int16 nx, u_int16 ny) |
Sets the base square of this object. | |
![]() | |
drawable () | |
Default constructor. | |
virtual | ~drawable () |
Destructor. | |
u_int16 | length () const |
Returns the length of the drawable. | |
u_int16 | height () const |
Returns the height of the drawable. | |
virtual bool | input_update () |
Virtual input update function, provided for objects which doesn't need one. | |
![]() | |
character_base () | |
Default constructor. | |
~character_base () | |
Destructor. | |
string | get_name () const |
Returns the name of the character. | |
string | get_id () |
Returns an unique identifier of the character. | |
void | set_name (string newname) |
Sets the name of the character. | |
u_int32 | get_color () const |
Returns the color representing the character. | |
void | set_color (int c) |
Sets the color representing the character. | |
string | get_portrait () const |
Returns the current portrait of the character. | |
void | set_portrait (string fname) |
Sets the current portrait of the character. | |
string | get_dialogue () const |
Return the file name of the current character's dialog. | |
void | set_dialogue (string dialogue) |
Sets the dialogue of the character. | |
void | put_state (ogzstream &out) |
Saves the state (ttributes) of the character into an opened file. | |
![]() | |
storage () | |
Default constructor. | |
~storage () | |
Destructor. | |
void | set_val (string key, s_int32 value) |
Sets key to value. | |
s_int32 | get_val (string key) |
Returns the value of a key. | |
pair< string, s_int32 > | next () |
Returns the next (key, value) pair of the storage. | |
s_int32 & | operator[] (string key) |
Returns the value of a key. | |
iterator | begin () |
Returns an iterator to the beginning of the storage. | |
iterator | end () |
Returns an iterator to the end of the storage. | |
u_int32 | size () const |
Returns the size (number of elements) of the storage. | |
![]() | |
event_list () | |
Constructor - creates an empty, unpaused event_list. | |
virtual | ~event_list () |
Destructor - unregisters and deletes all events owned by this list. | |
void | add_event (event *ev) |
Adds an event to this list. | |
void | remove_event (event *ev) |
Removes an event from the list. | |
event * | get_event (const string &id) |
Try to retrieve the event with given id from the list. | |
void | pause () |
Disable any events associated with this event_list. | |
void | resume () |
Re-enable the events associated with the event_list, thus 'awaking' the object to life again. | |
bool | is_paused () const |
Check whether the event list is temporarily disabled or not. |
Class holding game characters.
Definition at line 35 of file character.h.
character::character | ( | ) |
Default constructor.
Definition at line 30 of file character.cc.
character::~character | ( | ) |
Destructor.
Definition at line 34 of file character.cc.