2019-04-11 22:46:54 +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. */
|
|
|
|
#ifndef GAME_CLIENT_PREDICTION_ENTITIES_PROJECTILE_H
|
|
|
|
#define GAME_CLIENT_PREDICTION_ENTITIES_PROJECTILE_H
|
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
#include <game/client/prediction/entity.h>
|
2021-01-17 16:18:08 +00:00
|
|
|
|
|
|
|
class CProjectileData;
|
2019-04-11 22:46:54 +00:00
|
|
|
|
|
|
|
class CProjectile : public CEntity
|
|
|
|
{
|
|
|
|
friend class CGameWorld;
|
2019-04-13 22:54:29 +00:00
|
|
|
friend class CItems;
|
2020-09-26 19:41:58 +00:00
|
|
|
|
2019-04-11 22:46:54 +00:00
|
|
|
public:
|
2020-09-26 19:41:58 +00:00
|
|
|
CProjectile(
|
2019-04-11 22:46:54 +00:00
|
|
|
CGameWorld *pGameWorld,
|
|
|
|
int Type,
|
|
|
|
int Owner,
|
|
|
|
vec2 Pos,
|
|
|
|
vec2 Dir,
|
|
|
|
int Span,
|
2022-01-22 13:12:59 +00:00
|
|
|
bool Freeze,
|
2019-04-11 22:46:54 +00:00
|
|
|
bool Explosive,
|
|
|
|
float Force,
|
|
|
|
int SoundImpact,
|
|
|
|
int Layer = 0,
|
2020-09-26 19:41:58 +00:00
|
|
|
int Number = 0);
|
2019-04-11 22:46:54 +00:00
|
|
|
|
|
|
|
vec2 GetPos(float Time);
|
2021-01-17 16:18:08 +00:00
|
|
|
CProjectileData GetData() const;
|
2019-04-11 22:46:54 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void Tick() override;
|
2019-04-11 22:46:54 +00:00
|
|
|
|
2019-04-13 23:34:15 +00:00
|
|
|
bool Match(CProjectile *pProj);
|
|
|
|
void SetBouncing(int Value);
|
|
|
|
|
|
|
|
const vec2 &GetDirection() { return m_Direction; }
|
|
|
|
const int &GetOwner() { return m_Owner; }
|
|
|
|
const int &GetStartTick() { return m_StartTick; }
|
2021-09-19 12:14:00 +00:00
|
|
|
CProjectile(CGameWorld *pGameWorld, int ID, CProjectileData *pProj, const CNetObj_EntityEx *pEntEx = 0);
|
2019-04-13 23:34:15 +00:00
|
|
|
|
2019-04-13 22:54:29 +00:00
|
|
|
private:
|
2019-04-11 22:46:54 +00:00
|
|
|
vec2 m_Direction;
|
|
|
|
int m_LifeSpan;
|
|
|
|
int m_Owner;
|
|
|
|
int m_Type;
|
|
|
|
int m_SoundImpact;
|
|
|
|
float m_Force;
|
|
|
|
int m_StartTick;
|
|
|
|
bool m_Explosive;
|
|
|
|
|
|
|
|
// DDRace
|
|
|
|
|
|
|
|
int m_Bouncing;
|
|
|
|
bool m_Freeze;
|
2019-09-08 22:53:07 +00:00
|
|
|
int m_TuneZone;
|
2019-04-11 22:46:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|