DDraceNetwork Docs
CPlasma Class Reference

#include <plasma.h>

Inheritance diagram for CPlasma:
[legend]
Collaboration diagram for CPlasma:
[legend]

Public Member Functions

 CPlasma (CGameWorld *pGameWorld, vec2 Pos, vec2 Dir, bool Freeze, bool Explosive, int ForClientId)
 
void Reset () override
 
void Tick () override
 
void Snap (int SnappingClient) override
 
void SwapClients (int Client1, int Client2) override
 
- Public Member Functions inherited from CEntity
int GetId () const
 
 CEntity (CGameWorld *pGameWorld, int Objtype, vec2 Pos=vec2(0, 0), int ProximityRadius=0)
 
virtual ~CEntity ()
 
std::vector< SSwitchers > & Switchers ()
 
CGameWorldGameWorld ()
 
CTuningParamsTuning ()
 
CTuningParamsTuningList ()
 
CTuningParamsGetTuning (int i)
 
class CCollisionCollision ()
 
CEntityTypeNext ()
 
CEntityTypePrev ()
 
const vec2GetPos () const
 
float GetProximityRadius () const
 
void Destroy ()
 
virtual void PreTick ()
 
virtual void Tick ()
 
virtual void TickDeferred ()
 
bool GameLayerClipped (vec2 CheckPos)
 
CEntityNextEntity ()
 
void Keep ()
 
 CEntity ()
 
int GetId () const
 
 CEntity (CGameWorld *pGameWorld, int Objtype, vec2 Pos=vec2(0, 0), int ProximityRadius=0)
 
virtual ~CEntity ()
 
std::vector< SSwitchers > & Switchers ()
 
CGameWorldGameWorld ()
 
CTuningParamsTuning ()
 
CTuningParamsTuningList ()
 
CTuningParamsGetTuning (int i)
 
class CConfigConfig ()
 
class CGameContextGameServer ()
 
class IServerServer ()
 
CCollisionCollision ()
 
CEntityTypeNext ()
 
CEntityTypePrev ()
 
const vec2GetPos () const
 
float GetProximityRadius () const
 
virtual void Destroy ()
 
virtual void Reset ()
 
virtual void Tick ()
 
virtual void TickDeferred ()
 
virtual void TickPaused ()
 
virtual void Snap (int SnappingClient)
 
virtual void PostSnap ()
 
virtual void SwapClients (int Client1, int Client2)
 
virtual ESaveResult BlocksSave (int ClientId)
 
virtual int GetOwnerId () const
 
bool NetworkClipped (int SnappingClient) const
 
bool NetworkClipped (int SnappingClient, vec2 CheckPos) const
 
bool NetworkClippedLine (int SnappingClient, vec2 StartPos, vec2 EndPos) const
 
bool GameLayerClipped (vec2 CheckPos)
 
bool GetNearestAirPos (vec2 Pos, vec2 PrevPos, vec2 *pOutPos)
 
bool GetNearestAirPosPlayer (vec2 PlayerPos, vec2 *pOutPos)
 

Private Member Functions

void Move ()
 
bool HitCharacter (CCharacter *pTarget)
 
bool HitObstacle (CCharacter *pTarget)
 

Private Attributes

vec2 m_Core
 
int m_Freeze
 
bool m_Explosive
 
int m_ForClientId
 
int m_EvalTick
 
int m_LifeTime
 

Additional Inherited Members

- Public Attributes inherited from CEntity
float m_ProximityRadius
 
vec2 m_Pos
 
int m_Number
 
int m_Layer
 
int m_SnapTicks
 
int m_DestroyTick
 
int m_LastRenderTick
 
CEntitym_pParent
 
CEntitym_pChild
 
- Protected Attributes inherited from CEntity
CGameWorldm_pGameWorld
 
bool m_MarkedForDestroy
 
int m_Id
 
int m_ObjType
 

Detailed Description

Plasma Bullets are projectiles fired from turrets at a specific target

When hitting a tee, plasma bullets can either freeze or unfreeze the player Also, plasma projectiles can explode on impact. However, the player affected by the explosion is not necessarily the one the plasma collided with, but if the affected player is not a solo player, then the team-mate with the lowest ClientId within the explosion range. Furthermore, the affected player does not feel the explosion at the point of impact but at the last position of the plasma bullet. The same applies if a plasma bullet explodes due to a collision with a laser stopper or a solid block Plasma bullets move every tick in the assigned direction and then accelerate by the factor PLASMA_ACCEL Plasma bullets can explode twice if they would hit both a player and an obstacle in the next movement step Plasma bullets will stop existing as soon as:

  • The player they were created for do no longer exist
  • They have had a collision with a player, a solid block or a laser stopper
  • Their life time of 1.5 seconds has expired

Constructor & Destructor Documentation

◆ CPlasma()

CPlasma::CPlasma ( CGameWorld pGameWorld,
vec2  Pos,
vec2  Dir,
bool  Freeze,
bool  Explosive,
int  ForClientId 
)

Member Function Documentation

◆ HitCharacter()

bool CPlasma::HitCharacter ( CCharacter pTarget)
private

◆ HitObstacle()

bool CPlasma::HitObstacle ( CCharacter pTarget)
private

◆ Move()

void CPlasma::Move ( )
private

◆ Reset()

void CPlasma::Reset ( )
overridevirtual

Reimplemented from CEntity.

◆ Snap()

void CPlasma::Snap ( int  SnappingClient)
overridevirtual

Reimplemented from CEntity.

◆ SwapClients()

void CPlasma::SwapClients ( int  Client1,
int  Client2 
)
overridevirtual

Reimplemented from CEntity.

◆ Tick()

void CPlasma::Tick ( )
overridevirtual

Reimplemented from CEntity.

Member Data Documentation

◆ m_Core

vec2 CPlasma::m_Core
private

◆ m_EvalTick

int CPlasma::m_EvalTick
private

◆ m_Explosive

bool CPlasma::m_Explosive
private

◆ m_ForClientId

int CPlasma::m_ForClientId
private

◆ m_Freeze

int CPlasma::m_Freeze
private

◆ m_LifeTime

int CPlasma::m_LifeTime
private

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