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 void FillInfo(CNetObj_Projectile *pProj);
27
28 virtual void Reset() override;
29 virtual void Tick() override;
30 virtual void TickPaused() override;
31 virtual void Snap(int SnappingClient) override;
32 virtual void SwapClients(int Client1, int Client2) override;
33
34private:
35 vec2 m_Direction;
36 int m_LifeSpan;
37 int m_Owner;
38 int m_Type;
39 //int m_Damage;
40 int m_SoundImpact;
41 int m_StartTick;
42 bool m_Explosive;
43
44 // DDRace
45
46 int m_Bouncing;
47 bool m_Freeze;
48 int m_TuneZone;
49 bool m_BelongsToPracticeTeam;
50 vec2 m_InitDir;
51
52public:
53 void SetBouncing(int Value);
54 bool FillExtraInfoLegacy(CNetObj_DDRaceProjectile *pProj);
55 void FillExtraInfo(CNetObj_DDNetProjectile *pProj);
56
57 virtual int GetOwnerId() const override { return m_Owner; }
58};
59
60#endif
61