2010-11-20 10:37:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
2010-05-29 07:25:38 +00:00
|
|
|
#ifndef GAME_SERVER_ENTITIES_LASER_H
|
|
|
|
#define GAME_SERVER_ENTITIES_LASER_H
|
|
|
|
|
|
|
|
#include <game/server/entity.h>
|
|
|
|
|
|
|
|
class CLaser : public CEntity
|
|
|
|
{
|
|
|
|
public:
|
2010-08-30 23:45:42 +00:00
|
|
|
CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Type);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2021-12-14 09:35:00 +00:00
|
|
|
virtual void Reset() override;
|
|
|
|
virtual void Tick() override;
|
|
|
|
virtual void TickPaused() override;
|
|
|
|
virtual void Snap(int SnappingClient) override;
|
|
|
|
virtual void SwapClients(int Client1, int Client2) override;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
protected:
|
|
|
|
bool HitCharacter(vec2 From, vec2 To);
|
|
|
|
void DoBounce();
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
private:
|
|
|
|
vec2 m_From;
|
|
|
|
vec2 m_Dir;
|
2013-07-18 23:06:48 +00:00
|
|
|
vec2 m_TelePos;
|
2013-07-20 12:16:41 +00:00
|
|
|
bool m_WasTele;
|
2010-05-29 07:25:38 +00:00
|
|
|
float m_Energy;
|
|
|
|
int m_Bounces;
|
|
|
|
int m_EvalTick;
|
|
|
|
int m_Owner;
|
2011-07-22 12:58:06 +00:00
|
|
|
int m_TeamMask;
|
2022-06-10 12:59:34 +00:00
|
|
|
int m_ZeroEnergyBounceInLastTick;
|
2011-04-09 06:41:31 +00:00
|
|
|
|
|
|
|
// DDRace
|
|
|
|
|
|
|
|
vec2 m_PrevPos;
|
2010-07-29 05:21:18 +00:00
|
|
|
int m_Type;
|
2014-03-12 23:54:44 +00:00
|
|
|
int m_TuneZone;
|
2018-02-14 15:27:26 +00:00
|
|
|
bool m_TeleportCancelled;
|
2018-11-02 23:02:20 +00:00
|
|
|
bool m_IsBlueTeleport;
|
2022-02-11 09:56:34 +00:00
|
|
|
bool m_BelongsToPracticeTeam;
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|