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