DDraceNetwork Documentation
Loading...
Searching...
No Matches
CGun Class Reference

#include <gun.h>

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

Public Member Functions

 CGun (CGameWorld *pGameWorld, vec2 Pos, bool Freeze, bool Explosive, int Layer=0, int Number=0)
void Reset () override
void Tick () override
void Snap (int SnappingClient) 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 ()
CTuningParamsGlobalTuning ()
CTuningParamsTuningList ()
CTuningParamsGetTuning (int i)
class CCollisionCollision ()
CEntityTypeNext ()
CEntityTypePrev ()
const vec2GetPos () const
float GetProximityRadius () const
virtual bool CanCollide (int ClientId)
virtual void Destroy ()
virtual void PreTick ()
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 ()
CTuningParamsGlobalTuning ()
CTuningParamsTuningList ()
CTuningParamsGetTuning (int i)
class CConfigConfig ()
class CGameContextGameServer ()
class IServerServer ()
CCollisionCollision ()
CEntityTypeNext ()
CEntityTypePrev ()
const vec2GetPos () const
float GetProximityRadius () const
virtual void Destroy ()
virtual void TickDeferred ()
virtual void TickPaused ()
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)
virtual bool CanCollide (int ClientId)
bool GetNearestAirPos (vec2 Pos, vec2 PrevPos, vec2 *pOutPos)
bool GetNearestAirPosPlayer (vec2 PlayerPos, vec2 *pOutPos)

Private Member Functions

void Fire ()

Private Attributes

vec2 m_Core
bool m_Freeze
bool m_Explosive
int m_EvalTick
int m_aLastFireTeam [MAX_CLIENTS]
int m_aLastFireSolo [MAX_CLIENTS]

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

Turrets (also referred to as Gun) fire plasma bullets at the nearest player

A turret fires plasma bullets with a certain firing rate (sv_plasma_per_sec) at the closest player of a team for whom the following criteria are met:

  • The player is within the turret range (sv_plasma_range)
  • The player is not a super player
  • The turret is activated
  • The initial trajectory of the plasma bullet to be generated would not be stopped by any solid block With the exception of solo players, for whom plasma bullets will always be fired, regardless of the rest of the team, if the above criteria are met. Solo players do not affect the generation of plasma bullets for the rest of the team. The shooting rate of sv_plasma_per_sec is independent for each team and solo player and starts with the first tick when a target player is selected.

Constructor & Destructor Documentation

◆ CGun()

CGun::CGun ( CGameWorld * pGameWorld,
vec2 Pos,
bool Freeze,
bool Explosive,
int Layer = 0,
int Number = 0 )

Member Function Documentation

◆ Fire()

void CGun::Fire ( )
private

◆ Reset()

void CGun::Reset ( )
overridevirtual

Reimplemented from CEntity.

◆ Snap()

void CGun::Snap ( int SnappingClient)
overridevirtual

Reimplemented from CEntity.

◆ Tick()

void CGun::Tick ( )
overridevirtual

Reimplemented from CEntity.

Member Data Documentation

◆ m_aLastFireSolo

int CGun::m_aLastFireSolo[MAX_CLIENTS]
private

◆ m_aLastFireTeam

int CGun::m_aLastFireTeam[MAX_CLIENTS]
private

◆ m_Core

vec2 CGun::m_Core
private

◆ m_EvalTick

int CGun::m_EvalTick
private

◆ m_Explosive

bool CGun::m_Explosive
private

◆ m_Freeze

bool CGun::m_Freeze
private

The documentation for this class was generated from the following files:
  • src/game/server/entities/gun.h
  • src/game/server/entities/gun.cpp