1/* See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */
2#ifndef GAME_SERVER_ENTITIES_DRAGGER_BEAM_H
3#define GAME_SERVER_ENTITIES_DRAGGER_BEAM_H
4
5#include <game/server/entity.h>
6
7class CDragger;
8class CGameWorld;
9
10/**
11 * Dragger beams pull a selected player towards their center
12 *
13 * Dragger beams are generated by a particular dragger for the player closest to it and for whom certain criteria are
14 * met. Dragger beams exist until these criteria are no longer met. Dragger beams dissolve and automatically
15 * de-register from their dragger source as soon as the player for whom they were created:
16 * - is no longer alive
17 * - is no longer in range (sv_dragger_range)
18 * - can no longer be dragged because the beam is intercepted by a laser stopper (or if !IgnoreWalls by solid blocks)
19 *
20 * Dragger beams accelerate the selected player every tick towards their center. The length of the speed vector, which
21 * is added to that of the player, depends only on the strength of the dragger and is between 1 and 3 units long. If
22 * the player is in the center of the dragger, it will not accelerate.
23 */
24class CDraggerBeam : public CEntity
25{
26 CDragger *m_pDragger;
27 float m_Strength;
28 bool m_IgnoreWalls;
29 int m_ForClientId;
30 int m_EvalTick;
31 bool m_Active;
32
33public:
34 CDraggerBeam(CGameWorld *pGameWorld, CDragger *pDragger, vec2 Pos, float Strength, bool IgnoreWalls, int ForClientId, int Layer, int Number);
35
36 void SetPos(vec2 Pos);
37
38 void Reset() override;
39 void Tick() override;
40 void Snap(int SnappingClient) override;
41 void SwapClients(int Client1, int Client2) override;
42};
43
44#endif // GAME_SERVER_ENTITIES_DRAGGER_BEAM_H
45