| 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_LASER_H |
| 4 | #define GAME_SERVER_ENTITIES_LASER_H |
| 5 | |
| 6 | #include <game/server/entity.h> |
| 7 | |
| 8 | class CLaser : public CEntity |
| 9 | { |
| 10 | public: |
| 11 | CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Type); |
| 12 | |
| 13 | void Reset() override; |
| 14 | void Tick() override; |
| 15 | void TickPaused() override; |
| 16 | void Snap(int SnappingClient) override; |
| 17 | void SwapClients(int Client1, int Client2) override; |
| 18 | |
| 19 | int GetOwnerId() const override { return m_Owner; } |
| 20 | |
| 21 | protected: |
| 22 | bool HitCharacter(vec2 From, vec2 To); |
| 23 | void DoBounce(); |
| 24 | |
| 25 | private: |
| 26 | vec2 m_From; |
| 27 | vec2 m_Dir; |
| 28 | vec2 m_TelePos; |
| 29 | bool m_WasTele; |
| 30 | float m_Energy; |
| 31 | int m_Bounces; |
| 32 | int m_EvalTick; |
| 33 | int m_Owner; |
| 34 | CClientMask m_TeamMask; |
| 35 | bool m_ZeroEnergyBounceInLastTick; |
| 36 | |
| 37 | // DDRace |
| 38 | |
| 39 | vec2 m_PrevPos; |
| 40 | int m_Type; |
| 41 | int m_TuneZone; |
| 42 | bool m_TeleportCancelled; |
| 43 | bool m_IsBlueTeleport; |
| 44 | bool m_BelongsToPracticeTeam; |
| 45 | }; |
| 46 | |
| 47 | #endif |
| 48 | |