mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-20 04:30:12 +02:00
Initial Prey Game integration support.
This commit is contained in:
@@ -0,0 +1,222 @@
|
||||
// Copyright (C) 2004 Id Software, Inc.
|
||||
//
|
||||
|
||||
#ifndef __GAME_PROJECTILE_H__
|
||||
#define __GAME_PROJECTILE_H__
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
idProjectile
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
//HUMANHEAD: aob
|
||||
extern const idEventDef EV_Fizzle;
|
||||
//HUMANHEAD END
|
||||
|
||||
extern const idEventDef EV_Explode;
|
||||
|
||||
class idProjectile : public idEntity {
|
||||
public :
|
||||
CLASS_PROTOTYPE( idProjectile );
|
||||
|
||||
idProjectile();
|
||||
virtual ~idProjectile();
|
||||
|
||||
void Spawn( void );
|
||||
|
||||
void Save( idSaveGame *savefile ) const;
|
||||
void Restore( idRestoreGame *savefile );
|
||||
|
||||
virtual //HUMANHEAD
|
||||
void Create( idEntity *owner, const idVec3 &start, const idVec3 &dir );
|
||||
virtual void Launch( const idVec3 &start, const idVec3 &dir, const idVec3 &pushVelocity, const float timeSinceFire = 0.0f, const float launchPower = 1.0f, const float dmgPower = 1.0f );
|
||||
virtual void FreeLightDef( void );
|
||||
|
||||
idEntity * GetOwner( void ) const;
|
||||
|
||||
virtual void Think( void );
|
||||
virtual void Killed( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location );
|
||||
virtual bool Collide( const trace_t &collision, const idVec3 &velocity );
|
||||
virtual void Explode( const trace_t &collision, idEntity *ignore );
|
||||
virtual //HUMANHEAD
|
||||
void Fizzle( void );
|
||||
|
||||
//HUMANHEAD: aob - implementation in hhProjectile
|
||||
virtual void Create( idEntity *owner, const idVec3 &start, const idMat3 &axis ) {}
|
||||
virtual void Launch( const idVec3 &start, const idMat3 &axis, const idVec3 &pushVelocity, const float timeSinceFire = 0.0f, const float launchPower = 1.0f, const float dmgPower = 1.0f ) {}
|
||||
//HUMANHEAD END
|
||||
|
||||
static idVec3 GetVelocity( const idDict *projectile );
|
||||
static idVec3 GetGravity( const idDict *projectile );
|
||||
|
||||
enum {
|
||||
EVENT_DAMAGE_EFFECT = idEntity::EVENT_MAXEVENTS,
|
||||
EVENT_PROJECTILE_EXPLOSION, //HUMANHEAD rww
|
||||
EVENT_MAXEVENTS
|
||||
};
|
||||
|
||||
static void DefaultDamageEffect( idEntity *soundEnt, const idDict &projectileDef, const trace_t &collision, const idVec3 &velocity );
|
||||
static bool ClientPredictionCollide( idEntity *soundEnt, const idDict &projectileDef, const trace_t &collision, const idVec3 &velocity, bool addDamageEffect );
|
||||
virtual void ClientPredictionThink( void );
|
||||
virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
|
||||
virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
|
||||
virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg );
|
||||
//HUMANHEAD rww
|
||||
virtual void ClientHideProjectile(void);
|
||||
//HUMANHEAD END
|
||||
|
||||
protected:
|
||||
idEntityPtr<idEntity> owner;
|
||||
|
||||
struct projectileFlags_s {
|
||||
bool detonate_on_world : 1;
|
||||
bool detonate_on_actor : 1;
|
||||
bool randomShaderSpin : 1;
|
||||
bool isTracer : 1;
|
||||
bool noSplashDamage : 1;
|
||||
bool isLarge : 1; // HUMANHEAD bjk
|
||||
} projectileFlags;
|
||||
|
||||
float thrust;
|
||||
int thrust_end;
|
||||
float damagePower;
|
||||
|
||||
renderLight_t renderLight;
|
||||
qhandle_t lightDefHandle; // handle to renderer light def
|
||||
idVec3 lightOffset;
|
||||
int lightStartTime;
|
||||
int lightEndTime;
|
||||
idVec3 lightColor;
|
||||
|
||||
//HUMANHEAD rww - don't need thruster objects on the projectile, takes up time for constructor
|
||||
//idForce_Constant thruster;
|
||||
idPhysics_RigidBody physicsObj;
|
||||
|
||||
const idDeclParticle * smokeFly;
|
||||
int smokeFlyTime;
|
||||
|
||||
typedef enum {
|
||||
// must update these in script/doom_defs.script if changed
|
||||
SPAWNED = 0,
|
||||
CREATED = 1,
|
||||
LAUNCHED = 2,
|
||||
FIZZLED = 3,
|
||||
EXPLODED = 4,
|
||||
COLLIDED = 5 //HUMANHEAD bjk
|
||||
} projectileState_t;
|
||||
|
||||
projectileState_t state;
|
||||
bool netSyncPhysics;
|
||||
|
||||
private:
|
||||
|
||||
void AddDefaultDamageEffect( const trace_t &collision, const idVec3 &velocity );
|
||||
|
||||
void Event_Explode( void );
|
||||
void Event_Fizzle( void );
|
||||
void Event_RadiusDamage( idEntity *ignore );
|
||||
void Event_Touch( idEntity *other, trace_t *trace );
|
||||
void Event_GetProjectileState( void );
|
||||
};
|
||||
|
||||
class idGuidedProjectile : public idProjectile {
|
||||
public :
|
||||
CLASS_PROTOTYPE( idGuidedProjectile );
|
||||
|
||||
idGuidedProjectile( void );
|
||||
~idGuidedProjectile( void );
|
||||
|
||||
void Save( idSaveGame *savefile ) const;
|
||||
void Restore( idRestoreGame *savefile );
|
||||
|
||||
void Spawn( void );
|
||||
virtual void Think( void );
|
||||
virtual void Launch( const idVec3 &start, const idVec3 &dir, const idVec3 &pushVelocity, const float timeSinceFire = 0.0f, const float launchPower = 1.0f, const float dmgPower = 1.0f );
|
||||
|
||||
protected:
|
||||
float speed;
|
||||
idEntityPtr<idEntity> enemy;
|
||||
virtual void GetSeekPos( idVec3 &out );
|
||||
|
||||
private:
|
||||
idAngles rndScale;
|
||||
idAngles rndAng;
|
||||
idAngles angles;
|
||||
int rndUpdateTime;
|
||||
float turn_max;
|
||||
float clamp_dist;
|
||||
bool burstMode;
|
||||
bool unGuided;
|
||||
float burstDist;
|
||||
float burstVelocity;
|
||||
};
|
||||
|
||||
// idSoulCubeMissile (HUMANHEAD pdm: removed)
|
||||
|
||||
// idBFGProjectile (HUMANHEAD pdm: removed)
|
||||
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
idDebris
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
class idDebris : public idEntity {
|
||||
public :
|
||||
CLASS_PROTOTYPE( idDebris );
|
||||
|
||||
idDebris();
|
||||
~idDebris();
|
||||
|
||||
// save games
|
||||
void Save( idSaveGame *savefile ) const; // archives object for save game file
|
||||
void Restore( idRestoreGame *savefile ); // unarchives object from save game file
|
||||
|
||||
void Spawn( void );
|
||||
|
||||
void Create( idEntity *owner, const idVec3 &start, const idMat3 &axis );
|
||||
void Launch( void );
|
||||
void Think( void );
|
||||
void Killed( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location );
|
||||
void Explode( void );
|
||||
void Fizzle( void );
|
||||
virtual bool Collide( const trace_t &collision, const idVec3 &velocity );
|
||||
|
||||
//HUMANHEAD rww
|
||||
virtual void ClientPredictionThink( void );
|
||||
void WriteToSnapshot( idBitMsgDelta &msg ) const;
|
||||
void ReadFromSnapshot( const idBitMsgDelta &msg );
|
||||
//HUMANHEAD END
|
||||
|
||||
//HUMANHEAD: aob
|
||||
protected:
|
||||
s_channelType DetermineNextChannel();
|
||||
void AttemptToPlayBounceSound( const trace_t &collision, const idVec3 &velocity );
|
||||
//HUMANHEAD END
|
||||
|
||||
private:
|
||||
idEntityPtr<idEntity> owner;
|
||||
idPhysics_RigidBody physicsObj;
|
||||
const idDeclParticle * smokeFly;
|
||||
int smokeFlyTime;
|
||||
const idSoundShader * sndBounce;
|
||||
|
||||
//HUMANHEAD: aob
|
||||
float collisionSpeed_max;
|
||||
float collisionSpeed_min;
|
||||
int currentChannel;
|
||||
int solidTest; // mdl
|
||||
//HUMANHEAD END
|
||||
|
||||
void Event_Explode( void );
|
||||
void Event_Fizzle( void );
|
||||
void Event_CheckClip( void ); // HUMANHEAD mdl
|
||||
};
|
||||
|
||||
#endif /* !__GAME_PROJECTILE_H__ */
|
||||
Reference in New Issue
Block a user