All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
fpsstate Struct Reference

First person state. More...

#include <fpsstate.hpp>

Inheritance diagram for fpsstate:
fpsent server::gamestate

Public Member Functions

 fpsstate ()
void baseammo (int gun, int k=2, int scale=1)
 set initial ammo More...
void addammo (int gun, int k=1, int scale=1)
 add ammo More...
bool hasmaxammo (int type)
 ammo limitation reached/exceeded? More...
bool canpickup (int type)
 check if I can pick up this item depending on the radius More...
void pickup (int type)
 pick up this item More...
void respawn ()
 reset all members when spawning More...
void spawnstate (int gamemode)
 configure spawn settings (weapons, ammo, health...) depending on game mode More...
int dodamage (int damage)
 just subtract damage here, we can set death, etc. later in code calling this More...
int hasammo (int gun, int exclude=-1)
 is there ammo left for this gun More...

Public Attributes

int health
int maxhealth
int armour
int armourtype
int quadmillis
int gunselect
int gunwait
int ammo [NUMGUNS]
int aitype
int skill
int backupweapon
int bombradius
int bombdelay

Detailed Description

First person state.

TODO: change name inherited by fpsent and server clients

Constructor & Destructor Documentation

fpsstate::fpsstate ( )

Member Function Documentation

void fpsstate::addammo ( int  gun,
int  k = 1,
int  scale = 1 
void fpsstate::baseammo ( int  gun,
int  k = 2,
int  scale = 1 

set initial ammo

References itemstat::add, ammo, GUN_SG, and itemstats.

Referenced by spawnstate().

bool fpsstate::canpickup ( int  type)
int fpsstate::dodamage ( int  damage)

just subtract damage here, we can set death, etc. later in code calling this

References armour, armourtype, and health.

Referenced by game::damaged(), and server::dodamage().

int fpsstate::hasammo ( int  gun,
int  exclude = -1 

is there ammo left for this gun

Referenced by game::ctfclientmode::aifind(), ai::hasgoodammo(), and ai::request().

bool fpsstate::hasmaxammo ( int  type)
void fpsstate::pickup ( int  type)
void fpsstate::respawn ( )
void fpsstate::spawnstate ( int  gamemode)

Member Data Documentation

int fpsstate::aitype
int fpsstate::ammo[NUMGUNS]
int fpsstate::armour
int fpsstate::armourtype
int fpsstate::backupweapon
int fpsstate::bombdelay
int fpsstate::bombradius
int fpsstate::gunselect
int fpsstate::gunwait
int fpsstate::health
int fpsstate::maxhealth
int fpsstate::quadmillis
int fpsstate::skill

The documentation for this struct was generated from the following file: