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() const;
30 CNetObj_DDNetProjectile NetInfo() 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:
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 int m_Bouncing;
50 bool m_Freeze;
51 int m_TuneZone;
52 bool m_BelongsToPracticeTeam;
53 int m_DDRaceTeam;
54 bool m_IsSolo;
55 vec2 m_InitDir;
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
65