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
6#include <game/server/entity.h>
7
8class CProjectile : public CEntity
9{
10public:
11 CProjectile(
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
27 CNetObj_Projectile NetInfoVanilla() const;
28 bool NetIsInfoLegacyCompatible() const;
29 CNetObj_DDRaceProjectile NetInfoLegacy(int SnappingClient);
30 CNetObj_DDNetProjectile NetInfo(int SnappingClient);
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:
39 vec2 m_Direction;
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 CClientMask m_TeamMask;
50 int m_Bouncing;
51 bool m_Freeze;
52 int m_TuneZone;
53 bool m_BelongsToPracticeTeam;
54 int m_DDRaceTeam;
55 bool m_IsSolo;
56 vec2 m_InitDir;
57
58public:
59 void SetBouncing(int Value);
60
61 bool CanCollide(int ClientId) override;
62 int GetOwnerId() const override { return m_Owner; }
63};
64
65#endif
66