2011-12-25 13:33:05 +00:00
|
|
|
/* (c) Shereef Marzouk. See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */
|
2018-07-06 14:11:38 +00:00
|
|
|
#ifndef GAME_SERVER_ENTITIES_PLASMA_H
|
|
|
|
#define GAME_SERVER_ENTITIES_PLASMA_H
|
2010-07-29 05:21:18 +00:00
|
|
|
|
|
|
|
#include <game/server/entity.h>
|
|
|
|
|
2022-05-09 11:56:06 +00:00
|
|
|
/**
|
|
|
|
* 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
|
2022-05-17 12:28:37 +00:00
|
|
|
* Plasma bullets can explode twice if they would hit both a player and an obstacle in the next movement step
|
2022-05-09 11:56:06 +00:00
|
|
|
* 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
|
|
|
|
*/
|
2020-09-26 19:41:58 +00:00
|
|
|
class CPlasma : public CEntity
|
2010-07-29 05:21:18 +00:00
|
|
|
{
|
2010-08-28 20:32:16 +00:00
|
|
|
vec2 m_Core;
|
2022-05-04 17:33:48 +00:00
|
|
|
int m_Freeze;
|
|
|
|
bool m_Explosive;
|
|
|
|
int m_ForClientID;
|
2010-08-28 20:32:16 +00:00
|
|
|
int m_EvalTick;
|
|
|
|
int m_LifeTime;
|
2010-09-11 09:42:35 +00:00
|
|
|
|
2010-08-28 20:32:16 +00:00
|
|
|
void Move();
|
2022-05-17 12:28:37 +00:00
|
|
|
bool HitCharacter(CCharacter *pTarget);
|
|
|
|
bool HitObstacle(CCharacter *pTarget);
|
2010-09-11 09:42:35 +00:00
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
public:
|
2011-12-25 13:51:04 +00:00
|
|
|
CPlasma(CGameWorld *pGameWorld, vec2 Pos, vec2 Dir, bool Freeze,
|
2022-05-04 17:33:48 +00:00
|
|
|
bool Explosive, int ForClientId);
|
2010-07-29 05:21:18 +00:00
|
|
|
|
2022-05-17 20:13:44 +00:00
|
|
|
void Reset() override;
|
|
|
|
void Tick() override;
|
|
|
|
void Snap(int SnappingClient) override;
|
2010-07-29 05:21:18 +00:00
|
|
|
};
|
|
|
|
|
2018-07-06 14:11:38 +00:00
|
|
|
#endif // GAME_SERVER_ENTITIES_PLASMA_H
|