Public Member Functions | Protected Attributes

Creature Class Reference

base class for players, monsters, npc's, etc. More...

#include <Creature.h>

Inheritance diagram for Creature:
GModel GGraphicsObject GObject Monster Player

List of all members.

Public Member Functions

 Creature (void)
 standard constructor
 ~Creature (void)
 standard destructor
void SetMaxHits (int)
 set maximum number of hitpoints for creature
int GetMaxHits (void)
 get maximum number of hitpoints for creature
int GetCurrentHits (void)
 get number of current hitpoints
void SetHits (int _n)
 Set number of current hit points.
int SetGun (Gun *GunModel, GBone *AttachTo=NULL)
 Assign the creature a Gun.
GunGetGun (void)
 obtain pointer to assigned gun (if any)
virtual int setPosition (GVec4f v)
 set x,y,z position
int DropGun (void)
 unassign gun. NOTE: gun will be dropped in place and will remain an active scene object
virtual int RebuildMatrix (void)
 rebuild worldspace matrix
virtual int setRotation (GVec4f v)
 set new rotation for creature, assigned gun and crosshair
virtual int FireGun (double time, double dtime, int FLAGS)
 fire assigned gun and spawn new instances of class
virtual CrosshairGetCrosshair (void)
 obtain pointer to assigned crosshair (if any)
virtual int Damage (int)
 deal damage to a creature
virtual int Update (double time, double dtime)
 Update creature.

Protected Attributes

int MaxHitPoints
 Max. possible life.
int CurrentHitPoints
 Life at the moment.
GunEquippedGun
 Pointer to Gun (if any).
CrosshairmCrosshair
 Pointer to Crosshair.

Detailed Description

base class for players, monsters, npc's, etc.


Constructor & Destructor Documentation

Creature::Creature ( void   ) 

standard constructor

Creature::~Creature ( void   ) 

standard destructor


Member Function Documentation

int Creature::Damage ( int  i  )  [virtual]

deal damage to a creature

Reimplemented in Player.

int Creature::DropGun ( void   ) 

unassign gun. NOTE: gun will be dropped in place and will remain an active scene object

int Creature::FireGun ( double  time,
double  dtime,
int  FLAGS 
) [virtual]

fire assigned gun and spawn new instances of class

Reimplemented in Monster.

Crosshair * Creature::GetCrosshair ( void   )  [virtual]

obtain pointer to assigned crosshair (if any)

Reimplemented in Monster, and Player.

int Creature::GetCurrentHits ( void   ) 

get number of current hitpoints

Gun * Creature::GetGun ( void   ) 

obtain pointer to assigned gun (if any)

int Creature::GetMaxHits ( void   ) 

get maximum number of hitpoints for creature

int Creature::RebuildMatrix ( void   )  [virtual]

rebuild worldspace matrix

Reimplemented from GModel.

int Creature::SetGun ( Gun GunModel,
GBone AttachTo = NULL 
)

Assign the creature a Gun.

void Creature::SetHits ( int  _n  ) 

Set number of current hit points.

void Creature::SetMaxHits ( int  n  ) 

set maximum number of hitpoints for creature

int Creature::setPosition ( GVec4f  v  )  [virtual]

set x,y,z position

Reimplemented from GModel.

int Creature::setRotation ( GVec4f  v  )  [virtual]

set new rotation for creature, assigned gun and crosshair

Reimplemented from GModel.

int Creature::Update ( double  time,
double  dtime 
) [virtual]

Update creature.

Reimplemented from GModel.

Reimplemented in Player.


Member Data Documentation

int Creature::CurrentHitPoints [protected]

Life at the moment.

Gun* Creature::EquippedGun [protected]

Pointer to Gun (if any).

int Creature::MaxHitPoints [protected]

Max. possible life.

Pointer to Crosshair.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator Friends Defines