Public Member Functions | Protected Attributes

Player Class Reference

#include <Player.h>

Inheritance diagram for Player:
Creature GModel GGraphicsObject GObject

List of all members.

Public Member Functions

 Player (void)
 timestamp until which steroids keep the player stronger
 ~Player (void)
 standard constructor
int IncreaseThrowingDistance (float f)
 standard destructor
float GetThrowingDistance (void)
 add more force to the next grenade throw
int ResetThrowingDistance (void)
 query accumulated force for next grenade throw
int ThrowGrenade (float distance, double time, double dtime, int FLAGS)
 set accumulated force for next grenade throw to 0
CrosshairGetCrosshair (void)
 create new instance of grenade
int GetMaxGrenades (void)
 obtain pointer to crosshair
int GetCurrentGrenades (void)
 get max number of grenades the player can carry
void SetNbrGrenades (int _n)
 get number of grenades the player is currently carrying
int Draw (double time, double dtime, GMatrix16 *viewmatrix, GMatrix16 *worldmatrix, int FLAGS)
 set umber of grenades the player is currently carrying
virtual int Damage (int)
 deal damage to a creature
int SetOnSteroids (double time, double duration)
 damage the player (substract hitpoints, temporarily show a hud overlay, play a sound)
virtual int Update (double time, double dtime)
 inject steroids into player (make him run faster / jump higher)

Protected Attributes

int MaxGrenades
int CurrentGrenades
 max number of grenades the player can carry
double GrenadeDelay
 number of grenades the player is currently carrying
double LastGrenade
 min timespan between two grenades
float ThrowDistance
 timestamp of last grenade throw
double OnSteroidsSince
 distance to throw a grenade
double OnSteroidsUntil
 0 if player is not on steroids. otherwise, timestamp of steroid injection

Constructor & Destructor Documentation

Player::Player ( void   ) 

timestamp until which steroids keep the player stronger

Player::~Player ( void   ) 

standard constructor


Member Function Documentation

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

deal damage to a creature

Reimplemented from Creature.

int Player::Draw ( double  time,
double  dtime,
GMatrix16 viewmatrix,
GMatrix16 worldmatrix,
int  FLAGS 
) [virtual]

set umber of grenades the player is currently carrying

Reimplemented from GModel.

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

create new instance of grenade

Reimplemented from Creature.

int Player::GetCurrentGrenades ( void   ) 

get max number of grenades the player can carry

int Player::GetMaxGrenades ( void   ) 

obtain pointer to crosshair

float Player::GetThrowingDistance ( void   ) 

add more force to the next grenade throw

int Player::IncreaseThrowingDistance ( float  f  ) 

standard destructor

int Player::ResetThrowingDistance ( void   ) 

query accumulated force for next grenade throw

void Player::SetNbrGrenades ( int  _n  ) 

get number of grenades the player is currently carrying

int Player::SetOnSteroids ( double  time,
double  duration 
)

damage the player (substract hitpoints, temporarily show a hud overlay, play a sound)

int Player::ThrowGrenade ( float  distance,
double  time,
double  dtime,
int  FLAGS 
)

set accumulated force for next grenade throw to 0

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

inject steroids into player (make him run faster / jump higher)

Reimplemented from Creature.


Member Data Documentation

int Player::CurrentGrenades [protected]

max number of grenades the player can carry

double Player::GrenadeDelay [protected]

number of grenades the player is currently carrying

double Player::LastGrenade [protected]

min timespan between two grenades

int Player::MaxGrenades [protected]
double Player::OnSteroidsSince [protected]

distance to throw a grenade

double Player::OnSteroidsUntil [protected]

0 if player is not on steroids. otherwise, timestamp of steroid injection

float Player::ThrowDistance [protected]

timestamp of last grenade throw


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