Sikkmod v1.1 (game/ only)

This commit is contained in:
Daniel Gibson 2024-06-21 02:14:08 +02:00
parent ba6ba086b2
commit e4f953b523
35 changed files with 4794 additions and 390 deletions

View file

@ -965,6 +965,7 @@ idAFEntity_Gibbable::idAFEntity_Gibbable( void ) {
skeletonModel = NULL;
skeletonModelDefHandle = -1;
gibbed = false;
searchable = false; // sikk - Searchable Corpses
}
/*
@ -987,6 +988,8 @@ idAFEntity_Gibbable::Save
void idAFEntity_Gibbable::Save( idSaveGame *savefile ) const {
savefile->WriteBool( gibbed );
savefile->WriteBool( combatModel != NULL );
savefile->WriteBool( searchable ); // sikk - Searchable Corpses
}
/*
@ -1000,6 +1003,8 @@ void idAFEntity_Gibbable::Restore( idRestoreGame *savefile ) {
savefile->ReadBool( gibbed );
savefile->ReadBool( hasCombatModel );
savefile->ReadBool( searchable ); // sikk - Searchable Corpses
InitSkeletonModel();
if ( hasCombatModel ) {
@ -1017,6 +1022,8 @@ void idAFEntity_Gibbable::Spawn( void ) {
InitSkeletonModel();
gibbed = false;
spawnArgs.GetBool( "searchable", "0", searchable ); // sikk - Searchable Corpses
}
/*
@ -1173,14 +1180,19 @@ void idAFEntity_Gibbable::Gib( const idVec3 &dir, const char *damageDefName ) {
UnlinkCombat();
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 );
SpawnGibs( dir, damageDefName );
renderEntity.noShadow = true;
renderEntity.shaderParms[ SHADERPARM_TIME_OF_DEATH ] = gameLocal.time * 0.001f;
StartSound( "snd_gibbed", SND_CHANNEL_ANY, 0, false, NULL );
gibbed = true;
}
// }
} else {
gibbed = true;
}

View file

@ -228,6 +228,11 @@ public:
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 );
// sikk---> Searchable Corpses
bool searchable;
bool IsGibbed( void ) { return gibbed; };
// <---sikk
protected:
idRenderModel * skeletonModel;
int skeletonModelDefHandle;

View file

@ -625,7 +625,7 @@ void idActor::Spawn( void ) {
}
}
finalBoss = spawnArgs.GetBool( "finalBoss" );
finalBoss = g_cyberdemonDamageType.GetBool() ? false : spawnArgs.GetBool( "finalBoss" ); // sikk - Cyberdemon Damage Type
FinishSetup();
}
@ -2179,7 +2179,13 @@ void idActor::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir
gameLocal.Error( "Unknown damageDef '%s'", damageDefName );
}
int damage = damageDef->GetInt( "damage" ) * damageScale;
// sikk---> Ammo Management: Custom Ammo Damage
int damage;
if ( g_ammoDamageType.GetBool() && damageDef->GetInt( "custom_damage" ) )
damage = damageDef->GetInt( "custom_damage" ) * damageScale;
else
damage = damageDef->GetInt( "damage" ) * damageScale;
// <---sikk
damage = GetDamageForLocation( damage, location );
// inform the attacker that they hit someone

View file

@ -2998,7 +2998,13 @@ void idEntity::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &di
gameLocal.Error( "Unknown damageDef '%s'\n", damageDefName );
}
int damage = damageDef->GetInt( "damage" );
// sikk---> Ammo Management: Custom Ammo Damage
int damage;
if ( g_ammoDamageType.GetBool() && damageDef->GetInt( "custom_damage" ) )
damage = damageDef->GetInt( "custom_damage" );
else
damage = damageDef->GetInt( "damage" );
// <---sikk
// inform the attacker that they hit someone
attacker->DamageFeedback( this, inflictor, damage );

View file

@ -509,6 +509,9 @@ void idEntityFx::Run( int time ) {
useAction->renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = -MS2SEC( time );
useAction->renderEntity.shaderParms[3] = 1.0f;
useAction->renderEntity.shaderParms[5] = 0.0f;
useAction->renderEntity.suppressSurfaceInViewID = -8; // sikk - depth render
if ( useAction->renderEntity.hModel ) {
useAction->renderEntity.bounds = useAction->renderEntity.hModel->Bounds( &useAction->renderEntity );
}
@ -593,6 +596,9 @@ void idEntityFx::Spawn( void ) {
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();
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
}
/*
@ -576,10 +590,22 @@ void idGameLocal::SaveGame( idFile *f ) {
savegame.WriteVec3( gravity );
// gamestate
savegame.WriteBool( influenceActive );
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
// initialSpots
// currentInitialSpot
@ -938,6 +964,20 @@ void idGameLocal::LoadMap( const char *mapName, int randseed ) {
playerPVS.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
for( i = 0; i < aasNames.Num(); i++ ) {
aasList[ i ]->Init( idStr( mapFileName ).SetFileExtension( aasNames[ i ] ).c_str(), mapFile->GetGeometryCRC() );
@ -1430,6 +1470,22 @@ bool idGameLocal::InitFromSaveGame( const char *mapName, idRenderWorld *renderWo
savegame.ReadBool( influenceActive );
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
// initialSpots
// currentInitialSpot
@ -2040,6 +2096,26 @@ void idGameLocal::SetupPlayerPVS( void ) {
pvs.FreeCurrentPVS( otherPVS );
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
}
}
@ -2247,7 +2323,7 @@ gameReturn_t idGameLocal::RunFrame( const usercmd_t *clientCmds ) {
gameRenderWorld->SetRenderView( view );
}
}
// clear any debug lines from a previous frame
gameRenderWorld->DebugClearLines( time );
@ -3171,10 +3247,24 @@ bool idGameLocal::InhibitEntitySpawn( idDict &spawnArgs ) {
}
const char *name;
if ( g_skill.GetInteger() == 3 ) {
if ( g_skill.GetInteger() == 3 || g_healthManagementType.GetInteger() == 2 ) { // sikk - Health Management System (Health Regen) - inhibit medkits when using health regen
name = spawnArgs.GetString( "classname" );
if ( idStr::Icmp( name, "item_medkit" ) == 0 || idStr::Icmp( name, "item_medkit_small" ) == 0 ) {
result = true;
// sikk---> Health Management System (Health Regen)
// if medkit has a target, replace it with an adrenaline - This should be done in Nightmare difficulty as well
if ( spawnArgs.GetString( "target" ) != "" ) {
idEntity *ent;
idDict args;
args.Set( "classname", "powerup_adrenaline" );
// args.Set( "name", spawnArgs.GetString( "name" ) );
args.Set( "target", spawnArgs.GetString( "target" ) );
args.Set( "origin", spawnArgs.GetString( "origin" ) );
args.Set( "rotation", spawnArgs.GetString( "rotation" ) );
gameLocal.SpawnEntityDef( args, &ent );
}
// <---sikk
}
}
@ -3609,6 +3699,13 @@ void idGameLocal::RadiusDamage( const idVec3 &origin, idEntity *inflictor, idEnt
radius = 1;
}
// sikk---> Explosion FX PostProcess
explosionOrigin = origin;
explosionRadius = radius;
explosionDamage = damage;
explosionTime = time + g_explosionFXTime.GetInteger() * 1000;
// <---sikk
bounds = idBounds( origin ).Expand( radius );
// get all entities touching the bounds
@ -4409,3 +4506,255 @@ idGameLocal::GetMapLoadingGUI
===============
*/
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;
idStr mapscript = world->spawnArgs.GetString( "call" );
// we don't want random spawns in first or last level
if ( mapscript == "map_hellhole::main" || mapscript == "map_marscity1::main" )
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, enemyAreaNum;
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 ( mapscript == "map_hell1::main" && ( 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 ( mapscript == "map_hell1::main" && ( num == 1 || num == 31 || num == 41 ) ) {
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 41: name = "skins/models/monsters/a_hk_branded"; break;
default: name = ""; break;
}
return name;
}// <---sikk

View file

@ -294,6 +294,34 @@ public:
idEntityPtr<idEntity> lastGUIEnt; // last entity with a GUI, used by Cmd_NextGUI_f
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 -------------------
idGameLocal();
@ -657,3 +685,23 @@ extern const idVec3 DEFAULT_GRAVITY_VEC3;
extern const int CINEMATIC_SKIP_DELAY;
#endif /* !__GAME_LOCAL_H__ */
#if 0 // TODO: DG: ???
#include "physics/Force.h"
#include "physics/Force_Constant.h"
#include "physics/Force_Drag.h"
#include "physics/Force_Grab.h" // sikk - Object Manipulation
#include "physics/Force_Field.h"
#include "physics/Force_Spring.h"
#include "physics/Physics.h"
#include "physics/Physics_AF.h"
#include "SmokeParticles.h"
#include "Entity.h"
#include "GameEdit.h"
#include "Grab.h" // sikk - Object Manipulation
#include "AF.h"
#include "IK.h"
#include "AFEntity.h"
#endif // 0

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,9 @@ idItem::idItem() {
orgOrigin.Zero();
canPickUp = true;
fl.networkSync = true;
removeable = true; // sikk - Item Management: Random Item Removal
noPickup = false; // sikk - Item Management: Manual Item Pickup
}
/*
@ -108,6 +111,8 @@ void idItem::Save( idSaveGame *savefile ) const {
savefile->WriteInt( inViewTime );
savefile->WriteInt( lastCycle );
savefile->WriteInt( lastRenderViewTime );
savefile->WriteBool( removeable ); // sikk - Item Management: Random Item Removal
}
/*
@ -129,6 +134,8 @@ void idItem::Restore( idRestoreGame *savefile ) {
savefile->ReadInt( lastCycle );
savefile->ReadInt( lastRenderViewTime );
savefile->ReadBool( removeable ); // sikk - Item Management: Random Item Removal
itemShellHandle = -1;
}
@ -266,6 +273,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
@ -317,6 +337,48 @@ void idItem::Spawn( void ) {
lastCycle = -1;
itemShellHandle = -1;
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---> Item Management: Random Item Removal
if ( g_itemRemovalFactor.GetFloat() && ( spawnArgs.GetBool( "removeable", "0" ) && removeable ) ) {
if ( ( gameLocal.random.RandomFloat() <= g_itemRemovalFactor.GetFloat() ) && spawnArgs.GetString( "target" ) == "" )
PostEventMS( &EV_Remove, 0 );
else
removeable = false;
}
// <---sikk
}
/*
@ -346,6 +408,11 @@ bool idItem::GiveToPlayer( idPlayer *player ) {
return false;
}
// sikk---> Item Management: Manual Item Pickup
if ( noPickup )
return false;
// <---sikk
if ( spawnArgs.GetBool( "inv_carry" ) ) {
return player->GiveInventoryItem( &spawnArgs );
}
@ -408,6 +475,8 @@ bool idItem::Pickup( idPlayer *player ) {
}
}
noPickup = true; // sikk - Item Management: Manual Item Pickup
BecomeInactive( TH_THINK );
return true;
}
@ -516,7 +585,10 @@ void idItem::Event_Touch( idEntity *other, trace_t *trace ) {
return;
}
Pickup( static_cast<idPlayer *>(other) );
// sikk---> Manual Item Pickup
if ( !g_itemPickupType.GetBool() || spawnArgs.GetBool( "autopickup" ) )
Pickup( static_cast<idPlayer *>(other) );
// <---sikk
}
/*
@ -636,8 +708,12 @@ bool idItemPowerup::GiveToPlayer( idPlayer *player ) {
if ( player->spectating ) {
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 +788,26 @@ void idObjective::Event_CamShot( ) {
renderView_t fullView = *view;
fullView.width = SCREEN_WIDTH;
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
renderSystem->CropRenderSize( 256, 256, true );
gameRenderWorld->RenderScene( &fullView );
@ -924,7 +1020,7 @@ void idMoveableItem::Spawn( void ) {
idBounds bounds;
// create a trigger for item pickup
spawnArgs.GetFloat( "triggersize", "16.0", tsize );
spawnArgs.GetFloat( "triggersize", "32.0", tsize ); // sikk - Changed default trigger size from 16 to 32
trigger = new idClipModel( idTraceModel( idBounds( vec3_origin ).Expand( tsize ) ) );
trigger->Link( gameLocal.clip, this, 0, GetPhysics()->GetOrigin(), GetPhysics()->GetAxis() );
trigger->SetContents( CONTENTS_TRIGGER );
@ -954,16 +1050,26 @@ void idMoveableItem::Spawn( void ) {
spawnArgs.GetFloat( "bouncyness", "0.6", 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 ( spawnArgs.GetString( "bind" ) == "" )
offset = idVec3( 0.0f, 0.0f, 4.0f );
// <---sikk
// setup the physics
physicsObj.SetSelf( this );
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.SetBouncyness( bouncyness );
physicsObj.SetFriction( 0.6f, 0.6f, friction );
physicsObj.SetGravity( gameLocal.GetGravity() );
physicsObj.SetContents( CONTENTS_RENDERMODEL );
physicsObj.SetClipMask( MASK_SOLID | CONTENTS_MOVEABLECLIP );
// sikk---> We want moveable items to clip with other items and we also want ragdolls to clip with items
//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 );
smoke = NULL;
@ -974,6 +1080,40 @@ void idMoveableItem::Spawn( void ) {
smokeTime = gameLocal.time;
BecomeActive( TH_UPDATEPARTICLES );
}
// sikk---> Item Management: Helmet factor (replaces security armor)
bool bRemoved = false;
idStr defName = GetEntityDefName();
if ( !idStr::Icmp( defName, "item_armor_security" ) && ( g_itemHelmetFactor.GetFloat() && gameLocal.random.RandomFloat() <= g_itemHelmetFactor.GetFloat() ) ) {
idEntity *ent;
idDict args;
args.Set( "classname", "item_armor_helmet" );
args.Set( "name", GetName() );
// args.Copy( spawnArgs );
args.Set( "target", spawnArgs.GetString( "target" ) );
args.Set( "origin", spawnArgs.GetString( "origin" ) );
args.Set( "rotation", spawnArgs.GetString( "rotation" ) );
args.Set( "no_touch", spawnArgs.GetString( "no_touch" ) );
args.Set( "bind", spawnArgs.GetString( "bind" ) );
args.Set( "triggerFirst", spawnArgs.GetString( "triggerFirst" ) );
args.Set( "triggersize", spawnArgs.GetString( "triggersize" ) );
// PostEventMS( &EV_Remove, 0 );
delete this;
gameLocal.SpawnEntityDef( args, &ent );
bRemoved = true;
}
// <---sikk
// sikk---> Item Management: Random Item Removal
if ( g_itemRemovalFactor.GetFloat() && ( spawnArgs.GetBool( "removeable", "0" ) && removeable ) && !bRemoved ) {
if ( ( gameLocal.random.RandomFloat() < g_itemRemovalFactor.GetFloat() ) && ( spawnArgs.GetString( "target" ) == "" ) )
PostEventMS( &EV_Remove, 0 );
else
removeable = false;
}
// <---sikk
}
/*
@ -1046,7 +1186,7 @@ idEntity *idMoveableItem::DropItem( const char *classname, const idVec3 &origin,
removeDelay = 5 * 60 * 1000;
}
// 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;
}
@ -1206,6 +1346,116 @@ bool idMoveablePDAItem::GiveToPlayer(idPlayer *player) {
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,10 @@ public:
virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
int GetRandomValue( const char* invName ); // sikk - Item Management: Random Item Value
bool removeable; // sikk - Item Management: Random Item Removal
bool noPickup; // sikk - Item Management: Manual Item Pickup
private:
idVec3 orgOrigin;
bool spin;
@ -87,6 +91,7 @@ private:
mutable int lastCycle;
mutable int lastRenderViewTime;
bool UpdateRenderEntity( renderEntity_s *renderEntity, const renderView_t *renderView ) const;
static bool ModelCallback( renderEntity_s *renderEntity, const renderView_t *renderView );
@ -188,6 +193,35 @@ public:
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;
// sikk---> Soft Shadows PostProcess
// only put lights that cast shadows into the list
if ( spawnArgs.GetInt( "noshadows" ) == 0 ) {
gameLocal.currentLights.Append( entityNumber );
}
// <---sikk
SetLightLevel();
}
@ -417,6 +424,13 @@ void idLight::Spawn( void ) {
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();
}
@ -673,7 +687,7 @@ void idLight::BecomeBroken( idEntity *activator ) {
}
ActivateTargets( activator );
ActivateTargets( activator );
// offset the start time of the shader to sync it to the game time
renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = -MS2SEC( gameLocal.time );
@ -1156,3 +1170,19 @@ bool idLight::ClientReceiveEvent( int event, int time, const idBitMsg &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_MAXEVENTS
};
virtual void ClientPredictionThink( void );
virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg );
// sikk---> Soft Shadows PostProcess
renderLight_t* GetRenderLight( void ) { return &renderLight; };
void UpdateShadowState( void );
// <---sikk
private:
renderLight_t renderLight; // light presented to the renderer
idVec3 localLightOrigin; // light origin relative to the physics origin

View file

@ -1423,6 +1423,11 @@ void idStaticEntity::Spawn( void ) {
if ( model.Find( ".prt" ) >= 0 ) {
// we want the parametric particles out of sync with each other
renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = gameLocal.random.RandomInt( 32767 );
// sikk---> Depth Render
renderEntity.suppressSurfaceInViewID = -8;
renderEntity.noShadow = 1;
// <---sikk
}
fadeFrom.Set( 1, 1, 1, 1 );
@ -3156,3 +3161,63 @@ void idPhantomObjects::Think( void ) {
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

@ -765,4 +765,25 @@ private:
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__ */

View file

@ -907,6 +907,9 @@ void idExplodingBarrel::AddParticles( const char *name, bool burn ) {
particleRenderEntity.shaderParms[ SHADERPARM_ALPHA ] = rgb;
particleRenderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = -MS2SEC( gameLocal.realClientTime );
particleRenderEntity.shaderParms[ SHADERPARM_DIVERSITY ] = ( burn ) ? 1.0f : gameLocal.random.RandomInt( 90 );
particleRenderEntity.suppressSurfaceInViewID = -8; // sikk - Depth Render
if ( !particleRenderEntity.hModel ) {
particleRenderEntity.hModel = renderModelManager->FindModel( name );
}

File diff suppressed because it is too large Load diff

View file

@ -194,6 +194,9 @@ public:
int onePickupTime;
idList<idItemInfo> pickupItemNames;
idList<idObjectiveInfo> objectiveNames;
int healthPackAmount; // sikk - Health Management System (Health Pack)
int adrenalineAmount; // sikk - Adrenaline Pack System
};
typedef struct {
@ -284,7 +287,6 @@ public:
bool healthTake;
int nextHealthTake;
bool hiddenWeapon; // if the weapon is hidden ( in noWeapons maps )
idEntityPtr<idProjectile> soulCubeProjectile;
@ -524,6 +526,80 @@ public:
bool SelfSmooth( void );
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)
idItem* focusItem; // sikk - Manual Item Pickup
// 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 Handling System
bool GetWeaponHandling( void );
bool bWATrace;
bool bWAIsSprinting;
// <---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;
// <---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
private:
jointHandle_t hipJoint;
jointHandle_t chestJoint;
@ -675,7 +751,7 @@ private:
void ExtractEmailInfo( const idStr &email, const char *scan, idStr &out );
void UpdateObjectiveInfo( void );
void UseVehicle( void );
void UseVehicle( bool drive );
void Event_GetButtons( void );
void Event_GetMove( void );

File diff suppressed because it is too large Load diff

View file

@ -83,52 +83,135 @@ public:
void RenderPlayerView( idUserInterface *hud );
void Fade( idVec4 color, int time );
void Flash( idVec4 color, int time );
void AddBloodSpray( float duration );
// temp for view testing
void EnableBFGVision( bool b ) { bfgVision = b; };
private:
void SingleView( idUserInterface *hud, const renderView_t *view );
void DoubleVision( idUserInterface *hud, const renderView_t *view, int offset );
void BerserkVision( idUserInterface *hud, const renderView_t *view );
void InfluenceVision( idUserInterface *hud, const renderView_t *view );
void ScreenFade();
void SingleView( const renderView_t *view );
// sikk - Commented: Functions overridden
//void DoubleVision( const renderView_t *view, int offset );
//void BerserkVision( const renderView_t *view );
//void InfluenceVision( const renderView_t *view );
void ScreenFade( void );
screenBlob_t * GetScreenBlob( void );
screenBlob_t * GetScreenBlob();
const idMaterial * tunnelMaterial; // health tunnel vision
const idMaterial * armorMaterial; // armor damage view effect
const idMaterial * berserkMaterial; // berserk effect
const idMaterial * irGogglesMaterial; // ir effect
const idMaterial * bloodSprayMaterial; // blood spray
const idMaterial * bfgMaterial; // when targeted with BFG
const idMaterial * lagoMaterial; // lagometer drawing
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 fadeToColor; // color to fade to
idVec4 fadeFromColor; // color to fade from
float fadeRate; // fade rate
int fadeTime; // fade time
float lastDamageTime; // accentuate the tunnel effect for a while
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 * armorMaterial; // armor damage view effect
const idMaterial * berserkMaterial; // berserk effect
const idMaterial * irGogglesMaterial; // ir effect
const idMaterial * bloodSprayMaterial; // blood spray
const idMaterial * bfgMaterial; // when targeted with BFG
const idMaterial * lagoMaterial; // lagometer drawing
float lastDamageTime; // accentuate the tunnel effect for a while
idVec4 fadeColor; // fade color
idVec4 fadeToColor; // color to fade to
idVec4 fadeFromColor; // color to fade from
float fadeRate; // fade rate
int fadeTime; // fade time
idAngles shakeAng; // from the sound sources
idAngles shakeAng; // from the sound sources
idPlayer * player;
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;
float focusDistance; // Holds focus distance for depth of field
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
bool bDitherRendered; // Holds whether the dither map has been rendered
float fDitherSize; // Holds previous frame's dither size to check for changes
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__ */

View file

@ -248,6 +248,8 @@ void idProjectile::Create( idEntity *owner, const idVec3 &start, const idVec3 &d
damagePower = 1.0f;
renderEntity.suppressSurfaceInViewID = -8; // sikk - Depth Render
UpdateVisuals();
state = CREATED;
@ -368,7 +370,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
if ( spawnArgs.GetBool( "tracers" ) && gameLocal.random.RandomFloat() > 0.5f ) {
if ( spawnArgs.GetBool( "tracers" ) && ( gameLocal.random.RandomFloat() < g_tracerFrequency.GetFloat() ) ) { // sikk - Tracer Frequency
SetModel( spawnArgs.GetString( "model_tracer" ) );
projectileFlags.isTracer = true;
}
@ -587,6 +589,14 @@ bool idProjectile::Collide( const trace_t &collision, const idVec3 &velocity ) {
idPlayer *player = static_cast<idPlayer *>( owner.GetEntity() );
player->AddProjectileHits( 1 );
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() < g_bloodSprayFrequency.GetFloat() )
player->playerView.AddBloodSpray( g_bloodSprayTime.GetFloat() );
}
// <---sikk
}
}
@ -843,6 +853,9 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
renderEntity.shaderParms[SHADERPARM_ALPHA] = 1.0f;
renderEntity.shaderParms[SHADERPARM_TIMEOFFSET] = -MS2SEC( gameLocal.time );
renderEntity.shaderParms[SHADERPARM_DIVERSITY] = gameLocal.random.CRandomFloat();
renderEntity.suppressSurfaceInViewID = -8; // sikk - Depth Render
Show();
removeTime = ( removeTime > 3000 ) ? removeTime : 3000;
}
@ -892,10 +905,14 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
if ( removeTime < delay * 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 {
Event_RadiusDamage( ignore );
// Event_RadiusDamage( ignore );
Event_RadiusDamage( NULL );
}
// <---sikk
}
// spawn debris entities

View file

@ -1386,7 +1386,6 @@ void idPVS::DrawCurrentPVS( const pvsHandle_t handle, const idVec3 &source ) con
}
#if ASYNC_WRITE_PVS
/*
===================
idPVS::WritePVS
@ -1419,5 +1418,32 @@ void idPVS::ReadPVS( const pvsHandle_t handle, const idBitMsg &msg ) {
common->Printf( "\n" );
}
}
#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 );
#endif
bool CheckAreasForPortalSky( const pvsHandle_t handle, const idVec3 &origin ); // sikk - Portal Sky Box
private:
int numAreas;
int numPortals;

View file

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

View file

@ -376,6 +376,7 @@ void idWeapon::Save( idSaveGame *savefile ) const {
savefile->WriteBool( allowDrop );
savefile->WriteObject( projectileEnt );
savefile->WriteFloat( wh_hide_distance ); // sikk - Weapon Handling System
}
/*
@ -541,6 +542,8 @@ void idWeapon::Restore( idRestoreGame *savefile ) {
savefile->ReadBool( allowDrop );
savefile->ReadObject( reinterpret_cast<idClass *&>( projectileEnt ) );
savefile->ReadFloat( wh_hide_distance ); // sikk - Weapon Handling System
}
/***********************************************************************
@ -721,6 +724,8 @@ void idWeapon::Clear( void ) {
projectileEnt = NULL;
isFiring = false;
wh_hide_distance = -15; // sikk - Weapon Handling System
}
/*
@ -796,7 +801,7 @@ void idWeapon::GetWeaponDef( const char *objectname, int ammoinclip ) {
ammoType = GetAmmoNumForName( weaponDef->dict.GetString( "ammoType" ) );
ammoRequired = weaponDef->dict.GetInt( "ammoRequired" );
clipSize = weaponDef->dict.GetInt( "clipSize" );
clipSize = g_ammoCapacityType.GetBool() ? weaponDef->dict.GetInt( "custom_clipSize" ) : weaponDef->dict.GetInt( "clipSize" ); // sikk---> Ammo Management: Ammo Capacity Type
lowAmmo = weaponDef->dict.GetInt( "lowAmmo" );
icon = weaponDef->dict.GetString( "icon" );
@ -811,6 +816,8 @@ void idWeapon::GetWeaponDef( const char *objectname, int ammoinclip ) {
hideTime = SEC2MS( weaponDef->dict.GetFloat( "hide_time", "0.3" ) );
hideDistance = weaponDef->dict.GetFloat( "hide_distance", "-15" );
wh_hide_distance = weaponDef->dict.GetFloat( "wh_hide_distance", "-15" ); // sikk - Weapon Handling System
// muzzle smoke
smokeName = weaponDef->dict.GetString( "smoke_muzzle" );
if ( *smokeName != '\0' ) {
@ -1303,7 +1310,7 @@ idWeapon::LowerWeapon
void idWeapon::LowerWeapon( void ) {
if ( !hide ) {
hideStart = 0.0f;
hideEnd = hideDistance;
hideEnd = ( owner->GetWeaponHandling() && !owner->OnLadder() ) ? wh_hide_distance : hideDistance; // sikk - Weapon Handling System
if ( gameLocal.time - hideStartTime < hideTime ) {
hideStartTime = gameLocal.time - ( hideTime - ( gameLocal.time - hideStartTime ) );
} else {
@ -1322,7 +1329,7 @@ void idWeapon::RaiseWeapon( void ) {
Show();
if ( hide ) {
hideStart = hideDistance;
hideStart = ( owner->GetWeaponHandling() && !owner->OnLadder() ) ? wh_hide_distance : hideDistance; // sikk - Weapon Handling System;
hideEnd = 0.0f;
if ( gameLocal.time - hideStartTime < hideTime ) {
hideStartTime = gameLocal.time - ( hideTime - ( gameLocal.time - hideStartTime ) );
@ -2895,14 +2902,18 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
kick_endtime = gameLocal.realClientTime + muzzle_kick_maxtime;
}
if ( gameLocal.isClient ) {
// sikk---> Zoom Spread Reduction
if ( g_weaponHandlingType.GetBool() )
spread = spawnArgs.GetFloat( "wh_spread", "0" );
// <---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() );
ang = idMath::Sin( spreadRad * gameLocal.random.RandomFloat() * ( ( owner->bIsZoomed && g_weaponHandlingType.GetBool() ) ? ( ( GetEntityDefName() == "weapon_shotgun" ) ? 0.5 : 0.25f ) : 1.0f ) ); // sikk - Weapon Handling System: Zoom Spread Reduction
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();
@ -2912,16 +2923,14 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
}
}
}
} 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() );
ang = idMath::Sin( spreadRad * gameLocal.random.RandomFloat() * ( ( owner->bIsZoomed && g_weaponHandlingType.GetBool() ) ? 0.25f : 1.0f ) ); // sikk - Weapon Handling System: Zoom Spread Reduction
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();
@ -3098,6 +3107,14 @@ void idWeapon::Event_Melee( void ) {
idThread::ReturnInt( hit );
owner->WeaponFireFeedback( &weaponDef->dict );
// sikk---> Blood Spray Screen Effect
if ( g_showBloodSpray.GetBool() ) {
if ( GetOwner()->GetCurrentWeapon() == 10 && gameLocal.random.RandomFloat() < g_bloodSprayFrequency.GetFloat() && hit )
GetOwner()->playerView.AddBloodSpray( g_bloodSprayTime.GetFloat() );
}
// <---sikk
return;
}
@ -3190,4 +3207,4 @@ idWeapon::ClientPredictionThink
*/
void idWeapon::ClientPredictionThink( void ) {
UpdateAnimation();
}
}

View file

@ -158,6 +158,24 @@ public:
virtual void ClientPredictionThink( void );
float wh_hide_distance; // sikk - Weapon Handling System
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:
// script control
idScriptBool WEAPON_ATTACK;
@ -288,7 +306,7 @@ private:
// nozzle effects
bool nozzleFx; // does this use nozzle effects ( parm5 at rest, parm6 firing )
// this also assumes a nozzle light atm
// this also assumes a nozzle light atm
int nozzleFxFade; // time it takes to fade between the effects
int lastAttack; // last time an attack occured
renderLight_t nozzleGlow; // nozzle light

View file

@ -274,3 +274,17 @@ void idAASLocal::GetEdge( int edgeNum, idVec3 &start, idVec3 &end ) const {
start = file->GetVertex( v[INTSIGNBITSET(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;
// 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;
// Returns the number of areas in the current aas file.
virtual int GetNumAreas( int aasNum ) const = 0; // sikk - Random Encounters System
};
#endif /* !__AAS_H__ */

View file

@ -118,6 +118,8 @@ public:
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 int GetNumAreas( int aasNum ) const; // sikk - Random Encounters System
private:
idAASFile * file;
idStr name;

View file

@ -384,6 +384,11 @@ idAI::idAI() {
eyeFocusRate = 0.0f;
headFocusRate = 0.0f;
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->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( isRandom ); // sikk - Random Encounters System
// Set the AAS if the character has the correct gravity vector
idVec3 gravity = spawnArgs.GetVector( "gravityDir", "0 0 -1" );
gravity *= g_gravity.GetFloat();
@ -719,6 +728,8 @@ void idAI::Spawn( void ) {
return;
}
spawnArgs.GetBool( "isRandom", "0", isRandom ); // sikk - Random Encounters System
spawnArgs.GetInt( "team", "1", team );
spawnArgs.GetInt( "rank", "0", rank );
spawnArgs.GetInt( "fly_offset", "0", fly_offset );
@ -915,6 +926,20 @@ void idAI::Spawn( void ) {
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 it doesn't make any difference)
health *= g_enemyHealthScale.GetFloat();
if ( g_enemyHealthType.GetBool() )
health = ( health * 0.5f ) + ( health * gameLocal.random.RandomFloat() );
health = ( health <= 0 ) ? 1 : health;
// <---sikk
if ( health <= 0 ) {
gameLocal.Warning( "entity '%s' doesn't have health set", name.c_str() );
health = 1;
@ -1018,6 +1043,13 @@ void idAI::DormantBegin( void ) {
// remove ourselves from the enemy's enemylist
enemyNode.Remove();
}
// sikk---> Random Encounters System
if ( isRandom )
dormantTime = gameLocal.time;
// <---sikk
idActor::DormantBegin();
}
@ -1040,6 +1072,11 @@ void idAI::DormantEnd( void ) {
}
}
// sikk---> Random Encounters System
if ( spawnArgs.GetInt( "isRandom" ) )
dormantTime = 0;
// <---sikk
idActor::DormantEnd();
}
@ -1153,6 +1190,11 @@ void idAI::Think( void ) {
Present();
UpdateDamageEffects();
LinkCombat();
// sikk---> Random Encounters System
if ( isRandom && ( AI_DEST_UNREACHABLE || ( dormantTime && gameLocal.time > ( dormantTime + g_randomEncountersDormantTime.GetInteger() * 1000 ) ) ) )
Damage( gameLocal.world, gameLocal.world, idVec3( 0, 0, 1 ), "damage_moverCrush", 999999, INVALID_JOINT );
// <---sikk
}
/***********************************************************************
@ -3189,7 +3231,7 @@ int idAI::ReactionTo( const idEntity *ent ) {
}
// 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;
}
@ -3328,6 +3370,18 @@ void idAI::Killed( idEntity *inflictor, idEntity *attacker, int damage, const id
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
StopSound( SND_CHANNEL_VOICE, false );
if ( head.GetEntity() ) {

View file

@ -277,6 +277,13 @@ public:
// 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 );
int IsDead( void ) { return AI_DEAD; };
// sikk---> Random Encounters System
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:
// navigation
idAAS * aas;

View file

@ -130,8 +130,6 @@ idCVar g_healthTakeTime( "g_healthTakeTime", "5", CVAR_GAME | CVAR_INTEGER
idCVar g_healthTakeAmt( "g_healthTakeAmt", "5", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE, "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_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_showTriggers( "g_showTriggers", "0", CVAR_GAME | CVAR_BOOL, "draws trigger entities (orange) and their targets (green). disabled triggers are drawn grey." );
@ -261,6 +259,7 @@ idCVar pm_runroll( "pm_runroll", "0.005", CVAR_GAME | CVAR_NETWORKSYNC |
idCVar pm_bobup( "pm_bobup", "0.005", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "" );
idCVar pm_bobpitch( "pm_bobpitch", "0.002", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "" );
idCVar pm_bobroll( "pm_bobroll", "0.002", CVAR_GAME | CVAR_NETWORKSYNC | 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_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)" );
@ -335,3 +334,239 @@ 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_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 ;" );
// 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_useDynamicHud( "g_useDynamicHud", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "enables dynamic hud" );
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---> 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---> 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", "16.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "explosion effect scale" );
// <---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---> Portal Sky Box
idCVar g_enablePortalSky( "g_enablePortalSky", "1", CVAR_GAME | CVAR_BOOL, "enables portal sky box support" );
// <---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---> Enemy Health Management
idCVar g_enemyHealthType( "g_enemyHealthType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "sets enemy health type: 0 = normal; 1 = random" );
idCVar g_enemyHealthScale( "g_enemyHealthScale", "1.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "sets the health scale for enemies" );
// <---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---> 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---> 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---> 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", "100", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_INTEGER, "total amount of health reserve in the health pack" );
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_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_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_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_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_ammoDamageType( "g_ammoDamageType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "toggles between the use of normal or custom damage values" );
idCVar g_ammoCapacityType( "g_ammoCapacityType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "toggles between the use of normal or custom max ammo/clip size values" );
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 Handling System
idCVar g_weaponHandlingType( "g_weaponHandlingType", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "toggles between normal and realistic weapon handling" );
// <---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---> 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---> 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
// 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---> Thirdperson Camera
idCVar pm_thirdPersonOffest( "pm_thirdPersonOffset", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "camera offest 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", "1.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_BOOL, "Enable edge anti-aliasing" );
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", "0", 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.1", 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", "1.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", "2.2", 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", "1", 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", "1.0", 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.0", 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", "0", 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", "2.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", "2.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", "8.0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the sun shafts size" );
idCVar r_sunShaftsStrength( "r_sunShaftsStrength", "0.5", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_FLOAT, "Set the sun shafts strength" );
idCVar r_sunShaftsMaskStrength( "r_sunShaftsMaskStrength", "0.5", 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", "0", 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", "1.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", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Depth of field condition: Always on" );
idCVar r_dofConditionCinematic( "r_dofConditionCinematic", "0", 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", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Depth of field condition: Weapon Zoom" );
idCVar r_useMotionBlur( "r_useMotionBlur", "0", 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", "0", 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", "1.0", 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", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_ARCHIVE | CVAR_BOOL, "Enable vignetting postprocessing effect" );
// <---sikk

View file

@ -254,4 +254,219 @@ extern const char *si_gameTypeArgs[];
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---> Dynamic Hud system
extern idCVar g_useDynamicHud;
extern idCVar g_dynamicHudTime;
// <---sikk
// sikk---> Blood Spray Screen Effect
extern idCVar g_showBloodSpray;
extern idCVar g_bloodSprayTime;
extern idCVar g_bloodSprayDistance;
extern idCVar g_bloodSprayFrequency;
// <---sikk
// sikk---> Explosion FX
extern idCVar g_useExplosionFX;
extern idCVar g_explosionFXTime;
extern idCVar g_explosionFXScale;
// <---sikk
extern idCVar g_screenFrostTime; // sikk - Screen Frost
extern idCVar g_enablePortalSky; // sikk - Portal Sky Box
extern idCVar g_burnAwayDelay; // sikk - Monster Burn Away Delay
// sikk---> Enemy Health Management
extern idCVar g_enemyHealthType;
extern idCVar g_enemyHealthScale;
// <---sikk
extern idCVar g_interRankAggression; // sikk - Inter Rank Aggression
extern idCVar g_cyberdemonDamageType; // sikk - Cyberdemon Damage Type
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
// 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_itemRemovalFactor;
extern idCVar g_itemValueFactor;
extern idCVar g_itemHelmetFactor;
extern idCVar g_itemSearchFactor;
// <---sikk
// sikk---> Ammo Management
extern idCVar g_ammoDamageType;
extern idCVar g_ammoCapacityType;
extern idCVar g_ammoUsageType;
// <---sikk
extern idCVar g_weaponHandlingType; // sikk - Weapon Handling
extern idCVar g_tracerFrequency; // sikk - Tracer Frequency
extern idCVar g_grabMode; // sikk - Object Manipulation
// 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
extern idCVar g_showFirstPersonBody; // sikk - First Person Body
extern idCVar pm_thirdPersonOffest; // 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
#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