/* (c) Shereef Marzouk. See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */ #ifndef GAME_SERVER_ENTITIES_PLASMA_H #define GAME_SERVER_ENTITIES_PLASMA_H #include /** * Plasma Bullets are projectiles fired from turrets at a specific target * * When hitting a tee, plasma bullets can either freeze or unfreeze the player * Also, plasma projectiles can explode on impact. However, the player affected by the explosion is not necessarily the * one the plasma collided with, but if the affected player is not a solo player, then the team-mate with the lowest * ClientId within the explosion range. Furthermore, the affected player does not feel the explosion at the point of * impact but at the last position of the plasma bullet. The same applies if a plasma bullet explodes due to a collision * with a laser stopper or a solid block * Plasma bullets move every tick in the assigned direction and then accelerate by the factor PLASMA_ACCEL * Plasma bullets will stop existing as soon as: * - The player they were created for do no longer exist * - They have had a collision with a player, a solid block or a laser stopper * - Their life time of 1.5 seconds has expired */ class CPlasma : public CEntity { vec2 m_Core; int m_Freeze; bool m_Explosive; int m_ForClientID; int m_EvalTick; int m_LifeTime; bool HitCharacter(CCharacter *pTarget); void Move(); public: CPlasma(CGameWorld *pGameWorld, vec2 Pos, vec2 Dir, bool Freeze, bool Explosive, int ForClientId); void Reset() override; void Tick() override; void Snap(int SnappingClient) override; }; #endif // GAME_SERVER_ENTITIES_PLASMA_H