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
8class CLaser : public CEntity
9{
10public:
11 CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Type);
12
13 virtual void Reset() override;
14 virtual void Tick() override;
15 virtual void TickPaused() override;
16 virtual void Snap(int SnappingClient) override;
17 virtual void SwapClients(int Client1, int Client2) override;
18
19 virtual int GetOwnerId() const override { return m_Owner; }
20
21protected:
22 bool HitCharacter(vec2 From, vec2 To);
23 void DoBounce();
24
25private:
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