29 #include "../idlib/precompiled.h"
71 const idEventDef EV_Weapon_GrabberHasTarget(
"grabberHasTarget",
NULL,
'd' );
72 const idEventDef EV_Weapon_Grabber(
"grabber",
"d" );
73 const idEventDef EV_Weapon_Grabber_SetGrabDistance(
"grabberGrabDistance",
"f" );
74 const idEventDef EV_Weapon_LaunchProjectilesEllipse(
"launchProjectilesEllipse",
"dffff" );
75 const idEventDef EV_Weapon_LaunchPowerup(
"launchPowerup",
"sfd" );
76 const idEventDef EV_Weapon_StartWeaponSmoke(
"startWeaponSmoke" );
77 const idEventDef EV_Weapon_StopWeaponSmoke(
"stopWeaponSmoke" );
78 const idEventDef EV_Weapon_StartWeaponParticle(
"startWeaponParticle",
"s" );
79 const idEventDef EV_Weapon_StopWeaponParticle(
"stopWeaponParticle",
"s" );
80 const idEventDef EV_Weapon_StartWeaponLight(
"startWeaponLight",
"s" );
81 const idEventDef EV_Weapon_StopWeaponLight(
"stopWeaponLight",
"s" );
125 EVENT( EV_Weapon_Grabber, idWeapon::Event_Grabber )
126 EVENT( EV_Weapon_GrabberHasTarget,
idWeapon::Event_GrabberHasTarget )
127 EVENT( EV_Weapon_Grabber_SetGrabDistance,
idWeapon::Event_GrabberSetGrabDistance )
128 EVENT( EV_Weapon_LaunchProjectilesEllipse,
idWeapon::Event_LaunchProjectilesEllipse )
129 EVENT( EV_Weapon_LaunchPowerup,
idWeapon::Event_LaunchPowerup )
130 EVENT( EV_Weapon_StartWeaponSmoke,
idWeapon::Event_StartWeaponSmoke )
131 EVENT( EV_Weapon_StopWeaponSmoke,
idWeapon::Event_StopWeaponSmoke )
132 EVENT( EV_Weapon_StartWeaponParticle,
idWeapon::Event_StartWeaponParticle )
133 EVENT( EV_Weapon_StopWeaponParticle,
idWeapon::Event_StopWeaponParticle )
134 EVENT( EV_Weapon_StartWeaponLight,
idWeapon::Event_StartWeaponLight )
135 EVENT( EV_Weapon_StopWeaponLight,
idWeapon::Event_StopWeaponLight )
207 grabber.Initialize();
252 const char *brassDefName;
253 const char *clipModelName;
263 brassDefName = weaponDef->
dict.
GetString(
"def_ejectBrass" );
264 if ( brassDefName[0] ) {
268 if ( !clipModelName[0] ) {
412 savefile->
WriteInt(weaponParticles.Num());
413 for(
int i = 0;
i < weaponParticles.Num();
i++) {
414 WeaponParticle_t* part = weaponParticles.GetIndex(
i);
418 savefile->
WriteInt( part->startTime );
425 savefile->
WriteInt(weaponLights.Num());
426 for(
int i = 0;
i < weaponLights.Num();
i++) {
427 WeaponLight_t* light = weaponLights.GetIndex(
i);
430 savefile->
WriteInt( light->startTime );
432 savefile->
WriteInt( light->lightHandle );
494 if ( projectileDef ) {
613 savefile->
ReadInt( grabberState );
618 savefile->
ReadInt( particleCount );
619 for(
int i = 0;
i < particleCount;
i++) {
620 WeaponParticle_t newParticle;
621 memset(&newParticle, 0,
sizeof(newParticle));
627 strcpy( newParticle.name, name.
c_str() );
628 strcpy( newParticle.particlename, particlename.
c_str() );
630 savefile->
ReadBool( newParticle.active );
631 savefile->
ReadInt( newParticle.startTime );
632 savefile->
ReadJoint( newParticle.joint );
633 savefile->
ReadBool( newParticle.smoke );
634 if(newParticle.smoke) {
637 savefile->
ReadObject(reinterpret_cast<idClass *&>(newParticle.emitter));
640 weaponParticles.Set(newParticle.name, newParticle);
644 savefile->
ReadInt( lightCount );
645 for(
int i = 0;
i < lightCount;
i++) {
646 WeaponLight_t newLight;
647 memset(&newLight, 0,
sizeof(newLight));
651 strcpy( newLight.name, name.
c_str() );
653 savefile->
ReadBool( newLight.active );
654 savefile->
ReadInt( newLight.startTime );
656 savefile->
ReadInt( newLight.lightHandle );
658 if ( newLight.lightHandle >= 0 ) {
661 weaponLights.Set(newLight.name, newLight);
795 grabber.Update(
owner,
true );
827 for(
int i = 0;
i < weaponParticles.Num();
i++) {
828 WeaponParticle_t* part = weaponParticles.GetIndex(
i);
831 part->emitter->PostEventMS(&
EV_Remove, 0 );
834 weaponParticles.Clear();
837 for(
int i = 0;
i < weaponLights.Num();
i++) {
838 WeaponLight_t* light = weaponLights.GetIndex(
i);
839 if ( light->lightHandle != -1 ) {
843 weaponLights.Clear();
891 if ( model[0] && attach[0] ) {
905 if ( worldModelRenderEntity ) {
927 const char *objectType;
930 const char *projectileName;
931 const char *brassDefName;
932 const char *smokeName;
937 if ( !objectname || !objectname[ 0 ] ) {
964 if ( *smokeName !=
'\0' ) {
973 if ( *smokeName !=
'\0' ) {
986 if ( *guiLightShader !=
'\0' ) {
1015 if(smokeJoint.
Length() > 0) {
1026 if ( projectileName[0] !=
'\0' ) {
1028 if ( !projectileDef ) {
1029 gameLocal.
Warning(
"Unknown projectile '%s' in weapon '%s'", projectileName, objectname );
1031 const char *spawnclass = projectileDef->
dict.
GetString(
"spawnclass" );
1033 if ( !cls || !cls->
IsType( idProjectile::Type ) ) {
1034 gameLocal.
Warning(
"Invalid spawnclass '%s' on projectile '%s' (used by weapon '%s')", spawnclass, projectileName, objectname );
1047 bool flashPointLight;
1078 if ( !flashPointLight ) {
1115 if ( brassDefName[0] ) {
1159 gameLocal.
Error(
"No 'weapon_scriptobject' set on '%s'.", objectname );
1164 gameLocal.
Error(
"Script object '%s' not found on weapon '%s'.", objectType, objectname );
1178 if ( shader && *shader ) {
1203 WeaponParticle_t newParticle;
1204 memset( &newParticle, 0,
sizeof( newParticle ) );
1208 strcpy(newParticle.name, name.
c_str());
1213 newParticle.active =
false;
1214 newParticle.startTime = 0;
1217 strcpy(newParticle.particlename, particle.
c_str());
1219 if(newParticle.smoke) {
1225 args = emitterDef->
dict;
1226 args.
Set(
"model", particle.
c_str());
1227 args.
SetBool(
"start_off",
true);
1236 weaponParticles.Set(name.
c_str(), newParticle);
1243 WeaponLight_t newLight;
1244 memset( &newLight, 0,
sizeof( newLight ) );
1246 newLight.lightHandle = -1;
1247 newLight.active =
false;
1248 newLight.startTime = 0;
1251 strcpy(newLight.name, name.
c_str());
1260 newLight.light.lightRadius[0] = newLight.light.lightRadius[1] = newLight.light.lightRadius[2] = radius;
1261 newLight.light.pointLight =
true;
1262 newLight.light.noShadows =
true;
1266 weaponLights.Set(name.
c_str(), newLight);
1323 if ( ammoamount < 0 ) {
1658 if ( grabberState != -1 ) {
1689 if (
sndHum && grabberState == -1 ) {
1707 if (
sndHum && grabberState == -1 ) {
1759 if ( !classname[ 0 ] ) {
1799 if ( !classname[0] ) {
1913 idMat3 localAxis, axistemp;
1914 idVec3 localOrigin, normal;
1939 localAxis[2] = -normal;
1941 localAxis[0] = axistemp[ 0 ] * c + axistemp[ 1 ] * -
s;
1942 localAxis[1] = axistemp[ 0 ] * -s + axistemp[ 1 ] * -
c;
1944 localAxis[0] *= 1.0f /
size;
1945 localAxis[1] *= 1.0f /
size;
1949 localPlane[0] = localAxis[0];
1950 localPlane[0][3] = -(localOrigin * localAxis[0]) + 0.5
f;
1952 localPlane[1] = localAxis[1];
1953 localPlane[1][3] = -(localOrigin * localAxis[1]) + 0.5
f;
1999 origin = origin - axis *
offset;
2000 axis = ang.
ToMat3() * axis;
2018 if ( !constructor ) {
2117 if ( ent->
IsType( idAI::Type ) ) {
2118 static_cast<idAI *
>( ent )->TouchedByFlashlight(
owner );
2119 }
else if ( ent->
IsType( idTrigger::Type ) ) {
2136 if ( ent->
IsType( idAI::Type ) ) {
2137 static_cast<idAI *
>( ent )->TouchedByFlashlight(
owner );
2138 }
else if ( ent->
IsType( idTrigger::Type ) ) {
2163 frac = 1.0f - frac * frac;
2199 if ( showViewModel ) {
2252 if ( showViewModel && !
hide ) {
2254 for(
int i = 0;
i < weaponParticles.Num();
i++ ) {
2255 WeaponParticle_t* part = weaponParticles.GetIndex(
i);
2267 part->active =
false;
2268 part->startTime = 0;
2275 if ( part->emitter->GetModelDefHandle() != -1 ) {
2282 for(
int i = 0;
i < weaponLights.Num();
i++) {
2283 WeaponLight_t* light = weaponLights.GetIndex(
i);
2288 if ( ( light->lightHandle != -1 ) ) {
2298 if ( grabberState != -1 ) {
2299 grabberState = grabber.Update(
owner,
hide );
2366 grabber.Update( this->
GetOwner(),
true );
2453 gameLocal.
Error(
"Could not find entity definition for 'ammo_types'\n" );
2456 if ( !ammoname[ 0 ] ) {
2460 if ( !ammoDict->
GetInt( ammoname,
"-1", num ) ) {
2465 for ( i = 0; i < 2; i++ ) {
2468 }
else if ( i == 1 ) {
2471 if ( gamedir.
Length() > 0 ) {
2474 if ( ammoDict->
GetInt( ammoname,
"-1", num ) ) {
2486 if ( ( num < 0 ) || ( num >= AMMO_NUMTYPES ) ) {
2487 gameLocal.
Error(
"Ammo type '%s' value out of range. Maximum ammo types is %d.\n", ammoname, AMMO_NUMTYPES );
2507 gameLocal.
Error(
"Could not find entity definition for 'ammo_types'\n" );
2510 sprintf( text,
"%d", ammonum );
2513 for( i = 0; i <
num; i++ ) {
2523 for ( i = 0; i < 2; i++ ) {
2526 }
else if ( i == 1 ) {
2529 if ( gamedir.
Length() > 0 ) {
2533 for( i = 0; i <
num; i++ ) {
2560 gameLocal.
Error(
"Could not find entity definition for 'ammo_names'\n" );
2565 if ( name && *name ) {
2567 for( i = 0; i <
num; i++ ) {
2653 int idWeapon::GetGrabberState()
const {
2655 return grabberState;
2665 int idWeapon::AmmoCount()
const {
2695 bool snapLight = msg.
ReadBits( 1 ) != 0;
3130 if ( !skinname || !skinname[ 0 ] ) {
3147 msg.
Init( msgBuf,
sizeof( msgBuf ) );
3175 gameLocal.
Error(
"shader parm index (%d) out of range", parmnum );
3188 gameLocal.
Error(
"shader parm index (%d) out of range", parmnum );
3221 void idWeapon::Event_Grabber(
int enable ) {
3234 void idWeapon::Event_GrabberHasTarget() {
3243 void idWeapon::Event_GrabberSetGrabDistance(
float dist ) {
3245 grabber.SetDragDistance( dist );
3321 dmgPower = (
int )dmgPower + 1;
3387 float spreadRad =
DEG2RAD( spread );
3389 for( i = 0; i < num_projectiles; i++ ) {
3407 float spreadRad =
DEG2RAD( spread );
3408 for( i = 0; i < num_projectiles; i++ ) {
3423 if ( !ent || !ent->
IsType( idProjectile::Type ) ) {
3425 gameLocal.
Error(
"'%s' is not an idProjectile", projectileName );
3441 if ( ( ownerBounds - projBounds).RayIntersection( muzzle_pos,
playerViewAxis[0], distance ) ) {
3477 void idWeapon::Event_LaunchProjectilesEllipse(
int num_projectiles,
float spreada,
float spreadb,
float fuseOffset,
float power ) {
3558 float spreadRadA =
DEG2RAD( spreada );
3559 float spreadRadB =
DEG2RAD( spreadb );
3561 for( i = 0; i < num_projectiles; i++ ) {
3570 if ( !ent || !ent->
IsType( idProjectile::Type ) ) {
3572 gameLocal.
Error(
"'%s' is not an idProjectile", projectileName );
3583 if ( ( ownerBounds - projBounds).RayIntersection( muzzle_pos,
playerViewAxis[0], distance ) ) {
3618 void idWeapon::Event_LaunchPowerup(
const char* powerup,
float duration,
int useAmmo ) {
3653 void idWeapon::Event_StartWeaponSmoke() {
3659 void idWeapon::Event_StopWeaponSmoke() {
3665 void idWeapon::Event_StartWeaponParticle(
const char*
name) {
3666 WeaponParticle_t* part;
3667 weaponParticles.Get(name, &part);
3669 part->active =
true;
3674 part->emitter->Show();
3675 part->emitter->PostEventMS(&
EV_Activate, 0,
this);
3680 void idWeapon::Event_StopWeaponParticle(
const char* name) {
3681 WeaponParticle_t* part;
3682 weaponParticles.Get(name, &part);
3684 part->active =
false;
3685 part->startTime = 0;
3689 part->emitter->Hide();
3690 part->emitter->PostEventMS(&
EV_Activate, 0,
this);
3695 void idWeapon::Event_StartWeaponLight(
const char* name) {
3696 WeaponLight_t* light;
3697 weaponLights.Get(name, &light);
3699 light->active =
true;
3704 void idWeapon::Event_StopWeaponLight(
const char* name) {
3705 WeaponLight_t* light;
3706 weaponLights.Get(name, &light);
3708 light->active =
false;
3709 light->startTime = 0;
3710 if(light->lightHandle != -1) {
3712 light->lightHandle = -1;
3765 && ent->
IsType( idPlayer::Type )
3780 idVec3 kickDir, globalKickDir;
3816 if ( *hitSound ==
'\0' ) {
3824 if ( decal && *decal ) {
3839 if ( *hitSound !=
'\0' ) {
3896 idVec3 origin, linear_velocity, angular_velocity;
3904 if ( !ent || !ent->
IsType( idDebris::Type ) ) {
virtual const idVec3 & GetOrigin(int id=0) const =0
void Event_IsInvisible(void)
const idEventDef AI_PlayCycle("playCycle","ds", 'd')
renderEntity_t renderEntity
bool TracePoint(trace_t &results, const idVec3 &start, const idVec3 &end, int contentMask, const idEntity *passEntity)
float GetFloat(const char *key, const char *defaultString="0") const
virtual bool TrmFromModel(const char *modelName, idTraceModel &trm)=0
bool GetJointTransform(jointHandle_t jointHandle, int currenttime, idVec3 &offset, idMat3 &axis)
GLsizei const GLfloat * value
void WriteString(const char *string)
bool EmitSmoke(const idDeclParticle *smoke, const int startTime, const float diversity, const idVec3 &origin, const idMat3 &axis, int timeGroup)
const idDeclEntityDef * weaponDef
int GetInt(const char *key, const char *defaultString="0") const
void WeaponFireFeedback(const idDict *weaponDef)
void ReadSoundShader(const idSoundShader *&shader)
jointHandle_t barrelJointWorld
assert(prefInfo.fullscreenBtn)
void SetOwner(idPlayer *owner)
virtual const idSoundShader * FindSound(const char *name, bool makeDefault=true)=0
const idDict * FindEntityDefDict(const char *name, bool makeDefault=true) const
void Event_Flashlight(int enable)
void ReadParticle(const idDeclParticle *&particle)
void Restore(idRestoreGame *savefile)
const int SHADERPARM_DIVERSITY
idCVarSystem * cvarSystem
virtual void FreeLightDef(qhandle_t lightHandle)=0
idMat3 mat3_identity(idVec3(1, 0, 0), idVec3(0, 1, 0), idVec3(0, 0, 1))
void Delete(const char *key)
virtual void SetContents(int contents, int id=-1)=0
virtual idAnimator * GetAnimator(void)
void ReadMaterial(const idMaterial *&material)
void CallFunction(const function_t *func, bool clearStack)
void WriteObject(const idClass *obj)
virtual void DebugArrow(const idVec4 &color, const idVec3 &start, const idVec3 &end, int size, const int lifetime=0)=0
idVec3 GetCenter(void) const
void Event_UseAmmo(int amount)
void Event_GetLightParm(int parmnum)
static bool ClientPredictionCollide(idEntity *soundEnt, const idDict &projectileDef, const trace_t &collision, const idVec3 &velocity, bool addDamageEffect)
const idEventDef EV_Weapon_IsInvisible("isInvisible", NULL, 'f')
void Event_PlayAnim(int channel, const char *animname)
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)
const idEventDef EV_Weapon_NetEndReload("netEndReload")
void Printf(const char *fmt,...) const id_attribute((format(printf
bool BloodSplat(float size)
virtual void SetStateString(const char *varName, const char *value)=0
struct idEntity::entityFlags_s fl
void BindToJoint(idEntity *master, const char *jointname, bool orientated)
void Bind(idEntity *master, bool orientated)
type * GetEntity(void) const
const int MAX_EVENT_PARAM_SIZE
bool SetType(const char *typeName)
void SetShaderParm(int parmnum, float value)
const char * GetTypeName(void) const
idSmokeParticles * smokeParticles
const idStr & GetKey(void) const
void Event_LaunchProjectiles(int num_projectiles, float spread, float fuseOffset, float launchPower, float dmgPower)
const idEventDef EV_Activate("activate","e")
static void CacheWeapon(const char *weaponName)
idScriptBool WEAPON_ATTACK
const idEventDef AI_GetBlendFrames("getBlendFrames","d", 'd')
float weaponAngleOffsetScale
const idEventDef EV_Light_GetLightParm("getLightParm","d", 'f')
void Event_PlayCycle(int channel, const char *animname)
GLenum GLenum GLenum GLenum GLenum scale
void Event_EjectBrass(void)
void void void void void Error(const char *fmt,...) const id_attribute((format(printf
void SetPushVelocity(const idVec3 &pushVelocity)
idCVar g_showPlayerShadow("g_showPlayerShadow","0", CVAR_GAME|CVAR_ARCHIVE|CVAR_BOOL,"enables shadow of player model")
idScriptObject scriptObject
idAngles GetAngles(const char *key, const char *defaultString=NULL) const
idAngles muzzle_kick_angles
bool IsType(const idTypeInfo &c) const
void Event_NetReload(void)
jointHandle_t ejectJointWorld
void Set(const float x, const float y, const float z)
int GetInfluenceLevel(void)
int ClientRemapDecl(declType_t type, int index)
void InitWorldModel(const idDeclEntityDef *def)
const idMat3 & GetAxis(void) const
virtual void WriteToSnapshot(idBitMsgDelta &msg) const
virtual void DeconstructScriptObject(void)
int weaponAngleOffsetAverages
const idKeyValue * MatchPrefix(const char *prefix, const idKeyValue *lastMatch=NULL) const
float PowerUpModifier(int type)
bool ProcessEvent(const idEventDef *ev)
void Event_NetEndReload(void)
void PlayAnim(int channelNum, int animnum, int currenttime, int blendTime)
void WriteBits(int value, int numBits)
const idSoundShader * sndHum
void Event_WeaponState(const char *statename, int blendFrames)
void Event_AllowDrop(int allow)
jointHandle_t GetJointHandle(const char *name) const
int suppressShadowInViewID
jointHandle_t flashJointWorld
jointHandle_t barrelJointView
idScriptBool WEAPON_RELOAD
jointHandle_t ventLightJointView
const char * GetName(void) const
void ReadJoint(jointHandle_t &value)
void ReadBool(bool &value)
void WriteStaticObject(const idClass &obj)
void Event_CreateProjectile(void)
const int SHADERPARM_GREEN
virtual void FreeModelDef(void)
void Event_SetLightParm(int parmnum, float value)
virtual void SetLinearVelocity(const idVec3 &newLinearVelocity, int id=0)=0
void Event_ClipSize(void)
GLuint GLuint GLsizei GLenum type
void EnterCinematic(void)
void Create(idEntity *owner, const idVec3 &start, const idVec3 &dir)
const idEventDef EV_Weapon_WeaponHolstered("weaponHolstered")
virtual qhandle_t AddLightDef(const renderLight_t *rlight)=0
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
void Set(const char *key, const char *value)
virtual void ApplyImpulse(idEntity *ent, int id, const idVec3 &point, const idVec3 &impulse)
bool ShowCrosshair(void) const
jointHandle_t ejectJointView
int ReadBits(int numBits) const
virtual void Free(bool immediate)=0
static const char * GetAmmoPickupNameForNum(ammo_t ammonum)
idUserInterfaceManager * uiManager
bool IsReloading(void) const
deferredEntityCallback_t callback
void WriteVec3(const idVec3 &vec)
const idEventDef EV_Weapon_AmmoInClip("ammoInClip", NULL, 'f')
const idEventDef EV_Weapon_CreateProjectile("createProjectile", NULL, 'e')
const idEventDef EV_Weapon_AddToClip("addToClip","d")
virtual void SetModel(const char *modelname)
void GetWeaponTimeOffsets(float *time, float *scale)
int Icmp(const char *text) const
const idEventDef EV_Weapon_AutoReload("autoReload", NULL, 'f')
void SetName(const char *name)
virtual bool ClientReceiveEvent(int event, int time, const idBitMsg &msg)
const idDeclEntityDef * meleeDef
bool Give(const char *statname, const char *value)
void WriteSoundShader(const idSoundShader *shader)
void WriteMaterial(const idMaterial *material)
const int SHADERPARM_ALPHA
#define EVENT(event, function)
virtual void SetStateBool(const char *varName, const bool value)=0
void Init(byte *data, int length)
const int MAX_ENTITY_SHADER_PARMS
virtual void ClientPredictionThink(void)
void WriteJoint(const jointHandle_t value)
void WriteBool(const bool value)
virtual idUserInterface * FindGui(const char *qpath, bool autoLoad=false, bool needUnique=false, bool forceUnique=false)=0
void SetState(const char *statename, int blendFrames)
int suppressLightInViewID
float shaderParms[MAX_ENTITY_SHADER_PARMS]
void CalculateViewWeaponPos(idVec3 &origin, idMat3 &axis)
bool IsHidden(void) const
static float Sin16(float a)
const int SHADERPARM_TIMESCALE
idEntity * SpawnEntityType(const idTypeInfo &classdef, const idDict *args=NULL, bool bIsClientReadSnapshot=false)
const idMaterial * nozzleGlowShader
const idEventDef EV_Weapon_EjectBrass("ejectBrass")
void void void Warning(const char *fmt,...) const id_attribute((format(printf
const idEventDef EV_Weapon_WeaponOutOfAmmo("weaponOutOfAmmo")
virtual const idBounds & GetBounds(int id=-1) const =0
const idEventDef EV_Weapon_WeaponRising("weaponRising")
int suppressShadowInLightID
bool StartSoundShader(const idSoundShader *shader, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length)
const int SHADERPARM_BLUE
static ammo_t GetAmmoNumForName(const char *ammoname)
int ServerRemapDecl(int clientNum, declType_t type, int index)
idRenderModel * SetModel(const char *modelname)
const idEventDef AI_SetBlendFrames("setBlendFrames","dd")
virtual void AddDamageEffect(const trace_t &collision, const idVec3 &velocity, const char *damageDefName)
bool UseAmmo(ammo_t type, int amount)
GLuint GLuint GLsizei count
void NextBestWeapon(void)
idScriptBool WEAPON_RAISEWEAPON
idPhysics * GetPhysics(void) const
virtual void DebugLine(const idVec4 &color, const idVec3 &start, const idVec3 &end, const int lifetime=0, const bool depthTest=false)=0
renderLight_t worldMuzzleFlash
void SetSkin(const idDeclSkin *skin)
const char * GetString(const char *key, const char *defaultString="") const
bool SpawnEntityDef(const idDict &args, idEntity **ent=NULL, bool setDefaults=true)
void ReadFloat(float &value)
bool IsType(const idTypeInfo &superclass) const
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
idVec3 muzzle_kick_offset
idSoundEmitter * referenceSound
void ReadRenderLight(renderLight_t &renderLight)
virtual renderEntity_t * GetRenderEntity(void)
void DoneProcessing(void)
static float Sin(float a)
void UpdateNozzleFx(void)
void WriteFloat(const float value)
static const char * sufaceTypeNames[MAX_SURFACE_TYPES]
renderLight_t muzzleFlash
idThread * frameCommandThread
void ClearAllAnims(int currentTime, int cleartime)
bool GetBool(const char *key, const char *defaultString="0") const
idVec3 firstPersonViewOrigin
idCVar g_muzzleFlash("g_muzzleFlash","1", CVAR_GAME|CVAR_ARCHIVE|CVAR_BOOL,"show muzzle flashes")
virtual const char * GetCVarString(const char *name) const =0
ammo_t GetAmmoType(void) const
idAnimBlend * CurrentAnim(int channelNum)
const idDeclSkin * customSkin
virtual const idDecl * FindType(declType_t type, const char *name, bool makeDefault=true)=0
int GetSpawnId(void) const
int AmmoAvailable(void) const
idVec3 GetVector(const char *key, const char *defaultString=NULL) const
const idDeclParticle * weaponSmoke
void ServerSendEvent(int eventId, const idBitMsg *msg, bool saveEvent, int excludeClient) const
static idTypeInfo * GetClass(const char *name)
virtual void SetOrigin(const idVec3 &newOrigin, int id=-1)=0
void CancelEvents(const idEventDef *ev)
const idAnim * GetAnim(int index) const
const idEventDef AI_PlayAnim("playAnim","ds", 'd')
bool PowerUpActive(int powerup) const
void CycleAnim(int channelNum, int animnum, int currenttime, int blendtime)
static void ReturnFloat(float value)
bool CanShowWeaponViewmodel(void) const
float weaponAngleOffsetMax
const idEventDef EV_Weapon_TotalAmmoCount("totalAmmoCount", NULL, 'f')
const idStr & GetValue(void) const
virtual const idMat3 & GetAxis(int id=0) const =0
virtual idAnimator * GetAnimator(void)
virtual void UpdateEntityDef(qhandle_t entityHandle, const renderEntity_t *re)=0
const idEventDef EV_Weapon_State("weaponState","sd")
const idDeclModelDef * ModelDef(void) const
bool IsLinked(void) const
const idEventDef EV_Weapon_AllowDrop("allowDrop","d")
const function_t * GetConstructor(void) const
idBounds Rotate(const idMat3 &rotation) const
void Event_WeaponRising(void)
#define MASK_SHOT_RENDERMODEL
gameState_t GameState(void) const
const idEventDef EV_Weapon_WeaponReloading("weaponReloading")
void SetBool(const char *key, bool val)
const int SHADERPARM_TIMEOFFSET
void AlertAI(idEntity *ent)
virtual void Damage(idEntity *inflictor, idEntity *attacker, const idVec3 &dir, const char *damageDefName, const float damageScale, const int location)
void GetJoints(int *numJoints, idJointMat **jointsPtr)
static void SinCos16(float a, float &s, float &c)
virtual void UpdateLightDef(qhandle_t lightHandle, const renderLight_t *rlight)=0
const idDeclSkin * GetDefaultSkin(void) const
void Event_WeaponReloading(void)
void Restore(idRestoreGame *savefile)
idEntityPtr< idAnimatedEntity > worldModel
const surfTypes_t GetSurfaceType(void) const
virtual idClipModel * GetClipModel(int id=0) const =0
idMat3 firstPersonViewAxis
void WriteInt(const int value)
virtual void Present(void)
bool GetGlobalJointTransform(bool viewModel, const jointHandle_t jointHandle, idVec3 &offset, idMat3 &axis)
static idEntity * DropItem(const char *classname, const idVec3 &origin, const idMat3 &axis, const idVec3 &velocity, int activateDelay, int removeDelay)
virtual idThread * ConstructScriptObject(void)
void Event_GetWorldModel(void)
idDeclManager * declManager
const idEventDef EV_Light_SetLightParms("setLightParms","ffff")
void WriteMat3(const idMat3 &mat)
void ReadMat3(idMat3 &mat)
idEntity * entities[MAX_GENTITIES]
idDict userInfo[MAX_CLIENTS]
idCVar g_debugWeapon("g_debugWeapon","0", CVAR_GAME|CVAR_BOOL,"")
virtual bool ClientReceiveEvent(int event, int time, const idBitMsg &msg)
static const float TWO_PI
void MuzzleFlashLight(void)
void Event_GetBlendFrames(int channel)
void GetWeaponDef(const char *objectname, int ammoinclip)
idEntity * DropItem(const idVec3 &velocity, int activateDelay, int removeDelay, bool died)
const idDeclParticle * strikeSmoke
const char * Icon(void) const
void LinkTo(idScriptObject &obj, const char *name)
idEntity * GetTraceEntity(const trace_t &trace) const
const idEventDef EV_Weapon_Next("nextWeapon")
void ReadStaticObject(idClass &obj)
void UpdateFlashPosition(void)
void Event_WeaponReady(void)
const idEventDef EV_Weapon_Flashlight("flashlight","d")
void WeaponLoweringCallback(void)
void Event_GetOwner(void)
void WriteAngles(const idAngles &angles)
int HasAmmo(ammo_t type, int amount)
void WeaponRisingCallback(void)
virtual void RemoveDecals(qhandle_t entityHandle)=0
virtual const idDecl * DeclByIndex(declType_t type, int index, bool forceParse=true)=0
void Event_TotalAmmoCount(void)
void GetWeaponAngleOffsets(int *average, float *scale, float *max)
int GetListenerId(void) const
void ProjectDecal(const idVec3 &origin, const idVec3 &dir, float depth, bool parallel, float size, const char *material, float angle=0)
bool IsGametypeFlagBased(void)
const idEventDef EV_Weapon_UseAmmo("useAmmo","d")
void Event_WeaponOutOfAmmo(void)
idMat3 ToMat3(void) const
const idEventDef EV_Weapon_Melee("melee", NULL, 'd')
virtual const idBounds & GetAbsBounds(int id=-1) const =0
void StealWeapon(idPlayer *player)
virtual int GetDefaultSurfaceType(void) const
void Create(idEntity *owner, const idVec3 &start, const idMat3 &axis)
const function_t * GetFunction(const char *name) const
void Signal(signalNum_t signalnum)
idCVar pm_thirdPerson("pm_thirdPerson","0", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_BOOL,"enables third person view")
idCVar g_showBrass("g_showBrass","1", CVAR_GAME|CVAR_ARCHIVE|CVAR_BOOL,"enables ejected shells from weapon")
const function_t * GetDestructor(void) const
const idEventDef EV_Weapon_AmmoAvailable("ammoAvailable", NULL, 'f')
void Event_SetLightParms(float parm0, float parm1, float parm2, float parm3)
#define CLASS_DECLARATION(nameofsuperclass, nameofclass)
const idEventDef EV_Weapon_WeaponLowering("weaponLowering")
virtual void SetAngularVelocity(const idVec3 &newAngularVelocity, int id=0)=0
const idEventDef EV_Weapon_Clear("<clear>")
virtual void SetClipModel(idClipModel *model, float density, int id=0, bool freeOld=true)=0
virtual void ReadFromSnapshot(const idBitMsgDelta &msg)
int worldMuzzleFlashHandle
void UpdateAnimation(void)
void Save(idSaveGame *savefile) const
void ReadVec3(idVec3 &vec)
int suppressSurfaceInViewID
static void ReturnEntity(idEntity *ent)
class idUserInterface * gui[MAX_RENDERENTITY_GUI]
idScriptBool WEAPON_NETENDRELOAD
void Event_AddToClip(int amount)
const char * c_str(void) const
void Event_SetSkin(const char *skinname)
void Clear(int channelNum, int currentTime, int cleartime)
int AmmoInClip(void) const
const idEventDef EV_Weapon_ClipSize("clipSize", NULL, 'f')
const idEventDef EV_Weapon_WeaponReady("weaponReady")
void ReadAngles(idAngles &angles)
ID_INLINE int FRAME2MS(int framenum)
void BecomeActive(int flags)
static const char * GetAmmoNameForNum(ammo_t ammonum)
const idEventDef EV_Weapon_GetOwner("getOwner", NULL, 'e')
const idEventDef EV_Light_SetLightParm("setLightParm","df")
const idKeyValue * GetKeyVal(int index) const
const idEventDef EV_Remove("<immediateremove>", NULL)
void Event_AmmoInClip(void)
void Event_SetBlendFrames(int channel, int blendFrames)
const int ASYNC_PLAYER_INV_CLIP_BITS
int GetEndTime(void) const
virtual void ProjectOverlay(qhandle_t entityHandle, const idPlane localTextureAxis[2], const idMaterial *material)=0
virtual const idDeclSkin * FindSkin(const char *name, bool makeDefault=true)=0
void Event_AutoReload(void)
void PresentWeapon(bool showViewModel)
virtual void DebugBounds(const idVec4 &color, const idBounds &bounds, const idVec3 &org=vec3_origin, const int lifetime=0)=0
int AmmoRequired(void) const
idPlayer * GetOwner(void)
const char * GetEntityDefName(void) const
void MuzzleRise(idVec3 &origin, idMat3 &axis)
const idDeclEntityDef * FindEntityDef(const char *name, bool makeDefault=true) const
idRenderWorld * gameRenderWorld
char * va(const char *fmt,...)
bool Translation(trace_t &results, const idVec3 &start, const idVec3 &end, const idClipModel *mdl, const idMat3 &trmAxis, int contentMask, const idEntity *passEntity)
idScriptBool WEAPON_LOWERWEAPON
void SetOrigin(const idVec3 &org)
bool PostEventMS(const idEventDef *ev, int time)
jointHandle_t guiLightJointView
const idEventDef EV_Weapon_LaunchProjectiles("launchProjectiles","dffff")
void HideWorldModel(void)
const idMaterial * shader
void Save(idSaveGame *savefile) const
const idEventDef EV_Touch("<touch>","et")
void WriteParticle(const idDeclParticle *particle)
void Event_WeaponHolstered(void)
int GetNumKeyVals(void) const
idScriptBool WEAPON_NETRELOAD
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
float shaderParms[MAX_ENTITY_SHADER_PARMS]
void ReadString(idStr &string)
const idEventDef EV_SetSkin("setSkin","s")
const idEventDef EV_Weapon_NetReload("netReload")
void Event_WeaponLowering(void)
void WriteRenderLight(const renderLight_t &renderLight)
jointHandle_t flashJointView
static void ReturnInt(int value)
int sprintf(idStr &string, const char *fmt,...)
void NormalVectors(idVec3 &left, idVec3 &down) const
void Event_AmmoAvailable(void)
const idEventDef AI_AnimDone("animDone","dd", 'd')
virtual bool ShouldConstructScriptObjectAtSpawn(void) const
void ShowWorldModel(void)
idCollisionModelManager * collisionModelManager
void StopSound(const s_channelType channel, bool broadcast)
const idEventDef EV_Weapon_GetWorldModel("getWorldModel", NULL, 'e')
void Event_AnimDone(int channel, int blendFrames)
bool IsHolstered(void) const
void ReadObject(idClass *&obj)
virtual void SetModel(const char *modelname)
virtual void SetAxis(const idMat3 &newAxis, int id=-1)=0
static float Cos(float a)
idScriptBool WEAPON_NETFIRING
void AddProjectilesFired(int count)