Import Grimm changes

This commit is contained in:
Daniel Gibson 2024-11-13 03:02:06 +01:00
parent b782366a08
commit caca24cc53
51 changed files with 7198 additions and 584 deletions

View file

@ -920,6 +920,9 @@ bool idAF::Load( idEntity *ent, const char *fileName ) {
physicsObj.UpdateClipModels(); physicsObj.UpdateClipModels();
// grimm --> annoyingness in the console. I know the last body is not contained, but I'm so dumb I can't fix it and this error is driving me a bit crazy.
// todo: fix this bug in the cloth AF's and put this in again.
/*
// check if each joint is contained by a body // check if each joint is contained by a body
for( i = 0; i < animator->NumJoints(); i++ ) { for( i = 0; i < animator->NumJoints(); i++ ) {
if ( jointBody[i] == -1 ) { if ( jointBody[i] == -1 ) {
@ -927,6 +930,7 @@ bool idAF::Load( idEntity *ent, const char *fileName ) {
name.c_str(), self->name.c_str(), self->GetPhysics()->GetOrigin().ToString(0), animator->GetJointName( (jointHandle_t)i ) ); name.c_str(), self->name.c_str(), self->GetPhysics()->GetOrigin().ToString(0), animator->GetJointName( (jointHandle_t)i ) );
} }
} }
*/
physicsObj.SetMass( file->totalMass ); physicsObj.SetMass( file->totalMass );
physicsObj.SetChanged(); physicsObj.SetChanged();

View file

@ -524,7 +524,7 @@ CLASS_DECLARATION( idAnimatedEntity, idAFEntity_Base )
EVENT( EV_SetConstraintPosition, idAFEntity_Base::Event_SetConstraintPosition ) EVENT( EV_SetConstraintPosition, idAFEntity_Base::Event_SetConstraintPosition )
END_CLASS END_CLASS
static const float BOUNCE_SOUND_MIN_VELOCITY = 80.0f; static const float BOUNCE_SOUND_MIN_VELOCITY = 40.0f; //<-- grimm changed from 80 to 40 to make cloth sound more realistic.
static const float BOUNCE_SOUND_MAX_VELOCITY = 200.0f; static const float BOUNCE_SOUND_MAX_VELOCITY = 200.0f;
/* /*
@ -538,6 +538,7 @@ idAFEntity_Base::idAFEntity_Base( void ) {
nextSoundTime = 0; nextSoundTime = 0;
spawnOrigin.Zero(); spawnOrigin.Zero();
spawnAxis.Identity(); spawnAxis.Identity();
NextSprayTime = 0.0f;
} }
/* /*
@ -561,6 +562,7 @@ void idAFEntity_Base::Save( idSaveGame *savefile ) const {
savefile->WriteVec3( spawnOrigin ); savefile->WriteVec3( spawnOrigin );
savefile->WriteMat3( spawnAxis ); savefile->WriteMat3( spawnAxis );
savefile->WriteInt( nextSoundTime ); savefile->WriteInt( nextSoundTime );
savefile->WriteFloat( NextSprayTime );
af.Save( savefile ); af.Save( savefile );
} }
@ -575,9 +577,20 @@ void idAFEntity_Base::Restore( idRestoreGame *savefile ) {
savefile->ReadVec3( spawnOrigin ); savefile->ReadVec3( spawnOrigin );
savefile->ReadMat3( spawnAxis ); savefile->ReadMat3( spawnAxis );
savefile->ReadInt( nextSoundTime ); savefile->ReadInt( nextSoundTime );
savefile->ReadFloat( NextSprayTime );
LinkCombat(); LinkCombat();
af.Restore( savefile ); af.Restore( savefile );
//restore any splat that was made
//Repaint the world with a decal if needed
idStr mtr_collide;
mtr_collide = spawnArgs.GetString( "mtr_collide" );
float splatsize = spawnArgs.GetFloat( "mtr_splatsize", "282" );
if ( mtr_collide.Length() && g_UseDynamicPaint.GetBool() ) {
gameLocal.ProjectDecal( GetPhysics()->GetOrigin(), GetPhysics()->GetGravity(), 128.0f, true, splatsize, mtr_collide.c_str(), 0, true );
}
} }
/* /*
@ -589,6 +602,15 @@ void idAFEntity_Base::Spawn( void ) {
spawnOrigin = GetPhysics()->GetOrigin(); spawnOrigin = GetPhysics()->GetOrigin();
spawnAxis = GetPhysics()->GetAxis(); spawnAxis = GetPhysics()->GetAxis();
nextSoundTime = 0; nextSoundTime = 0;
// spawn a decal so there's some blood there upon spawn time.
idStr mtr_collide;
mtr_collide = spawnArgs.GetString( "mtr_collide" );
float splatsize = spawnArgs.GetFloat( "mtr_splatsize", "282" );
if ( mtr_collide.Length() && g_UseDynamicPaint.GetBool() ) {
gameLocal.ProjectDecal( GetPhysics()->GetOrigin(), GetPhysics()->GetGravity(), 128.0f, true, splatsize, mtr_collide.c_str(), 0, true );
}
} }
/* /*
@ -628,7 +650,21 @@ idAFEntity_Base::Think
================ ================
*/ */
void idAFEntity_Base::Think( void ) { void idAFEntity_Base::Think( void ) {
const char *spclass;
spclass = spawnArgs.GetString("spawnclass");
//grimm --> disable physics when user requests it.
if ( idStr::Icmp( spclass, "idAFEntity_Generic" ) == 0 && g_usemodelragdolls.GetBool() ) {
RunPhysics(); RunPhysics();
}
if ( idStr::Icmp( spclass, "idAFEntity_Generic" ) != 0 ) {
RunPhysics();
}
// <-- grimm
//RunPhysics();
UpdateAnimation(); UpdateAnimation();
if ( thinkFlags & TH_UPDATEVISUALS ) { if ( thinkFlags & TH_UPDATEVISUALS ) {
Present(); Present();
@ -752,6 +788,30 @@ idAFEntity_Base::Collide
================ ================
*/ */
bool idAFEntity_Base::Collide( const trace_t &collision, const idVec3 &velocity ) { bool idAFEntity_Base::Collide( const trace_t &collision, const idVec3 &velocity ) {
// grimm --> this needed a bit of adjusting for the sake of cloth and performance I've taken out the specific volume depending on impact.
if ( af.IsActive() && gameLocal.time > nextSoundTime ) {
//simply start the sound on SND_CHANNEL_ANY.
StartSound( "snd_bounce", SND_CHANNEL_ANY, 0, false, NULL );
nextSoundTime = gameLocal.time + 500;
}
// grimm -->
// spray something because the animation changed..
idStr mtr_collide;
mtr_collide = spawnArgs.GetString( "mtr_collide" );
if ( IsActive() && mtr_collide.Length() && NextSprayTime < gameLocal.GetTime() ) {
NextSprayTime = gameLocal.GetTime() + 750.0f;
//float ranScale;
//ranScale = 64 + ( 100.0f * gameLocal.random.CRandomFloat() );
//gameLocal.ProjectDecal( GetPhysics()->GetOrigin(), GetPhysics()->GetGravity(), 128.0f, true, ranScale, mtr_collide.c_str() );
gameLocal.ProjectDecal( GetPhysics()->GetOrigin(), -collision.c.normal, 128.0f, true, 128.0f, mtr_collide.c_str(), 0, false );
}
// <-- grimm
float v, f; float v, f;
if ( af.IsActive() ) { if ( af.IsActive() ) {
@ -965,6 +1025,7 @@ idAFEntity_Gibbable::idAFEntity_Gibbable( void ) {
skeletonModel = NULL; skeletonModel = NULL;
skeletonModelDefHandle = -1; skeletonModelDefHandle = -1;
gibbed = false; gibbed = false;
searchable = false; // sikk - Searchable Corpses
} }
/* /*
@ -987,6 +1048,8 @@ idAFEntity_Gibbable::Save
void idAFEntity_Gibbable::Save( idSaveGame *savefile ) const { void idAFEntity_Gibbable::Save( idSaveGame *savefile ) const {
savefile->WriteBool( gibbed ); savefile->WriteBool( gibbed );
savefile->WriteBool( combatModel != NULL ); savefile->WriteBool( combatModel != NULL );
savefile->WriteBool( searchable ); // sikk - Searchable Corpses
} }
/* /*
@ -1000,6 +1063,8 @@ void idAFEntity_Gibbable::Restore( idRestoreGame *savefile ) {
savefile->ReadBool( gibbed ); savefile->ReadBool( gibbed );
savefile->ReadBool( hasCombatModel ); savefile->ReadBool( hasCombatModel );
savefile->ReadBool( searchable ); // sikk - Searchable Corpses
InitSkeletonModel(); InitSkeletonModel();
if ( hasCombatModel ) { if ( hasCombatModel ) {
@ -1017,6 +1082,8 @@ void idAFEntity_Gibbable::Spawn( void ) {
InitSkeletonModel(); InitSkeletonModel();
gibbed = false; gibbed = false;
spawnArgs.GetBool( "searchable", "0", searchable ); // sikk - Searchable Corpses
} }
/* /*
@ -1092,7 +1159,8 @@ void idAFEntity_Gibbable::Damage( idEntity *inflictor, idEntity *attacker, const
return; return;
} }
idAFEntity_Base::Damage( inflictor, attacker, dir, damageDefName, damageScale, location ); idAFEntity_Base::Damage( inflictor, attacker, dir, damageDefName, damageScale, location );
if ( health < -20 && spawnArgs.GetBool( "gib" ) ) { // sikk - Changed gib health from -20 to -health
if ( health < -spawnArgs.GetInt( "health" ) && spawnArgs.GetBool( "gib" ) ) {
Gib( dir, damageDefName ); Gib( dir, damageDefName );
} }
} }
@ -1173,14 +1241,19 @@ void idAFEntity_Gibbable::Gib( const idVec3 &dir, const char *damageDefName ) {
UnlinkCombat(); UnlinkCombat();
if ( g_bloodEffects.GetBool() ) { if ( g_bloodEffects.GetBool() ) {
if ( gameLocal.time > gameLocal.GetGibTime() ) { // sikk - Since "nextGibTime" is a member of idGameLocal and not idAFEntity||idAFEntity_Gibbable
// the folloing if statement is only true once per damage event instead of per entity being damaged.
// This is why only one entity will get gibbed while the rest just disappear after a few seconds.
// I commented this out instead of moving the variable to the proper class because it's easier and
// the delay is only 200ms so the difference should be unnoticable
// if ( gameLocal.time > gameLocal.GetGibTime() ) {
gameLocal.SetGibTime( gameLocal.time + GIB_DELAY ); gameLocal.SetGibTime( gameLocal.time + GIB_DELAY );
SpawnGibs( dir, damageDefName ); SpawnGibs( dir, damageDefName );
renderEntity.noShadow = true; renderEntity.noShadow = true;
renderEntity.shaderParms[ SHADERPARM_TIME_OF_DEATH ] = gameLocal.time * 0.001f; renderEntity.shaderParms[ SHADERPARM_TIME_OF_DEATH ] = gameLocal.time * 0.001f;
StartSound( "snd_gibbed", SND_CHANNEL_ANY, 0, false, NULL ); StartSound( "snd_gibbed", SND_CHANNEL_ANY, 0, false, NULL );
gibbed = true; gibbed = true;
} // }
} else { } else {
gibbed = true; gibbed = true;
} }
@ -2683,7 +2756,7 @@ idGameEdit::AF_CreateMesh
idRenderModel *idGameEdit::AF_CreateMesh( const idDict &args, idVec3 &meshOrigin, idMat3 &meshAxis, bool &poseIsSet ) { idRenderModel *idGameEdit::AF_CreateMesh( const idDict &args, idVec3 &meshOrigin, idMat3 &meshAxis, bool &poseIsSet ) {
int i, jointNum; int i, jointNum;
const idDeclAF *af; const idDeclAF *af;
const idDeclAF_Body *fb; const idDeclAF_Body *fb = NULL; // sikk - warning C4701: potentially uninitialized local variable used
renderEntity_t ent; renderEntity_t ent;
idVec3 origin, *bodyOrigin, *newBodyOrigin, *modifiedOrigin; idVec3 origin, *bodyOrigin, *newBodyOrigin, *modifiedOrigin;
idMat3 axis, *bodyAxis, *newBodyAxis, *modifiedAxis; idMat3 axis, *bodyAxis, *newBodyAxis, *modifiedAxis;

View file

@ -192,6 +192,10 @@ public:
static void DropAFs( idEntity *ent, const char *type, idList<idEntity *> *list ); static void DropAFs( idEntity *ent, const char *type, idList<idEntity *> *list );
// grimm --> bloodspray
float NextSprayTime;
// <-- grimm
protected: protected:
idAF af; // articulated figure idAF af; // articulated figure
idClipModel * combatModel; // render model for hit detection idClipModel * combatModel; // render model for hit detection
@ -228,6 +232,11 @@ public:
virtual void Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir, const char *damageDefName, const float damageScale, const int location ); virtual void Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir, const char *damageDefName, const float damageScale, const int location );
virtual void SpawnGibs( const idVec3 &dir, const char *damageDefName ); virtual void SpawnGibs( const idVec3 &dir, const char *damageDefName );
// sikk---> Searchable Corpses
bool searchable;
bool IsGibbed( void ) { return gibbed; };
// <---sikk
protected: protected:
idRenderModel * skeletonModel; idRenderModel * skeletonModel;
int skeletonModelDefHandle; int skeletonModelDefHandle;

View file

@ -366,6 +366,10 @@ const idEventDef AI_SetState( "setState", "s" );
const idEventDef AI_GetState( "getState", NULL, 's' ); const idEventDef AI_GetState( "getState", NULL, 's' );
const idEventDef AI_GetHead( "getHead", NULL, 'e' ); const idEventDef AI_GetHead( "getHead", NULL, 'e' );
// grimm -->
const idEventDef AI_mSpawnGibs( "SpawnGibs" );
// <-- grimm
CLASS_DECLARATION( idAFEntity_Gibbable, idActor ) CLASS_DECLARATION( idAFEntity_Gibbable, idActor )
EVENT( AI_EnableEyeFocus, idActor::Event_EnableEyeFocus ) EVENT( AI_EnableEyeFocus, idActor::Event_EnableEyeFocus )
EVENT( AI_DisableEyeFocus, idActor::Event_DisableEyeFocus ) EVENT( AI_DisableEyeFocus, idActor::Event_DisableEyeFocus )
@ -408,6 +412,7 @@ CLASS_DECLARATION( idAFEntity_Gibbable, idActor )
EVENT( AI_SetState, idActor::Event_SetState ) EVENT( AI_SetState, idActor::Event_SetState )
EVENT( AI_GetState, idActor::Event_GetState ) EVENT( AI_GetState, idActor::Event_GetState )
EVENT( AI_GetHead, idActor::Event_GetHead ) EVENT( AI_GetHead, idActor::Event_GetHead )
EVENT( AI_mSpawnGibs, idActor::Event_mSpawnGibs )
END_CLASS END_CLASS
/* /*
@ -608,8 +613,16 @@ void idActor::Spawn( void ) {
blink_min = SEC2MS( spawnArgs.GetFloat( "blink_min", "0.5" ) ); blink_min = SEC2MS( spawnArgs.GetFloat( "blink_min", "0.5" ) );
blink_max = SEC2MS( spawnArgs.GetFloat( "blink_max", "8" ) ); blink_max = SEC2MS( spawnArgs.GetFloat( "blink_max", "8" ) );
// sikk---> Player Head Type
// set up the head anim if necessary // set up the head anim if necessary
int headAnim = headAnimator->GetAnim( "def_head" ); int headAnim;
if ( g_playerHeadType.GetBool() && spawnArgs.GetString( "def_head_custom" )[ 0 ] ) {
headAnim = headAnimator->GetAnim( "def_head_custom" );
} else {
headAnim = headAnimator->GetAnim( "def_head" );
}
// <---sikk
if ( headAnim ) { if ( headAnim ) {
if ( headEnt ) { if ( headEnt ) {
headAnimator->CycleAnim( ANIMCHANNEL_ALL, headAnim, gameLocal.time, 0 ); headAnimator->CycleAnim( ANIMCHANNEL_ALL, headAnim, gameLocal.time, 0 );
@ -625,7 +638,7 @@ void idActor::Spawn( void ) {
} }
} }
finalBoss = spawnArgs.GetBool( "finalBoss" ); finalBoss = g_cyberdemonDamageType.GetBool() ? false : spawnArgs.GetBool( "finalBoss" ); // sikk - Cyberdemon Damage Type
FinishSetup(); FinishSetup();
} }
@ -668,7 +681,14 @@ void idActor::SetupHead( void ) {
return; return;
} }
// sikk---> Player Head Type
if ( g_playerHeadType.GetBool() && spawnArgs.GetString( "def_head_custom" )[ 0 ] ) {
headModel = spawnArgs.GetString( "def_head_custom" );
} else {
headModel = spawnArgs.GetString( "def_head", "" ); headModel = spawnArgs.GetString( "def_head", "" );
}
// <---sikk
if ( headModel[ 0 ] ) { if ( headModel[ 0 ] ) {
jointName = spawnArgs.GetString( "head_joint" ); jointName = spawnArgs.GetString( "head_joint" );
joint = animator.GetJointHandle( jointName ); joint = animator.GetJointHandle( jointName );
@ -2179,7 +2199,17 @@ void idActor::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir
gameLocal.Error( "Unknown damageDef '%s'", damageDefName ); gameLocal.Error( "Unknown damageDef '%s'", damageDefName );
} }
int damage = damageDef->GetInt( "damage" ) * damageScale; // sikk---> Damage Type
int damage;
// if ( g_damageType.GetInteger() == 1 && damageDef->GetInt( "damage_doom_scale" ) ) {
// damage = damageDef->GetInt( "damage_doom_scale" ) * ( gameLocal.random.RandomInt( 255 ) % damageDef->GetInt( "damage_doom_range" ) + 1 );
// } else if ( g_damageType.GetInteger() == 2 && damageDef->GetInt( "damage_custom" ) ) {
// damage = damageDef->GetInt( "damage_custom" );
// } else {
damage = damageDef->GetInt( "damage" );
// }
// <---sikk
damage *= damageScale;
damage = GetDamageForLocation( damage, location ); damage = GetDamageForLocation( damage, location );
// inform the attacker that they hit someone // inform the attacker that they hit someone
@ -2191,7 +2221,8 @@ void idActor::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir
health = -999; health = -999;
} }
Killed( inflictor, attacker, damage, dir, location ); Killed( inflictor, attacker, damage, dir, location );
if ( ( health < -20 ) && spawnArgs.GetBool( "gib" ) && damageDef->GetBool( "gib" ) ) { // sikk - Changed gib health from -20 to -health
if ( ( health < -spawnArgs.GetInt( "health" ) ) && spawnArgs.GetBool( "gib" ) && damageDef->GetBool( "gib" ) ) {
Gib( dir, damageDefName ); Gib( dir, damageDefName );
} }
} else { } else {
@ -2347,19 +2378,29 @@ void idActor::SetupDamageGroups( void ) {
damageScale[ i ] = 1.0f; damageScale[ i ] = 1.0f;
} }
// sikk---> Doom 1/2 & custom Damage zones
// set the percentage on damage zones // set the percentage on damage zones
arg = spawnArgs.MatchPrefix( "damage_scale ", NULL ); const char* scalePrefix;
//if ( g_damageZoneType.GetInteger() == 1 )
// scalePrefix = "damage_scale_doom ";
//else if ( g_damageZoneType.GetInteger() == 2 )
// scalePrefix = "damage_scale_custom ";
//else
scalePrefix = "damage_scale ";
arg = spawnArgs.MatchPrefix( scalePrefix, NULL );
while ( arg ) { while ( arg ) {
scale = atof( arg->GetValue() ); scale = atof( arg->GetValue() );
groupname = arg->GetKey(); groupname = arg->GetKey();
groupname.Strip( "damage_scale " ); groupname.Strip( scalePrefix );
for( i = 0; i < damageScale.Num(); i++ ) { for( i = 0; i < damageScale.Num(); i++ ) {
if ( damageGroups[ i ] == groupname ) { if ( damageGroups[ i ] == groupname ) {
damageScale[ i ] = scale; damageScale[ i ] = scale;
} }
} }
arg = spawnArgs.MatchPrefix( "damage_scale ", arg ); arg = spawnArgs.MatchPrefix( scalePrefix, arg );
} }
// <---sikk
} }
/* /*
@ -3276,3 +3317,60 @@ idActor::Event_GetHead
void idActor::Event_GetHead( void ) { void idActor::Event_GetHead( void ) {
idThread::ReturnEntity( head.GetEntity() ); idThread::ReturnEntity( head.GetEntity() );
} }
// grimm -->
/*
=====================
idActor::Event_mSpawnGibs
=====================
*/
void idActor::Event_mSpawnGibs( void ) {
idPhysics *physObj;
physObj = GetPhysics();
const idKeyValue *kv = spawnArgs.MatchPrefix( "shard" );
// bool first = true;
while ( kv ) {
const idDict *debris_args = gameLocal.FindEntityDefDict( kv->GetValue(), false );
if ( debris_args ) {
idEntity *ent;
idVec3 dir;
idDebris *debris;
//if ( first ) {
dir = physObj->GetAxis()[1];
// first = false;
//} else {
dir.x += gameLocal.random.CRandomFloat() * 4.0f;
dir.y += gameLocal.random.CRandomFloat() * 4.0f;
//dir.z = gameLocal.random.RandomFloat() * 8.0f;
//}
dir.Normalize();
gameLocal.SpawnEntityDef( *debris_args, &ent, false );
if ( !ent || !ent->IsType( idDebris::Type ) ) {
gameLocal.Error( "'projectile_debris' is not an idDebris" );
}
debris = static_cast<idDebris *>(ent);
debris->Create( this, physObj->GetOrigin(), dir.ToMat3() );
debris->Launch();
debris->GetRenderEntity()->shaderParms[ SHADERPARM_TIME_OF_DEATH ] = ( gameLocal.time + 1500 ) * 0.001f;
debris->UpdateVisuals();
}
kv = spawnArgs.MatchPrefix( "shard", kv );
}
idStr sfx;
sfx = spawnArgs.GetString("fx_death");
if ( sfx.Length() ) {
idVec3 org = physObj->GetOrigin();
idEntityFx::StartFx(sfx.c_str(), &org, NULL, this ,false);
}
}
// <-- grimm

View file

@ -56,7 +56,6 @@ extern const idEventDef AI_PlayCycle;
extern const idEventDef AI_AnimDone; extern const idEventDef AI_AnimDone;
extern const idEventDef AI_SetBlendFrames; extern const idEventDef AI_SetBlendFrames;
extern const idEventDef AI_GetBlendFrames; extern const idEventDef AI_GetBlendFrames;
class idDeclParticle; class idDeclParticle;
class idAnimState { class idAnimState {
@ -209,6 +208,8 @@ public:
bool AnimDone( int channel, int blendFrames ) const; bool AnimDone( int channel, int blendFrames ) const;
virtual void SpawnGibs( const idVec3 &dir, const char *damageDefName ); virtual void SpawnGibs( const idVec3 &dir, const char *damageDefName );
bool GetFinalBoss( void ) const { return finalBoss; }; // sikk - Cyberdemon Damage Type
protected: protected:
friend class idAnimState; friend class idAnimState;
@ -318,6 +319,7 @@ private:
void Event_SetState( const char *name ); void Event_SetState( const char *name );
void Event_GetState( void ); void Event_GetState( void );
void Event_GetHead( void ); void Event_GetHead( void );
void Event_mSpawnGibs( void );
}; };
#endif /* !__GAME_ACTOR_H__ */ #endif /* !__GAME_ACTOR_H__ */

View file

@ -121,6 +121,10 @@ const idEventDef EV_HasFunction( "hasFunction", "s", 'd' );
const idEventDef EV_CallFunction( "callFunction", "s" ); const idEventDef EV_CallFunction( "callFunction", "s" );
const idEventDef EV_SetNeverDormant( "setNeverDormant", "d" ); const idEventDef EV_SetNeverDormant( "setNeverDormant", "d" );
// grimm --> for grimm_spray entity.
const idEventDef EV_SprayDecal( "sprayDecal", "vsvf" );
// <-- grimm
ABSTRACT_DECLARATION( idClass, idEntity ) ABSTRACT_DECLARATION( idClass, idEntity )
EVENT( EV_GetName, idEntity::Event_GetName ) EVENT( EV_GetName, idEntity::Event_GetName )
EVENT( EV_SetName, idEntity::Event_SetName ) EVENT( EV_SetName, idEntity::Event_SetName )
@ -185,6 +189,7 @@ ABSTRACT_DECLARATION( idClass, idEntity )
EVENT( EV_HasFunction, idEntity::Event_HasFunction ) EVENT( EV_HasFunction, idEntity::Event_HasFunction )
EVENT( EV_CallFunction, idEntity::Event_CallFunction ) EVENT( EV_CallFunction, idEntity::Event_CallFunction )
EVENT( EV_SetNeverDormant, idEntity::Event_SetNeverDormant ) EVENT( EV_SetNeverDormant, idEntity::Event_SetNeverDormant )
EVENT( EV_SprayDecal, idEntity::Event_SprayDecal )
END_CLASS END_CLASS
/* /*
@ -266,6 +271,11 @@ void idGameEdit::ParseSpawnArgsToRenderEntity( const idDict *args, renderEntity_
args->GetVector( "origin", "0 0 0", renderEntity->origin ); args->GetVector( "origin", "0 0 0", renderEntity->origin );
// grimm --> added 'random_rotspawn' spawnarg for randomly rotated entities upon mapload.
if ( args->GetBool( "random_rotspawn", "0" ) ) {
renderEntity->axis = idAngles( 0.0f, gameLocal.random.RandomFloat() * 360 , 0.0f).ToMat3();
} else {
//original code:
// get the rotation matrix in either full form, or single angle form // get the rotation matrix in either full form, or single angle form
if ( !args->GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", renderEntity->axis ) ) { if ( !args->GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", renderEntity->axis ) ) {
angle = args->GetFloat( "angle" ); angle = args->GetFloat( "angle" );
@ -274,7 +284,8 @@ void idGameEdit::ParseSpawnArgsToRenderEntity( const idDict *args, renderEntity_
} else { } else {
renderEntity->axis.Identity(); renderEntity->axis.Identity();
} }
} } // <-- original code
} // <--grimm
renderEntity->referenceSound = NULL; renderEntity->referenceSound = NULL;
@ -541,7 +552,15 @@ void idEntity::Spawn( void ) {
} }
} }
// sikk---> Doom/Custom Health Values
if ( g_enemyHealthType.GetInteger() == 1 && spawnArgs.GetInt( "health_doom" ) ) {
health = spawnArgs.GetInt( "health_doom" );
} else if ( g_enemyHealthType.GetInteger() == 2 && spawnArgs.GetInt( "health_custom" ) ) {
health = spawnArgs.GetInt( "health_custom" );
} else {
health = spawnArgs.GetInt( "health" ); health = spawnArgs.GetInt( "health" );
}
// <---sikk
InitDefaultPhysics( origin, axis ); InitDefaultPhysics( origin, axis );
@ -559,7 +578,9 @@ void idEntity::Spawn( void ) {
// auto-start a sound on the entity // auto-start a sound on the entity
if ( refSound.shader && !refSound.waitfortrigger ) { if ( refSound.shader && !refSound.waitfortrigger ) {
StartSoundShader( refSound.shader, SND_CHANNEL_ANY, 0, false, NULL ); //StartSoundShader( refSound.shader, SND_CHANNEL_ANY, 0, false, NULL );
// grimm --> changed to snd_channel_ambient
StartSoundShader( refSound.shader, SND_CHANNEL_AMBIENT, 0, false, NULL );
} }
// setup script object // setup script object
@ -1663,6 +1684,19 @@ void idEntity::SetSoundVolume( float volume ) {
refSound.parms.volume = volume; refSound.parms.volume = volume;
} }
/* grimm -->
================
idEntity::FadeSound
Can be called while sound is playing.
================
*/
void idEntity::FadeSound( float volume, float length ) {
refSound.referenceSound->FadeSound(0,volume,length);
}
//<-- grimm
/* /*
================ ================
idEntity::UpdateSound idEntity::UpdateSound
@ -2558,7 +2592,7 @@ bool idEntity::RunPhysics( void ) {
endTime = gameLocal.time; endTime = gameLocal.time;
gameLocal.push.InitSavingPushedEntityPositions(); gameLocal.push.InitSavingPushedEntityPositions();
blockedPart = NULL; blockedPart = blockingEntity = NULL; // sikk - warning C4701: potentially uninitialized local variable used
// save the physics state of the whole team and disable the team for collision detection // save the physics state of the whole team and disable the team for collision detection
for ( part = this; part != NULL; part = part->teamChain ) { for ( part = this; part != NULL; part = part->teamChain ) {
@ -2998,7 +3032,16 @@ void idEntity::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &di
gameLocal.Error( "Unknown damageDef '%s'\n", damageDefName ); gameLocal.Error( "Unknown damageDef '%s'\n", damageDefName );
} }
int damage = damageDef->GetInt( "damage" ); // sikk---> Damage Type
int damage;
//if ( g_damageType.GetInteger() == 1 && damageDef->GetInt( "damage_doom_scale" ) ) {
// damage = damageDef->GetInt( "damage_doom_scale" ) * ( gameLocal.random.RandomInt( 255 ) % damageDef->GetInt( "damage_doom_range" ) + 1 );
//} else if ( g_damageType.GetInteger() == 2 && damageDef->GetInt( "damage_custom" ) ) {
// damage = damageDef->GetInt( "damage_custom" );
//} else {
damage = damageDef->GetInt( "damage" );
//}
// <---sikk
// inform the attacker that they hit someone // inform the attacker that they hit someone
attacker->DamageFeedback( this, inflictor, damage ); attacker->DamageFeedback( this, inflictor, damage );
@ -4579,6 +4622,28 @@ void idEntity::Event_SetNeverDormant( int enable ) {
dormantStart = 0; dormantStart = 0;
} }
/* grimm --> spraydecal
================
idEntity::Event_SprayDecal
================
*/
void idEntity::Event_SprayDecal( idVec3 spray_origin, const char *mtr_decal, idVec3 spray_angle, float size ) {
//srpay something
idVec3 newangle = spray_angle;
//gameLocal.Printf( "%s <--current vector\n", spray_angle->ToString() );
if ( spray_angle.x <= -45 ) {
newangle.z = 90;
}
if ( spray_angle.x >= 45 ) {
newangle.z = -90;
}
gameLocal.ProjectDecal( spray_origin, newangle, 256.0f, true, size, mtr_decal, 0, true );
}
/*********************************************************************** /***********************************************************************
Network Network

View file

@ -68,6 +68,7 @@ extern const idEventDef EV_SetSkin;
extern const idEventDef EV_StartSoundShader; extern const idEventDef EV_StartSoundShader;
extern const idEventDef EV_StopSound; extern const idEventDef EV_StopSound;
extern const idEventDef EV_CacheSoundShader; extern const idEventDef EV_CacheSoundShader;
extern const idEventDef EV_SprayDecal;
// Think flags // Think flags
enum { enum {
@ -227,6 +228,13 @@ public:
bool StartSoundShader( const idSoundShader *shader, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length ); bool StartSoundShader( const idSoundShader *shader, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length );
void StopSound( const s_channelType channel, bool broadcast ); // pass SND_CHANNEL_ANY to stop all sounds void StopSound( const s_channelType channel, bool broadcast ); // pass SND_CHANNEL_ANY to stop all sounds
void SetSoundVolume( float volume ); void SetSoundVolume( float volume );
//grimm -->
void FadeSound( float volume, float length );
void Event_SprayDecal( idVec3 spray_origin, const char *mtr_decal, idVec3 spray_angle, float size );
//void Event_SprayDecal( const char *mtr_decal );
//<-- grimm
void UpdateSound( void ); void UpdateSound( void );
int GetListenerId( void ) const; int GetListenerId( void ) const;
idSoundEmitter * GetSoundEmitter( void ) const; idSoundEmitter * GetSoundEmitter( void ) const;
@ -465,6 +473,7 @@ private:
void Event_HasFunction( const char *name ); void Event_HasFunction( const char *name );
void Event_CallFunction( const char *name ); void Event_CallFunction( const char *name );
void Event_SetNeverDormant( int enable ); void Event_SetNeverDormant( int enable );
}; };
/* /*

View file

@ -509,6 +509,9 @@ void idEntityFx::Run( int time ) {
useAction->renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = -MS2SEC( time ); useAction->renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = -MS2SEC( time );
useAction->renderEntity.shaderParms[3] = 1.0f; useAction->renderEntity.shaderParms[3] = 1.0f;
useAction->renderEntity.shaderParms[5] = 0.0f; useAction->renderEntity.shaderParms[5] = 0.0f;
useAction->renderEntity.suppressSurfaceInViewID = -8; // sikk - depth render
if ( useAction->renderEntity.hModel ) { if ( useAction->renderEntity.hModel ) {
useAction->renderEntity.bounds = useAction->renderEntity.hModel->Bounds( &useAction->renderEntity ); useAction->renderEntity.bounds = useAction->renderEntity.hModel->Bounds( &useAction->renderEntity );
} }
@ -593,6 +596,9 @@ void idEntityFx::Spawn( void ) {
PostEventMS( &EV_Activate, 0, this ); PostEventMS( &EV_Activate, 0, this );
} }
} }
// We don't want particles in depth render.
renderEntity.suppressSurfaceInViewID = -8; // sikk - Depth Render
} }
/* /*

View file

@ -254,6 +254,20 @@ void idGameLocal::Clear( void ) {
savedEventQueue.Init(); savedEventQueue.Init();
memset( lagometer, 0, sizeof( lagometer ) ); memset( lagometer, 0, sizeof( lagometer ) );
// sikk---> Portal Sky Box
portalSkyEnt = NULL;
portalSkyActive = false;
// <---sikk
currentLights.Clear(); // sikk - Soft Shadows PostProcess
// sikk---> Random Encounters System
randomEnemyListNum = 0;
randomEnemyTime = 0;
randomEnemyTally = 0;
randomEnemyList.Clear();
// <---sikk
} }
/* /*
@ -465,6 +479,7 @@ void idGameLocal::SaveGame( idFile *f ) {
program.Save( &savegame ); program.Save( &savegame );
savegame.WriteInt( g_skill.GetInteger() ); savegame.WriteInt( g_skill.GetInteger() );
savegame.WriteInt( g_trapskill.GetInteger() );
savegame.WriteDict( &serverInfo ); savegame.WriteDict( &serverInfo );
@ -576,10 +591,22 @@ void idGameLocal::SaveGame( idFile *f ) {
savegame.WriteVec3( gravity ); savegame.WriteVec3( gravity );
// gamestate // gamestate
savegame.WriteBool( influenceActive ); savegame.WriteBool( influenceActive );
savegame.WriteInt( nextGibTime ); savegame.WriteInt( nextGibTime );
// sikk---> Portal Sky Box
portalSkyEnt.Save( &savegame );
savegame.WriteBool( portalSkyActive );
// <---sikk
// sikk---> Random Encounters System
savegame.WriteInt( randomEnemyTally );
savegame.WriteInt( randomEnemyList.Num() );
for( i = 0; i < randomEnemyList.Num(); i++ ) {
savegame.WriteInt( randomEnemyList[ i ] );
}
// <---sikk
// spawnSpots // spawnSpots
// initialSpots // initialSpots
// currentInitialSpot // currentInitialSpot
@ -938,6 +965,20 @@ void idGameLocal::LoadMap( const char *mapName, int randseed ) {
playerPVS.i = -1; playerPVS.i = -1;
playerConnectedAreas.i = -1; playerConnectedAreas.i = -1;
currentLights.Clear(); // sikk - Soft Shadows PostProcess
// sikk---> Portal Sky Box
portalSkyEnt = NULL;
portalSkyActive = false;
// <---sikk
// sikk---> Random Encounters System
randomEnemyListNum = 0;
randomEnemyTime = 0;
randomEnemyTally = 0;
//randomEnemyList.Clear();
// <---sikk
// load navigation system for all the different monster sizes // load navigation system for all the different monster sizes
for( i = 0; i < aasNames.Num(); i++ ) { for( i = 0; i < aasNames.Num(); i++ ) {
aasList[ i ]->Init( idStr( mapFileName ).SetFileExtension( aasNames[ i ] ).c_str(), mapFile->GetGeometryCRC() ); aasList[ i ]->Init( idStr( mapFileName ).SetFileExtension( aasNames[ i ] ).c_str(), mapFile->GetGeometryCRC() );
@ -1281,6 +1322,9 @@ bool idGameLocal::InitFromSaveGame( const char *mapName, idRenderWorld *renderWo
savegame.ReadInt( i ); savegame.ReadInt( i );
g_skill.SetInteger( i ); g_skill.SetInteger( i );
savegame.ReadInt( i );
g_trapskill.SetInteger( i );
// precache the player // precache the player
FindEntityDef( "player_doommarine", false ); FindEntityDef( "player_doommarine", false );
@ -1430,6 +1474,22 @@ bool idGameLocal::InitFromSaveGame( const char *mapName, idRenderWorld *renderWo
savegame.ReadBool( influenceActive ); savegame.ReadBool( influenceActive );
savegame.ReadInt( nextGibTime ); savegame.ReadInt( nextGibTime );
// sikk---> Portal Sky Box
portalSkyEnt.Restore( &savegame );
savegame.ReadBool( portalSkyActive );
// <---sikk
// sikk---> Random Encounters System
savegame.ReadInt( randomEnemyTally );
savegame.ReadInt( randomEnemyListNum );
randomEnemyList.Clear();
for( i = 0; i < randomEnemyListNum; i++ ) {
int j;
savegame.ReadInt( j );
randomEnemyList.Append( j );
}
// <---sikk
// spawnSpots // spawnSpots
// initialSpots // initialSpots
// currentInitialSpot // currentInitialSpot
@ -2040,6 +2100,26 @@ void idGameLocal::SetupPlayerPVS( void ) {
pvs.FreeCurrentPVS( otherPVS ); pvs.FreeCurrentPVS( otherPVS );
playerConnectedAreas = newPVS; playerConnectedAreas = newPVS;
} }
// sikk---> Portal Sky Box
// if portalSky is preset, then merge into pvs so we get rotating brushes, etc
if ( portalSkyEnt.GetEntity() ) {
idEntity *skyEnt = portalSkyEnt.GetEntity();
otherPVS = pvs.SetupCurrentPVS( skyEnt->GetPVSAreas(), skyEnt->GetNumPVSAreas() );
newPVS = pvs.MergeCurrentPVS( playerPVS, otherPVS );
pvs.FreeCurrentPVS( playerPVS );
pvs.FreeCurrentPVS( otherPVS );
playerPVS = newPVS;
otherPVS = pvs.SetupCurrentPVS( skyEnt->GetPVSAreas(), skyEnt->GetNumPVSAreas() );
newPVS = pvs.MergeCurrentPVS( playerConnectedAreas, otherPVS );
pvs.FreeCurrentPVS( playerConnectedAreas );
pvs.FreeCurrentPVS( otherPVS );
playerConnectedAreas = newPVS;
}
// <---sikk
} }
} }
@ -2555,8 +2635,43 @@ const char* idGameLocal::HandleGuiCommands( const char *menuCommand ) {
idGameLocal::HandleMainMenuCommands idGameLocal::HandleMainMenuCommands
================ ================
*/ */
void idGameLocal::HandleMainMenuCommands( const char *menuCommand, idUserInterface *gui ) { } void idGameLocal::HandleMainMenuCommands( const char *menuCommand, idUserInterface *gui ) {
int icmd;
idCmdArgs args;
args.TokenizeString(menuCommand, false);
for (icmd = 0; icmd < args.Argc();) {
const char *cmd = args.Argv(icmd++);
if (!idStr::Icmp(cmd, "startGrimm")) {
if (icmd < args.Argc()) {
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "map vin1_m1" );
} else {
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "map vin1_m1" );
}
continue;
}
if (!idStr::Icmp(cmd, "startChallenge")) {
if (icmd < args.Argc()) {
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "map vin1_mc" );
} else {
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "map vin1_mc" );
}
continue;
}
if (!idStr::Icmp(cmd, "startTutorial")) {
if (icmd < args.Argc()) {
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "map vin1_mt" );
} else {
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "map vin1_mt" );
}
continue;
}
}
}
/* /*
================ ================
idGameLocal::GetLevelMap idGameLocal::GetLevelMap
@ -3074,6 +3189,29 @@ bool idGameLocal::SpawnEntityDef( const idDict &args, idEntity **ent, bool setDe
spawnArgs.GetString( "classname", NULL, &classname ); spawnArgs.GetString( "classname", NULL, &classname );
// sikk---> Spectre Factor
if ( !idStr::Icmp( classname, "monster_demon_pinky" ) ) {
classname = ( ( random.RandomFloat() * 0.99999f ) < g_enemySpectreFactor.GetFloat() ) ? "monster_demon_spectre" : classname;
}
// <---sikk
// sikk---> Baron of Hell Factor
if ( !idStr::Icmp( classname, "monster_demon_hellknight" ) ) {
classname = ( ( random.RandomFloat() * 0.99999f ) < g_enemyBaronFactor.GetFloat() ) ? "monster_demon_baronofhell" : classname;
}
// <---sikk
// sikk---> Pain Elemental Factor
if ( !idStr::Icmp( classname, "monster_flying_cacodemon" ) ) {
classname = ( ( random.RandomFloat() * 0.99999f ) < g_enemyPainElementalFactor.GetFloat() ) ? "monster_flying_painelemental" : classname;
}
// <---sikk
// sikk---> Item Management: Helmet factor (replaces security armor)
if ( !idStr::Icmp( classname, "item_armor_security" ) ) {
classname = ( ( random.RandomFloat() * 0.99999f ) < g_itemHelmetFactor.GetFloat() ) ? "item_armor_helmet" : classname;
}
// <---sikk
const idDeclEntityDef *def = FindEntityDef( classname, false ); const idDeclEntityDef *def = FindEntityDef( classname, false );
if ( !def ) { if ( !def ) {
@ -3160,6 +3298,25 @@ bool idGameLocal::InhibitEntitySpawn( idDict &spawnArgs ) {
bool result = false; bool result = false;
const char *name;
name = spawnArgs.GetString( "classname" );
//grimm: We need to separate the regular skill settings (combat) from the trap skill settings (g_trapskill).
//grimm: g_trapskill regulates vin_moving_trap, vin_crusher and func_static entities. The first two are obvious.
//grimm: func_static is also controlled because in easy skill settings many jumps have been made easier by adding func_static entities
//grimm: here and there...
if ( idStr::Icmp( name, "func_rotating" ) == 0 || idStr::Icmp( name, "func_fx" ) == 0 || idStr::Icmp( name, "vin_moving_trap" ) == 0 || idStr::Icmp( name, "vin_crusher" ) == 0 || idStr::Icmp( name, "func_static" ) == 0){
if ( isMultiplayer ) {
spawnArgs.GetBool( "not_multiplayer", "0", result );
} else if ( g_trapskill.GetInteger() == 0 ) {
spawnArgs.GetBool( "not_easy", "0", result );
} else if ( g_trapskill.GetInteger() == 1 ) {
spawnArgs.GetBool( "not_medium", "0", result );
} else {
spawnArgs.GetBool( "not_hard", "0", result );
}
} else {
if ( isMultiplayer ) { if ( isMultiplayer ) {
spawnArgs.GetBool( "not_multiplayer", "0", result ); spawnArgs.GetBool( "not_multiplayer", "0", result );
} else if ( g_skill.GetInteger() == 0 ) { } else if ( g_skill.GetInteger() == 0 ) {
@ -3169,20 +3326,6 @@ bool idGameLocal::InhibitEntitySpawn( idDict &spawnArgs ) {
} else { } else {
spawnArgs.GetBool( "not_hard", "0", result ); spawnArgs.GetBool( "not_hard", "0", result );
} }
const char *name;
if ( g_skill.GetInteger() == 3 ) {
name = spawnArgs.GetString( "classname" );
if ( idStr::Icmp( name, "item_medkit" ) == 0 || idStr::Icmp( name, "item_medkit_small" ) == 0 ) {
result = true;
}
}
if ( gameLocal.isMultiplayer ) {
name = spawnArgs.GetString( "classname" );
if ( idStr::Icmp( name, "weapon_bfg" ) == 0 || idStr::Icmp( name, "weapon_soulcube" ) == 0 ) {
result = true;
}
} }
return result; return result;
@ -3207,6 +3350,26 @@ void idGameLocal::SetSkill( int value ) {
g_skill.SetInteger( skill_level ); g_skill.SetInteger( skill_level );
} }
/* //GRIMM
================
idGameLocal::SetTrapSkill
================
*/ //GRIMM
void idGameLocal::SetTrapSkill( int value ) {
int skill_level;
if ( value < 0 ) {
skill_level = 0;
} else if ( value > 3 ) {
skill_level = 3;
} else {
skill_level = value;
}
g_trapskill.SetInteger( skill_level );
}
/* /*
============== ==============
idGameLocal::GameState idGameLocal::GameState
@ -3242,6 +3405,10 @@ void idGameLocal::SpawnMapEntities( void ) {
SetSkill( g_skill.GetInteger() ); SetSkill( g_skill.GetInteger() );
//GRIMM
SetTrapSkill( g_trapskill.GetInteger() );
//GRIMM
numEntities = mapFile->GetNumEntities(); numEntities = mapFile->GetNumEntities();
if ( numEntities == 0 ) { if ( numEntities == 0 ) {
Error( "...no entities" ); Error( "...no entities" );
@ -3519,7 +3686,7 @@ void idGameLocal::KillBox( idEntity *ent, bool catch_teleport ) {
if ( hit->IsType( idPlayer::Type ) && static_cast< idPlayer * >( hit )->IsInTeleport() ) { if ( hit->IsType( idPlayer::Type ) && static_cast< idPlayer * >( hit )->IsInTeleport() ) {
static_cast< idPlayer * >( hit )->TeleportDeath( ent->entityNumber ); static_cast< idPlayer * >( hit )->TeleportDeath( ent->entityNumber );
} else if ( !catch_teleport ) { } else if ( !catch_teleport ) {
hit->Damage( ent, ent, vec3_origin, "damage_telefrag", 1.0f, INVALID_JOINT ); hit->Damage( ent, ent, vec3_origin, "damage_fatal_suicide", 1.0f, INVALID_JOINT );
} }
if ( !gameLocal.isMultiplayer ) { if ( !gameLocal.isMultiplayer ) {
@ -3609,6 +3776,13 @@ void idGameLocal::RadiusDamage( const idVec3 &origin, idEntity *inflictor, idEnt
radius = 1; radius = 1;
} }
// sikk---> Explosion FX PostProcess
explosionOrigin = origin;
explosionRadius = radius;
explosionDamage = damage;
explosionTime = time + g_explosionFXTime.GetInteger() * 1000;
// <---sikk
bounds = idBounds( origin ).Expand( radius ); bounds = idBounds( origin ).Expand( radius );
// get all entities touching the bounds // get all entities touching the bounds
@ -3646,6 +3820,13 @@ void idGameLocal::RadiusDamage( const idVec3 &origin, idEntity *inflictor, idEnt
continue; continue;
} }
// sikk---> Cyberdemon Damage Type
if ( !idStr::Icmp( ent->GetClassname(), "monster_boss_cyberdemon" ) && !static_cast< idActor * >( ent )->GetFinalBoss() ) {
continue;
}
// <---sikk
// find the distance from the edge of the bounding box // find the distance from the edge of the bounding box
for ( i = 0; i < 3; i++ ) { for ( i = 0; i < 3; i++ ) {
if ( origin[ i ] < ent->GetPhysics()->GetAbsBounds()[0][ i ] ) { if ( origin[ i ] < ent->GetPhysics()->GetAbsBounds()[0][ i ] ) {
@ -3821,7 +4002,7 @@ void idGameLocal::RadiusPushClipModel( const idVec3 &origin, const float push, c
idGameLocal::ProjectDecal idGameLocal::ProjectDecal
=============== ===============
*/ */
void idGameLocal::ProjectDecal( const idVec3 &origin, const idVec3 &dir, float depth, bool parallel, float size, const char *material, float angle ) { void idGameLocal::ProjectDecal( const idVec3 &origin, const idVec3 &dir, float depth, bool parallel, float size, const char *material, float angle, bool forever ) {
float s, c; float s, c;
idMat3 axis, axistemp; idMat3 axis, axistemp;
idFixedWinding winding; idFixedWinding winding;
@ -3862,7 +4043,15 @@ void idGameLocal::ProjectDecal( const idVec3 &origin, const idVec3 &dir, float d
winding += idVec5( windingOrigin + ( axis * decalWinding[1] ) * size, idVec2( 0, 1 ) ); winding += idVec5( windingOrigin + ( axis * decalWinding[1] ) * size, idVec2( 0, 1 ) );
winding += idVec5( windingOrigin + ( axis * decalWinding[2] ) * size, idVec2( 0, 0 ) ); winding += idVec5( windingOrigin + ( axis * decalWinding[2] ) * size, idVec2( 0, 0 ) );
winding += idVec5( windingOrigin + ( axis * decalWinding[3] ) * size, idVec2( 1, 0 ) ); winding += idVec5( windingOrigin + ( axis * decalWinding[3] ) * size, idVec2( 1, 0 ) );
gameRenderWorld->ProjectDecalOntoWorld( winding, projectionOrigin, parallel, depth * 0.5f, declManager->FindMaterial( material ), time ); if ( forever ) {
//27 hrs = 'forever' in game time..
//gameLocal.Printf( "Project decal forever\n");
gameRenderWorld->ProjectDecalOntoWorld( winding, projectionOrigin, parallel, depth * 0.5f, declManager->FindMaterial( material ), time + SEC2MS( 999999 ) );
} else {
//gameLocal.Printf( "Project decal for decalStay time\n");
gameRenderWorld->ProjectDecalOntoWorld( winding, projectionOrigin, parallel, depth * 0.5f, declManager->FindMaterial( material ), time + SEC2MS( g_decalStay.GetFloat() ) );
}
} }
/* /*
@ -4409,3 +4598,255 @@ idGameLocal::GetMapLoadingGUI
=============== ===============
*/ */
void idGameLocal::GetMapLoadingGUI( char gui[ MAX_STRING_CHARS ] ) { } void idGameLocal::GetMapLoadingGUI( char gui[ MAX_STRING_CHARS ] ) { }
// sikk---> Random Encounters System
/*
===============
idGameLocal::SpawnRandomEnemy
===============
*/
bool idGameLocal::SpawnRandomEnemy()
{
if ( !g_useRandomEncounters.GetBool() )
return false;
if ( !randomEnemyList.Num() )
return false;
if ( randomEnemyTally >= g_randomEncountersMaxSpawns.GetInteger() )
return false;
const char* map = GetLevelMap()->GetName();
// we don't want random spawns in first or last level
if ( !idStr::Icmp( map, "maps/game/marscity1" ) || !idStr::Icmp( map, "maps/game/hellhole" ) )
return false;
idAAS *pAAS48 = gameLocal.GetAAS( "aas48" );
idAAS *pAAS96 = gameLocal.GetAAS( "aas96" );
idAAS *pAASMan = gameLocal.GetAAS( "aas_mancubus" );
if ( pAAS48 ) {
idEntity *ent;
idDict args;
idVec3 origin;
idVec3 playerPos, enemyPos;
int /*playerAreaNum = 0,*/ enemyAreaNum = 0;
aasPath_t aaspath;
float randFloat = gameLocal.random.RandomFloat();
int randNum = gameLocal.random.RandomInt( randomEnemyList.Num() );
idStr defName = GetEnemyNameFromNum( randomEnemyList[ randNum ] );
if ( defName == "monster_zombie_maint" )
defName += ( 0.5f < randFloat ) ? "" : "2";
int num = GetEnemyNumFromName( defName );
if ( !num || defName == "" )
return false;
// we only want demons or monster_zombie_boney in Hell
if ( !idStr::Icmp( map, "maps/game/hell1" ) && ( num > 1 && num < 31 ) )
return false;
if ( num >= 39 && pAAS96 ) {
if ( num == 41 && pAASMan ) {
enemyAreaNum = randFloat * pAASMan->GetNumAreas( 3 );
origin = pAASMan->AreaCenter( enemyAreaNum ) + idVec3( 0.0f, 0.0f, 1.0f );
} else {
enemyAreaNum = randFloat * pAAS96->GetNumAreas( 1 );
origin = pAAS96->AreaCenter( enemyAreaNum ) + idVec3( 0.0f, 0.0f, 1.0f );
}
} else if ( num < 39 && pAAS48 ) {
enemyAreaNum = randFloat * pAAS48->GetNumAreas( 0 );
origin = pAAS48->AreaCenter( enemyAreaNum ) + idVec3( 0.0f, 0.0f, 1.0f );
if ( num < 31 ) {
trace_t trace;
idVec3 start = GetLocalPlayer()->GetEyePosition();
idVec3 end = origin + idVec3( 0.0f, 0.0f, 64.0f );
clip.TracePoint( trace, start, end, MASK_OPAQUE, NULL );
idVec3 viewVector = GetLocalPlayer()->viewAngles.ToForward();
idVec3 dir = end - start;
dir.Normalize();
float cos = viewVector * dir;
float fov = idMath::Cos( g_fov.GetFloat() * 0.5f );
// for enemies that don't teleport, if we can "see" it spawn, don't spawn
if ( trace.fraction >= 1.0f && cos >= fov )
return false;
}
} else {
return false;
}
trace_t t;
idBounds b = idBounds( idVec3( -32.0f, -32.0f, 0.0f ), idVec3( 32.0f, 32.0f, 63.0f ) );
if ( clip.TraceBounds( t, origin, origin + idVec3( 0.0f, 0.0f, 1.0f ), b, MASK_ALL, NULL ) )
return false;
args.Set( "classname", defName );
args.SetInt( "isRandom", 1 );
args.SetVector( "origin", origin );
args.SetInt( "angle", gameLocal.random.RandomInt( 359 ) );
// teleport in if it's a demon
if ( num >= 31 )
args.Set( "teleport", "1" );
// use Hell skin if we're in Hell
if ( !idStr::Icmp( map, "maps/game/hell1" ) && ( num == 1 || num == 31 || num == 40 ) ) {
args.Set( "skin", GetHellSkin( num ) );
}
SpawnEntityDef( args, &ent );
ent->Signal( SIG_TRIGGER );
ent->ProcessEvent( &EV_Activate, GetLocalPlayer() );
program.ReturnEntity( ent );
args.Clear();
return true;
}
return false;
}
/*
===============
idGameLocal::GetEnemyNumFromName
===============
*/
int idGameLocal::GetEnemyNumFromName( idStr name )
{
int num = 0;
// Zombies
if ( name == "monster_zombie_boney" ) num = 1;
else if ( name == "monster_zombie_bernie" ) num = 2;
else if ( name == "monster_zombie_fat" ) num = 3;
else if ( name == "monster_zombie_fat2" ) num = 4;
else if ( name == "monster_zombie_fat_wrench" ) num = 5;
else if ( name == "monster_zombie_jumpsuit" ) num = 6;
else if ( name == "monster_zombie_labcoat_limb" ) num = 7;
else if ( name == "monster_zombie_labcoat_neckstump" ) num = 8;
else if ( name == "monster_zombie_labcoat_pipe" ) num = 9;
else if ( name == "monster_zombie_labcoat_skinny" ) num = 10;
else if ( name == "monster_zombie_maint" ) num = 11;
else if ( name == "monster_zombie_maint2" ) num = 12;
else if ( name == "monster_zombie_maint_bald" ) num = 13;
else if ( name == "monster_zombie_maint_fast" ) num = 14;
else if ( name == "monster_zombie_maint_flashlight" ) num = 15;
else if ( name == "monster_zombie_maint_no_jaw" ) num = 16;
else if ( name == "monster_zombie_maint_nojaw" ) num = 17;
else if ( name == "monster_zombie_maint_skinny" ) num = 18;
else if ( name == "monster_zombie_maint_wrench" ) num = 19;
else if ( name == "monster_zombie_morgue" ) num = 20;
else if ( name == "monster_zombie_suit_bloodymouth" ) num = 21;
else if ( name == "monster_zombie_suit_neckstump" ) num = 22;
else if ( name == "monster_zombie_suit_skinny" ) num = 23;
else if ( name == "monster_zombie_tshirt_bald" ) num = 24;
else if ( name == "monster_zombie_tshirt_blown" ) num = 25;
else if ( name == "monster_zombie_sawyer" ) num = 26;
// ZSecs
else if ( name == "monster_zsec_pistol" ) num = 27;
else if ( name == "monster_zsec_machinegun" ) num = 28;
else if ( name == "monster_zsec_shotgun" ) num = 29;
else if ( name == "monster_zsec_shield" ) num = 30;
// Demons (aas48)
else if ( name == "monster_demon_imp" ) num = 31;
else if ( name == "monster_demon_maggot" ) num = 32;
else if ( name == "monster_demon_wraith" ) num = 33;
else if ( name == "monster_demon_cherub" ) num = 34;
else if ( name == "monster_demon_revenant" ) num = 35;
else if ( name == "monster_zombie_commando" ) num = 36;
else if ( name == "monster_zombie_commando_cgun" ) num = 37;
else if ( name == "monster_demon_archvile" ) num = 38;
// Demons (aas96)
else if ( name == "monster_demon_pinky" ) num = 39;
else if ( name == "monster_demon_hellknight" ) num = 40;
else if ( name == "monster_demon_mancubus" ) num = 41;
return num;
}
/*
===============
idGameLocal::GetEnemyNameFromNum
===============
*/
idStr idGameLocal::GetEnemyNameFromNum( int num )
{
idStr name = "";
switch ( num ) {
// Zombies
case 1: name = "monster_zombie_boney"; break;
case 2: name = "monster_zombie_bernie"; break;
case 3: name = "monster_zombie_fat"; break;
case 4: name = "monster_zombie_fat2"; break;
case 5: name = "monster_zombie_fat_wrench"; break;
case 6: name = "monster_zombie_jumpsuit"; break;
case 7: name = "monster_zombie_labcoat_limb"; break;
case 8: name = "monster_zombie_labcoat_neckstump"; break;
case 9: name = "monster_zombie_labcoat_pipe"; break;
case 10: name = "monster_zombie_labcoat_skinny"; break;
case 11: name = "monster_zombie_maint"; break;
case 12: name = "monster_zombie_maint2"; break;
case 13: name = "monster_zombie_maint_bald"; break;
case 14: name = "monster_zombie_maint_fast"; break;
case 15: name = "monster_zombie_maint_flashlight"; break;
case 16: name = "monster_zombie_maint_no_jaw"; break;
case 17: name = "monster_zombie_maint_nojaw"; break;
case 18: name = "monster_zombie_maint_skinny"; break;
case 19: name = "monster_zombie_maint_wrench"; break;
case 20: name = "monster_zombie_morgue"; break;
case 21: name = "monster_zombie_suit_bloodymouth"; break;
case 22: name = "monster_zombie_suit_neckstump"; break;
case 23: name = "monster_zombie_suit_skinny"; break;
case 24: name = "monster_zombie_tshirt_bald"; break;
case 25: name = "monster_zombie_tshirt_blown"; break;
case 26: name = "monster_zombie_sawyer"; break;
// ZSecs
case 27: name = "monster_zsec_pistol"; break;
case 28: name = "monster_zsec_machinegun"; break;
case 29: name = "monster_zsec_shotgun"; break;
case 30: name = "monster_zsec_shield"; break;
// Demons (aas48)
case 31: name = "monster_demon_imp"; break;
case 32: name = "monster_demon_maggot"; break;
case 33: name = "monster_demon_wraith"; break;
case 34: name = "monster_demon_cherub"; break;
case 35: name = "monster_demon_revenant"; break;
case 36: name = "monster_zombie_commando"; break;
case 37: name = "monster_zombie_commando_cgun"; break;
case 38: name = "monster_demon_archvile"; break;
// Demons (aas96)
case 39: name = "monster_demon_pinky"; break;
case 40: name = "monster_demon_mancubus"; break;
case 41: name = "monster_demon_hellknight"; break;
default: name = ""; break;
}
return name;
}
/*
===============
idGameLocal::GetHellSkin
===============
*/
idStr idGameLocal::GetHellSkin( int num )
{
idStr name = "";
switch ( num ) {
case 1: name = "skins/monsters/zombies/adrianboney01"; break;
case 31: name = "skins/models/monsters/a_hellimp"; break;
case 40: name = "skins/models/monsters/a_hk_branded"; break;
default: name = ""; break;
}
return name;
}
// <---sikk

View file

@ -80,6 +80,14 @@ class idThread;
class idEditEntities; class idEditEntities;
class idLocationEntity; class idLocationEntity;
#if 0 // TODO: needed?
#define MAX_CLIENTS 32
#define GENTITYNUM_BITS 13
#define MAX_GENTITIES (1<<GENTITYNUM_BITS)
#define ENTITYNUM_NONE (MAX_GENTITIES-1)
#define ENTITYNUM_WORLD (MAX_GENTITIES-2)
#endif // 0
//============================================================================ //============================================================================
extern const int NUM_RENDER_PORTAL_BITS; extern const int NUM_RENDER_PORTAL_BITS;
@ -294,6 +302,34 @@ public:
idEntityPtr<idEntity> lastGUIEnt; // last entity with a GUI, used by Cmd_NextGUI_f idEntityPtr<idEntity> lastGUIEnt; // last entity with a GUI, used by Cmd_NextGUI_f
int lastGUI; // last GUI on the lastGUIEnt int lastGUI; // last GUI on the lastGUIEnt
idList<int> currentLights; // sikk - Soft Shadows PostProcess
// sikk---> Explosion FX PostProcess
idVec3 explosionOrigin;
int explosionRadius;
int explosionDamage;
int explosionTime;
// <---sikk
// sikk---> Random Encounters System
idList<int> randomEnemyList; // current list of eligible enemies
int randomEnemyListNum; // holds the size of the list for when loading a save game
int randomEnemyTime; // holds next spawn time
int randomEnemyTally; // holds number of random enemies that are active
int GetEnemyNumFromName( idStr name );
idStr GetEnemyNameFromNum( int num );
idStr GetHellSkin( int num );
bool SpawnRandomEnemy( void );
// <---sikk
// sikk---> Portal Sky Box
idEntityPtr<idEntity> portalSkyEnt;
bool portalSkyActive;
void idGameLocal::SetPortalSkyEnt( idEntity *ent ) { portalSkyEnt = ent; }
bool idGameLocal::IsPortalSkyAcive( void ) { return portalSkyActive; }
pvsHandle_t GetPlayerPVS( void ) { return playerPVS; };
// <---sikk
// ---------------------- Public idGame Interface ------------------- // ---------------------- Public idGame Interface -------------------
idGameLocal(); idGameLocal();
@ -368,6 +404,7 @@ public:
bool CheatsOk( bool requirePlayer = true ); bool CheatsOk( bool requirePlayer = true );
void SetSkill( int value ); void SetSkill( int value );
void SetTrapSkill( int value );
gameState_t GameState( void ) const; gameState_t GameState( void ) const;
idEntity * SpawnEntityType( const idTypeInfo &classdef, const idDict *args = NULL, bool bIsClientReadSnapshot = false ); idEntity * SpawnEntityType( const idTypeInfo &classdef, const idDict *args = NULL, bool bIsClientReadSnapshot = false );
bool SpawnEntityDef( const idDict &args, idEntity **ent = NULL, bool setDefaults = true ); bool SpawnEntityDef( const idDict &args, idEntity **ent = NULL, bool setDefaults = true );
@ -410,7 +447,7 @@ public:
void RadiusPush( const idVec3 &origin, const float radius, const float push, const idEntity *inflictor, const idEntity *ignore, float inflictorScale, const bool quake ); void RadiusPush( const idVec3 &origin, const float radius, const float push, const idEntity *inflictor, const idEntity *ignore, float inflictorScale, const bool quake );
void RadiusPushClipModel( const idVec3 &origin, const float push, const idClipModel *clipModel ); void RadiusPushClipModel( const idVec3 &origin, const float push, const idClipModel *clipModel );
void ProjectDecal( const idVec3 &origin, const idVec3 &dir, float depth, bool parallel, float size, const char *material, float angle = 0 ); void ProjectDecal( const idVec3 &origin, const idVec3 &dir, float depth, bool parallel, float size, const char *material, float angle = 0, bool forever = false );
void BloodSplat( const idVec3 &origin, const idVec3 &dir, float size, const char *material ); void BloodSplat( const idVec3 &origin, const idVec3 &dir, float size, const char *material );
void CallFrameCommand( idEntity *ent, const function_t *frameCommand ); void CallFrameCommand( idEntity *ent, const function_t *frameCommand );

216
game/Grab.cpp Normal file
View file

@ -0,0 +1,216 @@
// sikk---> Object Manipulation
#include "../idlib/precompiled.h"
#pragma hdrstop
#include "Game_local.h"
#include "Misc.h"
#define MAX_DRAG_TRACE_DISTANCE 80.0f
#define TRACE_BOUNDS_SIZE 3.0f
#define MAX_HOLD_DISTANCE 96.0f
#define MIN_HOLD_DISTANCE 48.0f
#define DRAG_FAIL_LEN 64.0f
#define FAIL_TIME 1000
#define THROW_TIME 500
#define THROW_SCALE 20000
#define MAX_PICKUP_VELOCITY 1000 * 1000
#define MAX_PICKUP_SIZE 96.0f
/*
===============================================================================
Allows entities to be dragged through the world with physics.
===============================================================================
*/
CLASS_DECLARATION( idEntity, idGrabEntity )
END_CLASS
/*
==============
idGrabEntity::idGrabEntity
==============
*/
idGrabEntity::idGrabEntity( void ) {
Clear();
}
/*
==============
idGrabEntity::~idGrabEntity
==============
*/
idGrabEntity::~idGrabEntity( void ) {
StopDrag( owner, true );
}
/*
==============
idGrabEntity::Clear
==============
*/
void idGrabEntity::Clear() {
dragEnt = NULL;
owner = NULL;
id = 0;
oldUcmdFlags = 0;
dragFailTime = 0;
lastThrownTime = 0;
localPlayerPoint.Zero();
saveGravity.Zero();
}
/*
==============
idGrabEntity::StartDrag
==============
*/
void idGrabEntity::StartDrag( idPlayer *player, idEntity *grabEnt, int id ) {
if ( grabEnt && grabEnt->GetPhysics()->GetBounds().GetRadius() < MAX_PICKUP_SIZE &&
grabEnt->GetPhysics()->GetLinearVelocity().LengthSqr() < MAX_PICKUP_VELOCITY ) {
dragFailTime = gameLocal.time + FAIL_TIME;
oldUcmdFlags = player->usercmd.flags;
// This is the new object to drag around
dragEnt = grabEnt;
// Get the current physics object to manipulate
idPhysics *phys = grabEnt->GetPhysics();
// Turn off gravity on object
saveGravity = phys->GetGravity();
phys->SetGravity( vec3_origin );
// hold it directly in front of player, distance depends on object size
float lerp = 1.0f - ( grabEnt->GetPhysics()->GetBounds().GetRadius() / MAX_HOLD_DISTANCE );
lerp *= lerp;
float holdDist = lerp * MIN_HOLD_DISTANCE + ( 1.0f - lerp ) * MAX_HOLD_DISTANCE;
localPlayerPoint = ( player->firstPersonViewAxis[0] * holdDist ) * player->firstPersonViewAxis.Transpose();
// Start up the Force_Drag to bring it in
drag.Init( g_dragDamping.GetFloat() );
drag.SetPhysics( phys, id, player->firstPersonViewOrigin + localPlayerPoint * player->firstPersonViewAxis );
player->StartSoundShader( declManager->FindSound( "use_grab" ), SND_CHANNEL_VOICE, 0, false, NULL );
}
}
/*
==============
idGrabEntity::StopDrag
==============
*/
void idGrabEntity::StopDrag( idPlayer *player, bool drop ) {
if ( dragEnt.IsValid() ) {
idEntity *ent = dragEnt.GetEntity();
// If a cinematic has started, allow dropped object to think in cinematics
if ( gameLocal.inCinematic )
ent->cinematic = true;
// Restore Gravity
ent->GetPhysics()->SetGravity( saveGravity );
// If the object isn't near its goal, just drop it in place.
if ( drop || drag.GetDistanceToGoal() > DRAG_FAIL_LEN ) {
ent->GetPhysics()->SetLinearVelocity( vec3_origin );
} else { // throw the object forward
ent->ApplyImpulse( player, 0, ent->GetPhysics()->GetOrigin(), player->firstPersonViewAxis[0] * THROW_SCALE );
player->StartSoundShader( declManager->FindSound( "use_throw" ), SND_CHANNEL_VOICE, 0, false, NULL );
}
// Remove the Force_Drag's control of the entity
drag.RemovePhysics( ent->GetPhysics() );
lastThrownTime = gameLocal.time + THROW_TIME;
}
dragEnt = NULL;
}
/*
==============
idGrabEntity::Update
==============
*/
void idGrabEntity::Update( idPlayer *player ) {
trace_t trace;
// idEntity *newEnt;
owner = player;
if ( lastThrownTime > gameLocal.time ) {
prevViewAngles = player->viewAngles;
return;
}
bool valid = dragEnt.IsValid();
// Check if object being held has been removed or player is dead
if ( valid && dragEnt.GetEntity()->IsHidden() || player->health <= 0 ) {
StopDrag( player, true );
prevViewAngles = player->viewAngles;
return;
}
// attack throws object
if ( valid && player->usercmd.buttons & BUTTON_ATTACK ) {
StopDrag( player, false );
prevViewAngles = player->viewAngles;
return;
}
// if there is an entity selected for dragging
if ( dragEnt.GetEntity() ) {
idPhysics *entPhys = dragEnt.GetEntity()->GetPhysics();
idVec3 goalPos;
// Check if the player is standing on the object
idBounds playerBounds;
idBounds objectBounds = entPhys->GetAbsBounds();
idVec3 newPoint = player->GetPhysics()->GetOrigin();
// create a bounds at the players feet
playerBounds.Clear();
playerBounds.AddPoint( newPoint );
newPoint.z -= 1.0f;
playerBounds.AddPoint( newPoint );
playerBounds.ExpandSelf( 8.0f );
// If it intersects the object bounds, then drop it
if ( playerBounds.IntersectsBounds( objectBounds ) ) {
StopDrag( player, true );
prevViewAngles = player->viewAngles;
return;
}
idAngles ang = entPhys->GetAxis().ToAngles();
ang.yaw += player->viewAngles.yaw - prevViewAngles.yaw;
if ( ang.yaw > 180.0f )
ang.yaw -= 360.0f;
else if ( ang.yaw < -180.0f )
ang.yaw += 360.0f;
entPhys->SetAxis( ang.ToMat3() );
// Set and evaluate drag force
goalPos = player->firstPersonViewOrigin + localPlayerPoint * player->firstPersonViewAxis;
drag.SetGoalPosition( goalPos );
drag.Evaluate( gameLocal.time );
// If the object is stuck away from its intended position for more than 500ms, let it go.
if ( drag.GetDistanceToGoal() > DRAG_FAIL_LEN ) {
if ( dragFailTime < gameLocal.time ) {
StopDrag( player, true );
prevViewAngles = player->viewAngles;
return;
}
} else {
dragFailTime = gameLocal.time + 1000;
}
}
prevViewAngles = player->viewAngles;
}
// <---sikk

43
game/Grab.h Normal file
View file

@ -0,0 +1,43 @@
// sikk---> Object Manipulation
/*
===============================================================================
Grab Object - Class to extend idWeapon to include functionality for
manipulating physics objects.
===============================================================================
*/
class idGrabEntity : public idEntity {
public:
CLASS_PROTOTYPE( idGrabEntity );
idGrabEntity( void );
~idGrabEntity( void );
void Clear();
void Update( idPlayer *player );
void StartDrag( idPlayer *player, idEntity *grabEnt, int id );
void StopDrag( idPlayer *player, bool drop );
idEntity * GetGrabEntity( void ) const { return dragEnt.GetEntity(); }
int GetThrownTime( void ) const { return lastThrownTime; }
int SetThrownTime( int time ) { lastThrownTime = time; }
private:
idEntityPtr<idEntity> dragEnt; // entity being dragged
idForce_Grab drag;
idPlayer* owner;
idVec3 saveGravity;
idVec3 localPlayerPoint; // dragged point in player space
idAngles prevViewAngles; // Holds previous frame's player view angles
int id; // id of body being dragged
int oldUcmdFlags;
int dragFailTime;
int lastThrownTime;
};
// <---sikk

View file

@ -76,6 +76,8 @@ idItem::idItem() {
orgOrigin.Zero(); orgOrigin.Zero();
canPickUp = true; canPickUp = true;
fl.networkSync = true; fl.networkSync = true;
noPickup = false; // sikk - Item Management: Manual Item Pickup
} }
/* /*
@ -223,11 +225,13 @@ void idItem::Think( void ) {
idAngles ang; idAngles ang;
idVec3 org; idVec3 org;
ang.pitch = ang.roll = 0.0f; ang.pitch = ang.roll = 0.001f;
ang.yaw = ( gameLocal.time & 4095 ) * 360.0f / -4096.0f; ang.yaw = ( gameLocal.time & 4095 ) * 360.0f / -4096.0f;
SetAngles( ang ); SetAngles( ang );
float scale = 0.005f + entityNumber * 0.00001f; //GRIMM: Too many entities for this stuff.
//float scale = 0.005f + entityNumber * 0.00001f;
float scale = 0.0042f;
org = orgOrigin; org = orgOrigin;
org.z += 4.0f + cos( ( gameLocal.time + 2000 ) * scale ) * 4.0f; org.z += 4.0f + cos( ( gameLocal.time + 2000 ) * scale ) * 4.0f;
@ -266,6 +270,19 @@ void idItem::Present( void ) {
} }
} }
// sikk---> Item Management: Random Item Value
/*
================
idItem::GetRandomValue
================
*/
int idItem::GetRandomValue( const char* invName ) {
int n = spawnArgs.GetInt( invName ) * ( 1.0f - g_itemValueFactor.GetFloat() * gameLocal.random.RandomFloat() );
n = ( n < 1 ) ? 1 : n;
return n;
}
// <---sikk
/* /*
================ ================
idItem::Spawn idItem::Spawn
@ -317,6 +334,40 @@ void idItem::Spawn( void ) {
lastCycle = -1; lastCycle = -1;
itemShellHandle = -1; itemShellHandle = -1;
shellMaterial = declManager->FindMaterial( "itemHighlightShell" ); shellMaterial = declManager->FindMaterial( "itemHighlightShell" );
// sikk---> Item Management: Random Item Value
if ( g_itemValueFactor.GetFloat() ) {
// random ammo values
if ( spawnArgs.GetInt( "inv_ammo_shells" ) )
spawnArgs.SetInt( "inv_ammo_shells", GetRandomValue( "inv_ammo_shells" ) );
if ( spawnArgs.GetInt( "inv_ammo_bullets" ) )
spawnArgs.SetInt( "inv_ammo_bullets", GetRandomValue( "inv_ammo_bullets" ) );
if ( spawnArgs.GetInt( "inv_ammo_rockets" ) )
spawnArgs.SetInt( "inv_ammo_rockets", GetRandomValue( "inv_ammo_rockets" ) );
if ( spawnArgs.GetInt( "inv_ammo_cells" ) )
spawnArgs.SetInt( "inv_ammo_cells", GetRandomValue( "inv_ammo_cells" ) );
if ( spawnArgs.GetInt( "inv_ammo_grenades" ) )
spawnArgs.SetInt( "inv_ammo_grenades", GetRandomValue( "inv_ammo_grenades" ) );
if ( spawnArgs.GetInt( "inv_ammo_bfg" ) )
spawnArgs.SetInt( "inv_ammo_bfg", GetRandomValue( "inv_ammo_bfg" ) );
if ( spawnArgs.GetInt( "inv_ammo_clip" ) )
spawnArgs.SetInt( "inv_ammo_clip", GetRandomValue( "inv_ammo_clip" ) );
if ( spawnArgs.GetInt( "inv_ammo_belt" ) )
spawnArgs.SetInt( "inv_ammo_belt", GetRandomValue( "inv_ammo_belt" ) );
// random health values
if ( spawnArgs.GetInt( "inv_health" ) )
spawnArgs.SetInt( "inv_health", GetRandomValue( "inv_health" ) );
// random armor values
if ( spawnArgs.GetInt( "inv_armor" ) )
spawnArgs.SetInt( "inv_armor", GetRandomValue( "inv_armor" ) );
// random air values
if ( spawnArgs.GetInt( "inv_air" ) )
spawnArgs.SetInt( "inv_air", GetRandomValue( "inv_air" ) );
}
// <---sikk
} }
/* /*
@ -346,6 +397,11 @@ bool idItem::GiveToPlayer( idPlayer *player ) {
return false; return false;
} }
// sikk---> Item Management: Manual Item Pickup
if ( noPickup )
return false;
// <---sikk
if ( spawnArgs.GetBool( "inv_carry" ) ) { if ( spawnArgs.GetBool( "inv_carry" ) ) {
return player->GiveInventoryItem( &spawnArgs ); return player->GiveInventoryItem( &spawnArgs );
} }
@ -369,7 +425,10 @@ bool idItem::Pickup( idPlayer *player ) {
} }
// play pickup sound // play pickup sound
StartSound( "snd_acquire", SND_CHANNEL_ITEM, 0, false, NULL ); // grimm --> SND_CHANNEL_ITEM chokes somehow on items sometimes, let's see how it works out on the player entity.
//StartSound( "snd_acquire", SND_CHANNEL_ITEM, 0, false, NULL );
StartSound( "snd_acquire", SND_CHANNEL_ITEM, 0, true, NULL );
// grimm <--
// trigger our targets // trigger our targets
ActivateTargets( player ); ActivateTargets( player );
@ -408,6 +467,24 @@ bool idItem::Pickup( idPlayer *player ) {
} }
} }
//GRIMM: Add some FX when we pick up an item.
if ( g_ItemPickupFlash.GetBool() ) {
float ftime = SEC2MS( spawnArgs.GetFloat( "ftime", "2" ) );
idVec4 fcolor = spawnArgs.GetVec4( "fcolor" ,"1 0 0" );
player->playerView.GFlash( fcolor, ftime );
}
idStr entFx;
entFx = spawnArgs.GetString( "pickup_fx" );
if (entFx.Length()) {
idEntityFx::StartFx( entFx, NULL, NULL, this, true );
}
//GRIMM
noPickup = true; // sikk - Item Management: Manual Item Pickup
BecomeInactive( TH_THINK ); BecomeInactive( TH_THINK );
return true; return true;
} }
@ -453,12 +530,14 @@ idItem::ClientReceiveEvent
================ ================
*/ */
bool idItem::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) { bool idItem::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
switch( event ) { switch( event ) {
case EVENT_PICKUP: { case EVENT_PICKUP: {
// play pickup sound // play pickup sound
StartSound( "snd_acquire", SND_CHANNEL_ITEM, 0, false, NULL ); // grimm --> SND_CHANNEL_ITEM chokes somehow on items sometimes, let's see how it works out on the player entity.
//StartSound( "snd_acquire", SND_CHANNEL_ITEM, 0, false, NULL );
StartSound( "snd_acquire", SND_CHANNEL_ITEM, 0, true, NULL );
// grimm <--
// hide the model // hide the model
Hide(); Hide();
@ -516,7 +595,10 @@ void idItem::Event_Touch( idEntity *other, trace_t *trace ) {
return; return;
} }
// sikk---> Manual Item Pickup
if ( !g_itemPickupType.GetBool() || spawnArgs.GetBool( "autopickup" ) )
Pickup( static_cast<idPlayer *>(other) ); Pickup( static_cast<idPlayer *>(other) );
// <---sikk
} }
/* /*
@ -636,8 +718,12 @@ bool idItemPowerup::GiveToPlayer( idPlayer *player ) {
if ( player->spectating ) { if ( player->spectating ) {
return false; return false;
} }
player->GivePowerUp( type, time * 1000 );
return true; // sikk---> Adrenaline Pack System
// player->GivePowerUp( type, time * 1000 );
// return true;
return player->GivePowerUp( type, time * 1000 );
// <---sikk
} }
/* /*
@ -712,6 +798,26 @@ void idObjective::Event_CamShot( ) {
renderView_t fullView = *view; renderView_t fullView = *view;
fullView.width = SCREEN_WIDTH; fullView.width = SCREEN_WIDTH;
fullView.height = SCREEN_HEIGHT; fullView.height = SCREEN_HEIGHT;
// sikk---> Portal Sky Box
// HACK : always draw sky-portal view if there is one in the map, this isn't real-time
if ( gameLocal.portalSkyEnt.GetEntity() && g_enablePortalSky.GetBool() ) {
renderView_t portalView = fullView;
portalView.vieworg = gameLocal.portalSkyEnt.GetEntity()->GetPhysics()->GetOrigin();
// setup global fixup projection vars
int i, w, h;
renderSystem->GetGLSettings( w, h );
for ( i = 1; i < w; i <<= 1 ) {}
fullView.shaderParms[4] = (float)w / (float)i;
for ( i = 1; i < h; i <<= 1 ) {}
fullView.shaderParms[5] = (float)h / (float)i;
gameRenderWorld->RenderScene( &portalView );
renderSystem->CaptureRenderToImage( "_currentRender" );
}
// <---sikk
// draw a view to a texture // draw a view to a texture
renderSystem->CropRenderSize( 256, 256, true ); renderSystem->CropRenderSize( 256, 256, true );
gameRenderWorld->RenderScene( &fullView ); gameRenderWorld->RenderScene( &fullView );
@ -870,6 +976,8 @@ idMoveableItem::idMoveableItem() {
trigger = NULL; trigger = NULL;
smoke = NULL; smoke = NULL;
smokeTime = 0; smokeTime = 0;
//nextSoundTime = 0; // sikk - Moveable Items Collision Sound
} }
/* /*
@ -895,6 +1003,8 @@ void idMoveableItem::Save( idSaveGame *savefile ) const {
savefile->WriteParticle( smoke ); savefile->WriteParticle( smoke );
savefile->WriteInt( smokeTime ); savefile->WriteInt( smokeTime );
//savefile->WriteInt( nextSoundTime ); // sikk - Moveable Items Collision Sound
} }
/* /*
@ -910,6 +1020,8 @@ void idMoveableItem::Restore( idRestoreGame *savefile ) {
savefile->ReadParticle( smoke ); savefile->ReadParticle( smoke );
savefile->ReadInt( smokeTime ); savefile->ReadInt( smokeTime );
//savefile->ReadInt( nextSoundTime ); // sikk - Moveable Items Collision Sound
} }
/* /*
@ -924,7 +1036,7 @@ void idMoveableItem::Spawn( void ) {
idBounds bounds; idBounds bounds;
// create a trigger for item pickup // create a trigger for item pickup
spawnArgs.GetFloat( "triggersize", "16.0", tsize ); spawnArgs.GetFloat( "triggersize", "24.0", tsize ); // sikk - Increased default triggersize from 16 to 24
trigger = new idClipModel( idTraceModel( idBounds( vec3_origin ).Expand( tsize ) ) ); trigger = new idClipModel( idTraceModel( idBounds( vec3_origin ).Expand( tsize ) ) );
trigger->Link( gameLocal.clip, this, 0, GetPhysics()->GetOrigin(), GetPhysics()->GetAxis() ); trigger->Link( gameLocal.clip, this, 0, GetPhysics()->GetOrigin(), GetPhysics()->GetAxis() );
trigger->SetContents( CONTENTS_TRIGGER ); trigger->SetContents( CONTENTS_TRIGGER );
@ -954,20 +1066,33 @@ void idMoveableItem::Spawn( void ) {
spawnArgs.GetFloat( "bouncyness", "0.6", bouncyness ); spawnArgs.GetFloat( "bouncyness", "0.6", bouncyness );
bouncyness = idMath::ClampFloat( 0.0f, 1.0f, bouncyness ); bouncyness = idMath::ClampFloat( 0.0f, 1.0f, bouncyness );
// sikk---> Temp Fix for moveable items that spawn inside geometry
idVec3 offset = idVec3( 0.0f, 0.0f, 0.0f );
if ( !idStr::Icmp( spawnArgs.GetString( "bind" ), "" ) )
offset = idVec3( 0.0f, 0.0f, 4.0f );
// <---sikk
// setup the physics // setup the physics
physicsObj.SetSelf( this ); physicsObj.SetSelf( this );
physicsObj.SetClipModel( new idClipModel( trm ), density ); physicsObj.SetClipModel( new idClipModel( trm ), density );
physicsObj.SetOrigin( GetPhysics()->GetOrigin() ); physicsObj.SetOrigin( GetPhysics()->GetOrigin() + offset ); // sikk - Temp Fix for moveable items that spawn inside geometry
physicsObj.SetAxis( GetPhysics()->GetAxis() ); physicsObj.SetAxis( GetPhysics()->GetAxis() );
physicsObj.SetBouncyness( bouncyness ); physicsObj.SetBouncyness( bouncyness );
physicsObj.SetFriction( 0.6f, 0.6f, friction ); physicsObj.SetFriction( 0.6f, 0.6f, friction );
physicsObj.SetGravity( gameLocal.GetGravity() ); physicsObj.SetGravity( gameLocal.GetGravity() );
physicsObj.SetContents( CONTENTS_RENDERMODEL ); // sikk---> We want moveable items to clip with other items and we also want ragdolls to clip with items
physicsObj.SetClipMask( MASK_SOLID | CONTENTS_MOVEABLECLIP ); //physicsObj.SetContents( CONTENTS_RENDERMODEL );
//physicsObj.SetClipMask( MASK_SOLID | CONTENTS_MOVEABLECLIP );
physicsObj.SetContents( CONTENTS_RENDERMODEL | CONTENTS_CORPSE );
physicsObj.SetClipMask( MASK_SOLID | CONTENTS_CORPSE | CONTENTS_MOVEABLECLIP | CONTENTS_RENDERMODEL );
// <---sikk
SetPhysics( &physicsObj ); SetPhysics( &physicsObj );
smoke = NULL; smoke = NULL;
smokeTime = 0; smokeTime = 0;
//nextSoundTime = 0; // sikk - Moveable Items Collision Sound
const char *smokeName = spawnArgs.GetString( "smoke_trail" ); const char *smokeName = spawnArgs.GetString( "smoke_trail" );
if ( *smokeName != '\0' ) { if ( *smokeName != '\0' ) {
smoke = static_cast<const idDeclParticle *>( declManager->FindType( DECL_PARTICLE, smokeName ) ); smoke = static_cast<const idDeclParticle *>( declManager->FindType( DECL_PARTICLE, smokeName ) );
@ -1000,6 +1125,32 @@ void idMoveableItem::Think( void ) {
Present(); Present();
} }
// sikk---> Moveable Items Collision Sound
/*
=================
idMoveableItem::Collide
=================
*/
/*
bool idMoveableItem::Collide( const trace_t &collision, const idVec3 &velocity ) {
float v, f;
v = -( velocity * collision.c.normal );
if ( v > 80 && gameLocal.time > nextSoundTime ) {
f = v > 200 ? 1.0f : idMath::Sqrt( v - 80 ) * 0.091f;
if ( StartSound( "snd_bounce", SND_CHANNEL_ANY, 0, false, NULL ) ) {
// don't set the volume unless there is a bounce sound as it overrides the entire channel
// which causes footsteps on ai's to not honor their shader parms
SetSoundVolume( f );
}
nextSoundTime = gameLocal.time + 500;
}
return false;
}
*/
// <---sikk
/* /*
================ ================
idMoveableItem::Pickup idMoveableItem::Pickup
@ -1046,7 +1197,7 @@ idEntity *idMoveableItem::DropItem( const char *classname, const idVec3 &origin,
removeDelay = 5 * 60 * 1000; removeDelay = 5 * 60 * 1000;
} }
// always remove a dropped item after 5 minutes in case it dropped to an unreachable location // always remove a dropped item after 5 minutes in case it dropped to an unreachable location
item->PostEventMS( &EV_Remove, removeDelay ); // item->PostEventMS( &EV_Remove, removeDelay ); // sikk - Dropped moveable items are no longer removed
} }
return item; return item;
} }
@ -1206,6 +1357,116 @@ bool idMoveablePDAItem::GiveToPlayer(idPlayer *player) {
return true; return true;
} }
// sikk---> Moveable Video CD
/*
===============================================================================
idMoveableVideoCDItem
===============================================================================
*/
CLASS_DECLARATION( idMoveableItem, idMoveableVideoCDItem )
END_CLASS
/*
================
idMoveableVideoCDItem::Spawn
================
*/
void idMoveableVideoCDItem::Spawn( void ) {
}
/*
================
idMoveableVideoCDItem::GiveToPlayer
================
*/
bool idMoveableVideoCDItem::GiveToPlayer( idPlayer *player ) {
idStr str = spawnArgs.GetString( "video" );
if ( player && str.Length() ) {
player->GiveVideo( str, &spawnArgs );
}
return true;
}
// <---sikk
// sikk---> Moveable Powerup
/*
===============================================================================
idMoveableItemPowerup
===============================================================================
*/
/*
===============
idMoveableItemPowerup
===============
*/
CLASS_DECLARATION( idMoveableItem, idMoveableItemPowerup )
END_CLASS
/*
================
idMoveableItemPowerup::idMoveableItemPowerup
================
*/
idMoveableItemPowerup::idMoveableItemPowerup() {
time = 0;
type = 0;
}
/*
================
idMoveableItemPowerup::Save
================
*/
void idMoveableItemPowerup::Save( idSaveGame *savefile ) const {
savefile->WriteInt( time );
savefile->WriteInt( type );
}
/*
================
idMoveableItemPowerup::Restore
================
*/
void idMoveableItemPowerup::Restore( idRestoreGame *savefile ) {
savefile->ReadInt( time );
savefile->ReadInt( type );
}
/*
================
idMoveableItemPowerup::Spawn
================
*/
void idMoveableItemPowerup::Spawn( void ) {
time = spawnArgs.GetInt( "time", "30" );
type = spawnArgs.GetInt( "type", "0" );
}
/*
================
idMoveableItemPowerup::GiveToPlayer
================
*/
bool idMoveableItemPowerup::GiveToPlayer( idPlayer *player ) {
if ( player->spectating ) {
return false;
}
// sikk---> Adrenaline Pack System
// player->GivePowerUp( type, time * 1000 );
// return true;
return player->GivePowerUp( type, time * 1000 );
// <---sikk
}
// <---sikk
/* /*
=============================================================================== ===============================================================================

View file

@ -71,6 +71,11 @@ public:
virtual void WriteToSnapshot( idBitMsgDelta &msg ) const; virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
virtual void ReadFromSnapshot( const idBitMsgDelta &msg ); virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
// sikk---> Item Management: Random Item Value/Manual Item Pickup
int GetRandomValue( const char* invName ); // sikk - Item Management: Random Item Value
bool noPickup; // sikk - Item Management: Manual Item Pickup
// <---sikk
private: private:
idVec3 orgOrigin; idVec3 orgOrigin;
bool spin; bool spin;
@ -161,6 +166,9 @@ public:
void Spawn( void ); void Spawn( void );
virtual void Think( void ); virtual void Think( void );
//virtual bool Collide( const trace_t &collision, const idVec3 &velocity ); // sikk - Moveable Items Collision Sound
virtual bool Pickup( idPlayer *player ); virtual bool Pickup( idPlayer *player );
static void DropItems( idAnimatedEntity *ent, const char *type, idList<idEntity *> *list ); static void DropItems( idAnimatedEntity *ent, const char *type, idList<idEntity *> *list );
@ -175,6 +183,8 @@ private:
const idDeclParticle * smoke; const idDeclParticle * smoke;
int smokeTime; int smokeTime;
//int nextSoundTime; // sikk - Moveable Items Collision Sound
void Gib( const idVec3 &dir, const char *damageDefName ); void Gib( const idVec3 &dir, const char *damageDefName );
void Event_DropToFloor( void ); void Event_DropToFloor( void );
@ -188,6 +198,35 @@ public:
virtual bool GiveToPlayer( idPlayer *player ); virtual bool GiveToPlayer( idPlayer *player );
}; };
// sikk---> Moveable Video CD
class idMoveableVideoCDItem : public idMoveableItem {
public:
CLASS_PROTOTYPE( idMoveableVideoCDItem );
void Spawn();
virtual bool GiveToPlayer( idPlayer *player );
};
// <---sikk
// sikk---> Moveable Powerup
class idMoveableItemPowerup : public idMoveableItem {
public:
CLASS_PROTOTYPE( idMoveableItemPowerup );
idMoveableItemPowerup();
void Save( idSaveGame *savefile ) const;
void Restore( idRestoreGame *savefile );
void Spawn();
virtual bool GiveToPlayer( idPlayer *player );
private:
int time;
int type;
};
// <---sikk
/* /*
=============================================================================== ===============================================================================

View file

@ -300,6 +300,13 @@ void idLight::Restore( idRestoreGame *savefile ) {
lightDefHandle = -1; lightDefHandle = -1;
// sikk---> Soft Shadows PostProcess
// only put lights that cast shadows into the list
if ( spawnArgs.GetInt( "noshadows" ) == 0 ) {
gameLocal.currentLights.Append( entityNumber );
}
// <---sikk
SetLightLevel(); SetLightLevel();
} }
@ -417,6 +424,13 @@ void idLight::Spawn( void ) {
PostEventMS( &EV_PostSpawn, 0 ); PostEventMS( &EV_PostSpawn, 0 );
// sikk---> Soft Shadows PostProcess
// only put lights that cast shadows into the list
if ( spawnArgs.GetInt( "noshadows" ) == 0 ) {
gameLocal.currentLights.Append( entityNumber );
}
// <---sikk
UpdateVisuals(); UpdateVisuals();
} }
@ -1144,7 +1158,6 @@ idLight::ClientReceiveEvent
================ ================
*/ */
bool idLight::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) { bool idLight::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
switch( event ) { switch( event ) {
case EVENT_BECOMEBROKEN: { case EVENT_BECOMEBROKEN: {
BecomeBroken( NULL ); BecomeBroken( NULL );
@ -1156,3 +1169,19 @@ bool idLight::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
// sikk---> Soft Shadows PostProcess
/*
================
idLight::UpdateShadowState
================
*/
void idLight::UpdateShadowState( void ) {
// let the renderer apply it to the world
if ( ( lightDefHandle != -1 ) ) {
gameRenderWorld->UpdateLightDef( lightDefHandle, &renderLight );
} else {
lightDefHandle = gameRenderWorld->AddLightDef( &renderLight );
}
}
// <---sikk

View file

@ -91,12 +91,16 @@ public:
EVENT_BECOMEBROKEN = idEntity::EVENT_MAXEVENTS, EVENT_BECOMEBROKEN = idEntity::EVENT_MAXEVENTS,
EVENT_MAXEVENTS EVENT_MAXEVENTS
}; };
virtual void ClientPredictionThink( void ); virtual void ClientPredictionThink( void );
virtual void WriteToSnapshot( idBitMsgDelta &msg ) const; virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
virtual void ReadFromSnapshot( const idBitMsgDelta &msg ); virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg ); virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg );
// sikk---> Soft Shadows PostProcess
renderLight_t* GetRenderLight( void ) { return &renderLight; };
void UpdateShadowState( void );
// <---sikk
private: private:
renderLight_t renderLight; // light presented to the renderer renderLight_t renderLight; // light presented to the renderer
idVec3 localLightOrigin; // light origin relative to the physics origin idVec3 localLightOrigin; // light origin relative to the physics origin

View file

@ -613,7 +613,7 @@ idExplodable::Event_Explode
void idExplodable::Event_Explode( idEntity *activator ) { void idExplodable::Event_Explode( idEntity *activator ) {
const char *temp; const char *temp;
if ( spawnArgs.GetString( "def_damage", "damage_explosion", &temp ) ) { if ( spawnArgs.GetString( "def_damage", "damage_generic_explosion", &temp ) ) {
gameLocal.RadiusDamage( GetPhysics()->GetOrigin(), activator, activator, this, this, temp ); gameLocal.RadiusDamage( GetPhysics()->GetOrigin(), activator, activator, this, this, temp );
} }
@ -1360,6 +1360,7 @@ idStaticEntity::idStaticEntity( void ) {
fadeStart = 0; fadeStart = 0;
fadeEnd = 0; fadeEnd = 0;
runGui = false; runGui = false;
//sndHum = NULL;
} }
/* /*
@ -1375,6 +1376,7 @@ void idStaticEntity::Save( idSaveGame *savefile ) const {
savefile->WriteInt( fadeStart ); savefile->WriteInt( fadeStart );
savefile->WriteInt( fadeEnd ); savefile->WriteInt( fadeEnd );
savefile->WriteBool( runGui ); savefile->WriteBool( runGui );
//savefile->WriteSoundShader( sndHum );
} }
/* /*
@ -1383,6 +1385,7 @@ idStaticEntity::Restore
=============== ===============
*/ */
void idStaticEntity::Restore( idRestoreGame *savefile ) { void idStaticEntity::Restore( idRestoreGame *savefile ) {
savefile->ReadInt( spawnTime ); savefile->ReadInt( spawnTime );
savefile->ReadBool( active ); savefile->ReadBool( active );
savefile->ReadVec4( fadeFrom ); savefile->ReadVec4( fadeFrom );
@ -1390,8 +1393,39 @@ void idStaticEntity::Restore( idRestoreGame *savefile ) {
savefile->ReadInt( fadeStart ); savefile->ReadInt( fadeStart );
savefile->ReadInt( fadeEnd ); savefile->ReadInt( fadeEnd );
savefile->ReadBool( runGui ); savefile->ReadBool( runGui );
//savefile->ReadSoundShader( sndHum );
// grimm --> if this is a spray entity, re-apply the spray
if ( spawnArgs.GetBool("SprayObject") ) {
Spray();
}
// <-- grimm
} }
/* grim --> spray painting.
===============
idStaticEntity::Spray
===============
*/
void idStaticEntity::Spray( void ) {
if ( g_UseDynamicPaint.GetBool() ) {
// CHANGE THIS: make the textures come from the decal.
float k = gameLocal.random.RandomFloat() * 3;
if ( k <= 1.0f ) {
Event_SprayDecal( GetPhysics()->GetOrigin(), spawnArgs.GetString( "mtr_decal", "textures/decals/vin_splat_death2_dark" ), spawnArgs.GetVector( "angle", "0 0 0" ), spawnArgs.GetFloat( "spray_size", "360" ) );
}
if ( k > 1.0f && k <= 2.0f ) {
Event_SprayDecal( GetPhysics()->GetOrigin(), spawnArgs.GetString( "mtr_decal1", "textures/decals/vin_splatblood1" ), spawnArgs.GetVector( "angle", "0 0 0" ), spawnArgs.GetFloat( "spray_size", "360" ) );
}
if ( k > 2 ) {
Event_SprayDecal( GetPhysics()->GetOrigin(), spawnArgs.GetString( "mtr_decal2", "textures/decals/vin_splatblood2" ), spawnArgs.GetVector( "angle", "0 0 0" ), spawnArgs.GetFloat( "spray_size", "360" ) );
}
}
}
// <-- grimm
/* /*
=============== ===============
idStaticEntity::Spawn idStaticEntity::Spawn
@ -1401,6 +1435,7 @@ void idStaticEntity::Spawn( void ) {
bool solid; bool solid;
bool hidden; bool hidden;
// an inline static model will not do anything at all // an inline static model will not do anything at all
if ( spawnArgs.GetBool( "inline" ) || gameLocal.world->spawnArgs.GetBool( "inlineAllStatics" ) ) { if ( spawnArgs.GetBool( "inline" ) || gameLocal.world->spawnArgs.GetBool( "inlineAllStatics" ) ) {
Hide(); Hide();
@ -1410,6 +1445,20 @@ void idStaticEntity::Spawn( void ) {
solid = spawnArgs.GetBool( "solid" ); solid = spawnArgs.GetBool( "solid" );
hidden = spawnArgs.GetBool( "hide" ); hidden = spawnArgs.GetBool( "hide" );
// grim --> used for torches
// grimm --> i'm a dumbass, could've just used s_shader
/*
idStr snd_idle = spawnArgs.GetString("snd_torchidle");
if ( snd_idle.Length() && s_useEnvironmentalSounds.GetBool() ) {
sndHum = declManager->FindSound( snd_idle.c_str() );
if ( sndHum && !hidden ) {
StartSoundShader( sndHum, SND_CHANNEL_ANY, 0, false, NULL );
}
}
*/
// <-- grimm
if ( solid && !hidden ) { if ( solid && !hidden ) {
GetPhysics()->SetContents( CONTENTS_SOLID ); GetPhysics()->SetContents( CONTENTS_SOLID );
} else { } else {
@ -1423,6 +1472,11 @@ void idStaticEntity::Spawn( void ) {
if ( model.Find( ".prt" ) >= 0 ) { if ( model.Find( ".prt" ) >= 0 ) {
// we want the parametric particles out of sync with each other // we want the parametric particles out of sync with each other
renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = gameLocal.random.RandomInt( 32767 ); renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = gameLocal.random.RandomInt( 32767 );
// sikk---> Depth Render
renderEntity.suppressSurfaceInViewID = -8;
renderEntity.noShadow = 1;
// <---sikk
} }
fadeFrom.Set( 1, 1, 1, 1 ); fadeFrom.Set( 1, 1, 1, 1 );
@ -1430,6 +1484,17 @@ void idStaticEntity::Spawn( void ) {
fadeStart = 0; fadeStart = 0;
fadeEnd = 0; fadeEnd = 0;
// grimm --> if this is a spray entity, spray something
if ( spawnArgs.GetBool("SprayObject") ) {
Spray();
//hide the static if we're not in painting mode.
if ( !g_PaintSplatterMode.GetBool() ) {
Hide();
}
}
// <--grimm
// NOTE: this should be used very rarely because it is expensive // NOTE: this should be used very rarely because it is expensive
runGui = spawnArgs.GetBool( "runGui" ); runGui = spawnArgs.GetBool( "runGui" );
if ( runGui ) { if ( runGui ) {
@ -1514,6 +1579,14 @@ void idStaticEntity::Show( void ) {
if ( spawnArgs.GetBool( "solid" ) ) { if ( spawnArgs.GetBool( "solid" ) ) {
GetPhysics()->SetContents( CONTENTS_SOLID ); GetPhysics()->SetContents( CONTENTS_SOLID );
} }
// grimm --> if an idle sound was set then use it.
/*
if ( sndHum ) {
StartSoundShader( sndHum, SND_CHANNEL_ANY, 0, false, NULL );
}
*/
// grimm --> if an idle sound was set then use it.
} }
/* /*
@ -3156,3 +3229,63 @@ void idPhantomObjects::Think( void ) {
BecomeInactive( TH_THINK ); BecomeInactive( TH_THINK );
} }
} }
// sikk---> Portal Sky Box
/*
===============================================================================
idPortalSky
===============================================================================
*/
CLASS_DECLARATION( idEntity, idPortalSky )
EVENT( EV_PostSpawn, idPortalSky::Event_PostSpawn )
EVENT( EV_Activate, idPortalSky::Event_Activate )
END_CLASS
/*
===============
idPortalSky::idPortalSky
===============
*/
idPortalSky::idPortalSky( void ) {
}
/*
===============
idPortalSky::~idPortalSky
===============
*/
idPortalSky::~idPortalSky( void ) {
}
/*
===============
idPortalSky::Spawn
===============
*/
void idPortalSky::Spawn( void ) {
if ( !spawnArgs.GetBool( "triggered" ) ) {
PostEventMS( &EV_PostSpawn, 1 );
}
}
/*
================
idPortalSky::Event_PostSpawn
================
*/
void idPortalSky::Event_PostSpawn() {
gameLocal.SetPortalSkyEnt( this );
}
/*
================
idPortalSky::Event_Activate
================
*/
void idPortalSky::Event_Activate( idEntity *activator ) {
gameLocal.SetPortalSkyEnt( this );
}
// <---sikk

View file

@ -320,9 +320,17 @@ public:
void Fade( const idVec4 &to, float fadeTime ); void Fade( const idVec4 &to, float fadeTime );
virtual void Think( void ); virtual void Think( void );
// grimm idle sound for statics
// const idSoundShader * sndHum;
// grimm idle sound for statics
virtual void WriteToSnapshot( idBitMsgDelta &msg ) const; virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
virtual void ReadFromSnapshot( const idBitMsgDelta &msg ); virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
// grimm
void Spray( void );
// grimm
private: private:
void Event_Activate( idEntity *activator ); void Event_Activate( idEntity *activator );
@ -335,7 +343,6 @@ private:
bool runGui; bool runGui;
}; };
/* /*
=============================================================================== ===============================================================================
@ -765,4 +772,25 @@ private:
idList<idVec3> lastTargetPos; idList<idVec3> lastTargetPos;
}; };
// sikk---> Portal Sky Box
/*
===============================================================================
idPortalSky
===============================================================================
*/
class idPortalSky : public idEntity {
public:
CLASS_PROTOTYPE( idPortalSky );
idPortalSky();
~idPortalSky();
void Spawn( void );
void Event_PostSpawn();
void Event_Activate( idEntity *activator );
};
// <---sikk
#endif /* !__GAME_MISC_H__ */ #endif /* !__GAME_MISC_H__ */

View file

@ -75,6 +75,11 @@ idMoveable::idMoveable( void ) {
unbindOnDeath = false; unbindOnDeath = false;
allowStep = false; allowStep = false;
canDamage = false; canDamage = false;
// grimm -->
smokeFly = NULL;
smokeFlyTime = 0;
// <-- grimm
} }
/* /*
@ -98,6 +103,8 @@ void idMoveable::Spawn( void ) {
int clipShrink; int clipShrink;
idStr clipModelName; idStr clipModelName;
mtr_collide = spawnArgs.GetString( "mtr_collide" );
// check if a clip model is set // check if a clip model is set
spawnArgs.GetString( "clipmodel", "", clipModelName ); spawnArgs.GetString( "clipmodel", "", clipModelName );
if ( !clipModelName[0] ) { if ( !clipModelName[0] ) {
@ -178,6 +185,17 @@ void idMoveable::Spawn( void ) {
allowStep = spawnArgs.GetBool( "allowStep", "1" ); allowStep = spawnArgs.GetBool( "allowStep", "1" );
// grimm -->
smokeFly = NULL;
smokeFlyTime = 0;
const char *smokeName = spawnArgs.GetString( "smoke_fly" );
if ( *smokeName != '\0' ) {
smokeFly = static_cast<const idDeclParticle *>( declManager->FindType( DECL_PARTICLE, smokeName ) );
smokeFlyTime = gameLocal.time;
gameLocal.smokeParticles->EmitSmoke( smokeFly, smokeFlyTime, gameLocal.random.CRandomFloat(), GetPhysics()->GetOrigin(), GetPhysics()->GetAxis() );
}
// grimm <--
PostEventMS( &EV_SetOwnerFromSpawnArgs, 0 ); PostEventMS( &EV_SetOwnerFromSpawnArgs, 0 );
} }
@ -202,6 +220,10 @@ void idMoveable::Save( idSaveGame *savefile ) const {
savefile->WriteInt( nextSoundTime ); savefile->WriteInt( nextSoundTime );
savefile->WriteInt( initialSpline != NULL ? initialSpline->GetTime( 0 ) : -1 ); savefile->WriteInt( initialSpline != NULL ? initialSpline->GetTime( 0 ) : -1 );
savefile->WriteVec3( initialSplineDir ); savefile->WriteVec3( initialSplineDir );
savefile->WriteString( mtr_collide );
savefile->WriteInt( last_spraytime );
savefile->WriteParticle( smokeFly );
savefile->WriteInt( smokeFlyTime );
savefile->WriteStaticObject( physicsObj ); savefile->WriteStaticObject( physicsObj );
} }
@ -228,6 +250,10 @@ void idMoveable::Restore( idRestoreGame *savefile ) {
savefile->ReadInt( nextSoundTime ); savefile->ReadInt( nextSoundTime );
savefile->ReadInt( initialSplineTime ); savefile->ReadInt( initialSplineTime );
savefile->ReadVec3( initialSplineDir ); savefile->ReadVec3( initialSplineDir );
savefile->ReadString( mtr_collide );
savefile->ReadInt( last_spraytime );
savefile->ReadParticle( smokeFly );
savefile->ReadInt( smokeFlyTime );
if ( initialSplineTime != -1 ) { if ( initialSplineTime != -1 ) {
InitInitialSpline( initialSplineTime ); InitInitialSpline( initialSplineTime );
@ -237,6 +263,15 @@ void idMoveable::Restore( idRestoreGame *savefile ) {
savefile->ReadStaticObject( physicsObj ); savefile->ReadStaticObject( physicsObj );
RestorePhysics( &physicsObj ); RestorePhysics( &physicsObj );
// grimm -->
if ( smokeFly != NULL ) {
idVec3 dir;
dir = physicsObj.GetLinearVelocity();
dir.NormalizeFast();
gameLocal.smokeParticles->EmitSmoke( smokeFly, gameLocal.time, gameLocal.random.RandomFloat(), GetPhysics()->GetOrigin(), GetPhysics()->GetAxis() );
}
// grimm <--
} }
/* /*
@ -245,6 +280,22 @@ idMoveable::Hide
================ ================
*/ */
void idMoveable::Hide( void ) { void idMoveable::Hide( void ) {
const char *temp;
temp = spawnArgs.GetString( "fx_broken" );
if ( *temp != '\0' ) {
idVec3 org = physicsObj.GetOrigin();
//org.z = org.z + 8.0f;
idEntityFx::StartFx( temp, &org, NULL, gameLocal.GetLocalPlayer(), false );
}
// grimm --> blood spray
last_spraytime = 0;
if ( mtr_collide.c_str() != "" && last_spraytime < gameLocal.GetTime() ) {
idVec3 org = physicsObj.GetOrigin();
gameLocal.ProjectDecal( org, GetPhysics()->GetGravity(), 128.0f, true, 96.0f, mtr_collide.c_str() );
}
// <-- grimm
idEntity::Hide(); idEntity::Hide();
physicsObj.SetContents( 0 ); physicsObj.SetContents( 0 );
} }
@ -293,11 +344,22 @@ bool idMoveable::Collide( const trace_t &collision, const idVec3 &velocity ) {
} }
} }
// grimm --> Over the top blood & moveable effects.
if ( fxCollide.Length() && gameLocal.time > nextCollideFxTime ) { if ( fxCollide.Length() && gameLocal.time > nextCollideFxTime ) {
idEntityFx::StartFx( fxCollide, &collision.c.point, NULL, this, false ); idEntityFx::StartFx( fxCollide, &collision.c.point, NULL, this, false );
nextCollideFxTime = gameLocal.time + 3500; nextCollideFxTime = gameLocal.time + 1500;
} }
if ( mtr_collide.Length() && last_spraytime < gameLocal.GetTime() && !IsAtRest() ) {
float ranScale;
ranScale = 128.0f * (0.35 + gameLocal.random.CRandomFloat());
last_spraytime = gameLocal.GetTime() + 1500;
//gameLocal.ProjectDecal( GetPhysics()->GetOrigin(), GetPhysics()->GetGravity(), 128.0f, true, ranScale, mtr_collide.c_str() );
gameLocal.ProjectDecal( GetPhysics()->GetOrigin(), -collision.c.normal, 128.0f, true, 96.0f, mtr_collide.c_str() );
}
// <-- grimm
return false; return false;
} }
@ -421,6 +483,14 @@ void idMoveable::Think( void ) {
BecomeInactive( TH_THINK ); BecomeInactive( TH_THINK );
} }
} }
// grimm -->
if ( smokeFly && smokeFlyTime ) {
if ( !gameLocal.smokeParticles->EmitSmoke( smokeFly, smokeFlyTime, gameLocal.random.CRandomFloat(), GetPhysics()->GetOrigin(), GetPhysics()->GetAxis() ) ) {
smokeFlyTime = 0;
}
}
// <-- grimm
idEntity::Think(); idEntity::Think();
} }
@ -907,6 +977,9 @@ void idExplodingBarrel::AddParticles( const char *name, bool burn ) {
particleRenderEntity.shaderParms[ SHADERPARM_ALPHA ] = rgb; particleRenderEntity.shaderParms[ SHADERPARM_ALPHA ] = rgb;
particleRenderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = -MS2SEC( gameLocal.realClientTime ); particleRenderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = -MS2SEC( gameLocal.realClientTime );
particleRenderEntity.shaderParms[ SHADERPARM_DIVERSITY ] = ( burn ) ? 1.0f : gameLocal.random.RandomInt( 90 ); particleRenderEntity.shaderParms[ SHADERPARM_DIVERSITY ] = ( burn ) ? 1.0f : gameLocal.random.RandomInt( 90 );
particleRenderEntity.suppressSurfaceInViewID = -8; // sikk - Depth Render
if ( !particleRenderEntity.hModel ) { if ( !particleRenderEntity.hModel ) {
particleRenderEntity.hModel = renderModelManager->FindModel( name ); particleRenderEntity.hModel = renderModelManager->FindModel( name );
} }
@ -1011,7 +1084,7 @@ void idExplodingBarrel::Killed( idEntity *inflictor, idEntity *attacker, int dam
Hide(); Hide();
physicsObj.SetContents( 0 ); physicsObj.SetContents( 0 );
const char *splash = spawnArgs.GetString( "def_splash_damage", "damage_explosion" ); const char *splash = spawnArgs.GetString( "def_splash_damage", "damage_generic_explosion_splash" );
if ( splash && *splash ) { if ( splash && *splash ) {
gameLocal.RadiusDamage( GetPhysics()->GetOrigin(), this, attacker, this, this, splash ); gameLocal.RadiusDamage( GetPhysics()->GetOrigin(), this, attacker, this, this, splash );
} }
@ -1188,7 +1261,6 @@ idExplodingBarrel::ClientReceiveEvent
================ ================
*/ */
bool idExplodingBarrel::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) { bool idExplodingBarrel::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
switch( event ) { switch( event ) {
case EVENT_EXPLODE: case EVENT_EXPLODE:
if ( gameLocal.realClientTime - msg.ReadInt() < spawnArgs.GetInt( "explode_lapse", "1000" ) ) { if ( gameLocal.realClientTime - msg.ReadInt() < spawnArgs.GetInt( "explode_lapse", "1000" ) ) {

View file

@ -88,6 +88,13 @@ protected:
int nextDamageTime; // next time the movable can hurt the player int nextDamageTime; // next time the movable can hurt the player
int nextSoundTime; // next time the moveable can make a sound int nextSoundTime; // next time the moveable can make a sound
// grimm -->
idStr mtr_collide; // material to spray on walls when object collides with something.
int last_spraytime; // last time that a spray was made.
const idDeclParticle * smokeFly;
int smokeFlyTime;
// <-- grimm
const idMaterial * GetRenderModelMaterial( void ) const; const idMaterial * GetRenderModelMaterial( void ) const;
void BecomeNonSolid( void ); void BecomeNonSolid( void );
void InitInitialSpline( int startTime ); void InitInitialSpline( int startTime );

View file

@ -374,6 +374,13 @@ void idMover::Spawn( void ) {
} }
} }
//GRIMM
if ( spawnArgs.GetBool( "neverblocked" ) ) {
physicsObj.SetContents( CONTENTS_PLAYERCLIP | CONTENTS_RENDERMODEL);
physicsObj.SetClipMask( MASK_PLAYERSOLID );
}
//GRIMM
health = spawnArgs.GetInt( "health" ); health = spawnArgs.GetInt( "health" );
if ( health ) { if ( health ) {
fl.takedamage = true; fl.takedamage = true;
@ -401,6 +408,12 @@ void idMover::Show( void ) {
if ( spawnArgs.GetBool( "solid", "1" ) ) { if ( spawnArgs.GetBool( "solid", "1" ) ) {
physicsObj.SetContents( CONTENTS_SOLID ); physicsObj.SetContents( CONTENTS_SOLID );
} }
//GRIMM
if ( spawnArgs.GetBool( "neverblocked", "1" ) ) {
physicsObj.SetContents( CONTENTS_PLAYERCLIP );
physicsObj.SetClipMask( MASK_PLAYERSOLID );
}
//GRIMM
SetPhysics( &physicsObj ); SetPhysics( &physicsObj );
} }
@ -999,7 +1012,7 @@ idMover::Event_PartBlocked
*/ */
void idMover::Event_PartBlocked( idEntity *blockingEntity ) { void idMover::Event_PartBlocked( idEntity *blockingEntity ) {
if ( damage > 0.0f ) { if ( damage > 0.0f ) {
blockingEntity->Damage( this, this, vec3_origin, "damage_moverCrush", damage, INVALID_JOINT ); blockingEntity->Damage( this, this, vec3_origin, "damage_grimm_1", damage, INVALID_JOINT );
} }
if ( g_debugMover.GetBool() ) { if ( g_debugMover.GetBool() ) {
gameLocal.Printf( "%d: '%s' blocked by '%s'\n", gameLocal.time, name.c_str(), blockingEntity->name.c_str() ); gameLocal.Printf( "%d: '%s' blocked by '%s'\n", gameLocal.time, name.c_str(), blockingEntity->name.c_str() );
@ -3788,7 +3801,7 @@ idDoor::Event_PartBlocked
*/ */
void idDoor::Event_PartBlocked( idEntity *blockingEntity ) { void idDoor::Event_PartBlocked( idEntity *blockingEntity ) {
if ( damage > 0.0f ) { if ( damage > 0.0f ) {
blockingEntity->Damage( this, this, vec3_origin, "damage_moverCrush", damage, INVALID_JOINT ); blockingEntity->Damage( this, this, vec3_origin, "damage_grimm_1", damage, INVALID_JOINT );
} }
} }
@ -4225,7 +4238,7 @@ idPlat::Event_PartBlocked
*/ */
void idPlat::Event_PartBlocked( idEntity *blockingEntity ) { void idPlat::Event_PartBlocked( idEntity *blockingEntity ) {
if ( damage > 0.0f ) { if ( damage > 0.0f ) {
blockingEntity->Damage( this, this, vec3_origin, "damage_moverCrush", damage, INVALID_JOINT ); blockingEntity->Damage( this, this, vec3_origin, "damage_grimm_1", damage, INVALID_JOINT );
} }
} }
@ -4316,7 +4329,7 @@ idMover_Periodic::Event_PartBlocked
*/ */
void idMover_Periodic::Event_PartBlocked( idEntity *blockingEntity ) { void idMover_Periodic::Event_PartBlocked( idEntity *blockingEntity ) {
if ( damage > 0.0f ) { if ( damage > 0.0f ) {
blockingEntity->Damage( this, this, vec3_origin, "damage_moverCrush", damage, INVALID_JOINT ); blockingEntity->Damage( this, this, vec3_origin, "damage_grimm_1", damage, INVALID_JOINT );
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -194,6 +194,9 @@ public:
int onePickupTime; int onePickupTime;
idList<idItemInfo> pickupItemNames; idList<idItemInfo> pickupItemNames;
idList<idObjectiveInfo> objectiveNames; idList<idObjectiveInfo> objectiveNames;
int healthPackAmount; // sikk - Health Management System (Health Pack)
int adrenalineAmount; // sikk - Adrenaline Pack System
}; };
typedef struct { typedef struct {
@ -284,7 +287,6 @@ public:
bool healthTake; bool healthTake;
int nextHealthTake; int nextHealthTake;
bool hiddenWeapon; // if the weapon is hidden ( in noWeapons maps ) bool hiddenWeapon; // if the weapon is hidden ( in noWeapons maps )
idEntityPtr<idProjectile> soulCubeProjectile; idEntityPtr<idProjectile> soulCubeProjectile;
@ -452,7 +454,7 @@ public:
void AdjustHeartRate( int target, float timeInSecs, float delay, bool force ); void AdjustHeartRate( int target, float timeInSecs, float delay, bool force );
void SetCurrentHeartRate( void ); void SetCurrentHeartRate( void );
int GetBaseHeartRate( void ); int GetBaseHeartRate( void );
void UpdateAir( void ); //void UpdateAir( void );
virtual bool HandleSingleGuiCommand( idEntity *entityGui, idLexer *src ); virtual bool HandleSingleGuiCommand( idEntity *entityGui, idLexer *src );
bool GuiActive( void ) { return focusGUIent != NULL; } bool GuiActive( void ) { return focusGUIent != NULL; }
@ -524,6 +526,126 @@ public:
bool SelfSmooth( void ); bool SelfSmooth( void );
void SetSelfSmooth( bool b ); void SetSelfSmooth( bool b );
int nScreenFrostAlpha; // sikk - Screen Frost
//int nShowHudTimer; // sikk - Dynamic hud system - Used to say when to show the hud as well as fade it in/out (just for health/armor/ammo/weapon changes)
// sikk---> Manual Item Pickup
idItem* focusItem;
int itemPickupTime;
// <---sikk
// sikk---> Searchable Corpses
void SearchCorpse( idAFEntity_Gibbable* corpse );
idAFEntity_Gibbable* focusCorpse;
int searchTimer;
// <---sikk
// sikk---> Object Manipulation
//idGrabEntity grabEntity;
idEntity* focusMoveable;
int focusMoveableId;
int focusMoveableTimer;
// <---sikk
// sikk---> Adrenaline Pack System
void UseAdrenaline( void );
int adrenalineAmount;
// <---sikk
// sikk---> Health Management System
void UseHealthPack( void );
int healthPackAmount;
int healthPackTimer;
int nextHealthRegen;
int prevHeatlh; // sikk - holds player health after Health station has been used
// <---sikk
// sikk---> Crosshair Positioning
int GetCurrentWeapon( void ) { return currentWeapon; };
idVec3 v3CrosshairPos;
// <---sikk
// sikk---> Weapon Management: Awareness
bool GetWeaponAwareness( void );
bool bWATrace;
bool bWAIsSprinting;
bool bWAUseHideDist;
float fSpreadModifier;
idEntity* entChainsawed;
// <---sikk
// sikk---> Depth Render
void ToggleSuppression( bool bSuppress );
bool bViewModelsModified;
// <---sikk
// sikk---> Depth of Field PostProcess
int GetTalkCursor( void ) { return talkCursor; }; // used to check if character has focus
bool bIsZoomed;
float focusDistance;
// <---sikk
// sikk---> Global Ambient Light
void ToggleAmbientLight( bool bOn );
bool bAmbientLightOn;
idStr szAmbientLightColor;
idStr szAmbientLightRadius;
// <---sikk
// sikk---> Infrared Goggles/Headlight Mod
void UpdateBattery( void );
void ToggleIRGoggles( void );
void ToggleHeadlight( void );
bool bIRGogglesOn;
bool bHeadlightOn;
int nIRGogglesTime;
int nHeadlightTime;
int nBattery;
float fIntensity;
float fIRBloomParms[ 7 ];
// <---sikk
// grimm -->
//dynamic music
void UpdateDynamicMusic( void );
idEntity *music_suspense;
idEntity *music_combat;
float old_music_volume;
float new_music_volume;
bool use_combat_music;
bool combat_musicon;
float music_waittime;
//dashing & wallsliding
float dashtime;
void Dash( void );
bool KeptInPlace;
//screenfrosting for dark warrior complex
void UpdateFrost( void );
// map timers.
int totalplaytime;
int nexttimeupdate;
void UpdatePlayTime( void );
// kills meter
int kills_amt;
int kills_amt_total;
int AccoladeKills;
void CheckKillAccolade( void );
int lastAccoladeCheck;
int nextAccoladeCheck;
void SpawnThing( char *clname );
// obstacle checking (move cloth etc..)
void CheckObstacle( void );
// grimm <--
private: private:
jointHandle_t hipJoint; jointHandle_t hipJoint;
jointHandle_t chestJoint; jointHandle_t chestJoint;
@ -608,6 +730,13 @@ private:
idStr pdaVideoWave; idStr pdaVideoWave;
bool tipUp; bool tipUp;
// grimm -->
float lastStatsTime;
float lastCombosTime;
void ShowStats( void );
void ShowCombos( void );
//float s_slomoval;
// <-- grimm
bool objectiveUp; bool objectiveUp;
int lastDamageDef; int lastDamageDef;
@ -675,7 +804,7 @@ private:
void ExtractEmailInfo( const idStr &email, const char *scan, idStr &out ); void ExtractEmailInfo( const idStr &email, const char *scan, idStr &out );
void UpdateObjectiveInfo( void ); void UpdateObjectiveInfo( void );
void UseVehicle( void ); void UseVehicle( bool drive ); // sikk - function modified to support use function
void Event_GetButtons( void ); void Event_GetButtons( void );
void Event_GetMove( void ); void Event_GetMove( void );
@ -695,6 +824,15 @@ private:
void Event_LevelTrigger( void ); void Event_LevelTrigger( void );
void Event_Gibbed( void ); void Event_Gibbed( void );
void Event_GetIdealWeapon( void ); void Event_GetIdealWeapon( void );
void Event_ExecSaveGame( void );
void Event_getHealth( void );
void Event_AddBloodSpray( void );
void Event_UpdateFrost( float freeze );
void Event_SelectBestWeapon( void );
void Event_KeptInPlace( float newval );
void Event_Tip( const char *message );
void Event_SetViewAngles( const idAngles &vAngles );
//void Event_SetSlomoSound( float slomoval );
}; };
ID_INLINE bool idPlayer::IsReady( void ) { ID_INLINE bool idPlayer::IsReady( void ) {

File diff suppressed because it is too large Load diff

View file

@ -83,32 +83,21 @@ public:
void RenderPlayerView( idUserInterface *hud ); void RenderPlayerView( idUserInterface *hud );
void Fade( idVec4 color, int time ); void Fade( idVec4 color, int time );
void GFlash( idVec4 color, int time );
void Flash( idVec4 color, int time ); void Flash( idVec4 color, int time );
void AddBloodSpray( float duration ); void AddBloodSpray( float duration );
// temp for view testing // temp for view testing
void EnableBFGVision( bool b ) { bfgVision = b; }; void EnableBFGVision( bool b ) { bfgVision = b; };
private: private:
void SingleView( idUserInterface *hud, const renderView_t *view ); void SingleView( const renderView_t *view );
void DoubleVision( idUserInterface *hud, const renderView_t *view, int offset ); // sikk - Commented: Functions overridden
void BerserkVision( idUserInterface *hud, const renderView_t *view ); //void DoubleVision( const renderView_t *view, int offset );
void InfluenceVision( idUserInterface *hud, const renderView_t *view ); //void BerserkVision( const renderView_t *view );
void ScreenFade(); //void InfluenceVision( const renderView_t *view );
void ScreenFade( void );
screenBlob_t * GetScreenBlob(); screenBlob_t * GetScreenBlob( void );
screenBlob_t screenBlobs[MAX_SCREEN_BLOBS];
int dvFinishTime; // double vision will be stopped at this time
const idMaterial * dvMaterial; // material to take the double vision screen shot
int kickFinishTime; // view kick will be stopped at this time
idAngles kickAngles;
bool bfgVision; //
const idMaterial * tunnelMaterial; // health tunnel vision const idMaterial * tunnelMaterial; // health tunnel vision
const idMaterial * armorMaterial; // armor damage view effect const idMaterial * armorMaterial; // armor damage view effect
@ -117,18 +106,110 @@ private:
const idMaterial * bloodSprayMaterial; // blood spray const idMaterial * bloodSprayMaterial; // blood spray
const idMaterial * bfgMaterial; // when targeted with BFG const idMaterial * bfgMaterial; // when targeted with BFG
const idMaterial * lagoMaterial; // lagometer drawing const idMaterial * lagoMaterial; // lagometer drawing
float lastDamageTime; // accentuate the tunnel effect for a while
int dvFinishTime; // double vision will be stopped at this time
int kickFinishTime; // view kick will be stopped at this time
idAngles kickAngles;
bool bfgVision; //
idVec4 fadeColor; // fade color idVec4 fadeColor; // fade color
idVec4 fadeToColor; // color to fade to idVec4 fadeToColor; // color to fade to
idVec4 fadeFromColor; // color to fade from idVec4 fadeFromColor; // color to fade from
float fadeRate; // fade rate float fadeRate; // fade rate
int fadeTime; // fade time int fadeTime; // fade time
float lastDamageTime; // accentuate the tunnel effect for a while
screenBlob_t screenBlobs[MAX_SCREEN_BLOBS];
idAngles shakeAng; // from the sound sources idAngles shakeAng; // from the sound sources
idPlayer * player; idPlayer * player;
renderView_t view; renderView_t view;
// sikk---> PostProcess Effects
void DoPostFX( void );
void PostFX_SoftShadows( void );
void PostFX_EdgeAA( void );
void PostFX_HDR( void );
void PostFX_Bloom( void );
void PostFX_MotionBlur( void );
void PostFX_DoF( void );
void PostFX_SSIL( void );
void PostFX_SSAO( void );
void PostFX_SunShafts( void );
void PostFX_LensFlare( void );
void PostFX_ColorGrading( void );
void PostFX_ExplosionFX( void );
void PostFX_IRGoggles( void );
void PostFX_ScreenFrost( void );
void PostFX_CelShading( void );
void PostFX_Filmgrain( void );
void PostFX_Vignetting( void );
void PostFX_AdrenalineVision( void );
void PostFX_DoubleVision( void );
void PostFX_BerserkVision( void );
void PostFX_InfluenceVision( void );
void PostFX_BFGVision( void );
void PostFX_TunnelVision( void );
void PostFX_ScreenBlobs( void );
void PostFX_ArmorPulse( void );
void RenderDepth( bool bCrop );
void RenderNormals( bool bFace );
void ToggleShadows( bool noShadows );
void ResetShadows( void );
bool DoFConditionCheck( void );
bool MBConditionCheck( void );
const idMaterial * blackMaterial; // Black material (for general use)
const idMaterial * whiteMaterial; // White material (for general use)
const idMaterial * currentRenderMaterial; // Current Render material (for general use)
const idMaterial * scratchMaterial; // Scratch material (for general use)
const idMaterial * depthMaterial; // Depth material (for general use)
const idMaterial * normalsMaterial; // View Space Normals material (for general use)
const idMaterial * softShadowsMaterial; // Soft Shadow material
const idMaterial * edgeAAMaterial; // Edge AA material
const idMaterial * hdrLumBaseMaterial; // HDR Luminance Base material
const idMaterial * hdrLumAverageMaterial; // HDR Luminance Average material
const idMaterial * hdrLumAdaptedMaterial; // HDR Luminance Adapted material
const idMaterial * hdrBrightPass1Material; // HDR Bright Pass Filter material (Reinhard RGB)
const idMaterial * hdrBrightPass2Material; // HDR Bright Pass Filter material (Reinhard Yxy)
const idMaterial * hdrBrightPass3Material; // HDR Bright Pass Filter material (Exp)
const idMaterial * hdrBrightPass4Material; // HDR Bright Pass Filter material (Filmic simple)
const idMaterial * hdrBrightPass5Material; // HDR Bright Pass Filter material (Filmic complex)
const idMaterial * hdrBloomMaterial; // HDR Bloom material
const idMaterial * hdrFlareMaterial; // HDR Lens Flare material
const idMaterial * hdrGlareMaterial; // HDR Glare material
const idMaterial * hdrFinalMaterial; // HDR Final Tone Mapping material
const idMaterial * bloomMaterial; // Bloom material
const idMaterial * ssilMaterial; // SSIL material
const idMaterial * ssaoMaterial; // SSAO material
const idMaterial * sunShaftsMaterial; // Sun Shafts material
const idMaterial * lensFlareMaterial; // Lens Flare material
const idMaterial * dofMaterial; // DoF material
const idMaterial * motionBlurMaterial; // Motion Blur material
const idMaterial * colorGradingMaterial; // Color Grading material
const idMaterial * screenFrostMaterial; // Screen Frost material
const idMaterial * celShadingMaterial; // Cel Shading material
const idMaterial * filmgrainMaterial; // Filmgrain material
const idMaterial * vignettingMaterial; // Vignetting material
const idMaterial * tunnel2Material; // health tunnel vision for Health Management System (Health Regen)
const idMaterial * adrenalineMaterial; // Adrenaline Vision material
const idMaterial * explosionFXMaterial; // Explosion FX material
renderView_t hackedView;
idAngles prevViewAngles; // Holds previous frame's player view angles
int prevTime; // Holds previous frame's time
bool bDepthRendered; // Holds whether the depth map has been rendered for the current frame
pvsHandle_t playerPVS; // Holds player's current pvs (for soft shadows)
bool bSoftShadows; // a soft shadows toggle used so ResetShadows() is only run once when r_useSoftShadows = 0
// <---sikk
// sikk---> PostProccess Scaling Fix
int screenHeight;
int screenWidth;
idVec2 shiftScale;
// <---sikk
}; };
#endif /* !__GAME_PLAYERVIEW_H__ */ #endif /* !__GAME_PLAYERVIEW_H__ */

View file

@ -138,6 +138,8 @@ void idProjectile::Save( idSaveGame *savefile ) const {
savefile->WriteStaticObject( physicsObj ); savefile->WriteStaticObject( physicsObj );
savefile->WriteStaticObject( thruster ); savefile->WriteStaticObject( thruster );
savefile->WriteString( damageDefName );
} }
/* /*
@ -180,12 +182,15 @@ void idProjectile::Restore( idRestoreGame *savefile ) {
savefile->ReadStaticObject( thruster ); savefile->ReadStaticObject( thruster );
thruster.SetPhysics( &physicsObj ); thruster.SetPhysics( &physicsObj );
savefile->ReadString( damageDefName );
if ( smokeFly != NULL ) { if ( smokeFly != NULL ) {
idVec3 dir; idVec3 dir;
dir = physicsObj.GetLinearVelocity(); dir = physicsObj.GetLinearVelocity();
dir.NormalizeFast(); dir.NormalizeFast();
gameLocal.smokeParticles->EmitSmoke( smokeFly, gameLocal.time, gameLocal.random.RandomFloat(), GetPhysics()->GetOrigin(), GetPhysics()->GetAxis() ); gameLocal.smokeParticles->EmitSmoke( smokeFly, gameLocal.time, gameLocal.random.RandomFloat(), GetPhysics()->GetOrigin(), GetPhysics()->GetAxis() );
} }
} }
/* /*
@ -248,6 +253,8 @@ void idProjectile::Create( idEntity *owner, const idVec3 &start, const idVec3 &d
damagePower = 1.0f; damagePower = 1.0f;
renderEntity.suppressSurfaceInViewID = -8; // sikk - Depth Render
UpdateVisuals(); UpdateVisuals();
state = CREATED; state = CREATED;
@ -327,10 +334,13 @@ void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3
mass = spawnArgs.GetFloat( "mass" ); mass = spawnArgs.GetFloat( "mass" );
gravity = spawnArgs.GetFloat( "gravity" ); gravity = spawnArgs.GetFloat( "gravity" );
fuse = spawnArgs.GetFloat( "fuse" ); fuse = spawnArgs.GetFloat( "fuse" );
damageDefName = spawnArgs.GetString( "def_damage" );
projectileFlags.detonate_on_world = spawnArgs.GetBool( "detonate_on_world" ); projectileFlags.detonate_on_world = spawnArgs.GetBool( "detonate_on_world" );
projectileFlags.detonate_on_actor = spawnArgs.GetBool( "detonate_on_actor" ); projectileFlags.detonate_on_actor = spawnArgs.GetBool( "detonate_on_actor" );
projectileFlags.randomShaderSpin = spawnArgs.GetBool( "random_shader_spin" ); projectileFlags.randomShaderSpin = spawnArgs.GetBool( "random_shader_spin" );
projectileFlags.sticky = spawnArgs.GetBool( "sticky", "0" );
projectileFlags.continuous_damage = spawnArgs.GetBool( "continuous_damage", "0" );
if ( mass <= 0 ) { if ( mass <= 0 ) {
gameLocal.Error( "Invalid mass on '%s'\n", GetEntityDefName() ); gameLocal.Error( "Invalid mass on '%s'\n", GetEntityDefName() );
@ -368,7 +378,7 @@ void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3
} }
// don't do tracers on client, we don't know origin and direction // don't do tracers on client, we don't know origin and direction
if ( spawnArgs.GetBool( "tracers" ) && gameLocal.random.RandomFloat() > 0.5f ) { if ( spawnArgs.GetBool( "tracers" ) && ( ( gameLocal.random.RandomFloat() * 0.99999f ) < g_tracerFrequency.GetFloat() ) ) { // sikk - Tracer Frequency
SetModel( spawnArgs.GetString( "model_tracer" ) ); SetModel( spawnArgs.GetString( "model_tracer" ) );
projectileFlags.isTracer = true; projectileFlags.isTracer = true;
} }
@ -449,6 +459,12 @@ void idProjectile::Think( void ) {
} }
} }
// grimm --> add continuous damage
if ( state != EXPLODED && projectileFlags.continuous_damage ) {
gameLocal.RadiusDamage( physicsObj.GetOrigin(), this, owner.GetEntity(), owner.GetEntity(), this, damageDefName, 1 );
}
// <-- grimm
// run physics // run physics
RunPhysics(); RunPhysics();
@ -493,7 +509,9 @@ idProjectile::Collide
bool idProjectile::Collide( const trace_t &collision, const idVec3 &velocity ) { bool idProjectile::Collide( const trace_t &collision, const idVec3 &velocity ) {
idEntity *ent; idEntity *ent;
idEntity *ignore; idEntity *ignore;
const char *damageDefName;
// grimm --> moved to entity scope.
// const char *damageDefName;
idVec3 dir; idVec3 dir;
float push; float push;
float damageScale; float damageScale;
@ -568,8 +586,6 @@ bool idProjectile::Collide( const trace_t &collision, const idVec3 &velocity ) {
// unlink the clip model because we no longer need it // unlink the clip model because we no longer need it
GetPhysics()->UnlinkClip(); GetPhysics()->UnlinkClip();
damageDefName = spawnArgs.GetString( "def_damage" );
ignore = NULL; ignore = NULL;
// if the hit entity takes damage // if the hit entity takes damage
@ -587,6 +603,14 @@ bool idProjectile::Collide( const trace_t &collision, const idVec3 &velocity ) {
idPlayer *player = static_cast<idPlayer *>( owner.GetEntity() ); idPlayer *player = static_cast<idPlayer *>( owner.GetEntity() );
player->AddProjectileHits( 1 ); player->AddProjectileHits( 1 );
damageScale *= player->PowerUpModifier( PROJECTILE_DAMAGE ); damageScale *= player->PowerUpModifier( PROJECTILE_DAMAGE );
// sikk---> Blood Spray Screen Effect
if ( g_showBloodSpray.GetBool() ) {
idVec3 vLength = player->GetEyePosition() - ent->GetPhysics()->GetOrigin();
if ( vLength.Length() <= g_bloodSprayDistance.GetFloat() && ( gameLocal.random.RandomFloat() * 0.99999f ) < g_bloodSprayFrequency.GetFloat() )
player->playerView.AddBloodSpray( g_bloodSprayTime.GetFloat() );
}
// <---sikk
} }
} }
@ -833,6 +857,20 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
} else { } else {
fxname = spawnArgs.GetString( "model_smoke" ); fxname = spawnArgs.GetString( "model_smoke" );
} }
/* switch ( surfaceType ) {
case SURFTYPE_NONE: fxname = spawnArgs.GetString( "model_smokespark" ); break;
case SURFTYPE_METAL: fxname = spawnArgs.GetString( "model_impact_metal" ); break;
case SURFTYPE_STONE: fxname = spawnArgs.GetString( "model_impact_stone" ); break;
case SURFTYPE_FLESH: fxname = spawnArgs.GetString( "model_impact_flesh" ); break;
case SURFTYPE_WOOD: fxname = spawnArgs.GetString( "model_impact_wood" ); break;
case SURFTYPE_CARDBOARD: fxname = spawnArgs.GetString( "model_impact_cardboard" ); break;
case SURFTYPE_LIQUID: fxname = spawnArgs.GetString( "model_impact_liquid" ); break;
case SURFTYPE_GLASS: fxname = spawnArgs.GetString( "model_impact_glass" ); break;
case SURFTYPE_PLASTIC: fxname = spawnArgs.GetString( "model_impact_plastic" ); break;
case SURFTYPE_RICOCHET: fxname = spawnArgs.GetString( "model_ricochet" ); break;
default: fxname = spawnArgs.GetString( "model_smoke" ); break;
}*/
} }
if ( fxname && *fxname ) { if ( fxname && *fxname ) {
@ -843,9 +881,23 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
renderEntity.shaderParms[SHADERPARM_ALPHA] = 1.0f; renderEntity.shaderParms[SHADERPARM_ALPHA] = 1.0f;
renderEntity.shaderParms[SHADERPARM_TIMEOFFSET] = -MS2SEC( gameLocal.time ); renderEntity.shaderParms[SHADERPARM_TIMEOFFSET] = -MS2SEC( gameLocal.time );
renderEntity.shaderParms[SHADERPARM_DIVERSITY] = gameLocal.random.CRandomFloat(); renderEntity.shaderParms[SHADERPARM_DIVERSITY] = gameLocal.random.CRandomFloat();
renderEntity.suppressSurfaceInViewID = -8; // sikk - Depth Render
Show(); Show();
// grimm --> remove models/fx depending on the g_breakables_lifetime thingy.
//
if ( projectileFlags.sticky ) {
//this is a sticky projectile, leave it as long as g_bulletstaytime is set, if it's set lower than 2 then keep it at 2.
int dstay = g_bulletstaytime.GetInteger();
if ( dstay < 2 ) { dstay = 2; } //stay a minimum of 2 seconds
removeTime = ( removeTime > SEC2MS( dstay ) ) ? removeTime : SEC2MS( dstay );
} else {
//regular code
removeTime = ( removeTime > 3000 ) ? removeTime : 3000; removeTime = ( removeTime > 3000 ) ? removeTime : 3000;
} }
// <-- grimm
}
// explosion light // explosion light
light_shader = spawnArgs.GetString( "mtr_explode_light_shader" ); light_shader = spawnArgs.GetString( "mtr_explode_light_shader" );
@ -892,10 +944,14 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
if ( removeTime < delay * 1000 ) { if ( removeTime < delay * 1000 ) {
removeTime = ( delay + 0.10 ) * 1000; removeTime = ( delay + 0.10 ) * 1000;
} }
PostEventSec( &EV_RadiusDamage, delay, ignore ); // sikk---> Entities hit directly by a projectile will no longer be ignored by splash damage
// PostEventSec( &EV_RadiusDamage, delay, ignore );
PostEventSec( &EV_RadiusDamage, delay, NULL );
} else { } else {
Event_RadiusDamage( ignore ); // Event_RadiusDamage( ignore );
Event_RadiusDamage( NULL );
} }
// <---sikk
} }
// spawn debris entities // spawn debris entities
@ -2069,6 +2125,9 @@ idDebris::Spawn
================ ================
*/ */
void idDebris::Spawn( void ) { void idDebris::Spawn( void ) {
mtr_collide = spawnArgs.GetString( "mtr_collide" );
nextCollideFxTime = 0;
owner = NULL; owner = NULL;
smokeFly = NULL; smokeFly = NULL;
smokeFlyTime = 0; smokeFlyTime = 0;
@ -2124,6 +2183,11 @@ void idDebris::Save( idSaveGame *savefile ) const {
savefile->WriteParticle( smokeFly ); savefile->WriteParticle( smokeFly );
savefile->WriteInt( smokeFlyTime ); savefile->WriteInt( smokeFlyTime );
savefile->WriteSoundShader( sndBounce ); savefile->WriteSoundShader( sndBounce );
savefile->WriteString( mtr_collide );
savefile->WriteInt( last_spraytime );
savefile->WriteString( fxCollide );
savefile->WriteInt( nextCollideFxTime );
} }
/* /*
@ -2140,6 +2204,11 @@ void idDebris::Restore( idRestoreGame *savefile ) {
savefile->ReadParticle( smokeFly ); savefile->ReadParticle( smokeFly );
savefile->ReadInt( smokeFlyTime ); savefile->ReadInt( smokeFlyTime );
savefile->ReadSoundShader( sndBounce ); savefile->ReadSoundShader( sndBounce );
savefile->ReadString( mtr_collide );
savefile->ReadInt( last_spraytime );
savefile->ReadString( fxCollide );
savefile->ReadInt( nextCollideFxTime );
} }
/* /*
@ -2308,6 +2377,24 @@ bool idDebris::Collide( const trace_t &collision, const idVec3 &velocity ) {
StartSoundShader( sndBounce, SND_CHANNEL_BODY, 0, false, NULL ); StartSoundShader( sndBounce, SND_CHANNEL_BODY, 0, false, NULL );
} }
sndBounce = NULL; sndBounce = NULL;
// grimm --> Over the top blood & moveable effects.
if ( fxCollide.Length() && gameLocal.time > nextCollideFxTime ) {
idEntityFx::StartFx( fxCollide, &collision.c.point, NULL, this, false );
nextCollideFxTime = gameLocal.time + 1500;
}
if ( mtr_collide.Length() && last_spraytime < gameLocal.GetTime() && !IsAtRest() ) {
float ranScale;
ranScale = 128.0f * (0.35 + gameLocal.random.CRandomFloat());
last_spraytime = gameLocal.GetTime() + 1500;
//gameLocal.ProjectDecal( GetPhysics()->GetOrigin(), GetPhysics()->GetGravity(), 128.0f, true, ranScale, mtr_collide.c_str() );
gameLocal.ProjectDecal( GetPhysics()->GetOrigin(), -collision.c.normal, 128.0f, true, 96.0f, mtr_collide.c_str() );
}
// <-- grimm
return false; return false;
} }

View file

@ -91,6 +91,10 @@ protected:
bool randomShaderSpin : 1; bool randomShaderSpin : 1;
bool isTracer : 1; bool isTracer : 1;
bool noSplashDamage : 1; bool noSplashDamage : 1;
//grimm projectile doesn't explode but does damage and remains until decalStay time.
bool sticky : 1;
bool continuous_damage : 1;
} projectileFlags; } projectileFlags;
float thrust; float thrust;
@ -110,6 +114,10 @@ protected:
const idDeclParticle * smokeFly; const idDeclParticle * smokeFly;
int smokeFlyTime; int smokeFlyTime;
//grimm
idStr damageDefName;
//grimm
typedef enum { typedef enum {
// must update these in script/doom_defs.script if changed // must update these in script/doom_defs.script if changed
SPAWNED = 0, SPAWNED = 0,
@ -257,7 +265,6 @@ public :
void Fizzle( void ); void Fizzle( void );
virtual bool Collide( const trace_t &collision, const idVec3 &velocity ); virtual bool Collide( const trace_t &collision, const idVec3 &velocity );
private: private:
idEntityPtr<idEntity> owner; idEntityPtr<idEntity> owner;
idPhysics_RigidBody physicsObj; idPhysics_RigidBody physicsObj;
@ -265,9 +272,15 @@ private:
int smokeFlyTime; int smokeFlyTime;
const idSoundShader * sndBounce; const idSoundShader * sndBounce;
void Event_Explode( void ); void Event_Explode( void );
void Event_Fizzle( void ); void Event_Fizzle( void );
// grimm -->
idStr mtr_collide; // material to spray on walls when object collides with something.
int last_spraytime; // last time that a spray was made.
idStr fxCollide; // fx system to start when collides with something
int nextCollideFxTime; // next time it is ok to spawn collision fx
// <-- grimm
}; };
#endif /* !__GAME_PROJECTILE_H__ */ #endif /* !__GAME_PROJECTILE_H__ */

View file

@ -1421,3 +1421,32 @@ void idPVS::ReadPVS( const pvsHandle_t handle, const idBitMsg &msg ) {
} }
#endif #endif
// sikk---> Portal Sky Box
/*
================
idPVS::CheckAreasForPortalSky
================
*/
bool idPVS::CheckAreasForPortalSky( const pvsHandle_t handle, const idVec3 &origin ) {
int sourceArea;
if ( handle.i < 0 || handle.i >= MAX_CURRENT_PVS || handle.h != currentPVS[ handle.i ].handle.h )
return false;
sourceArea = gameRenderWorld->PointInArea( origin );
if ( sourceArea == -1 )
return false;
for ( int i = 0; i < numAreas; i++ ) {
if ( !( currentPVS[ handle.i ].pvs[ i >> 3 ] & ( 1 << ( i & 7 ) ) ) )
continue;
if ( gameRenderWorld->CheckAreaForPortalSky( i ) )
return true;
}
return false;
}
// <---sikk

View file

@ -97,6 +97,8 @@ public:
void ReadPVS( const pvsHandle_t handle, const idBitMsg &msg ); void ReadPVS( const pvsHandle_t handle, const idBitMsg &msg );
#endif #endif
bool CheckAreasForPortalSky( const pvsHandle_t handle, const idVec3 &origin ); // sikk - Portal Sky Box
private: private:
int numAreas; int numAreas;
int numPortals; int numPortals;

View file

@ -81,6 +81,8 @@ void idSmokeParticles::Init( void ) {
renderEntity.hModel = renderModelManager->AllocModel(); renderEntity.hModel = renderModelManager->AllocModel();
renderEntity.hModel->InitEmpty( smokeParticle_SnapshotName ); renderEntity.hModel->InitEmpty( smokeParticle_SnapshotName );
renderEntity.suppressSurfaceInViewID = -8; // sikk - Depth Render
// we certainly don't want particle shadows // we certainly don't want particle shadows
renderEntity.noShadow = 1; renderEntity.noShadow = 1;

View file

@ -216,6 +216,30 @@ void idTarget_EndLevel::Event_Activate( idEntity *activator ) {
gameLocal.sessionCommand += nextMap; gameLocal.sessionCommand += nextMap;
} }
/*
===============================================================================
idTarget_SaveGame
GRIMM: AUTOCHECKPOINT SYSTEM
===============================================================================
*/
CLASS_DECLARATION( idTarget, idTarget_SaveGame )
EVENT( EV_Activate, idTarget_SaveGame::Event_Activate )
END_CLASS
/*
================
idTarget_SaveGame::Event_Activate
================
*/
void idTarget_SaveGame::Event_Activate( idEntity *activator ) {
if ( g_useCheckpointing.GetBool()) {
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "saveGame checkpoint" );
}
}
/* /*
=============================================================================== ===============================================================================

View file

@ -81,6 +81,23 @@ private:
}; };
/*
===============================================================================
idTarget_SaveGame
===============================================================================
*/
class idTarget_SaveGame : public idTarget {
public:
CLASS_PROTOTYPE( idTarget_SaveGame );
private:
void Event_Activate( idEntity *activator );
};
/* /*
=============================================================================== ===============================================================================

View file

@ -993,6 +993,7 @@ void idTrigger_Hurt::Spawn( void ) {
idTrigger_Hurt::Event_Touch idTrigger_Hurt::Event_Touch
================ ================
*/ */
/* Original code:
void idTrigger_Hurt::Event_Touch( idEntity *other, trace_t *trace ) { void idTrigger_Hurt::Event_Touch( idEntity *other, trace_t *trace ) {
const char *damage; const char *damage;
@ -1006,6 +1007,40 @@ void idTrigger_Hurt::Event_Touch( idEntity *other, trace_t *trace ) {
nextTime = gameLocal.time + SEC2MS( delay ); nextTime = gameLocal.time + SEC2MS( delay );
} }
} }
*/
/*
================
GRIMM: idTrigger_Hurt::Event_Touch
================
*/
void idTrigger_Hurt::Event_Touch( idEntity *other, trace_t *trace ) {
const char *damage;
const char *playerdamage;
const char *monsterdamage;
if ( on && other && gameLocal.time >= nextTime ) {
damage = spawnArgs.GetString( "def_damage", "damage_vintrap" );
playerdamage = spawnArgs.GetString( "def_player_damage" );
monsterdamage = spawnArgs.GetString( "def_monster_damage" );
if ( other->IsType( idPlayer::Type ) && playerdamage){
damage = playerdamage;
}
if ( other->IsType( idAI::Type ) && monsterdamage ){
damage = monsterdamage;
}
other->Damage( NULL, NULL, vec3_origin, damage, 1.0f, INVALID_JOINT );
ActivateTargets( other );
CallScript();
nextTime = gameLocal.time + SEC2MS( delay );
}
}
/* /*
================ ================

View file

@ -66,6 +66,9 @@ const idEventDef EV_Weapon_WeaponRising( "weaponRising" );
const idEventDef EV_Weapon_WeaponLowering( "weaponLowering" ); const idEventDef EV_Weapon_WeaponLowering( "weaponLowering" );
const idEventDef EV_Weapon_Flashlight( "flashlight", "d" ); const idEventDef EV_Weapon_Flashlight( "flashlight", "d" );
const idEventDef EV_Weapon_LaunchProjectiles( "launchProjectiles", "dffff" ); const idEventDef EV_Weapon_LaunchProjectiles( "launchProjectiles", "dffff" );
//GRIMM
const idEventDef EV_Weapon_LaunchGrimmProjectiles( "launchGrimmProjectiles", "sdffff", 'e' );
//GRIMM
const idEventDef EV_Weapon_CreateProjectile( "createProjectile", NULL, 'e' ); const idEventDef EV_Weapon_CreateProjectile( "createProjectile", NULL, 'e' );
const idEventDef EV_Weapon_EjectBrass( "ejectBrass" ); const idEventDef EV_Weapon_EjectBrass( "ejectBrass" );
const idEventDef EV_Weapon_Melee( "melee", NULL, 'd' ); const idEventDef EV_Weapon_Melee( "melee", NULL, 'd' );
@ -107,6 +110,9 @@ CLASS_DECLARATION( idAnimatedEntity, idWeapon )
EVENT( EV_Light_SetLightParm, idWeapon::Event_SetLightParm ) EVENT( EV_Light_SetLightParm, idWeapon::Event_SetLightParm )
EVENT( EV_Light_SetLightParms, idWeapon::Event_SetLightParms ) EVENT( EV_Light_SetLightParms, idWeapon::Event_SetLightParms )
EVENT( EV_Weapon_LaunchProjectiles, idWeapon::Event_LaunchProjectiles ) EVENT( EV_Weapon_LaunchProjectiles, idWeapon::Event_LaunchProjectiles )
//GRIMM
EVENT( EV_Weapon_LaunchGrimmProjectiles, idWeapon::Event_LaunchGrimmProjectiles )
//GRIMM
EVENT( EV_Weapon_CreateProjectile, idWeapon::Event_CreateProjectile ) EVENT( EV_Weapon_CreateProjectile, idWeapon::Event_CreateProjectile )
EVENT( EV_Weapon_EjectBrass, idWeapon::Event_EjectBrass ) EVENT( EV_Weapon_EjectBrass, idWeapon::Event_EjectBrass )
EVENT( EV_Weapon_Melee, idWeapon::Event_Melee ) EVENT( EV_Weapon_Melee, idWeapon::Event_Melee )
@ -376,6 +382,7 @@ void idWeapon::Save( idSaveGame *savefile ) const {
savefile->WriteBool( allowDrop ); savefile->WriteBool( allowDrop );
savefile->WriteObject( projectileEnt ); savefile->WriteObject( projectileEnt );
savefile->WriteFloat( wm_hide_distance ); // sikk - Weapon Management: Awareness
} }
/* /*
@ -541,6 +548,8 @@ void idWeapon::Restore( idRestoreGame *savefile ) {
savefile->ReadBool( allowDrop ); savefile->ReadBool( allowDrop );
savefile->ReadObject( reinterpret_cast<idClass *&>( projectileEnt ) ); savefile->ReadObject( reinterpret_cast<idClass *&>( projectileEnt ) );
savefile->ReadFloat( wm_hide_distance ); // sikk - Weapon Management: Awareness
} }
/*********************************************************************** /***********************************************************************
@ -721,6 +730,8 @@ void idWeapon::Clear( void ) {
projectileEnt = NULL; projectileEnt = NULL;
isFiring = false; isFiring = false;
wm_hide_distance = -15; // sikk - Weapon Management: Awareness
} }
/* /*
@ -796,7 +807,17 @@ void idWeapon::GetWeaponDef( const char *objectname, int ammoinclip ) {
ammoType = GetAmmoNumForName( weaponDef->dict.GetString( "ammoType" ) ); ammoType = GetAmmoNumForName( weaponDef->dict.GetString( "ammoType" ) );
ammoRequired = weaponDef->dict.GetInt( "ammoRequired" ); ammoRequired = weaponDef->dict.GetInt( "ammoRequired" );
// sikk---> Ammo Management: Ammo Clip Size Type
if ( g_ammoClipSizeType.GetInteger() == 1 ) {
clipSize = weaponDef->dict.GetInt( "clipSize_doom" );
} else if ( g_ammoClipSizeType.GetInteger() == 2 ) {
clipSize = weaponDef->dict.GetInt( "clipSize_custom" );
} else {
clipSize = weaponDef->dict.GetInt( "clipSize" ); clipSize = weaponDef->dict.GetInt( "clipSize" );
}
// <---sikk
lowAmmo = weaponDef->dict.GetInt( "lowAmmo" ); lowAmmo = weaponDef->dict.GetInt( "lowAmmo" );
icon = weaponDef->dict.GetString( "icon" ); icon = weaponDef->dict.GetString( "icon" );
@ -811,6 +832,8 @@ void idWeapon::GetWeaponDef( const char *objectname, int ammoinclip ) {
hideTime = SEC2MS( weaponDef->dict.GetFloat( "hide_time", "0.3" ) ); hideTime = SEC2MS( weaponDef->dict.GetFloat( "hide_time", "0.3" ) );
hideDistance = weaponDef->dict.GetFloat( "hide_distance", "-15" ); hideDistance = weaponDef->dict.GetFloat( "hide_distance", "-15" );
wm_hide_distance = weaponDef->dict.GetFloat( "wm_hide_distance", "-15" ); // sikk - Weapon Management: Awareness
// muzzle smoke // muzzle smoke
smokeName = weaponDef->dict.GetString( "smoke_muzzle" ); smokeName = weaponDef->dict.GetString( "smoke_muzzle" );
if ( *smokeName != '\0' ) { if ( *smokeName != '\0' ) {
@ -1082,9 +1105,17 @@ void idWeapon::UpdateGUI( void ) {
renderEntity.gui[ 0 ]->SetStateString( "player_ammo", "" ); renderEntity.gui[ 0 ]->SetStateString( "player_ammo", "" );
} else { } else {
// show remaining ammo // show remaining ammo
renderEntity.gui[ 0 ]->SetStateString( "player_totalammo", va( "%i", ammoamount - inclip) ); // sikk---> Ammo Management: Ammo Clip Size Type
if ( g_ammoClipSizeType.GetInteger() == 1 ) {
renderEntity.gui[ 0 ]->SetStateString( "player_totalammo", ClipSize() ? va( "%i", ammoamount - inclip ) : va( "%i", ammoamount ) );
renderEntity.gui[ 0 ]->SetStateString( "player_ammo", ClipSize() ? va( "%i", inclip ) : "" );
renderEntity.gui[ 0 ]->SetStateString( "player_clips", ClipSize() ? va("%i", ammoamount / ClipSize()) : "" );
} else {
renderEntity.gui[ 0 ]->SetStateString( "player_totalammo", va( "%i", ammoamount - inclip ) );
renderEntity.gui[ 0 ]->SetStateString( "player_ammo", ClipSize() ? va( "%i", inclip ) : "--" ); renderEntity.gui[ 0 ]->SetStateString( "player_ammo", ClipSize() ? va( "%i", inclip ) : "--" );
renderEntity.gui[ 0 ]->SetStateString( "player_clips", ClipSize() ? va("%i", ammoamount / ClipSize()) : "--" ); renderEntity.gui[ 0 ]->SetStateString( "player_clips", ClipSize() ? va("%i", ammoamount / ClipSize()) : "--" );
}
// <---sikk
renderEntity.gui[ 0 ]->SetStateString( "player_allammo", va( "%i/%i", inclip, ammoamount - inclip ) ); renderEntity.gui[ 0 ]->SetStateString( "player_allammo", va( "%i/%i", inclip, ammoamount - inclip ) );
} }
renderEntity.gui[ 0 ]->SetStateBool( "player_ammo_empty", ( ammoamount == 0 ) ); renderEntity.gui[ 0 ]->SetStateBool( "player_ammo_empty", ( ammoamount == 0 ) );
@ -1277,6 +1308,14 @@ idWeapon::PutAway
================ ================
*/ */
void idWeapon::PutAway( void ) { void idWeapon::PutAway( void ) {
// grimm --> update hud upon lower/raise
idUserInterface * _hud = owner->hud;
if ( _hud ) {
_hud->SetStateInt( "player_energyammo", 0 );
_hud->SetStateInt( "player_spikeammo", 0 );
_hud->SetStateInt( "player_cannonammo", 0 );
}
hasBloodSplat = false; hasBloodSplat = false;
if ( isLinked ) { if ( isLinked ) {
WEAPON_LOWERWEAPON = true; WEAPON_LOWERWEAPON = true;
@ -1303,7 +1342,7 @@ idWeapon::LowerWeapon
void idWeapon::LowerWeapon( void ) { void idWeapon::LowerWeapon( void ) {
if ( !hide ) { if ( !hide ) {
hideStart = 0.0f; hideStart = 0.0f;
hideEnd = hideDistance; hideEnd = owner->bWAUseHideDist ? wm_hide_distance : hideDistance; // sikk - Weapon Management: Awareness
if ( gameLocal.time - hideStartTime < hideTime ) { if ( gameLocal.time - hideStartTime < hideTime ) {
hideStartTime = gameLocal.time - ( hideTime - ( gameLocal.time - hideStartTime ) ); hideStartTime = gameLocal.time - ( hideTime - ( gameLocal.time - hideStartTime ) );
} else { } else {
@ -1322,7 +1361,7 @@ void idWeapon::RaiseWeapon( void ) {
Show(); Show();
if ( hide ) { if ( hide ) {
hideStart = hideDistance; hideStart = owner->bWAUseHideDist ? wm_hide_distance : hideDistance; // sikk - Weapon Management: Awareness
hideEnd = 0.0f; hideEnd = 0.0f;
if ( gameLocal.time - hideStartTime < hideTime ) { if ( gameLocal.time - hideStartTime < hideTime ) {
hideStartTime = gameLocal.time - ( hideTime - ( gameLocal.time - hideStartTime ) ); hideStartTime = gameLocal.time - ( hideTime - ( gameLocal.time - hideStartTime ) );
@ -2217,6 +2256,12 @@ idWeapon::AmmoInClip
================ ================
*/ */
int idWeapon::AmmoInClip( void ) const { int idWeapon::AmmoInClip( void ) const {
// sikk---> Ammo Management: Ammo Clip Size Type
if ( !clipSize ) {
return AmmoAvailable();
}
// <---sikk
return ammoClip; return ammoClip;
} }
@ -2412,6 +2457,34 @@ void idWeapon::Event_WeaponReady( void ) {
StartSoundShader( sndHum, SND_CHANNEL_BODY, 0, false, NULL ); StartSoundShader( sndHum, SND_CHANNEL_BODY, 0, false, NULL );
} }
// grimm --> update hud upon lower/raise
idUserInterface * _hud = owner->hud;
const char *weaptype =spawnArgs.GetString( "weapon_type", "melee" );
if ( _hud && idStr::Cmp( weaptype, "melee" ) == 0 ) {
_hud->SetStateInt( "player_energyammo", 0 );
_hud->SetStateInt( "player_spikeammo", 0 );
_hud->SetStateInt( "player_cannonammo", 0 );
}
if ( _hud && idStr::Cmp( weaptype, "energy" ) == 0 ) {
_hud->SetStateInt( "player_energyammo", 1 );
_hud->SetStateInt( "player_spikeammo", 0 );
_hud->SetStateInt( "player_cannonammo", 0 );
}
if ( _hud && idStr::Cmp( weaptype, "spike" ) == 0 ) {
_hud->SetStateInt( "player_energyammo", 0 );
_hud->SetStateInt( "player_spikeammo", 1 );
_hud->SetStateInt( "player_cannonammo", 0 );
}
if ( _hud && idStr::Cmp( weaptype, "cannon" ) == 0 ) {
_hud->SetStateInt( "player_energyammo", 0 );
_hud->SetStateInt( "player_spikeammo", 0 );
_hud->SetStateInt( "player_cannonammo", 1 );
}
// <-- grimm
} }
/* /*
@ -2877,7 +2950,7 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
} }
// calculate the muzzle position // calculate the muzzle position
if ( barrelJointView != INVALID_JOINT && projectileDict.GetBool( "launchFromBarrel" ) ) { if ( barrelJointView != INVALID_JOINT && ( projectileDict.GetBool( "launchFromBarrel" ) || g_weaponProjectileOrigin.GetBool() ) ) { // sikk - Weapon Management: Projectile Origin
// there is an explicit joint for the muzzle // there is an explicit joint for the muzzle
GetGlobalJointTransform( true, barrelJointView, muzzleOrigin, muzzleAxis ); GetGlobalJointTransform( true, barrelJointView, muzzleOrigin, muzzleAxis );
} else { } else {
@ -2895,8 +2968,20 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
kick_endtime = gameLocal.realClientTime + muzzle_kick_maxtime; kick_endtime = gameLocal.realClientTime + muzzle_kick_maxtime;
} }
if ( gameLocal.isClient ) { // sikk---> Weapon Management: Handling/Awareness
if ( ( g_weaponHandlingType.GetInteger() == 1 || g_weaponHandlingType.GetInteger() == 3 ) && owner->GetCurrentWeapon() != 2 ) {
spread = ( spread + 2.0f ) * owner->fSpreadModifier;
owner->fSpreadModifier += 0.25f;
if ( owner->fSpreadModifier > 2.0f )
owner->fSpreadModifier = 2.0f;
}
if ( g_weaponAwareness.GetBool() && owner->bIsZoomed )
spread *= 0.5f;
// <---sikk
if ( gameLocal.isClient ) {
// predict instant hit projectiles // predict instant hit projectiles
if ( projectileDict.GetBool( "net_instanthit" ) ) { if ( projectileDict.GetBool( "net_instanthit" ) ) {
float spreadRad = DEG2RAD( spread ); float spreadRad = DEG2RAD( spread );
@ -2912,9 +2997,7 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
} }
} }
} }
} else { } else {
ownerBounds = owner->GetPhysics()->GetAbsBounds(); ownerBounds = owner->GetPhysics()->GetAbsBounds();
owner->AddProjectilesFired( num_projectiles ); owner->AddProjectilesFired( num_projectiles );
@ -2926,6 +3009,12 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
dir = playerViewAxis[ 0 ] + playerViewAxis[ 2 ] * ( ang * idMath::Sin( spin ) ) - playerViewAxis[ 1 ] * ( ang * idMath::Cos( spin ) ); dir = playerViewAxis[ 0 ] + playerViewAxis[ 2 ] * ( ang * idMath::Sin( spin ) ) - playerViewAxis[ 1 ] * ( ang * idMath::Cos( spin ) );
dir.Normalize(); dir.Normalize();
// sikk---> Weapon Management: Handling
if ( g_weaponHandlingType.GetInteger() > 1 && !( g_weaponAwareness.GetBool() && owner->bIsZoomed ) ) {
owner->SetViewAngles( owner->viewAngles + idAngles( -0.5f * owner->fSpreadModifier, 0.0f, 0.0f ) );
}
// <---sikk
if ( projectileEnt ) { if ( projectileEnt ) {
ent = projectileEnt; ent = projectileEnt;
ent->Show(); ent->Show();
@ -2950,6 +3039,212 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
projBounds = proj->GetPhysics()->GetBounds().Rotate( proj->GetPhysics()->GetAxis() ); projBounds = proj->GetPhysics()->GetBounds().Rotate( proj->GetPhysics()->GetAxis() );
// make sure the projectile starts inside the bounding box of the owner
if ( i == 0 ) {
muzzle_pos = muzzleOrigin + playerViewAxis[ 0 ] * 2.0f;
if ( ( ownerBounds - projBounds).RayIntersection( muzzle_pos, playerViewAxis[0], distance ) ) {
start = muzzle_pos + distance * playerViewAxis[0];
} else {
start = ownerBounds.GetCenter();
}
gameLocal.clip.Translation( tr, start, muzzle_pos, proj->GetPhysics()->GetClipModel(), proj->GetPhysics()->GetClipModel()->GetAxis(), MASK_SHOT_RENDERMODEL, owner );
muzzle_pos = tr.endpos;
}
proj->Launch( muzzle_pos, dir, pushVelocity, fuseOffset, launchPower, dmgPower );
}
// toss the brass
PostEventMS( &EV_Weapon_EjectBrass, brassDelay );
}
// add the light for the muzzleflash
if ( !lightOn ) {
MuzzleFlashLight();
}
owner->WeaponFireFeedback( &weaponDef->dict );
// reset muzzle smoke
weaponSmokeStartTime = gameLocal.realClientTime;
}
/*
================
idWeapon::Event_LaunchGrimmProjectiles
================
*/
void idWeapon::Event_LaunchGrimmProjectiles( char *gprojdef, int num_projectiles, float spread, float fuseOffset, float launchPower, float dmgPower ) {
idProjectile *proj;
idEntity *ent;
int i;
idVec3 dir;
float ang;
float spin;
float distance;
trace_t tr;
idVec3 start;
idVec3 muzzle_pos;
idBounds ownerBounds, projBounds;
if ( IsHidden() ) {
return;
}
if ( !idStr::Length( gprojdef ) ) {
const char *classname = weaponDef->dict.GetString( "classname" );
gameLocal.Warning( "No projectile defined on '%s'", classname );
return;
}
// avoid all ammo considerations on an MP client
if ( !gameLocal.isClient ) {
// check if we're out of ammo or the clip is empty
int ammoAvail = owner->inventory.HasAmmo( ammoType, ammoRequired );
if ( !ammoAvail || ( ( clipSize != 0 ) && ( ammoClip <= 0 ) ) ) {
return;
}
// if this is a power ammo weapon ( currently only the bfg ) then make sure
// we only fire as much power as available in each clip
if ( powerAmmo ) {
// power comes in as a float from zero to max
// if we use this on more than the bfg will need to define the max
// in the .def as opposed to just in the script so proper calcs
// can be done here.
dmgPower = ( int )dmgPower + 1;
if ( dmgPower > ammoClip ) {
dmgPower = ammoClip;
}
}
owner->inventory.UseAmmo( ammoType, ( powerAmmo ) ? dmgPower : ammoRequired );
if ( clipSize && ammoRequired ) {
ammoClip -= powerAmmo ? dmgPower : 1;
}
}
if ( !silent_fire ) {
// wake up nearby monsters
gameLocal.AlertAI( owner );
}
// set the shader parm to the time of last projectile firing,
// which the gun material shaders can reference for single shot barrel glows, etc
renderEntity.shaderParms[ SHADERPARM_DIVERSITY ] = gameLocal.random.CRandomFloat();
renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = -MS2SEC( gameLocal.realClientTime );
if ( worldModel.GetEntity() ) {
worldModel.GetEntity()->SetShaderParm( SHADERPARM_DIVERSITY, renderEntity.shaderParms[ SHADERPARM_DIVERSITY ] );
worldModel.GetEntity()->SetShaderParm( SHADERPARM_TIMEOFFSET, renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] );
}
// calculate the muzzle position
if ( barrelJointView != INVALID_JOINT && ( projectileDict.GetBool( "launchFromBarrel" ) || g_weaponProjectileOrigin.GetBool() ) ) { // sikk - Weapon Management: Projectile Origin
// there is an explicit joint for the muzzle
GetGlobalJointTransform( true, barrelJointView, muzzleOrigin, muzzleAxis );
} else {
// go straight out of the view
muzzleOrigin = playerViewOrigin;
muzzleAxis = playerViewAxis;
}
// add some to the kick time, incrementally moving repeat firing weapons back
if ( kick_endtime < gameLocal.realClientTime ) {
kick_endtime = gameLocal.realClientTime;
}
kick_endtime += muzzle_kick_time;
if ( kick_endtime > gameLocal.realClientTime + muzzle_kick_maxtime ) {
kick_endtime = gameLocal.realClientTime + muzzle_kick_maxtime;
}
// sikk---> Weapon Management: Handling/Awareness
if ( ( g_weaponHandlingType.GetInteger() == 1 || g_weaponHandlingType.GetInteger() == 3 ) && owner->GetCurrentWeapon() != 2 ) {
spread = ( spread + 2.0f ) * owner->fSpreadModifier;
owner->fSpreadModifier += 0.25f;
if ( owner->fSpreadModifier > 2.0f )
owner->fSpreadModifier = 2.0f;
}
if ( g_weaponAwareness.GetBool() && owner->bIsZoomed )
spread *= 0.5f;
// <---sikk
if ( gameLocal.isClient ) {
// predict instant hit projectiles
if ( projectileDict.GetBool( "net_instanthit" ) ) {
float spreadRad = DEG2RAD( spread );
muzzle_pos = muzzleOrigin + playerViewAxis[ 0 ] * 2.0f;
for( i = 0; i < num_projectiles; i++ ) {
ang = idMath::Sin( spreadRad * gameLocal.random.RandomFloat() );
spin = (float)DEG2RAD( 360.0f ) * gameLocal.random.RandomFloat();
dir = playerViewAxis[ 0 ] + playerViewAxis[ 2 ] * ( ang * idMath::Sin( spin ) ) - playerViewAxis[ 1 ] * ( ang * idMath::Cos( spin ) );
dir.Normalize();
gameLocal.clip.Translation( tr, muzzle_pos, muzzle_pos + dir * 4096.0f, NULL, mat3_identity, MASK_SHOT_RENDERMODEL, owner );
if ( tr.fraction < 1.0f ) {
idProjectile::ClientPredictionCollide( this, projectileDict, tr, vec3_origin, true );
}
}
}
} else {
ownerBounds = owner->GetPhysics()->GetAbsBounds();
owner->AddProjectilesFired( num_projectiles );
float spreadRad = DEG2RAD( spread );
for( i = 0; i < num_projectiles; i++ ) {
ang = idMath::Sin( spreadRad * gameLocal.random.RandomFloat() );
spin = (float)DEG2RAD( 360.0f ) * gameLocal.random.RandomFloat();
dir = playerViewAxis[ 0 ] + playerViewAxis[ 2 ] * ( ang * idMath::Sin( spin ) ) - playerViewAxis[ 1 ] * ( ang * idMath::Cos( spin ) );
dir.Normalize();
// sikk---> Weapon Management: Handling
if ( g_weaponHandlingType.GetInteger() > 1 && !( g_weaponAwareness.GetBool() && owner->bIsZoomed ) ) {
owner->SetViewAngles( owner->viewAngles + idAngles( -0.5f * owner->fSpreadModifier, 0.0f, 0.0f ) );
}
// <---sikk
const idDeclEntityDef *gprojd = gameLocal.FindEntityDef(gprojdef, false );
if ( gprojd ) {
projectileDict = gprojd->dict;
} else {
projectileDict.Clear();
}
gameLocal.SpawnEntityDef( projectileDict, &projectileEnt, false );
if ( projectileEnt ) {
projectileEnt->SetOrigin( GetPhysics()->GetOrigin() );
projectileEnt->Bind( owner, false );
projectileEnt->Hide();
//}
//if ( projectileEnt ) {
ent = projectileEnt;
ent->Show();
ent->Unbind();
projectileEnt = NULL;
} else {
gameLocal.SpawnEntityDef( projectileDict, &ent, false );
}
if ( !ent || !ent->IsType( idProjectile::Type ) ) {
const char *projectileName = weaponDef->dict.GetString( gprojdef );
gameLocal.Error( "'%s' is not an idProjectile", projectileName );
}
if ( projectileDict.GetBool( "net_instanthit" ) ) {
// don't synchronize this on top of the already predicted effect
ent->fl.networkSync = false;
}
proj = static_cast<idProjectile *>(ent);
proj->Create( owner, muzzleOrigin, dir );
projBounds = proj->GetPhysics()->GetBounds().Rotate( proj->GetPhysics()->GetAxis() );
// make sure the projectile starts inside the bounding box of the owner // make sure the projectile starts inside the bounding box of the owner
if ( i == 0 ) { if ( i == 0 ) {
muzzle_pos = muzzleOrigin + playerViewAxis[ 0 ] * 2.0f; muzzle_pos = muzzleOrigin + playerViewAxis[ 0 ] * 2.0f;
@ -2984,6 +3279,8 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
// reset muzzle smoke // reset muzzle smoke
weaponSmokeStartTime = gameLocal.realClientTime; weaponSmokeStartTime = gameLocal.realClientTime;
idThread::ReturnEntity( proj );
} }
/* /*
@ -3020,7 +3317,6 @@ void idWeapon::Event_Melee( void ) {
const char *hitSound = meleeDef->dict.GetString( "snd_miss" ); const char *hitSound = meleeDef->dict.GetString( "snd_miss" );
if ( ent ) { if ( ent ) {
float push = meleeDef->dict.GetFloat( "push" ); float push = meleeDef->dict.GetFloat( "push" );
idVec3 impulse = -push * owner->PowerUpModifier( SPEED ) * tr.c.normal; idVec3 impulse = -push * owner->PowerUpModifier( SPEED ) * tr.c.normal;
@ -3047,18 +3343,34 @@ void idWeapon::Event_Melee( void ) {
globalKickDir = muzzleAxis * kickDir; globalKickDir = muzzleAxis * kickDir;
ent->Damage( owner, owner, globalKickDir, meleeDefName, owner->PowerUpModifier( MELEE_DAMAGE ), tr.c.id ); ent->Damage( owner, owner, globalKickDir, meleeDefName, owner->PowerUpModifier( MELEE_DAMAGE ), tr.c.id );
hit = true; hit = true;
// sikk---> Chainsaw View Sticking
if ( ent->IsType( idAI::Type ) && !idStr::Icmp( weaponDef->GetName(), "weapon_chainsaw" ) ) {
idVec3 playerOrigin;
idMat3 playerAxis;
idVec3 targetVec = ent->GetPhysics()->GetAbsBounds().GetCenter();
owner->GetViewPos( playerOrigin, playerAxis );
targetVec = ent->GetPhysics()->GetAbsBounds().GetCenter() - playerOrigin;
targetVec[2] *= 0.5f;
targetVec.Normalize();
idAngles delta = targetVec.ToAngles() - owner->cmdAngles - owner->GetDeltaViewAngles();
delta.Normalize180();
float fade = 1.0f - idMath::Fabs( playerAxis[ 0 ].z );
// move the view towards the monster
owner->SetDeltaViewAngles( owner->GetDeltaViewAngles() + delta * fade );
// push the player towards the monster
owner->ApplyImpulse( ent, 0, playerOrigin, playerAxis[ 0 ] * 20000.0f );
}
// <---sikk
} }
if ( weaponDef->dict.GetBool( "impact_damage_effect" ) ) { if ( weaponDef->dict.GetBool( "impact_damage_effect" ) ) {
if ( ent->spawnArgs.GetBool( "bleed" ) ) { if ( ent->spawnArgs.GetBool( "bleed" ) ) {
hitSound = meleeDef->dict.GetString( owner->PowerUpActive( BERSERK ) ? "snd_hit_berserk" : "snd_hit" ); hitSound = meleeDef->dict.GetString( owner->PowerUpActive( BERSERK ) ? "snd_hit_berserk" : "snd_hit" );
ent->AddDamageEffect( tr, impulse, meleeDef->dict.GetString( "classname" ) ); ent->AddDamageEffect( tr, impulse, meleeDef->dict.GetString( "classname" ) );
} else { } else {
int type = tr.c.material->GetSurfaceType(); int type = tr.c.material->GetSurfaceType();
if ( type == SURFTYPE_NONE ) { if ( type == SURFTYPE_NONE ) {
type = GetDefaultSurfaceType(); type = GetDefaultSurfaceType();
@ -3098,6 +3410,22 @@ void idWeapon::Event_Melee( void ) {
idThread::ReturnInt( hit ); idThread::ReturnInt( hit );
owner->WeaponFireFeedback( &weaponDef->dict ); owner->WeaponFireFeedback( &weaponDef->dict );
// sikk---> Blood Spray Screen Effect
/*
if ( g_showBloodSpray.GetBool() ) {
if ( GetOwner()->GetCurrentWeapon() == 10 && ( gameLocal.random.RandomFloat() * 0.99999f ) < g_bloodSprayFrequency.GetFloat() && hit )
GetOwner()->playerView.AddBloodSpray( g_bloodSprayTime.GetFloat() );
}
*/
// <---sikk
////grimm --> adjusted bloodspray stuff for Grimm weaponry
// if ( g_showBloodSpray.GetBool() && spawnArgs.GetBool("ismeleeweapon", false) && hit ) {
// GetOwner()->playerView.AddBloodSpray( g_bloodSprayTime.GetFloat() );
// }
////<-- grimm
return; return;
} }

View file

@ -158,6 +158,24 @@ public:
virtual void ClientPredictionThink( void ); virtual void ClientPredictionThink( void );
float wm_hide_distance; // sikk - Weapon Management: Awareness
idEntityPtr<idAnimatedEntity>* GetWorldModel( void ) { return &worldModel; }; // sikk - Depth Render
// sikk---> Crosshair Positioning
idVec3 GetMuzzleOrigin( void ) { return muzzleOrigin; };
idMat3 GetMuzzleAxis( void ) { return muzzleAxis; };
jointHandle_t GetBarrelJointView( void ) { return barrelJointView; };
idDict GetProjectileDict( void ) { return projectileDict; };
// <---sikk
// sikk---> Soft Shadows PostProcess
renderLight_t* GetMuzzleFlash( void ) { return &muzzleFlash; };
renderLight_t* GetWorldMuzzleFlash( void ) { return &worldMuzzleFlash; };
int GetMuzzleFlashHandle( void ) { return muzzleFlashHandle; };
int GetWorldMuzzleFlashHandle( void ) { return worldMuzzleFlashHandle; };
// <---sikk
private: private:
// script control // script control
idScriptBool WEAPON_ATTACK; idScriptBool WEAPON_ATTACK;
@ -344,6 +362,9 @@ private:
void Event_SetLightParm( int parmnum, float value ); void Event_SetLightParm( int parmnum, float value );
void Event_SetLightParms( float parm0, float parm1, float parm2, float parm3 ); void Event_SetLightParms( float parm0, float parm1, float parm2, float parm3 );
void Event_LaunchProjectiles( int num_projectiles, float spread, float fuseOffset, float launchPower, float dmgPower ); void Event_LaunchProjectiles( int num_projectiles, float spread, float fuseOffset, float launchPower, float dmgPower );
//GRIMM
void Event_LaunchGrimmProjectiles( char *gprojdef, int num_projectiles, float spread, float fuseOffset, float launchPower, float dmgPower );
//GRIMM
void Event_CreateProjectile( void ); void Event_CreateProjectile( void );
void Event_EjectBrass( void ); void Event_EjectBrass( void );
void Event_Melee( void ); void Event_Melee( void );

View file

@ -56,7 +56,14 @@ void idWorldspawn::Spawn( void ) {
idStr scriptname; idStr scriptname;
idThread *thread; idThread *thread;
const function_t *func; const function_t *func;
const idKeyValue *kv; //const idKeyValue *kv; <-- not used in grimm
// grimm -->
gameSoundWorld->SetSlowmo( false );
gameSoundWorld->SetSlowmoSpeed( 0.8f );
// <-- grimm
assert( gameLocal.world == NULL ); assert( gameLocal.world == NULL );
gameLocal.world = this; gameLocal.world = this;
@ -82,6 +89,12 @@ void idWorldspawn::Spawn( void ) {
} }
} }
// grimm --> set the current ambient light levels for this session
SetAmbientLight();
// <-- grimm
/* grimm --> not needed for us. I call everything from main anyway.
// call any functions specified in worldspawn // call any functions specified in worldspawn
kv = spawnArgs.MatchPrefix( "call" ); kv = spawnArgs.MatchPrefix( "call" );
while( kv != NULL ) { while( kv != NULL ) {
@ -94,6 +107,8 @@ void idWorldspawn::Spawn( void ) {
thread->DelayedStart( 0 ); thread->DelayedStart( 0 );
kv = spawnArgs.MatchPrefix( "call", kv ); kv = spawnArgs.MatchPrefix( "call", kv );
} }
*/
// <-- grimm
} }
/* /*
@ -118,6 +133,10 @@ void idWorldspawn::Restore( idRestoreGame *savefile ) {
if ( spawnArgs.GetBool( "no_stamina" ) ) { if ( spawnArgs.GetBool( "no_stamina" ) ) {
pm_stamina.SetFloat( 0.0f ); pm_stamina.SetFloat( 0.0f );
} }
// grimm --> set the current ambient light levels for this session
SetAmbientLight();
// <-- grimm
} }
/* /*
@ -137,5 +156,29 @@ idWorldspawn::Event_Remove
================ ================
*/ */
void idWorldspawn::Event_Remove( void ) { void idWorldspawn::Event_Remove( void ) {
gameLocal.Error( "Tried to remove world" ); gameLocal.Error( "Cannot remove the world." );
} }
// grimm --> sets the ambient type for the current session, specified in the worldspawn entity (any brush in the map)
/*
================
idWorldspawn::SetAmbientLight
================
*/
void idWorldspawn::SetAmbientLight( void ) {
int AmbientType = spawnArgs.GetInt("AmbientType");
gameLocal.Printf("Ambienttype set to %i.\n", AmbientType);
if ( AmbientType == 0 ) {
cvarSystem->SetCVarString( "g_ambientLightColor", "0.12 0.06 0.04" );
} else if ( AmbientType == 1 ) {
cvarSystem->SetCVarString( "g_ambientLightColor", "0.04 0.07 0.11" );
} else if ( AmbientType == 2 ) {
cvarSystem->SetCVarString( "g_ambientLightColor", "0.08 0.08 0.08");
} else if (AmbientType == 3) {
cvarSystem->SetCVarString( "g_ambientLightColor", "0.04 0.12 0.06");
} else {
cvarSystem->SetCVarString( "g_ambientLightColor", "0.12 0.06 0.04" );
}
}
// <-- grimm

View file

@ -50,6 +50,10 @@ public:
void Save( idRestoreGame *savefile ); void Save( idRestoreGame *savefile );
void Restore( idRestoreGame *savefile ); void Restore( idRestoreGame *savefile );
// grimm --> called from spawn and restore
void SetAmbientLight( void );
// <-- grimm
private: private:
void Event_Remove( void ); void Event_Remove( void );
}; };

View file

@ -274,3 +274,17 @@ void idAASLocal::GetEdge( int edgeNum, idVec3 &start, idVec3 &end ) const {
start = file->GetVertex( v[INTSIGNBITSET(edgeNum)] ); start = file->GetVertex( v[INTSIGNBITSET(edgeNum)] );
end = file->GetVertex( v[INTSIGNBITNOTSET(edgeNum)] ); end = file->GetVertex( v[INTSIGNBITNOTSET(edgeNum)] );
} }
// sikk---> Random Encounters System
/*
============
idAASLocal::GetNumAreas
============
*/
int idAASLocal::GetNumAreas( int aasNum ) const {
if ( !file ) {
return -1;
}
return file->GetNumAreas();
}
// <---sikk

View file

@ -138,6 +138,9 @@ public:
virtual void ShowFlyPath( const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin ) const = 0; virtual void ShowFlyPath( const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin ) const = 0;
// Find the nearest goal which satisfies the callback. // Find the nearest goal which satisfies the callback.
virtual bool FindNearestGoal( aasGoal_t &goal, int areaNum, const idVec3 origin, const idVec3 &target, int travelFlags, aasObstacle_t *obstacles, int numObstacles, idAASCallback &callback ) const = 0; virtual bool FindNearestGoal( aasGoal_t &goal, int areaNum, const idVec3 origin, const idVec3 &target, int travelFlags, aasObstacle_t *obstacles, int numObstacles, idAASCallback &callback ) const = 0;
// Returns the number of areas in the current aas file.
virtual int GetNumAreas( int aasNum ) const = 0; // sikk - Random Encounters System
}; };
#endif /* !__AAS_H__ */ #endif /* !__AAS_H__ */

View file

@ -118,6 +118,8 @@ public:
virtual void ShowFlyPath( const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin ) const; virtual void ShowFlyPath( const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin ) const;
virtual bool FindNearestGoal( aasGoal_t &goal, int areaNum, const idVec3 origin, const idVec3 &target, int travelFlags, aasObstacle_t *obstacles, int numObstacles, idAASCallback &callback ) const; virtual bool FindNearestGoal( aasGoal_t &goal, int areaNum, const idVec3 origin, const idVec3 &target, int travelFlags, aasObstacle_t *obstacles, int numObstacles, idAASCallback &callback ) const;
virtual int GetNumAreas( int aasNum ) const; // sikk - Random Encounters System
private: private:
idAASFile * file; idAASFile * file;
idStr name; idStr name;

View file

@ -384,6 +384,11 @@ idAI::idAI() {
eyeFocusRate = 0.0f; eyeFocusRate = 0.0f;
headFocusRate = 0.0f; headFocusRate = 0.0f;
focusAlignTime = 0; focusAlignTime = 0;
// sikk---> Random Encounters System
dormantTime = 0;
isRandom = false;
// <---sikk
} }
/* /*
@ -531,6 +536,8 @@ void idAI::Save( idSaveGame *savefile ) const {
savefile->WriteJoint( flyTiltJoint ); savefile->WriteJoint( flyTiltJoint );
savefile->WriteBool( GetPhysics() == static_cast<const idPhysics *>(&physicsObj) ); savefile->WriteBool( GetPhysics() == static_cast<const idPhysics *>(&physicsObj) );
savefile->WriteBool( isRandom ); // sikk - Random Encounters System
} }
/* /*
@ -680,6 +687,8 @@ void idAI::Restore( idRestoreGame *savefile ) {
savefile->ReadBool( restorePhysics ); savefile->ReadBool( restorePhysics );
savefile->ReadBool( isRandom ); // sikk - Random Encounters System
// Set the AAS if the character has the correct gravity vector // Set the AAS if the character has the correct gravity vector
idVec3 gravity = spawnArgs.GetVector( "gravityDir", "0 0 -1" ); idVec3 gravity = spawnArgs.GetVector( "gravityDir", "0 0 -1" );
gravity *= g_gravity.GetFloat(); gravity *= g_gravity.GetFloat();
@ -719,6 +728,8 @@ void idAI::Spawn( void ) {
return; return;
} }
spawnArgs.GetBool( "isRandom", "0", isRandom ); // sikk - Random Encounters System
spawnArgs.GetInt( "team", "1", team ); spawnArgs.GetInt( "team", "1", team );
spawnArgs.GetInt( "rank", "0", rank ); spawnArgs.GetInt( "rank", "0", rank );
spawnArgs.GetInt( "fly_offset", "0", fly_offset ); spawnArgs.GetInt( "fly_offset", "0", fly_offset );
@ -915,6 +926,20 @@ void idAI::Spawn( void ) {
StartSound( "snd_ambient", SND_CHANNEL_AMBIENT, 0, false, NULL ); StartSound( "snd_ambient", SND_CHANNEL_AMBIENT, 0, false, NULL );
} }
// sikk - Monster Burn Away Delay (this doesn't effect zombies or other non-burning monsters)
if ( g_burnAwayDelay.GetFloat() > 0.0 && spawnArgs.GetFloat( "burnaway" ) > 0.0 )
spawnArgs.SetFloat( "burnaway", g_burnAwayDelay.GetFloat() );
// <---sikk
// sikk---> Enemy Health Management (also modifies friendlies but that doesn't matter)
health *= g_enemyHealthScale.GetFloat();
if ( g_enemyHealthRandom.GetBool() )
health += health * 0.5f * gameLocal.random.CRandomFloat();
health = ( health <= 0 ) ? 1 : health;
// <---sikk
if ( health <= 0 ) { if ( health <= 0 ) {
gameLocal.Warning( "entity '%s' doesn't have health set", name.c_str() ); gameLocal.Warning( "entity '%s' doesn't have health set", name.c_str() );
health = 1; health = 1;
@ -1018,6 +1043,12 @@ void idAI::DormantBegin( void ) {
// remove ourselves from the enemy's enemylist // remove ourselves from the enemy's enemylist
enemyNode.Remove(); enemyNode.Remove();
} }
// sikk---> Random Encounters System
if ( isRandom )
dormantTime = gameLocal.time;
// <---sikk
idActor::DormantBegin(); idActor::DormantBegin();
} }
@ -1040,6 +1071,11 @@ void idAI::DormantEnd( void ) {
} }
} }
// sikk---> Random Encounters System
if ( spawnArgs.GetInt( "isRandom" ) )
dormantTime = 0;
// <---sikk
idActor::DormantEnd(); idActor::DormantEnd();
} }
@ -3189,7 +3225,7 @@ int idAI::ReactionTo( const idEntity *ent ) {
} }
// monsters will fight when attacked by lower ranked monsters. rank 0 never fights back. // monsters will fight when attacked by lower ranked monsters. rank 0 never fights back.
if ( rank && ( actor->rank < rank ) ) { if ( rank && ( actor->rank < rank + g_interRankAggression.GetInteger() ) ) { // sikk - Inter Rank Aggression
return ATTACK_ON_DAMAGE; return ATTACK_ON_DAMAGE;
} }
@ -3328,6 +3364,18 @@ void idAI::Killed( idEntity *inflictor, idEntity *attacker, int damage, const id
return; return;
} }
// sikk---> Random Encounters System
int i = gameLocal.GetEnemyNumFromName( spawnArgs.GetString( "classname" ) );
if ( i ) {
if ( isRandom ) {
gameLocal.randomEnemyTally--;
gameLocal.randomEnemyTally = ( gameLocal.randomEnemyTally < 0 ) ? 0 : gameLocal.randomEnemyTally;
} else {
gameLocal.randomEnemyList.Append( i );
}
}
// <---sikk
// stop all voice sounds // stop all voice sounds
StopSound( SND_CHANNEL_VOICE, false ); StopSound( SND_CHANNEL_VOICE, false );
if ( head.GetEntity() ) { if ( head.GetEntity() ) {
@ -3657,7 +3705,7 @@ void idAI::SetEnemyPosition( void ) {
idActor *enemyEnt = enemy.GetEntity(); idActor *enemyEnt = enemy.GetEntity();
int enemyAreaNum; int enemyAreaNum;
int areaNum; int areaNum;
int lastVisibleReachableEnemyAreaNum; int lastVisibleReachableEnemyAreaNum = 0; // sikk - warning C4701: potentially uninitialized local variable used
aasPath_t path; aasPath_t path;
idVec3 pos; idVec3 pos;
bool onGround; bool onGround;
@ -4103,8 +4151,35 @@ idProjectile *idAI::LaunchProjectile( const char *jointname, idEntity *target, b
attack_accuracy = spawnArgs.GetFloat( "attack_accuracy", "7" ); attack_accuracy = spawnArgs.GetFloat( "attack_accuracy", "7" );
attack_cone = spawnArgs.GetFloat( "attack_cone", "70" ); attack_cone = spawnArgs.GetFloat( "attack_cone", "70" );
// sikk---> Damage Type/Spread
if ( g_damageType.GetInteger() == 1 ) {
if ( spawnArgs.GetFloat( "projectile_spread_doom", "-1.0" ) != -1.0 )
projectile_spread = spawnArgs.GetFloat( "projectile_spread_doom", "0" );
else
projectile_spread = spawnArgs.GetFloat( "projectile_spread", "0" );
if ( spawnArgs.GetInt( "num_projectiles_doom" ) )
num_projectiles = spawnArgs.GetInt( "num_projectiles_doom", "1" );
else
num_projectiles = spawnArgs.GetInt( "num_projectiles", "1" );
} else if ( g_damageType.GetInteger() == 2 ) {
if ( spawnArgs.GetFloat( "projectile_spread_custom", "-1.0" ) != -1.0 )
projectile_spread = spawnArgs.GetFloat( "projectile_spread_custom", "0" );
else
projectile_spread = spawnArgs.GetFloat( "projectile_spread", "0" );
if ( spawnArgs.GetInt( "num_projectiles_custom" ) )
num_projectiles = spawnArgs.GetInt( "num_projectiles_custom", "1" );
else
num_projectiles = spawnArgs.GetInt( "num_projectiles", "1" );
} else {
projectile_spread = spawnArgs.GetFloat( "projectile_spread", "0" ); projectile_spread = spawnArgs.GetFloat( "projectile_spread", "0" );
num_projectiles = spawnArgs.GetInt( "num_projectiles", "1" ); num_projectiles = spawnArgs.GetInt( "num_projectiles", "1" );
}
// <---sikk
GetMuzzle( jointname, muzzle, axis ); GetMuzzle( jointname, muzzle, axis );

View file

@ -277,6 +277,12 @@ public:
// Finds the best collision free trajectory for a clip model. // Finds the best collision free trajectory for a clip model.
static bool PredictTrajectory( const idVec3 &firePos, const idVec3 &target, float projectileSpeed, const idVec3 &projGravity, const idClipModel *clip, int clipmask, float max_height, const idEntity *ignore, const idEntity *targetEntity, int drawtime, idVec3 &aimDir ); static bool PredictTrajectory( const idVec3 &firePos, const idVec3 &target, float projectileSpeed, const idVec3 &projGravity, const idClipModel *clip, int clipmask, float max_height, const idEntity *ignore, const idEntity *targetEntity, int drawtime, idVec3 &aimDir );
// sikk---> Random Encounters System
int IsDead( void ) { return AI_DEAD; };
int dormantTime; // holds the time when a random enemy goes dormant
bool isRandom; // holds whether the entity was a random spawn or not
// <---sikk
protected: protected:
// navigation // navigation
idAAS * aas; idAAS * aas;

View file

@ -850,6 +850,8 @@ idAI::Event_StopRagdoll
void idAI::Event_StopRagdoll( void ) { void idAI::Event_StopRagdoll( void ) {
StopRagdoll(); StopRagdoll();
physicsObj.SetOrigin( af.GetPhysics()->GetOrigin() ); // sikk - Zombie Ressurection Fix
// set back the monster physics // set back the monster physics
SetPhysics( &physicsObj ); SetPhysics( &physicsObj );
} }

View file

@ -334,6 +334,14 @@ void Cmd_Give_f( const idCmdArgs &args ) {
} }
} }
if ( give_all || idStr::Icmp( name, "hpacks" ) == 0 ) {
player->healthPackAmount = g_healthPackTotal.GetInteger();
if ( !give_all ) {
return;
}
}
if ( give_all || idStr::Icmp( name, "ammo" ) == 0 ) { if ( give_all || idStr::Icmp( name, "ammo" ) == 0 ) {
for ( i = 0 ; i < AMMO_NUMTYPES; i++ ) { for ( i = 0 ; i < AMMO_NUMTYPES; i++ ) {
player->inventory.ammo[ i ] = player->inventory.MaxAmmoForAmmoClass( player, idWeapon::GetAmmoNameForNum( ( ammo_t )i ) ); player->inventory.ammo[ i ] = player->inventory.MaxAmmoForAmmoClass( player, idWeapon::GetAmmoNameForNum( ( ammo_t )i ) );
@ -841,7 +849,7 @@ void Cmd_Damage_f( const idCmdArgs &args ) {
return; return;
} }
ent->Damage( gameLocal.world, gameLocal.world, idVec3( 0, 0, 1 ), "damage_moverCrush", atoi( args.Argv( 2 ) ), INVALID_JOINT ); ent->Damage( gameLocal.world, gameLocal.world, idVec3( 0, 0, 1 ), "damage_grimm_1", atoi( args.Argv( 2 ) ), INVALID_JOINT );
} }
@ -908,6 +916,7 @@ void Cmd_TestLight_f( const idCmdArgs &args ) {
} }
dict.Set( "classname", "light" ); dict.Set( "classname", "light" );
dict.Set( "_color", "0.7 0.3 0" );
for( i = 2; i < args.Argc() - 1; i += 2 ) { for( i = 2; i < args.Argc() - 1; i += 2 ) {
key = args.Argv( i ); key = args.Argv( i );
@ -1556,9 +1565,9 @@ static void Cmd_TestDeath_f( const idCmdArgs &args ) {
dir[2] = 0; dir[2] = 0;
g_testDeath.SetBool( 1 ); g_testDeath.SetBool( 1 );
player->Damage( NULL, NULL, dir, "damage_triggerhurt_1000", 1.0f, INVALID_JOINT ); player->Damage( NULL, NULL, dir, "damage_fatal", 1.0f, INVALID_JOINT );
if ( args.Argc() >= 2) { if ( args.Argc() >= 2) {
player->SpawnGibs( dir, "damage_triggerhurt_1000" ); player->SpawnGibs( dir, "damage_fatal" );
} }
} }
@ -1783,9 +1792,11 @@ static void Cmd_SaveRagdolls_f( const idCmdArgs &args ) {
continue; continue;
} }
/* grimm --> I need to be able to place bound af's as well.
if ( af->IsBound() ) { if ( af->IsBound() ) {
continue; continue;
} }
<-- grimm */
if ( !af->IsAtRest() ) { if ( !af->IsAtRest() ) {
gameLocal.Warning( "the articulated figure for entity %s is not at rest", gameLocal.entities[ e ]->name.c_str() ); gameLocal.Warning( "the articulated figure for entity %s is not at rest", gameLocal.entities[ e ]->name.c_str() );
@ -1806,9 +1817,12 @@ static void Cmd_SaveRagdolls_f( const idCmdArgs &args ) {
break; break;
} }
} }
af->name = name; // grimm --> changed af->name = name to:
af->SetName( name );
mapEnt->epairs.Set( "classname", af->GetEntityDefName() ); mapEnt->epairs.Set( "classname", af->GetEntityDefName() );
mapEnt->epairs.Set( "name", af->name ); // grimm --> added origin, todo: fix it so the origin is also saved after the entity is moved with g_dragentity.
mapEnt->epairs.Set( "origin", af->spawnArgs.GetString("origin") );
mapEnt->epairs.Set( "name", name );
} }
// save the articulated figure state // save the articulated figure state
mapEnt->epairs.Copy( dict ); mapEnt->epairs.Copy( dict );
@ -1863,6 +1877,341 @@ static void Cmd_GameError_f( const idCmdArgs &args ) {
gameLocal.Error( "game error" ); gameLocal.Error( "game error" );
} }
/* grimm--> own resolution setting implementation
==================
Cmd_setResolution_f
==================
*/
static void Cmd_setResolution_f( const idCmdArgs &args ) {
//grimm > steps: set set r_mode to -1, set custom width and height (always for consistency) then do a vid_restart
// 13 = my lucky number
if (r_screenresolution.GetFloat() == 0) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 640" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 480" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 1) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 800" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 600" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 2) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1024" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 768" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 3) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1152" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 864" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 4) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1280" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 768" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 5) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1280" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 800" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 6) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1280" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 960" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 7) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1280" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 1024" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 8) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1440" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 900" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 9) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1600" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 1024" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 10) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1600" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 1200" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 11) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1680" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 1050" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 12) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1920" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customHeight 1080" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
if (r_screenresolution.GetFloat() == 13) {
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1920" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_customwidth 1200" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "set r_mode -1" );
cmdSystem->BufferCommandText( CMD_EXEC_NOW, "vid_restart" );
}
}
/*
==================
Cmd_SaveDecals_f
==================
*/
static void Cmd_SaveDecals_f( const idCmdArgs &args ) {
if ( !g_PaintSplatterMode.GetBool() ) {
gameLocal.Warning( "Decal Paint Mode disabled!\n" );
return;
}
int e, i;
idStaticEntity *ent;
idMapEntity *mapEnt;
idMapFile *mapFile = gameLocal.GetLevelMap();
idDict dict;
idStr mapName;
const char *name;
if ( !gameLocal.CheatsOk() ) {
return;
}
if ( args.Argc() > 1 ) {
mapName = args.Argv( 1 );
mapName = "maps/" + mapName;
}
else {
mapName = mapFile->GetName();
}
for( e = 0; e < MAX_GENTITIES; e++ ) {
ent = static_cast<idStaticEntity *>(gameLocal.entities[ e ]);
if ( !ent ) {
continue;
}
if ( !idStr::Icmp(ent->spawnArgs.GetString("classname"), "grimm_spray" ) == 0 ) {
continue;
}
gameLocal.Printf( "Adding entity %s to %s\n", ent->spawnArgs.GetString("classname"), mapName.c_str() );
dict.Clear();
// find map file entity
mapEnt = mapFile->FindEntity( ent->name );
// create new map file entity if there isn't one for this articulated figure
if ( !mapEnt ) {
mapEnt = new idMapEntity();
mapFile->AddEntity( mapEnt );
for ( i = 0; i < 9999; i++ ) {
name = va( "%s_%d", ent->GetEntityDefName(), i );
if ( !gameLocal.FindEntity( name ) ) {
break;
}
}
// grimm --> changed af->name = name to:
ent->SetName( name );
mapEnt->epairs.Set( "classname", ent->GetEntityDefName() );
// grimm --> added origin, todo: fix it so the origin is also saved after the entity is moved with g_dragentity.
mapEnt->epairs.Set( "origin", ent->spawnArgs.GetString("origin") );
mapEnt->epairs.Set( "angle", ent->spawnArgs.GetString("angle") );
mapEnt->epairs.Set( "mtr_decal", ent->spawnArgs.GetString("mtr_decal") );
mapEnt->epairs.Set( "name", name );
}
// save the articulated figure state
mapEnt->epairs.Copy( dict );
}
// write out the map file
mapFile->Write( mapName, ".map" );
}
//<-- grimm
/*<-- grimm > Visual fx and postfx presets
==================
Cmd_setVisualFxPreset_f
==================
*/
static void Cmd_setVisualFxPreset_f( const idCmdArgs &args ) {
//sterile
if ( r_VisualFXPreset.GetFloat() == 1 ) {
r_useBloom.SetBool(0);
r_useHDR.SetBool(0);
r_useColorGrading.SetBool(0);
r_useVignetting.SetBool(0);
r_useEdgeAA.SetBool(0);
r_useFilmgrain.SetBool(0);
r_useCelShading.SetBool(0);
r_useSSAO.SetBool(0);
r_useSunShafts.SetBool(0);
g_useAmbientLight.SetBool(0);
}
//vintage
if ( r_VisualFXPreset.GetFloat() == 2 ) {
r_useBloom.SetBool(1);
r_useHDR.SetBool(0);
r_useColorGrading.SetBool(0);
r_useVignetting.SetBool(1);
r_useEdgeAA.SetBool(0);
r_useFilmgrain.SetBool(1);
r_useCelShading.SetBool(0);
r_useSSAO.SetBool(0);
r_useSunShafts.SetBool(0);
g_useAmbientLight.SetBool(0);
}
//vintage light
if ( r_VisualFXPreset.GetFloat() == 3 ) {
r_useBloom.SetBool(1);
r_useHDR.SetBool(0);
r_useColorGrading.SetBool(0);
r_useVignetting.SetBool(1);
r_useEdgeAA.SetBool(0);
r_useFilmgrain.SetBool(1);
r_useCelShading.SetBool(0);
r_useSSAO.SetBool(0);
r_useSunShafts.SetBool(0);
g_useAmbientLight.SetBool(1);
}
//vidid
if ( r_VisualFXPreset.GetFloat() == 4 ) {
r_useBloom.SetBool(1);
r_useHDR.SetBool(1);
r_useColorGrading.SetBool(1);
r_useVignetting.SetBool(1);
r_useEdgeAA.SetBool(0);
r_useFilmgrain.SetBool(0);
r_useCelShading.SetBool(0);
r_useSSAO.SetBool(0);
r_useSunShafts.SetBool(0);
g_useAmbientLight.SetBool(0);
}
//vidid light
if ( r_VisualFXPreset.GetFloat() == 5 ) {
r_useBloom.SetBool(1);
r_useHDR.SetBool(1);
r_useColorGrading.SetBool(1);
r_useVignetting.SetBool(1);
r_useEdgeAA.SetBool(0);
r_useFilmgrain.SetBool(0);
r_useCelShading.SetBool(0);
r_useSSAO.SetBool(0);
r_useSunShafts.SetBool(0);
g_useAmbientLight.SetBool(1);
}
//ultra vidid
if ( r_VisualFXPreset.GetFloat() == 6 ) {
r_useBloom.SetBool(1);
r_useHDR.SetBool(1);
r_useColorGrading.SetBool(1);
r_useVignetting.SetBool(1);
r_useEdgeAA.SetBool(1);
r_useFilmgrain.SetBool(0);
r_useCelShading.SetBool(0);
r_useSSAO.SetBool(1);
r_useSunShafts.SetBool(0);
g_useAmbientLight.SetBool(0);
}
//ultra vidid light
if ( r_VisualFXPreset.GetFloat() == 7 ) {
r_useBloom.SetBool(1);
r_useHDR.SetBool(1);
r_useColorGrading.SetBool(1);
r_useVignetting.SetBool(1);
r_useEdgeAA.SetBool(1);
r_useFilmgrain.SetBool(0);
r_useCelShading.SetBool(0);
r_useSSAO.SetBool(1);
r_useSunShafts.SetBool(0);
g_useAmbientLight.SetBool(1);
}
}
//<-- grimm
/*<-- grimm > Visual fx and postfx presets
==================
Cmd_setVisualCustomPreset_f
==================
*/
static void Cmd_setVisualCustomPreset_f( const idCmdArgs &args ) {
//rests the preset to custom when a user changes some value.
r_VisualFXPreset.SetFloat(-1);
}
/*<-- grimm > Visual fx and postfx presets
==================
Cmd_r_resetBrightness_f
==================
*/
static void Cmd_r_resetBrightness_f( const idCmdArgs &args ) {
//rests the preset to custom when a user changes some value.
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "r_brightness 1" );
}
/*<-- grimm > Visual fx and postfx presets
==================
Cmd_r_resetGamma_f
==================
*/
static void Cmd_r_resetGamma_f( const idCmdArgs &args ) {
// resets the preset to custom when a user changes some value.
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "r_gamma 1" );
}
/*<-- grimm > Resume Game (mainmenu or CMD command)
==================
Cmd_ResumeGame_f
==================
*/
static void Cmd_ResumeGame_f( const idCmdArgs &args ) {
// Resumes the game from the last checkpoint
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "LoadGame checkpoint" );
}
//<-- grimm
/* /*
================== ==================
Cmd_SaveLights_f Cmd_SaveLights_f
@ -2380,6 +2729,16 @@ void idGameLocal::InitConsoleCommands( void ) {
cmdSystem->AddCommand( "clearLights", Cmd_ClearLights_f, CMD_FL_GAME|CMD_FL_CHEAT, "clears all lights" ); cmdSystem->AddCommand( "clearLights", Cmd_ClearLights_f, CMD_FL_GAME|CMD_FL_CHEAT, "clears all lights" );
cmdSystem->AddCommand( "gameError", Cmd_GameError_f, CMD_FL_GAME|CMD_FL_CHEAT, "causes a game error" ); cmdSystem->AddCommand( "gameError", Cmd_GameError_f, CMD_FL_GAME|CMD_FL_CHEAT, "causes a game error" );
// grimm -->
cmdSystem->AddCommand( "r_setResolution", Cmd_setResolution_f, CMD_FL_GAME, "Actually sets the resolution defined in r_screenresolution, restarts the render engine" );
cmdSystem->AddCommand( "r_setVisualFXPreset", Cmd_setVisualFxPreset_f, CMD_FL_GAME, "Actually sets the preset defined in r_VisualFXPreset" );
cmdSystem->AddCommand( "r_setVisualCustomPreset", Cmd_setVisualCustomPreset_f, CMD_FL_GAME, "Sets the preset defined in r_VisualFXPreset to -1" );
cmdSystem->AddCommand( "r_resetBrightness", Cmd_r_resetBrightness_f, CMD_FL_GAME, "Resets the brightness to default" );
cmdSystem->AddCommand( "r_resetGamma", Cmd_r_resetGamma_f, CMD_FL_GAME, "Resets the gamme to default" );
cmdSystem->AddCommand( "ResumeGame", Cmd_ResumeGame_f, CMD_FL_GAME, "Resumes the game from the last checkpoint." );
cmdSystem->AddCommand( "SaveDecals", Cmd_SaveDecals_f, CMD_FL_GAME|CMD_FL_CHEAT, "Saves all grimm_spray entities to the map." );
// <-- grimm
cmdSystem->AddCommand( "disasmScript", Cmd_DisasmScript_f, CMD_FL_GAME|CMD_FL_CHEAT, "disassembles script" ); cmdSystem->AddCommand( "disasmScript", Cmd_DisasmScript_f, CMD_FL_GAME|CMD_FL_CHEAT, "disassembles script" );
cmdSystem->AddCommand( "recordViewNotes", Cmd_RecordViewNotes_f, CMD_FL_GAME|CMD_FL_CHEAT, "record the current view position with notes" ); cmdSystem->AddCommand( "recordViewNotes", Cmd_RecordViewNotes_f, CMD_FL_GAME|CMD_FL_CHEAT, "record the current view position with notes" );
cmdSystem->AddCommand( "showViewNotes", Cmd_ShowViewNotes_f, CMD_FL_GAME|CMD_FL_CHEAT, "show any view notes for the current map, successive calls will cycle to the next note" ); cmdSystem->AddCommand( "showViewNotes", Cmd_ShowViewNotes_f, CMD_FL_GAME|CMD_FL_CHEAT, "show any view notes for the current map, successive calls will cycle to the next note" );

View file

@ -105,7 +105,13 @@ idCVar g_doubleVision( "g_doubleVision", "1", CVAR_GAME | CVAR_ARCHIVE |
idCVar g_monsters( "g_monsters", "1", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_monsters( "g_monsters", "1", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_decals( "g_decals", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "show decals such as bullet holes" ); idCVar g_decals( "g_decals", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "show decals such as bullet holes" );
idCVar g_knockback( "g_knockback", "1000", CVAR_GAME | CVAR_INTEGER, "" ); idCVar g_knockback( "g_knockback", "1000", CVAR_GAME | CVAR_INTEGER, "" );
idCVar g_skill( "g_skill", "1", CVAR_GAME | CVAR_INTEGER, "" );
// GRIMM: CHANGED THIS TO INCLUDE TRAP SETTINGS
idCVar g_skill( "g_skill", "1", CVAR_GAME | CVAR_INTEGER, "Skill Setting for combat and the world" );
idCVar g_trapskill( "g_trapskill", "1", CVAR_GAME | CVAR_INTEGER, "Specific Trap Skill Setting, e.g. how fast traps move, how deadly they are, etc.." );
// TODO: IN Exe Source, change the way that objects are loaded (e.g. not_easy, not_medium keys for entities).
// END GRIM..
idCVar g_nightmare( "g_nightmare", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "if nightmare mode is allowed" ); idCVar g_nightmare( "g_nightmare", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "if nightmare mode is allowed" );
idCVar g_gravity( "g_gravity", DEFAULT_GRAVITY_STRING, CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_gravity( "g_gravity", DEFAULT_GRAVITY_STRING, CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_skipFX( "g_skipFX", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_skipFX( "g_skipFX", "0", CVAR_GAME | CVAR_BOOL, "" );
@ -122,15 +128,13 @@ idCVar g_debugMover( "g_debugMover", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_debugTriggers( "g_debugTriggers", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_debugTriggers( "g_debugTriggers", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_debugCinematic( "g_debugCinematic", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_debugCinematic( "g_debugCinematic", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_stopTime( "g_stopTime", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_stopTime( "g_stopTime", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_damageScale( "g_damageScale", "1", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "scale final damage on player by this factor" ); idCVar g_damageScale( "g_damageScale", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "scale final damage on player by this factor" );
idCVar g_armorProtection( "g_armorProtection", "0.3", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "armor takes this percentage of damage" ); idCVar g_armorProtection( "g_armorProtection", "0.8", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "armor takes this percentage of damage" );
idCVar g_armorProtectionMP( "g_armorProtectionMP", "0.6", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "armor takes this percentage of damage in mp" ); idCVar g_armorProtectionMP( "g_armorProtectionMP", "0.6", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "armor takes this percentage of damage in mp" );
idCVar g_useDynamicProtection( "g_useDynamicProtection", "1", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE, "scale damage and armor dynamically to keep the player alive more often" ); idCVar g_useDynamicProtection( "g_useDynamicProtection", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "scale damage and armor dynamically to keep the player alive more often" );
idCVar g_healthTakeTime( "g_healthTakeTime", "5", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE, "how often to take health in nightmare mode" ); idCVar g_healthTakeTime( "g_healthTakeTime", "5", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER, "how often to take health in nightmare mode" );
idCVar g_healthTakeAmt( "g_healthTakeAmt", "5", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE, "how much health to take in nightmare mode" ); idCVar g_healthTakeAmt( "g_healthTakeAmt", "5", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER, "how much health to take in nightmare mode" );
idCVar g_healthTakeLimit( "g_healthTakeLimit", "25", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE, "how low can health get taken in nightmare mode" ); idCVar g_healthTakeLimit( "g_healthTakeLimit", "25", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER, "how low can health get taken in nightmare mode" );
idCVar g_showPVS( "g_showPVS", "0", CVAR_GAME | CVAR_INTEGER, "", 0, 2 ); idCVar g_showPVS( "g_showPVS", "0", CVAR_GAME | CVAR_INTEGER, "", 0, 2 );
idCVar g_showTargets( "g_showTargets", "0", CVAR_GAME | CVAR_BOOL, "draws entities and their targets. hidden entities are drawn grey." ); idCVar g_showTargets( "g_showTargets", "0", CVAR_GAME | CVAR_BOOL, "draws entities and their targets. hidden entities are drawn grey." );
@ -141,7 +145,8 @@ idCVar g_showCollisionTraces( "g_showCollisionTraces", "0", CVAR_GAME | CVAR_
idCVar g_maxShowDistance( "g_maxShowDistance", "128", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_maxShowDistance( "g_maxShowDistance", "128", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_showEntityInfo( "g_showEntityInfo", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_showEntityInfo( "g_showEntityInfo", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_showviewpos( "g_showviewpos", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_showviewpos( "g_showviewpos", "0", CVAR_GAME | CVAR_BOOL, "" );
idCVar g_showcamerainfo( "g_showcamerainfo", "0", CVAR_GAME | CVAR_ARCHIVE, "displays the current frame # for the camera when playing cinematics" ); // sikk - g_showcamerainfo was archived and type bool was not set
idCVar g_showcamerainfo( "g_showcamerainfo", "0", CVAR_GAME | CVAR_BOOL, "displays the current frame # for the camera when playing cinematics" );
idCVar g_showTestModelFrame( "g_showTestModelFrame", "0", CVAR_GAME | CVAR_BOOL, "displays the current animation and frame # for testmodels" ); idCVar g_showTestModelFrame( "g_showTestModelFrame", "0", CVAR_GAME | CVAR_BOOL, "displays the current animation and frame # for testmodels" );
idCVar g_showActiveEntities( "g_showActiveEntities", "0", CVAR_GAME | CVAR_BOOL, "draws boxes around thinking entities. dormant entities (outside of pvs) are drawn yellow. non-dormant are green." ); idCVar g_showActiveEntities( "g_showActiveEntities", "0", CVAR_GAME | CVAR_BOOL, "draws boxes around thinking entities. dormant entities (outside of pvs) are drawn yellow. non-dormant are green." );
idCVar g_showEnemies( "g_showEnemies", "0", CVAR_GAME | CVAR_BOOL, "draws boxes around monsters that have targeted the the player" ); idCVar g_showEnemies( "g_showEnemies", "0", CVAR_GAME | CVAR_BOOL, "draws boxes around monsters that have targeted the the player" );
@ -230,58 +235,64 @@ idCVar rb_showInertia( "rb_showInertia", "0", CVAR_GAME | CVAR_BOOL, "sho
idCVar rb_showVelocity( "rb_showVelocity", "0", CVAR_GAME | CVAR_BOOL, "show the velocity of each rigid body" ); idCVar rb_showVelocity( "rb_showVelocity", "0", CVAR_GAME | CVAR_BOOL, "show the velocity of each rigid body" );
idCVar rb_showActive( "rb_showActive", "0", CVAR_GAME | CVAR_BOOL, "show rigid bodies that are not at rest" ); idCVar rb_showActive( "rb_showActive", "0", CVAR_GAME | CVAR_BOOL, "show rigid bodies that are not at rest" );
// sikk---> Added "CVAR_ARCHIVE" to all player movement cvars
// The default values for player movement cvars are set in def/player.def // The default values for player movement cvars are set in def/player.def
idCVar pm_jumpheight( "pm_jumpheight", "48", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "approximate height the player can jump" ); idCVar pm_jumpheight( "pm_jumpheight", "48", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "approximate hieght the player can jump" );
idCVar pm_stepsize( "pm_stepsize", "16", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "maximum height the player can step up without jumping" ); idCVar pm_stepsize( "pm_stepsize", "16", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "maximum height the player can step up without jumping" );
idCVar pm_crouchspeed( "pm_crouchspeed", "80", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "speed the player can move while crouched" ); idCVar pm_crouchspeed( "pm_crouchspeed", "80", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "speed the player can move while crouched" );
idCVar pm_walkspeed( "pm_walkspeed", "140", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "speed the player can move while walking" ); idCVar pm_walkspeed( "pm_walkspeed", "140", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "speed the player can move while walking" );
idCVar pm_runspeed( "pm_runspeed", "220", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "speed the player can move while running" ); idCVar pm_runspeed( "pm_runspeed", "220", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "speed the player can move while running" );
idCVar pm_noclipspeed( "pm_noclipspeed", "200", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "speed the player can move while in noclip" ); idCVar pm_noclipspeed( "pm_noclipspeed", "200", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "speed the player can move while in noclip" );
idCVar pm_spectatespeed( "pm_spectatespeed", "450", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "speed the player can move while spectating" ); idCVar pm_spectatespeed( "pm_spectatespeed", "450", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "speed the player can move while spectating" );
idCVar pm_spectatebbox( "pm_spectatebbox", "32", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "size of the spectator bounding box" ); idCVar pm_spectatebbox( "pm_spectatebbox", "32", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "size of the spectator bounding box" );
idCVar pm_usecylinder( "pm_usecylinder", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_BOOL, "use a cylinder approximation instead of a bounding box for player collision detection" ); idCVar pm_usecylinder( "pm_usecylinder", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_BOOL, "use a cylinder approximation instead of a bounding box for player collision detection" );
idCVar pm_minviewpitch( "pm_minviewpitch", "-89", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "amount player's view can look up (negative values are up)" ); idCVar pm_minviewpitch( "pm_minviewpitch", "-89", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "amount player's view can look up (negative values are up)" );
idCVar pm_maxviewpitch( "pm_maxviewpitch", "89", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "amount player's view can look down" ); idCVar pm_maxviewpitch( "pm_maxviewpitch", "89", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "amount player's view can look down" );
idCVar pm_stamina( "pm_stamina", "24", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "length of time player can run" ); idCVar pm_stamina( "pm_stamina", "24", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "length of time player can run" );
idCVar pm_staminathreshold( "pm_staminathreshold", "45", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "when stamina drops below this value, player gradually slows to a walk" ); idCVar pm_staminathreshold( "pm_staminathreshold", "4", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "when stamina drops below this value, player gradually slows to a walk" );
idCVar pm_staminarate( "pm_staminarate", "0.75", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "rate that player regains stamina. divide pm_stamina by this value to determine how long it takes to fully recharge." ); idCVar pm_staminarate( "pm_staminarate", "0.75", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "rate that player regains stamina. divide pm_stamina by this value to determine how long it takes to fully recharge." );
idCVar pm_crouchheight( "pm_crouchheight", "38", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "height of player's bounding box while crouched" ); idCVar pm_crouchheight( "pm_crouchheight", "38", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "height of player's bounding box while crouched" );
idCVar pm_crouchviewheight( "pm_crouchviewheight", "32", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "height of player's view while crouched" ); idCVar pm_crouchviewheight( "pm_crouchviewheight", "32", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "height of player's view while crouched" );
idCVar pm_normalheight( "pm_normalheight", "74", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "height of player's bounding box while standing" ); idCVar pm_normalheight( "pm_normalheight", "74", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "height of player's bounding box while standing" );
idCVar pm_normalviewheight( "pm_normalviewheight", "68", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "height of player's view while standing" ); idCVar pm_normalviewheight( "pm_normalviewheight", "68", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "height of player's view while standing" );
idCVar pm_deadheight( "pm_deadheight", "20", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "height of player's bounding box while dead" ); idCVar pm_deadheight( "pm_deadheight", "20", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "height of player's bounding box while dead" );
idCVar pm_deadviewheight( "pm_deadviewheight", "10", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "height of player's view while dead" ); idCVar pm_deadviewheight( "pm_deadviewheight", "10", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "height of player's view while dead" );
idCVar pm_crouchrate( "pm_crouchrate", "0.87", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "time it takes for player's view to change from standing to crouching" ); idCVar pm_crouchrate( "pm_crouchrate", "0.87", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "time it takes for player's view to change from standing to crouching" );
idCVar pm_bboxwidth( "pm_bboxwidth", "32", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "x/y size of player's bounding box" ); idCVar pm_bboxwidth( "pm_bboxwidth", "32", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "x/y size of player's bounding box" );
idCVar pm_crouchbob( "pm_crouchbob", "0.5", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "bob much faster when crouched" ); idCVar pm_crouchbob( "pm_crouchbob", "0.5", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "bob much faster when crouched" );
idCVar pm_walkbob( "pm_walkbob", "0.3", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "bob slowly when walking" ); idCVar pm_walkbob( "pm_walkbob", "0.3", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "bob slowly when walking" );
idCVar pm_runbob( "pm_runbob", "0.4", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "bob faster when running" ); idCVar pm_runbob( "pm_runbob", "0.4", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "bob faster when running" );
idCVar pm_runpitch( "pm_runpitch", "0.002", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "" ); idCVar pm_runpitch( "pm_runpitch", "0.002", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar pm_runroll( "pm_runroll", "0.005", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "" ); idCVar pm_runroll( "pm_runroll", "0.005", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar pm_bobup( "pm_bobup", "0.005", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "" ); idCVar pm_bobup( "pm_bobup", "0.005", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar pm_bobpitch( "pm_bobpitch", "0.002", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "" ); idCVar pm_bobpitch( "pm_bobpitch", "0.002", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar pm_bobroll( "pm_bobroll", "0.002", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "" ); idCVar pm_bobroll( "pm_bobroll", "0.002", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar pm_thirdPersonRange( "pm_thirdPersonRange", "80", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "camera distance from player in 3rd person" );
idCVar pm_thirdPersonHeight( "pm_thirdPersonHeight", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "height of camera from normal view height in 3rd person" ); idCVar pm_thirdPersonRange( "pm_thirdPersonRange", "80", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "camera distance from player in 3rd person" );
idCVar pm_thirdPersonAngle( "pm_thirdPersonAngle", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "direction of camera from player in 3rd person in degrees (0 = behind player, 180 = in front)" ); idCVar pm_thirdPersonHeight( "pm_thirdPersonHeight", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "height of camera from normal view height in 3rd person" );
idCVar pm_thirdPersonClip( "pm_thirdPersonClip", "1", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_BOOL, "clip third person view into world space" ); idCVar pm_thirdPersonAngle( "pm_thirdPersonAngle", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "direction of camera from player in 3rd person in degrees (0 = behind player, 180 = in front)" );
idCVar pm_thirdPerson( "pm_thirdPerson", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_BOOL, "enables third person view" ); idCVar pm_thirdPersonClip( "pm_thirdPersonClip", "1", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_BOOL, "clip third person view into world space" );
idCVar pm_thirdPersonDeath( "pm_thirdPersonDeath", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_BOOL, "enables third person view when player dies" ); idCVar pm_thirdPerson( "pm_thirdPerson", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_BOOL, "enables third person view" );
idCVar pm_modelView( "pm_modelView", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_INTEGER, "draws camera from POV of player model (1 = always, 2 = when dead)", 0, 2, idCmdSystem::ArgCompletion_Integer<0,2> ); idCVar pm_thirdPersonDeath( "pm_thirdPersonDeath", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_BOOL, "enables third person view when player dies" );
idCVar pm_airTics( "pm_air", "1800", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_INTEGER, "how long in milliseconds the player can go without air before he starts taking damage" ); idCVar pm_modelView( "pm_modelView", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_INTEGER, "draws camera from POV of player model (1 = always, 2 = when dead)", 0, 2, idCmdSystem::ArgCompletion_Integer<0,2> );
idCVar pm_airTics( "pm_air", "1800", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_INTEGER, "how long in milliseconds the player can go without air before he starts taking damage" );
// <---sikk
idCVar g_showPlayerShadow( "g_showPlayerShadow", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "enables shadow of player model" ); idCVar g_showPlayerShadow( "g_showPlayerShadow", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "enables shadow of player model" );
idCVar g_showHud( "g_showHud", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "" ); idCVar g_showHud( "g_showHud", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "" );
idCVar g_showProjectilePct( "g_showProjectilePct", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "enables display of player hit percentage" ); idCVar g_showProjectilePct( "g_showProjectilePct", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "enables display of player hit percentage" );
idCVar g_showBrass( "g_showBrass", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "enables ejected shells from weapon" ); idCVar g_showBrass( "g_showBrass", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "enables ejected shells from weapon" );
idCVar g_gun_x( "g_gunX", "0", CVAR_GAME | CVAR_FLOAT, "" );
idCVar g_gun_y( "g_gunY", "0", CVAR_GAME | CVAR_FLOAT, "" ); // sikk---> Added "CVAR_ARCHIVE" to all select game cvars
idCVar g_gun_z( "g_gunZ", "0", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_gun_x( "g_gunX", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar g_viewNodalX( "g_viewNodalX", "0", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_gun_y( "g_gunY", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar g_viewNodalZ( "g_viewNodalZ", "0", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_gun_z( "g_gunZ", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar g_fov( "g_fov", "90", CVAR_GAME | CVAR_INTEGER | CVAR_NOCHEAT, "" ); idCVar g_viewNodalX( "g_viewNodalX", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar g_skipViewEffects( "g_skipViewEffects", "0", CVAR_GAME | CVAR_BOOL, "skip damage and other view effects" ); idCVar g_viewNodalZ( "g_viewNodalZ", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "" );
idCVar g_mpWeaponAngleScale( "g_mpWeaponAngleScale", "0", CVAR_GAME | CVAR_FLOAT, "Control the weapon sway in MP" ); idCVar g_fov( "g_fov", "90", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_NOCHEAT, "" );
idCVar g_skipViewEffects( "g_skipViewEffects", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "skip damage and other view effects" );
idCVar g_mpWeaponAngleScale( "g_mpWeaponAngleScale", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Control the weapon sway in MP" );
// <---sikk
idCVar g_testParticle( "g_testParticle", "0", CVAR_GAME | CVAR_INTEGER, "test particle visualation, set by the particle editor" ); idCVar g_testParticle( "g_testParticle", "0", CVAR_GAME | CVAR_INTEGER, "test particle visualation, set by the particle editor" );
idCVar g_testParticleName( "g_testParticleName", "", CVAR_GAME, "name of the particle being tested by the particle editor" ); idCVar g_testParticleName( "g_testParticleName", "", CVAR_GAME, "name of the particle being tested by the particle editor" );
@ -334,4 +345,309 @@ idCVar mod_validSkins( "mod_validSkins", "skins/characters/player/marine_mp
idCVar net_serverDownload( "net_serverDownload", "0", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE, "enable server download redirects. 0: off 1: redirect to si_serverURL 2: use builtin download. see net_serverDl cvars for configuration" ); idCVar net_serverDownload( "net_serverDownload", "0", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE, "enable server download redirects. 0: off 1: redirect to si_serverURL 2: use builtin download. see net_serverDl cvars for configuration" );
idCVar net_serverDlBaseURL( "net_serverDlBaseURL", "", CVAR_GAME | CVAR_ARCHIVE, "base URL for the download redirection" ); idCVar net_serverDlBaseURL( "net_serverDlBaseURL", "", CVAR_GAME | CVAR_ARCHIVE, "base URL for the download redirection" );
idCVar net_serverDlTable( "net_serverDlTable", "", CVAR_GAME | CVAR_ARCHIVE, "pak names for which download is provided, separated by ;" ); idCVar net_serverDlTable( "net_serverDlTable", "", CVAR_GAME | CVAR_ARCHIVE, "pak names for which download is provided, seperated by ;" );
// sikk - New Cvars -
//-------------------------------------------------
// sikk---> Crosshair Cvar
idCVar g_crosshair( "g_crosshair", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "0 = crosshair off, 1 = crosshair on, 2 = crosshair on only when zoomed or npc has focus" );
idCVar g_crosshairType( "g_crosshairType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "toggle between static and precise crosshair positioning" );
idCVar g_crosshairLerp( "g_crosshairLerp", "0.5", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "smoothness for the movement of the crosshair when g_crosshairType = 1" );
// <---sikk
// sikk---> Dynamic Hud system
idCVar g_hudType( "g_hudType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "toggles between default and custom hud" );
idCVar g_useDynamicHud( "g_useDynamicHud", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "enables dynamic hud (g_hudType == 1 only)" );
idCVar g_dynamicHudTime( "g_dynamicHudTime", "10.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "time (in sec) before the hud fades out" );
// <---sikk
// sikk---> IR Goggles/Headlight Mod
idCVar g_goggleType( "g_goggleType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "sets the goggle's type: 0 = Infrared; 1 = Thermal" );
idCVar g_batteryLife( "g_batteryLife", "60", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "how long the battery lasts (in seconds) for ir goggles/headlight" );
idCVar g_batteryRechargeRate( "g_batteryRechargeRate", "120", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "how long it takes the battery to fully recharge (in seconds) for ir goggles/headlight" );
// <---sikk
// sikk---> Global Ambient Light
idCVar g_useAmbientLight( "g_useAmbientLight", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "enable a global ambient light bound to player" );
idCVar g_ambientLightRadius( "g_ambientLightRadius", "1024 1024 1024", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE, "sets the ambient light's radius (XYZ = 0 to 65536)" );
idCVar g_ambientLightColor( "g_ambientLightColor", "0.03125 0.03125 0.03125", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE, "sets the ambient light's color (RGB = 0.0 to 1.0)" );
// sikk---> Explosion FX
idCVar g_useExplosionFX( "g_useExplosionFX", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "enables explosion screen effects" );
idCVar g_explosionFXTime( "g_explosionFXTime", "2.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "time (in secs) the effect lasts" );
idCVar g_explosionFXScale( "g_explosionFXScale", "32.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "explosion effect scale" );
// <---sikk
// sikk---> Blood Spray Screen Effect
idCVar g_showBloodSpray( "g_showBloodSpray", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "show blood spray effect on screen when inflicting damage up close" );
idCVar g_bloodSprayTime( "g_bloodSprayTime", "5.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "how long blood spray effect lasts (in seconds)" );
idCVar g_bloodSprayDistance( "g_bloodSprayDistance", "96", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "how close you have to be for blood spray effect to \"hit the camera\". Not relevant for chainsaw." );
idCVar g_bloodSprayFrequency( "g_bloodSprayFrequency", "0.5", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "how often the blood spray effect can occur. Value Range: 0.0 (never) - 1.0 (always)" );
// <---sikk
// sikk---> Screen Frost
idCVar g_screenFrostTime( "g_screenFrostTime", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "time (in secs) for frost to fully build on the screen. 0 = disables effect" );
// <---sikk
// sikk---> Tracer Frequency
idCVar g_tracerFrequency( "g_tracerFrequency", "0.5", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "how frequent a fired shot will be a tracer. Value Range: 0.0 (no tracers) - 1.0 (all tracers)" );
// <---sikk
// sikk---> Player Head Type
idCVar g_playerHeadType( "g_playerHeadType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "sets which head def to use for the player. 0 = Default Player Head; 1 = Marine Helmet" );
// <---sikk
// sikk---> First Person Body
idCVar g_showFirstPersonBody( "g_showFirstPersonBody", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "draws the player body in first person view mode" );
// <---sikk
// sikk---> Portal Sky Box
idCVar g_enablePortalSky( "g_enablePortalSky", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "enables portal sky box support" );
// <---sikk
// sikk---> Health Management System
idCVar g_healthManagementType( "g_healthManagementType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "selects which health management system to use. 0 = default; 1 = carriable health pack; 2 = regenerating health" );
idCVar g_healthPackTotal( "g_healthPackTotal", "5", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER, "Total amount of healthpacks a player can carry." );
idCVar g_healthPackUses( "g_healthPackUses", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "number of uses in the health pack. g_healthPackTotal divided by this is how much health is given per use." );
idCVar g_healthPackTime( "g_healthPackTime", "3", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "maximum time it takes to heal yourself. " );
idCVar g_healthRegenTime( "g_healthRegenTime", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "how often to regenerate health when using regenerative health system" );
idCVar g_healthRegenDelay( "g_healthRegenDelay", "5", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "delay (in seconds) before health starts to regenerate after taking damage when using regenerative health system" );
idCVar g_healthRegenAmt( "g_healthRegenAmt", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "how much health to regenerate per g_healthRegenTime when using regenerative health system" );
idCVar g_healthRegenLimit( "g_healthRegenLimit", "100", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "total amount of health that can be regenerated when using regenerative health system" );
idCVar g_healthRegenSteps( "g_healthRegenSteps", "4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "splits g_healthRegenLimit into n number of steps. Value of 1 or less will turn steps off.\nexample1: if g_healthRegenLimit == 100 && g_healthRegenSteps == 4, health regeneration will stop at 25/50/75/100\nexample2: if g_healthRegenLimit == 50 && g_healthRegenSteps == 5, health regeneration will stop at 10/20/30/40/50" );
idCVar g_healthRegenFeedback( "g_healthRegenFeedback", "50", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "how low must health reach before feedback is drawn when using regenerative health system" );
// <---sikk
// sikk---> Item Management
idCVar g_itemPickupType( "g_itemPickupType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "toggles whether items need to be picked up manually with the 'Use' key." );
idCVar g_itemMaxArmorType( "g_itemMaxArmorType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "sets armor capacity type: 0 = Doom 3; 1 = Doom 1/2; 2 = Custom" );
idCVar g_itemHelmetFactor( "g_itemHelmetFactor", "0.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "sets the factor for which security armor is randomly replaced with a marine helmet. Value Range: 0.0 (no replacement) - 1.0 (full replacement)" );
idCVar g_itemValueFactor( "g_itemValueFactor", "0.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "sets the factor for which the value for items are randomly set. Value Range: 0.0 (items have full value) - 1.0 (items have anywhere from one to full value)" );
idCVar g_itemRemovalFactor( "g_itemRemovalFactor", "0.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "sets the factor for which items are randomly removed from the map. Value Range: 0.0 (no items are removed) - 1.0 (all items are removed)" );
idCVar g_itemSearchFactor( "g_itemSearchFactor", "0.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "sets the factor for which items can be found on dead bodies. Value Range: 0.0 (dead bodies contain no items) - 1.0 (dead bodies always contain items)" );
// <---sikk
// sikk---> Ammo Management
idCVar g_ammoCapacityType( "g_ammoCapacityType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "sets ammo capacity type: 0 = Doom 3; 1 = Doom 1/2; 2 = Custom" );
idCVar g_ammoClipSizeType( "g_ammoClipSizeType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "sets ammo clip size type: 0 = Doom 3; 1 = Doom 1/2; 2 = Custom" );
idCVar g_ammoUsageType( "g_ammoUsageType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "enables realistic ammo usage when reloading and collecting ammo" );
// <---sikk
// sikk---> Weapon Management
idCVar g_weaponAwareness( "g_weaponAwareness", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "toggles weapon awareness" );
idCVar g_weaponHandlingType( "g_weaponHandlingType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "sets the weapon handling type: 0 = spread (fixed); 1 = spread (variable); 2 spread (fixed) + recoil; 2 spread (variable) + recoil" );
idCVar g_weaponProjectileOrigin( "g_weaponProjectileOrigin", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "sets whether projectiles are launched from their def defined origin or to launch all projectiles from the weapon's barrel: 0 = Default; 1 = Weapon Barrel" );
// <---sikk
// sikk---> First Person Body
idCVar g_grabMode( "g_grabMode", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "enables the ability to grab moveable objects" );
// <---sikk
// sikk---> Disable Fall Damage
idCVar g_disableFallDamage( "g_disableFallDamage", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "disables fall damage" );
// <---sikk
// sikk---> Locational Damage Type
idCVar g_damageType( "g_damageType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "sets damage value type: 0 = Doom 3; 1 = Doom 1/2; 2 = Custom" );
idCVar g_damageZoneType( "g_damageZoneType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "sets locational damage type: 0 = Doom 3; 1 = Doom 1/2; 2 = Custom" );
// <---sikk
// sikk---> Enemy Health Management
idCVar g_enemyHealthType( "g_enemyHealthType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "sets enemy health type: 0 = Doom 3; 1 = Doom 1/2; 2 = Custom" );
idCVar g_enemyHealthScale( "g_enemyHealthScale", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "sets the health scale for enemies" );
idCVar g_enemyHealthRandom( "g_enemyHealthRandom", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "sets whether to randomize enemy health values" );
// <---sikk
// sikk---> Spectre Factor
idCVar g_enemySpectreFactor( "g_enemySpectreFactor", "0.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "sets the factor that a Pinky demon will spawn as a Spectre" );
// <---sikk
// sikk---> Pain Elemental Factor
idCVar g_enemyPainElementalFactor( "g_enemyPainElementalFactor", "0.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "sets the factor that a Cacodemon will spawn as a Pain Elemental" );
// <---sikk
// sikk---> Baron of Hell Factor
idCVar g_enemyBaronFactor( "g_enemyBaronFactor", "0.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "sets the factor that a Hellknight will spawn as a Baron of Hell" );
// <---sikk
// sikk---> Monster Burn Away Delay
idCVar g_burnAwayDelay( "g_burnAwayDelay", "0.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "enemy burn away delay. 0.0 = use default value" );
// <---sikk
// sikk---> Cyberdemon Damage Type
idCVar g_cyberdemonDamageType( "g_cyberdemonDamageType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "sets how the Cyberdemon can be damaged: 0 = Soul Cube only; 1 = All weapons" );
// <---sikk
// sikk---> Inter Rank Aggression
idCVar g_interRankAggression( "g_interRankAggression", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "sets whether enemies of the same rank will fight each other" );
// <---sikk
// sikk---> Zombie Resurrection
idCVar g_zombieResurrectionLimit( "g_zombieResurrectionLimit", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "sets the total number of times a zombie can resurrect. The chance for a zombie to resurrect is still randomized. 0 = Off" );
// <---sikk
// sikk---> Random Encounters System
idCVar g_useRandomEncounters( "g_useRandomEncounters", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "enables random encounters" );
idCVar g_randomEncountersMaxSpawns( "g_randomEncountersMaxSpawns", "5", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "number of random enemies that can be alive at one time" );
idCVar g_randomEncountersMinTime( "g_randomEncountersMinTime", "30", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "minimum time (in secs) to wait before spawning another random enemy" );
idCVar g_randomEncountersMaxTime( "g_randomEncountersMaxTime", "60", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "maximum time (in secs) to wait before spawning another random enemy" );
idCVar g_randomEncountersDormantTime( "g_randomEncountersDormantTime", "10", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "maximum time (in secs) a random enemy can be dormant before it is removed" );
// <---sikk
// sikk---> Thirdperson Camera
idCVar pm_thirdPersonOffset( "pm_thirdPersonOffset", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_ARCHIVE | CVAR_FLOAT, "camera offset from player in 3rd person (-n = left, +n = right)" );
// <---sikk
// sikk---> PostProcess Effects
idCVar r_useSoftShadows( "r_useSoftShadows", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable Soft Shadows postprocessing effect" );
idCVar r_softShadowsBlurFilter( "r_softShadowsBlurFilter", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Blur method used for the shadow mask:\n0 = No Filter\n1 = Box Filter\n2 = Poisson Filter\n3 = Gaussian Filter" );
idCVar r_softShadowsBlurScale( "r_softShadowsBlurScale", "8.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Sample offset scale for the blur filter" );
idCVar r_softShadowsBlurEpsilon( "r_softShadowsBlurEpsilon", "4.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the blur depth difference factor for the blur filter" );
idCVar r_useEdgeAA( "r_useEdgeAA", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Enable edge anti-aliasing: 0 = RGB edge AA; 1 = FXAA" );
idCVar r_edgeAASampleScale( "r_edgeAASampleScale", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the sample offset scale for edge detection" );
idCVar r_edgeAAFilterScale( "r_edgeAAFilterScale", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the filter offset scale for blurring" );
idCVar r_useHDR( "r_useHDR", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable High Dynamic Range lighting" );
idCVar r_hdrToneMapper( "r_hdrToneMapper", "4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Tone mapping method:\n0 = Reinhard (RGB)\n1 = Reinhard (Yxy)\n2 = Exponential\n3 = Filmic (simple)\n4 = Filmic (complex)" );
idCVar r_hdrAdaptationRate( "r_hdrAdaptationRate", "60.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Eye adaptation rate" );
idCVar r_hdrMiddleGray( "r_hdrMiddleGray", "0.18", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Middle gray value used in HDR tone mapping" );
idCVar r_hdrWhitePoint( "r_hdrWhitePoint", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Smallest luminance value that will be mapped to white" );
idCVar r_hdrBlueShiftFactor( "r_hdrBlueShiftFactor", "0.25", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Blue shift blend factor" );
idCVar r_hdrDither( "r_hdrDither", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable dithering" );
idCVar r_hdrDitherSize( "r_hdrDitherSize", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Sets the size of the dither threshold map" );
idCVar r_hdrLumThresholdMax( "r_hdrLumThresholdMax", "0.3", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Minimum luminance value threshold" );
idCVar r_hdrLumThresholdMin( "r_hdrLumThresholdMin", "0.2", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Maximum luminance value threshold" );
idCVar r_hdrBloomToneMapper( "r_hdrBloomToneMapper", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Tone mapping method, specific to bloom:\n0 = Reinhard (RGB)\n1 = Reinhard (Yxy)\n2 = Exponential\n3 = Filmic (simple)\n4 = Filmic (complex)" );
idCVar r_hdrBloomMiddleGray( "r_hdrBloomMiddleGray", "0.18", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Middle gray value used in HDR tone mapping, specific to bloom" );
idCVar r_hdrBloomWhitePoint( "r_hdrBloomWhitePoint", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Smallest luminance value that will be mapped to white, specific to bloom" );
idCVar r_hdrBloomThreshold( "r_hdrBloomThreshold", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Bloom luminance threshold" );
idCVar r_hdrBloomOffset( "r_hdrBloomOffset", "3.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Bloom luminance offset" );
idCVar r_hdrBloomScale( "r_hdrBloomScale", "2.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Intensity scale amount for bloom effect" );
idCVar r_hdrBloomSize( "r_hdrBloomSize", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Size of the bloom effect" );
idCVar r_hdrFlareGamma( "r_hdrFlareGamma", "100", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Gamma curve for the flare texture" );
idCVar r_hdrFlareScale( "r_hdrFlareScale", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Intensity scale amount for lens flare effect. 0 = Off" );
idCVar r_hdrFlareSize( "r_hdrFlareSize", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Size of the lens flare effect" );
idCVar r_hdrGlareStyle( "r_hdrGlareStyle", "10", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Glare style to use with HDR lighting. Value range: 0 - 11\n0 = Off\n1 = Natural\n2 = Star\n3 = Cross\n4 = Snow Cross\n5 = Horizontal\n6 = Vertical\n7 = Star (Spectral)\n8 = Cross (Spectral)\n9 = Snow Cross (Spectral)\n10 = Horizontal (Spectral)\n11 = Vertical (Spectral)" );
idCVar r_hdrGlareScale( "r_hdrGlareScale", "0.4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Intensity scale amount for glare effect" );
idCVar r_hdrGlareSize( "r_hdrGlareSize", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Size of the glare effect" );
idCVar r_useBloom( "r_useBloom", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable bloom postprocessing effect" );
idCVar r_bloomBufferSize( "r_bloomBufferSize", "3", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Bloom render target size:\n0 = 32x32\n1 = 64x64\n2 = 128x128\n3 = 256x256\n4 = 512x512\n5 = 1024x1024" );
idCVar r_bloomBlurIterations( "r_bloomBlurIterations", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Number of times the blur filter is applied" );
idCVar r_bloomBlurScaleX( "r_bloomBlurScaleX", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Amount to scale the X axis sample offsets" );
idCVar r_bloomBlurScaleY( "r_bloomBlurScaleY", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Amount to scale the Y axis sample offsets" );
idCVar r_bloomScale( "r_bloomScale", "1.5", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Amount to scale the intensity of the bloom effect" );
idCVar r_bloomGamma( "r_bloomGamma", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Gamma curve for the bloom texture" );
idCVar r_useSSIL( "r_useSSIL", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable Screen-Space Indirect Lighting postprocessing effect" );
idCVar r_ssilRadius( "r_ssilRadius", "128", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the sample radius for ssil" );
idCVar r_ssilAmount( "r_ssilAmount", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the contribution factor for ssil" );
idCVar r_ssilBlurMethod( "r_ssilBlurMethod", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Blur method used for the ssil buffer:\n0 = Gaussian\n1 = Bilateral" );
idCVar r_ssilBlurScale( "r_ssilBlurScale", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the blur scale for the ssil buffer" );
idCVar r_ssilBlurQuality( "r_ssilBlurQuality", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the blur quality for the ssil buffer" );
idCVar r_ssilBlurEpsilon( "r_ssilBlurEpsilon", "4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the blur depth difference factor for the ssil buffer" );
idCVar r_useSSAO( "r_useSSAO", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable Screen-Space Ambient Occlusion postprocessing effect" );
idCVar r_ssaoMethod( "r_ssaoMethod", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the ssao method:\n0 = Crytek\n1 = HDAO\n2 = ABAO\n3 = PBAO\n4 = HBAO (low)\n5 = HBAO (medium)\n6 = HBAO (high)\n7 = Ray Marching\n8 = Volumetric Obscurance" );
idCVar r_ssaoRadius( "r_ssaoRadius", "16", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the sample radius for ssao" );
idCVar r_ssaoBias( "r_ssaoBias", "0.075", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the angle bias for ssao (darkening factor for Crytek's)" );
idCVar r_ssaoAmount( "r_ssaoAmount", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the contribution factor for ssao" );
idCVar r_ssaoBlurMethod( "r_ssaoBlurMethod", "2", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Blur method used for the ssao buffer:\n0 = Crytek\n1 = Box\n2 = Gaussian\n3 = Bilateral" );
idCVar r_ssaoBlurScale( "r_ssaoBlurScale", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the blur scale for the ssao buffer" );
idCVar r_ssaoBlurQuality( "r_ssaoBlurQuality", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the blur quality for the ssao buffer" );
idCVar r_ssaoBlurEpsilon( "r_ssaoBlurEpsilon", "16", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the blur depth difference factor for the ssao buffer" );
idCVar r_ssaoBlendPower( "r_ssaoBlendPower", "3.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the blend exponent for the ssao to scene final combine" );
idCVar r_ssaoBlendScale( "r_ssaoBlendScale", "6.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the blend scale for the ssao to scene final combine" );
idCVar r_useSunShafts( "r_useSunShafts", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable Screen-Space Volumetric Lighting (Sun Shafts) postprocessing effect" );
idCVar r_sunShaftsSize( "r_sunShaftsSize", "16.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the sun shafts size" );
idCVar r_sunShaftsStrength( "r_sunShaftsStrength", "2.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the sun shafts strength" );
idCVar r_sunShaftsMaskStrength( "r_sunShaftsMaskStrength", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the sun shafts mask strength" );
idCVar r_sunShaftsQuality( "r_sunShaftsQuality", "4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the sun shafts quality" );
idCVar r_sunOriginX( "r_sunOriginX", "0.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the sun's origin along the X axis (used for sun shafts & lens flare)" );
idCVar r_sunOriginY( "r_sunOriginY", "0.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the sun's origin along the Y axis (used for sun shafts & lens flare)" );
idCVar r_sunOriginZ( "r_sunOriginZ", "0.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the sun's origin along the Z axis (used for sun shafts & lens flare)" );
idCVar r_useLensFlare( "r_useLensFlare", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable lens flare postprocessing effect" );
idCVar r_lensFlareStrength( "r_lensFlareStrength", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the lens flare strength" );
idCVar r_useDepthOfField( "r_useDepthOfField", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Enable depth of field postprocessing effect. Value range: 0 - 2 \n0 = Off\n1 = Automatic Focus\n2 = Manual Focus" );
idCVar r_dofBlurScale( "r_dofBlurScale", "4.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the blur scale for depth of field postprocessing effect" );
idCVar r_dofBlurQuality( "r_dofBlurQuality", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the blur quality for depth of field postprocessing effect:\n0 = Box Filter\n1 = Poisson Filter\n2 = Gaussian Filter\n3 = Bokeh!" );
idCVar r_dofNear( "r_dofNear", "-128", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the near distance for depth of field postprocessing effect (r_useDepthOfField = 2 only)" );
idCVar r_dofFar( "r_dofFar", "1024", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the far distance for depth of field postprocessing effect (r_useDepthOfField = 2 only)" );
idCVar r_dofFocus( "r_dofFocus", "128", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the focus distance for depth of field postprocessing effect (r_useDepthOfField = 2 only)" );
idCVar r_dofConditionAlways( "r_dofConditionAlways", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Depth of field condition: Always on" );
idCVar r_dofConditionCinematic( "r_dofConditionCinematic", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Depth of field condition: Cinematics" );
idCVar r_dofConditionGUI( "r_dofConditionGUI", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Depth of field condition: GUI Active" );
idCVar r_dofConditionReload( "r_dofConditionReload", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Depth of field condition: Reloading" );
idCVar r_dofConditionTalk( "r_dofConditionTalk", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Depth of field condition: Talking" );
idCVar r_dofConditionZoom( "r_dofConditionZoom", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Depth of field condition: Weapon Zoom" );
idCVar r_useMotionBlur( "r_useMotionBlur", "2", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Enable motion blur postprocessing effect.\n0 = off\n1 = Camera\n2 = Accumulation\n3 = Camera + Accumulation" );
idCVar r_motionBlurScale( "r_motionBlurScale", "0.1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the motion blur scale. Works similar to shutter speed. Higher values == stronger blurring" );
idCVar r_motionBlurMaskDistance( "r_motionBlurMaskDistance", "32", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Don't do motion blur if framerate is below this value" );
idCVar r_motionBlurFPSThreshold( "r_motionBlurFPSThreshold", "20", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the motion blur mask distance. Used to mask the view weapon." );
idCVar r_motionBlurMinThreshold( "r_motionBlurMinThreshold", "10", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the motion blur min sensitivity threshold. Screen won't blur until threshold is passed. Lower values == higher sensitivity" );
idCVar r_motionBlurMaxThreshold( "r_motionBlurMaxThreshold", "45", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the motion blur max sensitivity threshold. Blur strength won't pass threshold." );
idCVar r_motionBlurFactor( "r_motionBlurFactor", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the motion blur blend factor" );
idCVar r_motionBlurLerp( "r_motionBlurLerp", "0.5", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the motion blur blend lerp factor" );
idCVar r_motionBlurQuality( "r_motionBlurQuality", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the motion blur quality. Value range: 1 - 4\n1 = 8 samples\n2 = 64 samples (virtual)\n3 = 512 samples (virtual)\n4 = 4096 samples (virtual)" );
idCVar r_useColorGrading( "r_useColorGrading", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable color grading postprocessing effect. Parameters need to be set manually in the material." );
idCVar r_colorGradingParm( "r_colorGradingParm", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Parameter to allow specific color grading stage to be used in the material" );
idCVar r_colorGradingType( "r_colorGradingType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Color grading type:\n0 = math\n1 = lut" );
idCVar r_colorGradingSharpness( "r_colorGradingSharpness", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Sharpness level when color grading is enabled" );
idCVar r_useCelShading( "r_useCelShading", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable cel shading postprocessing effect" );
idCVar r_celShadingMethod( "r_celShadingMethod", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the cel shading edge detection method. Value range: 0 - 2 \n0 = RGB\n1 = Luminance\n2 = Depth(incomplete)" );
idCVar r_celShadingScale( "r_celShadingScale", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the cel shading scale. Higher values == thicker outline" );
idCVar r_celShadingThreshold( "r_celShadingThreshold", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the cel shading threshold" );
idCVar r_useFilmgrain( "r_useFilmgrain", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable filmgrain postprocessing effect" );
idCVar r_filmgrainBlendMode( "r_filmgrainBlendMode", "2", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "Set the grain blending mode. Value range: 0 - 3\n0 = gl_one, gl_one\n1 = gl_zero, gl_one_minus_src_color\n2 = gl_dst_color, gl_one\n3 = gl_one_minus_dst_color, gl_one" );
idCVar r_filmgrainScale( "r_filmgrainScale", "0.8", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the grain scale" );
idCVar r_filmgrainStrength( "r_filmgrainStrength", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the grain strength. Value range: 0.0 - 1.0" );
idCVar r_useVignetting( "r_useVignetting", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable vignetting postprocessing effect" );
// <---sikk
//GRIMM
idCVar g_useCheckpointing( "g_useCheckpointing", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable automatic saving of checkpoints" );
idCVar s_musicvolume_DB( "s_musicvolume_DB", "-2.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the music volume" );
idCVar g_breakables_lifetime( "g_breakables_lifetime", "4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "How long breakables last in the game before being removed." );
idCVar g_breakables_ranlifetime( "g_breakables_ranlifetime", "4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Random variation in waittime before breakables are removed from the game." );
idCVar g_gibs_lifetime( "g_gibs_lifetime", "4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "How long gibs last in the game before being removed, gibs make an extra strain on performance due to their decals." );
idCVar g_gibs_ranlifetime( "g_gibs_ranlifetime", "4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Random variation in waittime before gibs are removed from the game." );
idCVar jumping( "jumping", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_BOOL, "Used internally by Grimm" );
idCVar dashing( "dashing", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_BOOL, "Used internally by Grimm" );
idCVar hpack( "hpack", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_FLOAT, "Used internally by Grimm, changing value will break game, bugs will happen." );
idCVar g_UseClutter( "g_UseClutter", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Use clutter objects like cups, knives, forks, pots but also ground rubble." );
idCVar g_ClutterDensity( "g_ClutterDensity", "4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "The density to spawn clutter objects with. 0 = load no objects / 1 = very few objects / 8 = all objects" );
idCVar secrets( "secrets", "0", CVAR_GAME | CVAR_FLOAT, "Used internally by Grimm, changing value will break game, bugs will happen." );
idCVar secretsfound( "secretsfound", "0", CVAR_GAME | CVAR_FLOAT, "Used internally by Grimm, changing value will break game, bugs will happen." );
idCVar breakablesfound( "breakablesfound", "0", CVAR_GAME | CVAR_FLOAT, "Used internally by Grimm, changing value will break game, bugs will happen." );
idCVar breakables( "breakables", "0", CVAR_GAME | CVAR_FLOAT, "Used internally by Grimm, changing value will break game, bugs will happen." );
idCVar smash( "smash", "0", CVAR_GAME, "A highly secret function that you should never, EVER, bind a key to e.g. 'bind h smash 1' and use in-game!!!" );
idCVar g_ItemPickupFlash( "g_ItemPickupFlash", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Flash the screen with a color when you pick up an item" );
idCVar g_PickupFullItems( "g_PickupFullItems", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "When enabled, players can always pick up items. Beware, when the inventory is full then item will be picked up but not added!" );
idCVar r_screenresolution( "r_screenresolution", "2", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the screenresolution for Grimm, available options are 0-12 where 0=640x480 and 12=1920x1200" );
idCVar r_VisualFXPreset( "r_VisualFXPreset", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Visual and Post-FX Presets: 0=Sterile, 1=Vintage, 2=Vivid" );
idCVar g_MaximumGibs( "g_MaximumGibs", "16", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "No more than this amount of gibs are spawned at any time. Set to a low number to prevent slowdowns in big fights." );
idCVar g_MaximumBreakables( "g_MaximumBreakables", "30", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "No more than this amount of breakables are spawned at any time. Set to a low number to prevent slowdowns when breaking lots of stuff." );
idCVar g_decalStay( "g_decalStay", "4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "This amount of seconds is added to how long blooddecals usually stay." );
idCVar s_useEnvironmentalSounds( "s_useEnvironmentalSounds", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Set to 0 to disable torch sounds and other minor environment sounds." );
idCVar g_useShissleFX( "g_useShissleFX", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Set to 0 to disable shizzling effects on breakable shards and gibs." );
//idCVar ShowStats( "ShowStats", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_BOOL, "Show the stats onscreen" );
idCVar g_bulletstaytime( "g_bulletstaytime", "4", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "How many seconds 'sticky' projectiles stay in the world (e.g. stakes from the stingstaff)" );
idCVar g_useburnlights( "g_useburnlights", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Burning objects cast light (heavy on performance!)" );
idCVar g_usemodelragdolls( "g_usemodelragdolls", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable or disabe physics for ragdolls (e.g. skeletons and dead bodies)" );
idCVar g_PaintSplatterMode( "g_PaintSplatterMode", "0", CVAR_GAME | CVAR_BOOL, "Enable or disabe painting mode, use in conjunction with saveDecals and grimm_spray entities." );
idCVar g_UseDynamicPaint( "g_UseDynamicPaint", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable or disabe paint in the world." );
//idCVar g_UseDynamicMoveableSounds( "g_UseDynamicMoveableSounds", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable or disabe paint in the world." );
//GRIMM

View file

@ -254,4 +254,272 @@ extern const char *si_gameTypeArgs[];
extern const char *ui_skinArgs[]; extern const char *ui_skinArgs[];
// sikk - New Cvars -
//-------------------------------------------------
// sikk---> Crosshair Cvars
extern idCVar g_crosshair;
extern idCVar g_crosshairType;
extern idCVar g_crosshairLerp;
// <---sikk
// sikk---> Hud management
extern idCVar g_hudType;
extern idCVar g_useDynamicHud;
extern idCVar g_dynamicHudTime;
// <---sikk
// sikk---> IR Goggles/Headlight Mod
extern idCVar g_goggleType;
extern idCVar g_batteryLife;
extern idCVar g_batteryRechargeRate;
// <---sikk
// sikk---> Global Ambient Light
extern idCVar g_useAmbientLight;
extern idCVar g_ambientLightRadius;
extern idCVar g_ambientLightColor;
// <---sikk
// sikk---> Explosion FX
extern idCVar g_useExplosionFX;
extern idCVar g_explosionFXTime;
extern idCVar g_explosionFXScale;
// <---sikk
// sikk---> Blood Spray Screen Effect
extern idCVar g_showBloodSpray;
extern idCVar g_bloodSprayTime;
extern idCVar g_bloodSprayDistance;
extern idCVar g_bloodSprayFrequency;
// <---sikk
extern idCVar g_screenFrostTime; // sikk - Screen Frost
extern idCVar g_tracerFrequency; // sikk - Tracer Frequency
extern idCVar g_playerHeadType; // sikk - Player Head Type
extern idCVar g_showFirstPersonBody; // sikk - First Person Body
extern idCVar g_enablePortalSky; // sikk - Portal Sky Box
// sikk---> Health Management System
extern idCVar g_healthManagementType;
extern idCVar g_healthPackTotal;
extern idCVar g_healthPackUses;
extern idCVar g_healthPackTime;
extern idCVar g_healthRegenTime;
extern idCVar g_healthRegenDelay;
extern idCVar g_healthRegenAmt;
extern idCVar g_healthRegenLimit;
extern idCVar g_healthRegenSteps;
extern idCVar g_healthRegenFeedback;
// <---sikk
// sikk---> Item Management
extern idCVar g_itemPickupType;
extern idCVar g_itemMaxArmorType;
extern idCVar g_itemHelmetFactor;
extern idCVar g_itemValueFactor;
extern idCVar g_itemRemovalFactor;
extern idCVar g_itemSearchFactor;
// <---sikk
// sikk---> Ammo Management
extern idCVar g_ammoCapacityType;
extern idCVar g_ammoClipSizeType;
extern idCVar g_ammoUsageType;
// <---sikk
// sikk---> Weapon Management
extern idCVar g_weaponAwareness;
extern idCVar g_weaponHandlingType;
extern idCVar g_weaponProjectileOrigin;
// <---sikk
extern idCVar g_grabMode; // sikk - Object Manipulation
extern idCVar g_disableFallDamage; // sikk - Disable Fall Damage
extern idCVar g_damageType; // sikk - Damage Type
extern idCVar g_damageZoneType; // sikk - Locational Damage Type
// sikk---> Enemy Health Management
extern idCVar g_enemyHealthType;
extern idCVar g_enemyHealthScale;
extern idCVar g_enemyHealthRandom;
// <---sikk
extern idCVar g_enemySpectreFactor; // sikk - Spectre Factor
extern idCVar g_enemyPainElementalFactor; // sikk - Pain Elemental Factor
extern idCVar g_enemyBaronFactor; // sikk - Baron of Hell Factor
extern idCVar g_burnAwayDelay; // sikk - Monster Burn Away Delay
extern idCVar g_cyberdemonDamageType; // sikk - Cyberdemon Damage Type
extern idCVar g_interRankAggression; // sikk - Inter Rank Aggression
extern idCVar g_zombieResurrectionLimit; // sikk - Zombie Resurrection
// sikk---> Random Encounters System
extern idCVar g_useRandomEncounters;
extern idCVar g_randomEncountersMaxSpawns;
extern idCVar g_randomEncountersMinTime;
extern idCVar g_randomEncountersMaxTime;
extern idCVar g_randomEncountersDormantTime;
// <---sikk
extern idCVar pm_thirdPersonOffset; // sikk - Thirdpesron Camera
// sikk---> PostProcess Effects
extern idCVar r_useSoftShadows;
extern idCVar r_softShadowsBlurFilter;
extern idCVar r_softShadowsBlurScale;
extern idCVar r_softShadowsBlurEpsilon;
extern idCVar r_useEdgeAA;
extern idCVar r_edgeAASampleScale;
extern idCVar r_edgeAAFilterScale;
extern idCVar r_useHDR;
extern idCVar r_hdrToneMapper;
extern idCVar r_hdrAdaptationRate;
extern idCVar r_hdrMiddleGray;
extern idCVar r_hdrWhitePoint;
extern idCVar r_hdrBlueShiftFactor;
extern idCVar r_hdrDither;
extern idCVar r_hdrDitherSize;
extern idCVar r_hdrLumThresholdMax;
extern idCVar r_hdrLumThresholdMin;
extern idCVar r_hdrBloomToneMapper;
extern idCVar r_hdrBloomMiddleGray;
extern idCVar r_hdrBloomWhitePoint;
extern idCVar r_hdrBloomThreshold;
extern idCVar r_hdrBloomOffset;
extern idCVar r_hdrBloomScale;
extern idCVar r_hdrBloomSize;
extern idCVar r_hdrFlareGamma;
extern idCVar r_hdrFlareScale;
extern idCVar r_hdrFlareSize;
extern idCVar r_hdrGlareStyle;
extern idCVar r_hdrGlareScale;
extern idCVar r_hdrGlareSize;
extern idCVar r_useBloom;
extern idCVar r_bloomBufferSize;
extern idCVar r_bloomBlurIterations;
extern idCVar r_bloomBlurScaleX;
extern idCVar r_bloomBlurScaleY;
extern idCVar r_bloomScale;
extern idCVar r_bloomGamma;
extern idCVar r_useSSIL;
extern idCVar r_ssilRadius;
extern idCVar r_ssilAmount;
extern idCVar r_ssilBlurMethod;
extern idCVar r_ssilBlurScale;
extern idCVar r_ssilBlurQuality;
extern idCVar r_ssilBlurEpsilon;
extern idCVar r_useSSAO;
extern idCVar r_ssaoMethod;
extern idCVar r_ssaoRadius;
extern idCVar r_ssaoAmount;
extern idCVar r_ssaoBias;
extern idCVar r_ssaoBlurMethod;
extern idCVar r_ssaoBlurScale;
extern idCVar r_ssaoBlurQuality;
extern idCVar r_ssaoBlurEpsilon;
extern idCVar r_ssaoBlendPower;
extern idCVar r_ssaoBlendScale;
extern idCVar r_useSunShafts;
extern idCVar r_sunShaftsSize;
extern idCVar r_sunShaftsStrength;
extern idCVar r_sunShaftsMaskStrength;
extern idCVar r_sunShaftsQuality;
extern idCVar r_sunOriginX;
extern idCVar r_sunOriginY;
extern idCVar r_sunOriginZ;
extern idCVar r_useLensFlare;
extern idCVar r_lensFlareStrength;
extern idCVar r_useMotionBlur;
extern idCVar r_motionBlurScale;
extern idCVar r_motionBlurMaskDistance;
extern idCVar r_motionBlurFPSThreshold;
extern idCVar r_motionBlurMinThreshold;
extern idCVar r_motionBlurMaxThreshold;
extern idCVar r_motionBlurFactor;
extern idCVar r_motionBlurLerp;
extern idCVar r_motionBlurQuality;
extern idCVar r_useDepthOfField;
extern idCVar r_dofBlurScale;
extern idCVar r_dofBlurQuality;
extern idCVar r_dofNear;
extern idCVar r_dofFar;
extern idCVar r_dofFocus;
extern idCVar r_dofConditionAlways;
extern idCVar r_dofConditionCinematic;
extern idCVar r_dofConditionGUI;
extern idCVar r_dofConditionTalk;
extern idCVar r_dofConditionReload;
extern idCVar r_dofConditionZoom;
extern idCVar r_useColorGrading;
extern idCVar r_colorGradingParm;
extern idCVar r_colorGradingType;
extern idCVar r_colorGradingSharpness;
extern idCVar r_useCelShading;
extern idCVar r_celShadingMethod;
extern idCVar r_celShadingScale;
extern idCVar r_celShadingThreshold;
extern idCVar r_useFilmgrain;
extern idCVar r_filmgrainBlendMode;
extern idCVar r_filmgrainScale;
extern idCVar r_filmgrainStrength;
extern idCVar r_useVignetting; // <---sikk
//GRIMM
extern idCVar g_useCheckpointing;
extern idCVar s_musicvolume_DB;
extern idCVar jumping;
extern idCVar dashing;
extern idCVar hpack;
extern idCVar g_UseClutter;
extern idCVar g_ClutterDensity;
extern idCVar secrets;
extern idCVar secretsfound;
extern idCVar breakablesfound;
extern idCVar breakables;
extern idCVar smash;
extern idCVar g_breakables_lifetime;
extern idCVar g_breakables_ranlifetime;
extern idCVar g_gibs_lifetime;
extern idCVar g_gibs_ranlifetime;
extern idCVar g_trapskill;
extern idCVar g_ItemPickupFlash;
extern idCVar g_PickupFullItems;
extern idCVar r_screenresolution;
extern idCVar r_VisualFXPreset;
extern idCVar g_MaximumGibs;
extern idCVar g_MaximumBreakables;
extern idCVar g_decalStay;
extern idCVar s_useEnvironmentalSounds;
extern idCVar g_useShissleFX;
extern idCVar ShowStats;
extern idCVar g_bulletstaytime;
extern idCVar g_useburnlights;
extern idCVar g_usemodelragdolls;
extern idCVar g_PaintSplatterMode;
extern idCVar g_UseDynamicPaint;
#endif /* !__SYS_CVAR_H__ */ #endif /* !__SYS_CVAR_H__ */

153
game/physics/Force_Grab.cpp Normal file
View file

@ -0,0 +1,153 @@
// sikk---> Object Manipulation
#include "../../idlib/precompiled.h"
#pragma hdrstop
#include "../Game_local.h"
CLASS_DECLARATION( idForce, idForce_Grab )
END_CLASS
/*
================
idForce_Grab::Save
================
*/
void idForce_Grab::Save( idSaveGame *savefile ) const {
savefile->WriteFloat( damping );
savefile->WriteVec3( goalPosition );
savefile->WriteFloat( distanceToGoal );
savefile->WriteInt( id );
}
/*
================
idForce_Grab::Restore
================
*/
void idForce_Grab::Restore( idRestoreGame *savefile ) {
//Note: Owner needs to call set physics
savefile->ReadFloat( damping );
savefile->ReadVec3( goalPosition );
savefile->ReadFloat( distanceToGoal );
savefile->ReadInt( id );
}
/*
================
idForce_Grab::idForce_Grab
================
*/
idForce_Grab::idForce_Grab( void ) {
damping = 0.5f;
physics = NULL;
id = 0;
}
/*
================
idForce_Grab::~idForce_Grab
================
*/
idForce_Grab::~idForce_Grab( void ) {
}
/*
================
idForce_Grab::Init
================
*/
void idForce_Grab::Init( float damping ) {
if ( damping >= 0.0f && damping < 1.0f ) {
this->damping = damping;
}
}
/*
================
idForce_Grab::SetPhysics
================
*/
void idForce_Grab::SetPhysics( idPhysics *phys, int id, const idVec3 &goal ) {
this->physics = phys;
this->id = id;
this->goalPosition = goal;
}
/*
================
idForce_Grab::SetGoalPosition
================
*/
void idForce_Grab::SetGoalPosition( const idVec3 &goal ) {
this->goalPosition = goal;
}
/*
=================
idForce_Grab::GetDistanceToGoal
=================
*/
float idForce_Grab::GetDistanceToGoal( void ) {
return distanceToGoal;
}
/*
================
idForce_Grab::Evaluate
================
*/
void idForce_Grab::Evaluate( int time ) {
if ( !physics )
return;
idVec3 forceDir, v, objectCenter;
float forceAmt;
float mass = physics->GetMass( id );
objectCenter = physics->GetAbsBounds( id ).GetCenter();
forceDir = goalPosition - objectCenter;
distanceToGoal = forceDir.Normalize();
float temp = distanceToGoal;
if ( temp > 12.0f && temp < 32.0f ) {
temp = 32.0f;
}
forceAmt = ( 1000.0f * mass ) + ( 500.0f * temp * mass );
if ( forceAmt / mass > 120000.0f ) {
forceAmt = 120000.0f * mass;
}
physics->AddForce( id, objectCenter, forceDir * forceAmt );
if ( distanceToGoal < 128.0f ) {
v = physics->GetLinearVelocity( id );
if ( distanceToGoal <= 1.0f )
physics->SetLinearVelocity( vec3_origin, id );
else
physics->SetLinearVelocity( v * damping, id );
}
physics->SetAngularVelocity( vec3_origin, id );
//if ( distanceToGoal < 16.0f ) {
// v = physics->GetAngularVelocity( id );
// if ( v.LengthSqr() > Square( 8 ) ) {
// physics->SetAngularVelocity( v * 0.99999f, id );
// }
//}
}
/*
================
idForce_Grab::RemovePhysics
================
*/
void idForce_Grab::RemovePhysics( const idPhysics *phys ) {
if ( physics == phys ) {
physics = NULL;
}
}
// <---sikk

54
game/physics/Force_Grab.h Normal file
View file

@ -0,0 +1,54 @@
// sikk---> Object Manipulation
#ifndef __FORCE_GRAB_H__
#define __FORCE_GRAB_H__
/*
===============================================================================
Drag force
===============================================================================
*/
class idForce_Grab : public idForce {
public:
CLASS_PROTOTYPE( idForce_Grab );
void Save( idSaveGame *savefile ) const;
void Restore( idRestoreGame *savefile );
idForce_Grab( void );
virtual ~idForce_Grab( void );
// initialize the drag force
void Init( float damping );
// set physics object being dragged
void SetPhysics( idPhysics *physics, int id, const idVec3 &goal );
// update the goal position
void SetGoalPosition( const idVec3 &goal );
public: // common force interface
virtual void Evaluate( int time );
virtual void RemovePhysics( const idPhysics *phys );
// Get the distance from object to goal position
float GetDistanceToGoal( void );
private:
// properties
float damping;
idVec3 goalPosition;
float distanceToGoal;
// positioning
idPhysics * physics; // physics object
int id; // clip model id of physics object
};
#endif /* !__FORCE_GRAB_H__ */
// <---sikk

View file

@ -1174,20 +1174,20 @@ float idPush::ClipTranslationalPush( trace_t &results, idEntity *pusher, const i
// if blocking entities should be crushed // if blocking entities should be crushed
if ( flags & PUSHFL_CRUSH ) { if ( flags & PUSHFL_CRUSH ) {
check->Damage( clipModel->GetEntity(), clipModel->GetEntity(), vec3_origin, "damage_crush", 1.0f, CLIPMODEL_ID_TO_JOINT_HANDLE( pushResults.c.id ) ); check->Damage( clipModel->GetEntity(), clipModel->GetEntity(), vec3_origin, "damage_fatal", 1.0f, CLIPMODEL_ID_TO_JOINT_HANDLE( pushResults.c.id ) );
continue; continue;
} }
// if the entity is an active articulated figure and gibs // if the entity is an active articulated figure and gibs
if ( check->IsType( idAFEntity_Base::Type ) && check->spawnArgs.GetBool( "gib" ) ) { if ( check->IsType( idAFEntity_Base::Type ) && check->spawnArgs.GetBool( "gib" ) ) {
if ( static_cast<idAFEntity_Base *>(check)->IsActiveAF() ) { if ( static_cast<idAFEntity_Base *>(check)->IsActiveAF() ) {
check->ProcessEvent( &EV_Gib, "damage_Gib" ); check->ProcessEvent( &EV_Gib, "damage_fatal_suicide" );
} }
} }
// if the entity is a moveable item and gibs // if the entity is a moveable item and gibs
if ( check->IsType( idMoveableItem::Type ) && check->spawnArgs.GetBool( "gib" ) ) { if ( check->IsType( idMoveableItem::Type ) && check->spawnArgs.GetBool( "gib" ) ) {
check->ProcessEvent( &EV_Gib, "damage_Gib" ); check->ProcessEvent( &EV_Gib, "damage_fatal_suicide" );
} }
// blocked // blocked
@ -1344,14 +1344,14 @@ float idPush::ClipRotationalPush( trace_t &results, idEntity *pusher, const int
// if blocking entities should be crushed // if blocking entities should be crushed
if ( flags & PUSHFL_CRUSH ) { if ( flags & PUSHFL_CRUSH ) {
check->Damage( clipModel->GetEntity(), clipModel->GetEntity(), vec3_origin, "damage_crush", 1.0f, CLIPMODEL_ID_TO_JOINT_HANDLE( pushResults.c.id ) ); check->Damage( clipModel->GetEntity(), clipModel->GetEntity(), vec3_origin, "damage_fatal_suicide", 1.0f, CLIPMODEL_ID_TO_JOINT_HANDLE( pushResults.c.id ) );
continue; continue;
} }
// if the entity is an active articulated figure and gibs // if the entity is an active articulated figure and gibs
if ( check->IsType( idAFEntity_Base::Type ) && check->spawnArgs.GetBool( "gib" ) ) { if ( check->IsType( idAFEntity_Base::Type ) && check->spawnArgs.GetBool( "gib" ) ) {
if ( static_cast<idAFEntity_Base *>(check)->IsActiveAF() ) { if ( static_cast<idAFEntity_Base *>(check)->IsActiveAF() ) {
check->ProcessEvent( &EV_Gib, "damage_Gib" ); check->ProcessEvent( &EV_Gib, "damage_fatal_suicide" );
} }
} }

View file

@ -114,6 +114,14 @@ const idEventDef EV_Thread_DebugBounds( "debugBounds", "vvvf" );
const idEventDef EV_Thread_DrawText( "drawText", "svfvdf" ); const idEventDef EV_Thread_DrawText( "drawText", "svfvdf" );
const idEventDef EV_Thread_InfluenceActive( "influenceActive", NULL, 'd' ); const idEventDef EV_Thread_InfluenceActive( "influenceActive", NULL, 'd' );
// grimm -->
const idEventDef EV_Thread_ExecCMD( "ExecCMD", "s" );
const idEventDef EV_Thread_Tip( "Tip", "s" );
const idEventDef EV_Thread_GetPlayer( "GetPlayer", NULL, 'e' );
const idEventDef EV_Thread_SetSoundSlowmo( "soundSlowmo", "f" );
const idEventDef EV_Thread_SetSoundSlowmoSpeed( "setSlowmoSpeed", "f" );
// <-- grimm
CLASS_DECLARATION( idClass, idThread ) CLASS_DECLARATION( idClass, idThread )
EVENT( EV_Thread_Execute, idThread::Event_Execute ) EVENT( EV_Thread_Execute, idThread::Event_Execute )
EVENT( EV_Thread_TerminateThread, idThread::Event_TerminateThread ) EVENT( EV_Thread_TerminateThread, idThread::Event_TerminateThread )
@ -193,6 +201,14 @@ CLASS_DECLARATION( idClass, idThread )
EVENT( EV_Thread_DebugBounds, idThread::Event_DebugBounds ) EVENT( EV_Thread_DebugBounds, idThread::Event_DebugBounds )
EVENT( EV_Thread_DrawText, idThread::Event_DrawText ) EVENT( EV_Thread_DrawText, idThread::Event_DrawText )
EVENT( EV_Thread_InfluenceActive, idThread::Event_InfluenceActive ) EVENT( EV_Thread_InfluenceActive, idThread::Event_InfluenceActive )
// grimm -->
EVENT( EV_Thread_ExecCMD, idThread::Event_ExecCMD )
EVENT( EV_Thread_Tip, idThread::Event_Tip )
EVENT( EV_Thread_GetPlayer, idThread::Event_GetPlayer )
EVENT( EV_Thread_SetSoundSlowmo, idThread::Event_SetSlomoSound )
EVENT( EV_Thread_SetSoundSlowmoSpeed, idThread::Event_SetSlomoSpeed )
// <-- grimm
END_CLASS END_CLASS
idThread *idThread::currentThread = NULL; idThread *idThread::currentThread = NULL;
@ -1841,3 +1857,90 @@ void idThread::Event_InfluenceActive( void ) {
idThread::ReturnInt( false ); idThread::ReturnInt( false );
} }
} }
// grimm -->
/*
================
idThread::ExecCMD
================
*/
void idThread::Event_ExecCMD( const char *text ) {
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, text );
}
/*
================
idThread::Tip
================
*/
void idThread::Event_Tip( const char *message ) {
idPlayer *player = gameLocal.GetLocalPlayer();
if ( player ) {
player->ShowTip( "", message, true );
}
}
/*
================
idThread::GetPlayer
================
*/
void idThread::Event_GetPlayer( void ) {
idPlayer *player = gameLocal.GetLocalPlayer();
if ( player ) {
ReturnEntity( player ) ;
} else {
ReturnEntity( ( idEntity * )NULL );
}
}
/*
=================
idThread::Event_SetSlomoSound( float son );
=================
*/
void idThread::Event_SetSlomoSound( float son ) {
if ( gameSoundWorld && son > 0.0f ) {
gameSoundWorld->SetSlowmo( true );
//gameSoundWorld->SetSlowmoSpeed( 0.8f );
}
if ( gameSoundWorld && son == 0.0f ) {
gameSoundWorld->SetSlowmo( false );
//gameSoundWorld->SetSlowmoSpeed( 1.0f );
}
}
/*
=================
idThread::Event_SetSlomoSpeed( float speed );;
=================
*/
void idThread::Event_SetSlomoSpeed( float speed ) {
if ( !gameSoundWorld ) {
return;
}
if ( speed > 0.0f && speed < 1.0f ) {
gameSoundWorld->SetSlowmoSpeed( speed );
} else {
// the value must be between 0 and 1 so set it to something default.
if ( speed < 0.5f ) {
gameSoundWorld->SetSlowmoSpeed( 0.7f );
}
if ( speed == 1 ) {
gameSoundWorld->SetSlowmoSpeed( 0.99f );
}
}
}
// <-- grimm

View file

@ -78,6 +78,15 @@ extern const idEventDef EV_Thread_FadeOut;
extern const idEventDef EV_Thread_FadeTo; extern const idEventDef EV_Thread_FadeTo;
extern const idEventDef EV_Thread_Restart; extern const idEventDef EV_Thread_Restart;
// grimm -->
extern const idEventDef EV_Thread_ExecCMD;
extern const idEventDef EV_Thread_Tip;
extern const idEventDef EV_Thread_GetPlayer;
extern const idEventDef EV_Thread_SetSoundSlowmo;
extern const idEventDef EV_Thread_SetSoundSlowmoSpeed;
// <-- grimm
class idThread : public idClass { class idThread : public idClass {
private: private:
static idThread *currentThread; static idThread *currentThread;
@ -188,6 +197,14 @@ private:
void Event_DrawText( const char *text, const idVec3 &origin, float scale, const idVec3 &color, const int align, const float lifetime ); void Event_DrawText( const char *text, const idVec3 &origin, float scale, const idVec3 &color, const int align, const float lifetime );
void Event_InfluenceActive( void ); void Event_InfluenceActive( void );
// grimm -->
void Event_ExecCMD( const char *text );
void Event_Tip( const char *message );
void Event_GetPlayer( void );
void Event_SetSlomoSound( float son );
void Event_SetSlomoSpeed( float speed );
// <-- grimm
public: public:
CLASS_PROTOTYPE( idThread ); CLASS_PROTOTYPE( idThread );