2022-05-02 18:31:17 +00:00
|
|
|
/* See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */
|
|
|
|
#ifndef GAME_SERVER_ENTITIES_DRAGGER_BEAM_H
|
|
|
|
#define GAME_SERVER_ENTITIES_DRAGGER_BEAM_H
|
|
|
|
|
|
|
|
#include <game/server/entity.h>
|
|
|
|
|
2022-06-17 17:54:10 +00:00
|
|
|
class CDragger;
|
|
|
|
class CGameWorld;
|
|
|
|
|
2022-05-09 11:56:06 +00:00
|
|
|
/**
|
|
|
|
* Dragger beams pull a selected player towards their center
|
|
|
|
*
|
|
|
|
* Dragger beams are generated by a particular dragger for the player closest to it and for whom certain criteria are
|
|
|
|
* met. Dragger beams exist until these criteria are no longer met. Dragger beams dissolve and automatically
|
|
|
|
* de-register from their dragger source as soon as the player for whom they were created:
|
|
|
|
* - is no longer alive
|
2022-05-09 12:03:00 +00:00
|
|
|
* - is no longer in range (sv_dragger_range)
|
2022-05-09 11:56:06 +00:00
|
|
|
* - can no longer be dragged because the beam is intercepted by a laser stopper (or if !IgnoreWalls by solid blocks)
|
|
|
|
*
|
|
|
|
* Dragger beams accelerate the selected player every tick towards their center. The length of the speed vector, which
|
|
|
|
* is added to that of the player, depends only on the strength of the dragger and is between 1 and 3 units long. If
|
|
|
|
* the player is in the center of the dragger, it will not accelerate.
|
|
|
|
*/
|
2022-05-02 18:31:17 +00:00
|
|
|
class CDraggerBeam : public CEntity
|
|
|
|
{
|
2022-05-04 17:33:48 +00:00
|
|
|
CDragger *m_pDragger;
|
2022-05-02 18:31:17 +00:00
|
|
|
float m_Strength;
|
2022-05-04 17:33:48 +00:00
|
|
|
bool m_IgnoreWalls;
|
2022-05-02 18:31:17 +00:00
|
|
|
int m_ForClientID;
|
|
|
|
int m_EvalTick;
|
|
|
|
bool m_Active;
|
|
|
|
|
|
|
|
public:
|
2022-05-26 17:33:01 +00:00
|
|
|
CDraggerBeam(CGameWorld *pGameWorld, CDragger *pDragger, vec2 Pos, float Strength, bool IgnoreWalls, int ForClientID, int Layer, int Number);
|
2022-05-02 18:31:17 +00:00
|
|
|
|
|
|
|
void SetPos(vec2 Pos);
|
|
|
|
|
2022-05-22 20:01:07 +00:00
|
|
|
void Reset() override;
|
|
|
|
void Tick() override;
|
|
|
|
void Snap(int SnappingClient) override;
|
2022-05-02 18:31:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GAME_SERVER_ENTITIES_DRAGGER_BEAM_H
|