doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Protected Attributes | Private Types | Private Attributes | List of all members
SSDPowerup Class Reference

Powerups work in two phases: 1.) Closed container hurls at you If you shoot the container it open 3.) If an opened powerup hits the player he aquires the powerup Powerup Types: Health - Give a specific amount of health Super Blaster - Increases the power of the blaster (lasts a specific amount of time) Asteroid Nuke - Destroys all asteroids on screen as soon as it is aquired Rescue Powerup - Rescues all astronauts as soon as it is acquited Bonus Points - Gives some bonus points when acquired. More...

#include <GameSSDWindow.h>

Inheritance diagram for SSDPowerup:
SSDMover SSDEntity

Public Member Functions

 SSDPowerup ()
 
virtual ~SSDPowerup ()
 
virtual void WriteToSaveGame (idFile *savefile)
 
virtual void ReadFromSaveGame (idFile *savefile, idGameSSDWindow *_game)
 
virtual void OnHit (int key)
 
virtual void OnStrikePlayer ()
 
void OnOpenPowerup ()
 
void OnActivatePowerup ()
 
void Init (idGameSSDWindow *_game, float _speed, float _rotation)
 
- Public Member Functions inherited from SSDMover
 SSDMover ()
 
virtual ~SSDMover ()
 
void MoverInit (const idVec3 &_speed, float _rotationSpeed)
 
virtual void EntityUpdate ()
 
- Public Member Functions inherited from SSDEntity
 SSDEntity ()
 
virtual ~SSDEntity ()
 
void EntityInit ()
 
void SetGame (idGameSSDWindow *_game)
 
void SetMaterial (const char *_name)
 
void SetPosition (const idVec3 &_position)
 
void SetSize (const idVec2 &_size)
 
void SetRadius (float _radius, float _hitFactor=1.0f)
 
void SetRotation (float _rotation)
 
void Update ()
 
bool HitTest (const idVec2 &pt)
 
virtual void Draw (idDeviceContext *dc)
 
virtual void DestroyEntity ()
 
idBounds WorldToScreen (const idBounds worldBounds)
 
idVec3 WorldToScreen (const idVec3 &worldPos)
 
idVec3 ScreenToWorld (const idVec3 &screenPos)
 

Static Public Member Functions

static SSDPowerupGetNewPowerup (idGameSSDWindow *_game, float _speed, float _rotation)
 
static SSDPowerupGetSpecificPowerup (int id)
 
static void WritePowerups (idFile *savefile)
 
static void ReadPowerups (idFile *savefile, idGameSSDWindow *_game)
 

Static Protected Attributes

static SSDPowerup powerupPool [MAX_POWERUPS]
 

Private Types

enum  { POWERUP_STATE_CLOSED = 0, POWERUP_STATE_OPEN }
 
enum  {
  POWERUP_TYPE_HEALTH = 0, POWERUP_TYPE_SUPER_BLASTER, POWERUP_TYPE_ASTEROID_NUKE, POWERUP_TYPE_RESCUE_ALL,
  POWERUP_TYPE_BONUS_POINTS, POWERUP_TYPE_DAMAGE, POWERUP_TYPE_MAX
}
 

Private Attributes

int powerupState
 
int powerupType
 

Additional Inherited Members

- Public Attributes inherited from SSDMover
idVec3 speed
 
float rotationSpeed
 
- Public Attributes inherited from SSDEntity
int type
 
int id
 
idStr materialName
 
const idMaterialmaterial
 
idVec3 position
 
idVec2 size
 
float radius
 
float hitRadius
 
float rotation
 
idVec4 matColor
 
idStr text
 
float textScale
 
idVec4 foreColor
 
idGameSSDWindowgame
 
int currentTime
 
int lastUpdate
 
int elapsed
 
bool destroyed
 
bool noHit
 
bool noPlayerDamage
 
bool inUse
 

Detailed Description

Powerups work in two phases: 1.) Closed container hurls at you If you shoot the container it open 3.) If an opened powerup hits the player he aquires the powerup Powerup Types: Health - Give a specific amount of health Super Blaster - Increases the power of the blaster (lasts a specific amount of time) Asteroid Nuke - Destroys all asteroids on screen as soon as it is aquired Rescue Powerup - Rescues all astronauts as soon as it is acquited Bonus Points - Gives some bonus points when acquired.

Definition at line 351 of file GameSSDWindow.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
POWERUP_STATE_CLOSED 
POWERUP_STATE_OPEN 

Definition at line 353 of file GameSSDWindow.h.

anonymous enum
private
Enumerator
POWERUP_TYPE_HEALTH 
POWERUP_TYPE_SUPER_BLASTER 
POWERUP_TYPE_ASTEROID_NUKE 
POWERUP_TYPE_RESCUE_ALL 
POWERUP_TYPE_BONUS_POINTS 
POWERUP_TYPE_DAMAGE 
POWERUP_TYPE_MAX 

Definition at line 358 of file GameSSDWindow.h.

Constructor & Destructor Documentation

SSDPowerup::SSDPowerup ( )

Definition at line 1023 of file GameSSDWindow.cpp.

SSDPowerup::~SSDPowerup ( )
virtual

Definition at line 1027 of file GameSSDWindow.cpp.

Member Function Documentation

SSDPowerup * SSDPowerup::GetNewPowerup ( idGameSSDWindow _game,
float  _speed,
float  _rotation 
)
static

Definition at line 1152 of file GameSSDWindow.cpp.

SSDPowerup * SSDPowerup::GetSpecificPowerup ( int  id)
static

Definition at line 1164 of file GameSSDWindow.cpp.

void SSDPowerup::Init ( idGameSSDWindow _game,
float  _speed,
float  _rotation 
)

Definition at line 1119 of file GameSSDWindow.cpp.

void SSDPowerup::OnActivatePowerup ( )

Definition at line 1080 of file GameSSDWindow.cpp.

void SSDPowerup::OnHit ( int  key)
virtual

Reimplemented from SSDEntity.

Definition at line 1044 of file GameSSDWindow.cpp.

void SSDPowerup::OnOpenPowerup ( )

Definition at line 1077 of file GameSSDWindow.cpp.

void SSDPowerup::OnStrikePlayer ( )
virtual

Reimplemented from SSDEntity.

Definition at line 1066 of file GameSSDWindow.cpp.

void SSDPowerup::ReadFromSaveGame ( idFile savefile,
idGameSSDWindow _game 
)
virtual

Reimplemented from SSDMover.

Definition at line 1037 of file GameSSDWindow.cpp.

void SSDPowerup::ReadPowerups ( idFile savefile,
idGameSSDWindow _game 
)
static

Definition at line 1184 of file GameSSDWindow.cpp.

void SSDPowerup::WritePowerups ( idFile savefile)
static

Definition at line 1168 of file GameSSDWindow.cpp.

void SSDPowerup::WriteToSaveGame ( idFile savefile)
virtual

Reimplemented from SSDMover.

Definition at line 1030 of file GameSSDWindow.cpp.

Member Data Documentation

SSDPowerup SSDPowerup::powerupPool
staticprotected

Definition at line 398 of file GameSSDWindow.h.

int SSDPowerup::powerupState
private

Definition at line 368 of file GameSSDWindow.h.

int SSDPowerup::powerupType
private

Definition at line 369 of file GameSSDWindow.h.


The documentation for this class was generated from the following files: