DDNet documentation
Loading...
Searching...
No Matches
projectile.h
Go to the documentation of this file.
1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef GAME_SERVER_ENTITIES_PROJECTILE_H
4#define GAME_SERVER_ENTITIES_PROJECTILE_H
5
7
8class CProjectile : public CEntity
9{
10public:
12 CGameWorld *pGameWorld,
13 int Type,
14 int Owner,
15 vec2 Pos,
16 vec2 Dir,
17 int Span,
18 bool Freeze,
19 bool Explosive,
20 int SoundImpact,
21 vec2 InitDir,
22 int Layer = 0,
23 int Number = 0);
24
25 vec2 GetPos(float Time);
26
28 bool NetIsInfoLegacyCompatible() const;
31
32 void Reset() override;
33 void Tick() override;
34 void TickPaused() override;
35 void Snap(int SnappingClient) override;
36 void SwapClients(int Client1, int Client2) override;
37
38private:
40 int m_LifeSpan;
41 int m_Owner;
42 int m_Type;
43 int m_SoundImpact;
44 int m_StartTick;
45 bool m_Explosive;
46
47 // DDRace
48
49 int m_Bouncing;
50 bool m_Freeze;
51 int m_TuneZone;
56
57public:
58 void SetBouncing(int Value);
59
60 bool CanCollide(int ClientId) override;
61 int GetOwnerId() const override { return m_Owner; }
62};
63
64#endif
Definition entity.h:13
Definition projectile.h:11
int GetOwnerId() const override
Definition projectile.h:61
bool m_IsSolo
Definition projectile.h:54
int m_DDRaceTeam
Definition projectile.h:53
bool m_Freeze
Definition projectile.h:55
bool NetIsInfoLegacyCompatible() const
Definition projectile.cpp:283
int m_Bouncing
Definition projectile.h:54
CNetObj_DDRaceProjectile NetInfoLegacy() const
Definition projectile.cpp:294
vec2 m_Direction
Definition projectile.h:43
void Tick() override
bool CanCollide(int ClientId) override
Definition projectile.cpp:429
int m_SoundImpact
Definition projectile.h:47
int m_Owner
Definition projectile.h:45
vec2 GetPos(float Time)
CNetObj_Projectile NetInfoVanilla() const
Definition projectile.cpp:271
CProjectile(CGameWorld *pGameWorld, int Type, int Owner, vec2 Pos, vec2 Dir, int Span, bool Freeze, bool Explosive, int SoundImpact, int Layer=0, int Number=0)
Definition projectile.cpp:15
bool m_BelongsToPracticeTeam
Definition projectile.h:52
void TickPaused() override
Definition projectile.cpp:266
int m_TuneZone
Definition projectile.h:56
void Reset() override
Definition projectile.cpp:54
void Snap(int SnappingClient) override
Definition projectile.cpp:369
void SetBouncing(int Value)
bool m_Explosive
Definition projectile.h:50
int m_StartTick
Definition projectile.h:49
CNetObj_DDNetProjectile NetInfo() const
Definition projectile.cpp:324
int m_LifeSpan
Definition projectile.h:44
int m_Type
Definition projectile.h:46
void SwapClients(int Client1, int Client2) override
Definition projectile.cpp:422
friend class CGameWorld
Definition projectile.h:12
vec2 m_InitDir
Definition projectile.h:55
Definition protocol.h:646
Definition protocol.h:618
Definition protocol.h:442
vector2_base< float > vec2
Definition vmath.h:161