TCharacter Class Reference

A generic character class. More...

#import <character.h>

Inheritance diagram for TCharacter:

TObject List of all members.

Public Member Functions

(id) - init:
 Initializes the character.
(id) - free
(void) - set_phys_properties:first_name:last_name:height:weight:height_unit:weight_unit:eye_color:hair_color:sex:
 Set the physical properties of the character.
(int) - gain_exp:
 Have the character gain experience points in add_exp.
(int) - lvl_up
 Level up the character by one.
(char *) - get_first_name
(char *) - get_last_name
(char *) - get_eye_color
(char *) - get_hair_color
(char *) - get_bio
(int) - get_lvl
(int) - get_hp
(int) - get_hp_max
(int) - get_str
(int) - get_cons
(int) - get_intel
(int) - get_wis
(int) - get_charisma
(int) - get_dex
(int) - get_speed
(int) - get_exp
(void) - set_hp:
(TItem *) - equip:item:
 Put the item in the specified location, returning what was previously there.
(TItem *) - get_item_equipped_at_location:
 Get item at location.
(void) - consume:
(void) - eat:
(void) - drink:

Public Attributes

char * height_unit
 Something like "Centimeters" to be displayed after the height.
char * weight_unit
 Something like "Newtons" to be displayed after the weight.
int hunger
 10 is dying from hunger, 0 is full
int thirst
 10 is dying from thirst, 0 is not thirsty
int hunger_speed
 should be positive, how fast hunger increases
int thirst_speed
 should be positive, how fast thirst increases

Protected Attributes

char * first_name
char * last_name
unsigned int height
unsigned int weight
char * eye_color
char * hair_color
unsigned short int sex
 Use a predefined macro for this.
char * bio
 A description of this character.
int lvl
 Current level.
int hp
 Current HP.
int hp_max
 Maximum HP.
int str
 strength
int cons
 constitution
int intel
 intelligence
int wis
 wisdom
int charisma
int dex
 dexterity
int speed
 speed
int exp
 experience points
TItemhelmet
 Slot to place an item.
TItemface
 Slot to place an item.
TItemtunic
 Slot to place an item.
TItemarmor
 Slot to place an item.
TItembelt
 Slot to place an item.
TItembackpack
 Slot to place an item.
TItemr_hand_holding
 Slot to place an item.
TItemr_hand_index_finger
 Slot to place an item.
TItemr_hand_middle_finger
 Slot to place an item.
TItemr_hand_ring_finger
 Slot to place an item.
TItemr_hand_pinky_finger
 Slot to place an item.
TIteml_hand_holding
 Slot to place an item.
TIteml_hand_index_finger
 Slot to place an item.
TIteml_hand_middle_finger
 Slot to place an item.
TIteml_hand_ring_finger
 Slot to place an item.
TIteml_hand_pinky_finger
 Slot to place an item.
TItemgloves
 Slot to place an item.
TItemboots
 Slot to place an item.
TCharacterClasscharclass
 This character's Character Class.
TSkillSetskillset
 This character's Skill Set (independent from Character Class).

Detailed Description

A generic character class.

Contains many variables for the state of the character and its characteristics. Contains many functions for manipulating the character and for getting and setting its state.

Definition at line 126 of file character.h.


Member Function Documentation

- (TItem *) equip: (TItem *) 
item: (int)  location
 
 

Put the item in the specified location, returning what was previously there.

Parameters:
item Item to be equipped
location Location where the item should be equipped. This should be a macro defined in character.h

Definition at line 314 of file character.m.

- (int) gain_exp: (int)  add_exp  
 

Have the character gain experience points in add_exp.

Calls lvl_up if the new experience passes lvl_exp_increment in the character's charclass.

Parameters:
add_exp Experience points to be added.

Definition at line 199 of file character.m.

References lvl_up.

- (TItem *) get_item_equipped_at_location: (int)  location  
 

Get item at location.

Parameters:
location This should be a macro defined in character.h

Definition at line 319 of file character.m.

- (id) init: (TCharacterClass *)  charclass  
 

Initializes the character.

Parameters:
charclass The character class of this character.

Definition at line 98 of file character.m.

References TObject::init, and TCharacterClass::skillset.

- (void) set_phys_properties: (char *) 
first_name: (char *) 
last_name: (unsigned)  int
height: (unsigned)  int
weight: (char *) 
height_unit: (char *) 
weight_unit: (char *) 
eye_color: (char *) 
hair_color: (unsigned short)  int
sex: (char *)  bio
 
 

Set the physical properties of the character.

Paramaters are copied into their respective fields in the class. Use NULL for pointers and -1 for others to keep the current.

Definition at line 140 of file character.m.

References first_name.


The documentation for this class was generated from the following files:
Generated on Wed Dec 21 13:16:08 2005 for Toten by  doxygen 1.4.5 SourceForge.net Logo