mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2025-04-10 11:21:12 +00:00
import eldoom source
from https://github.com/Ez0n3/Doom_3/tree/main/ELDOOM/Port/dhewm3
This commit is contained in:
parent
5fcabc8f6a
commit
3f75150a3f
15 changed files with 553 additions and 11 deletions
|
@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 2.8...3.22 FATAL_ERROR)
|
|||
project(dhewm3sdk)
|
||||
|
||||
option(BASE "Build the base (game/) game code" ON)
|
||||
set(BASE_NAME "base" CACHE STRING "Name of the mod built from game/ (will result in \${BASE_NAME}.dll)")
|
||||
set(BASE_NAME "eldoom" CACHE STRING "Name of the mod built from game/ (will result in \${BASE_NAME}.dll)")
|
||||
set(BASE_DEFS "GAME_DLL" CACHE STRING "Compiler definitions for the mod built from game/")
|
||||
|
||||
option(D3XP "Build the d3xp/ game code" ON)
|
||||
option(D3XP "Build the d3xp/ game code" OFF)
|
||||
set(D3XP_NAME "d3xp" CACHE STRING "Name of the mod built from d3xp/ (will result in \${D3XP_NAME}.dll)")
|
||||
set(D3XP_DEFS "GAME_DLL;_D3XP;CTF" CACHE STRING "Compiler definitions for the mod built from d3xp/")
|
||||
|
||||
|
|
|
@ -254,6 +254,12 @@ void idGameLocal::Clear( void ) {
|
|||
savedEventQueue.Init();
|
||||
|
||||
memset( lagometer, 0, sizeof( lagometer ) );
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
portalSkyEnt = NULL;
|
||||
portalSkyActive = false;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -547,6 +553,12 @@ void idGameLocal::SaveGame( idFile *f ) {
|
|||
savegame.WriteBool( isNewFrame );
|
||||
savegame.WriteFloat( clientSmoothing );
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
portalSkyEnt.Save( &savegame );
|
||||
savegame.WriteBool( portalSkyActive );
|
||||
|
||||
|
||||
savegame.WriteBool( mapCycleLoaded );
|
||||
savegame.WriteInt( spawnCount );
|
||||
|
||||
|
@ -917,6 +929,12 @@ void idGameLocal::LoadMap( const char *mapName, int randseed ) {
|
|||
sessionCommand = "";
|
||||
nextGibTime = 0;
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
portalSkyEnt = NULL;
|
||||
portalSkyActive = false;
|
||||
|
||||
|
||||
vacuumAreaNum = -1; // if an info_vacuum is spawned, it will set this
|
||||
|
||||
if ( !editEntities ) {
|
||||
|
@ -1393,6 +1411,12 @@ bool idGameLocal::InitFromSaveGame( const char *mapName, idRenderWorld *renderWo
|
|||
savegame.ReadInt( realClientTime );
|
||||
savegame.ReadBool( isNewFrame );
|
||||
savegame.ReadFloat( clientSmoothing );
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
portalSkyEnt.Restore( &savegame );
|
||||
savegame.ReadBool( portalSkyActive );
|
||||
|
||||
|
||||
savegame.ReadBool( mapCycleLoaded );
|
||||
savegame.ReadInt( spawnCount );
|
||||
|
@ -2040,6 +2064,27 @@ void idGameLocal::SetupPlayerPVS( void ) {
|
|||
pvs.FreeCurrentPVS( otherPVS );
|
||||
playerConnectedAreas = newPVS;
|
||||
}
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4316,6 +4361,27 @@ void idGameLocal::ThrottleUserInfo( void ) {
|
|||
mpGame.ThrottleUserInfo();
|
||||
}
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
/*
|
||||
=================
|
||||
idPlayer::SetPortalSkyEnt
|
||||
=================
|
||||
*/
|
||||
void idGameLocal::SetPortalSkyEnt( idEntity *ent ) {
|
||||
portalSkyEnt = ent;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
idPlayer::IsPortalSkyAcive
|
||||
=================
|
||||
*/
|
||||
bool idGameLocal::IsPortalSkyAcive() {
|
||||
return portalSkyActive;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===========
|
||||
idGameLocal::SelectTimeGroup
|
||||
|
|
|
@ -294,6 +294,15 @@ public:
|
|||
idEntityPtr<idEntity> lastGUIEnt; // last entity with a GUI, used by Cmd_NextGUI_f
|
||||
int lastGUI; // last GUI on the lastGUIEnt
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
idEntityPtr<idEntity> portalSkyEnt;
|
||||
bool portalSkyActive;
|
||||
|
||||
void SetPortalSkyEnt( idEntity *ent );
|
||||
bool IsPortalSkyAcive();
|
||||
|
||||
|
||||
// ---------------------- Public idGame Interface -------------------
|
||||
|
||||
idGameLocal();
|
||||
|
@ -387,6 +396,11 @@ public:
|
|||
bool InPlayerPVS( idEntity *ent ) const;
|
||||
bool InPlayerConnectedArea( idEntity *ent ) const;
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
pvsHandle_t GetPlayerPVS() { return playerPVS; };
|
||||
|
||||
|
||||
void SetCamera( idCamera *cam );
|
||||
idCamera * GetCamera( void ) const;
|
||||
bool SkipCinematic( void );
|
||||
|
|
|
@ -589,6 +589,21 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms
|
|||
numSourceAreas = gameRenderWorld->BoundsInAreas( spectated->GetPlayerPhysics()->GetAbsBounds(), sourceAreas, idEntity::MAX_PVS_AREAS );
|
||||
pvsHandle = gameLocal.pvs.SetupCurrentPVS( sourceAreas, numSourceAreas, PVS_NORMAL );
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
// Add portalSky areas to PVS
|
||||
if ( portalSkyEnt.GetEntity() ) {
|
||||
pvsHandle_t otherPVS, newPVS;
|
||||
idEntity *skyEnt = portalSkyEnt.GetEntity();
|
||||
|
||||
otherPVS = gameLocal.pvs.SetupCurrentPVS( skyEnt->GetPVSAreas(), skyEnt->GetNumPVSAreas() );
|
||||
newPVS = gameLocal.pvs.MergeCurrentPVS( pvsHandle, otherPVS );
|
||||
pvs.FreeCurrentPVS( pvsHandle );
|
||||
pvs.FreeCurrentPVS( otherPVS );
|
||||
pvsHandle = newPVS;
|
||||
}
|
||||
|
||||
|
||||
#if ASYNC_WRITE_TAGS
|
||||
idRandom tagRandom;
|
||||
tagRandom.SetSeed( random.RandomInt() );
|
||||
|
|
|
@ -3156,3 +3156,65 @@ void idPhantomObjects::Think( void ) {
|
|||
BecomeInactive( TH_THINK );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
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 );
|
||||
}
|
||||
|
|
22
game/Misc.h
22
game/Misc.h
|
@ -765,4 +765,26 @@ private:
|
|||
idList<idVec3> lastTargetPos;
|
||||
};
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
idPortalSky
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
class idPortalSky : public idEntity {
|
||||
public:
|
||||
CLASS_PROTOTYPE( idPortalSky );
|
||||
|
||||
idPortalSky();
|
||||
~idPortalSky();
|
||||
|
||||
void Spawn( void );
|
||||
void Event_PostSpawn();
|
||||
void Event_Activate( idEntity *activator );
|
||||
};
|
||||
|
||||
|
||||
#endif /* !__GAME_MISC_H__ */
|
||||
|
|
|
@ -401,12 +401,20 @@ void idInventory::RestoreInventory( idPlayer *owner, const idDict &dict ) {
|
|||
// weapons are stored as a number for persistant data, but as strings in the entityDef
|
||||
weapons = dict.GetInt( "weapon_bits", "0" );
|
||||
|
||||
if ( g_skill.GetInteger() >= 3 ) {
|
||||
//if ( g_skill.GetInteger() >= 3 ) {
|
||||
// Give( owner, dict, "weapon", dict.GetString( "weapon_nightmare" ), NULL, false );
|
||||
//} else {
|
||||
// Give( owner, dict, "weapon", dict.GetString( "weapon" ), NULL, false );
|
||||
//}
|
||||
|
||||
//ELDOOM CVAR
|
||||
if ( g_skill.GetInteger() >= 3 && !ui_oldNightmare.GetInteger() ) {
|
||||
Give( owner, dict, "weapon", dict.GetString( "weapon_nightmare" ), NULL, false );
|
||||
} else {
|
||||
Give( owner, dict, "weapon", dict.GetString( "weapon" ), NULL, false );
|
||||
}
|
||||
|
||||
|
||||
num = dict.GetInt( "levelTriggers" );
|
||||
for ( i = 0; i < num; i++ ) {
|
||||
sprintf( itemname, "levelTrigger_Level_%i", i );
|
||||
|
@ -1291,9 +1299,23 @@ void idPlayer::Init( void ) {
|
|||
pm_stamina.SetFloat( 0.0f );
|
||||
}
|
||||
|
||||
|
||||
//ELDOOM CVAR
|
||||
if ( GetUserInfo()->GetBool( "ui_noStamina" ) && gameLocal.world && !gameLocal.world->spawnArgs.GetBool( "no_stamina" ) ) {
|
||||
pm_stamina.SetFloat( 0.0f );
|
||||
}
|
||||
|
||||
|
||||
// stamina always initialized to maximum
|
||||
stamina = pm_stamina.GetFloat();
|
||||
|
||||
|
||||
//ELDOOM CVAR
|
||||
if ( GetUserInfo()->GetBool( "ui_slowAirTanks" ) ) {
|
||||
pm_airTics.SetFloat( 3600.0f ); //DEFAULT 1800
|
||||
}
|
||||
|
||||
|
||||
// air always initialized to maximum too
|
||||
airTics = pm_airTics.GetFloat();
|
||||
airless = false;
|
||||
|
@ -1586,10 +1608,18 @@ void idPlayer::Spawn( void ) {
|
|||
g_damageScale.SetFloat( 1.0f );
|
||||
g_armorProtection.SetFloat( ( g_skill.GetInteger() < 2 ) ? 0.4f : 0.2f );
|
||||
|
||||
if ( g_skill.GetInteger() == 3 ) {
|
||||
//if ( g_skill.GetInteger() == 3 ) {
|
||||
// healthTake = true;
|
||||
// nextHealthTake = gameLocal.time + g_healthTakeTime.GetInteger() * 1000;
|
||||
//}
|
||||
|
||||
//ELDOOM CVAR
|
||||
if ( g_skill.GetInteger() == 3 && !ui_oldNightmare.GetInteger() ) {
|
||||
healthTake = true;
|
||||
nextHealthTake = gameLocal.time + g_healthTakeTime.GetInteger() * 1000;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3176,7 +3206,12 @@ void idPlayer::UpdatePowerUps( void ) {
|
|||
healthPulse = true;
|
||||
}
|
||||
|
||||
if ( !gameLocal.inCinematic && influenceActive == 0 && g_skill.GetInteger() == 3 && gameLocal.time > nextHealthTake && !AI_DEAD && health > g_healthTakeLimit.GetInteger() ) {
|
||||
//if ( !gameLocal.inCinematic && influenceActive == 0 && g_skill.GetInteger() == 3 && gameLocal.time > nextHealthTake && !AI_DEAD && health > g_healthTakeLimit.GetInteger() ) {
|
||||
|
||||
//ELDOOM CVAR
|
||||
if ( !gameLocal.inCinematic && influenceActive == 0 && g_skill.GetInteger() == 3 && gameLocal.time > nextHealthTake && !AI_DEAD && health > g_healthTakeLimit.GetInteger() && !ui_oldNightmare.GetInteger() ) {
|
||||
|
||||
|
||||
assert( !gameLocal.isClient ); // healthPool never be set on client
|
||||
health -= g_healthTakeAmt.GetInteger();
|
||||
if ( health < g_healthTakeLimit.GetInteger() ) {
|
||||
|
@ -5694,6 +5729,13 @@ void idPlayer::AdjustSpeed( void ) {
|
|||
float speed;
|
||||
float rate;
|
||||
|
||||
|
||||
//ELDOOM CVAR
|
||||
if ( GetUserInfo()->GetBool( "ui_autoRun" ) ) {
|
||||
usercmd.buttons ^= BUTTON_RUN;
|
||||
}
|
||||
|
||||
|
||||
if ( spectating ) {
|
||||
speed = pm_spectatespeed.GetFloat();
|
||||
bobFrac = 0.0f;
|
||||
|
@ -6406,6 +6448,13 @@ void idPlayer::Think( void ) {
|
|||
}
|
||||
gameLocal.Printf( "%d: enemies\n", num );
|
||||
}
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
// determine if portal sky is in pvs
|
||||
gameLocal.portalSkyActive = gameLocal.pvs.CheckAreasForPortalSky( gameLocal.GetPlayerPVS(), GetPhysics()->GetOrigin() );
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -7935,6 +7984,15 @@ void idPlayer::ClientPredictionThink( void ) {
|
|||
if ( gameLocal.isNewFrame && entityNumber == gameLocal.localClientNum ) {
|
||||
playerView.CalculateShake();
|
||||
}
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
// determine if portal sky is in pvs
|
||||
pvsHandle_t clientPVS = gameLocal.pvs.SetupCurrentPVS( GetPVSAreas(), GetNumPVSAreas() );
|
||||
gameLocal.portalSkyActive = gameLocal.pvs.CheckAreasForPortalSky( clientPVS, GetPhysics()->GetOrigin() );
|
||||
gameLocal.pvs.FreeCurrentPVS( clientPVS );
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -34,6 +34,16 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#include "GameBase.h"
|
||||
#include "Player.h"
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
static int MakePowerOfTwo( int num ) {
|
||||
int pot;
|
||||
for (pot = 1 ; pot < num ; pot<<=1) {
|
||||
}
|
||||
return pot;
|
||||
}
|
||||
|
||||
|
||||
#include "PlayerView.h"
|
||||
|
||||
const int IMPULSE_DELAY = 150;
|
||||
|
@ -232,8 +242,21 @@ void idPlayerView::DamageImpulse( idVec3 localKickDir, const idDict *damageDef )
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
//ELDOOM
|
||||
float knockBackVar = g_knockBackVar.GetFloat();
|
||||
|
||||
|
||||
float dvTime = damageDef->GetFloat( "dv_time" );
|
||||
if ( dvTime ) {
|
||||
|
||||
|
||||
//ELDOOM CVAR
|
||||
if ( ui_reduceKnockBack.GetBool() ) {
|
||||
dvTime *= knockBackVar;
|
||||
}
|
||||
|
||||
|
||||
if ( dvFinishTime < gameLocal.time ) {
|
||||
dvFinishTime = gameLocal.time;
|
||||
}
|
||||
|
@ -249,6 +272,14 @@ void idPlayerView::DamageImpulse( idVec3 localKickDir, const idDict *damageDef )
|
|||
//
|
||||
float kickTime = damageDef->GetFloat( "kick_time" );
|
||||
if ( kickTime ) {
|
||||
|
||||
|
||||
//ELDOOM CVAR
|
||||
if ( ui_reduceKnockBack.GetBool() ) {
|
||||
kickTime *= knockBackVar;
|
||||
}
|
||||
|
||||
|
||||
kickFinishTime = gameLocal.time + g_kickTime.GetFloat() * kickTime;
|
||||
|
||||
// forward / back kick will pitch view
|
||||
|
@ -265,6 +296,14 @@ void idPlayerView::DamageImpulse( idVec3 localKickDir, const idDict *damageDef )
|
|||
|
||||
float kickAmplitude = damageDef->GetFloat( "kick_amplitude" );
|
||||
if ( kickAmplitude ) {
|
||||
|
||||
|
||||
//ELDOOM CVAR
|
||||
if ( ui_reduceKnockBack.GetBool() ) {
|
||||
kickAmplitude *= knockBackVar;
|
||||
}
|
||||
|
||||
|
||||
kickAngles *= kickAmplitude;
|
||||
}
|
||||
}
|
||||
|
@ -274,6 +313,14 @@ void idPlayerView::DamageImpulse( idVec3 localKickDir, const idDict *damageDef )
|
|||
//
|
||||
float blobTime = damageDef->GetFloat( "blob_time" );
|
||||
if ( blobTime ) {
|
||||
|
||||
|
||||
//ELDOOM CVAR
|
||||
if ( ui_reduceKnockBack.GetBool() ) {
|
||||
blobTime *= knockBackVar;
|
||||
}
|
||||
|
||||
|
||||
screenBlob_t *blob = GetScreenBlob();
|
||||
blob->startFadeTime = gameLocal.time;
|
||||
blob->finishTime = gameLocal.time + blobTime * g_blobTime.GetFloat();
|
||||
|
@ -358,7 +405,27 @@ Called when a weapon fires, generates head twitches, etc
|
|||
void idPlayerView::WeaponFireFeedback( const idDict *weaponDef ) {
|
||||
int recoilTime;
|
||||
|
||||
recoilTime = weaponDef->GetInt( "recoilTime" );
|
||||
|
||||
//ELDOOM
|
||||
//recoilTime = weaponDef->GetInt( "recoilTime" );
|
||||
if ( g_eldoomWeapons.GetInteger() ) {
|
||||
recoilTime = weaponDef->GetInt( "eldoomRecoilTime" );
|
||||
//DEBUG
|
||||
//common->Printf("using eldoom recoilTime = %i \n", recoilTime);
|
||||
|
||||
if ( !recoilTime ) {
|
||||
recoilTime = weaponDef->GetInt( "recoilTime" );
|
||||
//DEBUG
|
||||
//common->Printf("couldn't find recoilTime = %i \n", recoilTime);
|
||||
}
|
||||
}
|
||||
else {
|
||||
recoilTime = weaponDef->GetInt( "recoilTime" );
|
||||
//DEBUG
|
||||
//common->Printf("not using eldoom recoilTime = %i \n", recoilTime);
|
||||
}
|
||||
|
||||
|
||||
// don't shorten a damage kick in progress
|
||||
if ( recoilTime && kickFinishTime < gameLocal.time ) {
|
||||
idAngles angles;
|
||||
|
@ -452,6 +519,39 @@ void idPlayerView::SingleView( idUserInterface *hud, const renderView_t *view )
|
|||
renderView_t hackedView = *view;
|
||||
hackedView.viewaxis = hackedView.viewaxis * ShakeAxis();
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
if ( gameLocal.portalSkyEnt.GetEntity() && gameLocal.IsPortalSkyAcive() && g_enablePortalSky.GetBool() ) {
|
||||
renderView_t portalView = hackedView;
|
||||
portalView.vieworg = gameLocal.portalSkyEnt.GetEntity()->GetPhysics()->GetOrigin();
|
||||
|
||||
// setup global fixup projection vars
|
||||
if ( 1 ) {
|
||||
int vidWidth, vidHeight;
|
||||
idVec2 shiftScale;
|
||||
|
||||
renderSystem->GetGLSettings( vidWidth, vidHeight );
|
||||
|
||||
float pot;
|
||||
int w = vidWidth;
|
||||
pot = MakePowerOfTwo( w );
|
||||
shiftScale.x = (float)w / pot;
|
||||
|
||||
int h = vidHeight;
|
||||
pot = MakePowerOfTwo( h );
|
||||
shiftScale.y = (float)h / pot;
|
||||
|
||||
hackedView.shaderParms[4] = shiftScale.x;
|
||||
hackedView.shaderParms[5] = shiftScale.y;
|
||||
}
|
||||
|
||||
gameRenderWorld->RenderScene( &portalView );
|
||||
renderSystem->CaptureRenderToImage( "_currentRender" );
|
||||
|
||||
hackedView.forceUpdate = true; // FIX: for smoke particles not drawing when portalSky present
|
||||
}
|
||||
|
||||
|
||||
gameRenderWorld->RenderScene( &hackedView );
|
||||
|
||||
if ( player->spectating ) {
|
||||
|
|
|
@ -323,7 +323,29 @@ void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3
|
|||
linear_friction = spawnArgs.GetFloat( "linear_friction" );
|
||||
angular_friction = spawnArgs.GetFloat( "angular_friction" );
|
||||
contact_friction = spawnArgs.GetFloat( "contact_friction" );
|
||||
bounce = spawnArgs.GetFloat( "bounce" );
|
||||
|
||||
|
||||
|
||||
//ELDOOM
|
||||
//bounce = spawnArgs.GetFloat( "bounce" );
|
||||
if ( g_eldoomWeapons.GetInteger() ) {
|
||||
bounce = spawnArgs.GetFloat( "eldoomBounce" );
|
||||
//DEBUG
|
||||
//common->Printf("using eldoom bounce = %f \n", bounce);
|
||||
|
||||
if ( !bounce ) {
|
||||
bounce = spawnArgs.GetFloat( "bounce" );
|
||||
//DEBUG
|
||||
//common->Printf("couldn't find eldoom bounce = %f \n", bounce);
|
||||
}
|
||||
}
|
||||
else {
|
||||
bounce = spawnArgs.GetFloat( "bounce" );
|
||||
//DEBUG
|
||||
//common->Printf("not using eldoom bounce = %f \n", bounce);
|
||||
}
|
||||
|
||||
|
||||
mass = spawnArgs.GetFloat( "mass" );
|
||||
gravity = spawnArgs.GetFloat( "gravity" );
|
||||
fuse = spawnArgs.GetFloat( "fuse" );
|
||||
|
|
34
game/Pvs.cpp
34
game/Pvs.cpp
|
@ -1421,3 +1421,37 @@ void idPVS::ReadPVS( const pvsHandle_t handle, const idBitMsg &msg ) {
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
/*
|
||||
================
|
||||
idPVS::CheckAreasForPortalSky
|
||||
================
|
||||
*/
|
||||
bool idPVS::CheckAreasForPortalSky( const pvsHandle_t handle, const idVec3 &origin ) {
|
||||
int j, 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 ( j = 0; j < numAreas; j++ ) {
|
||||
|
||||
if ( !( currentPVS[handle.i].pvs[j>>3] & (1 << (j&7)) ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( gameRenderWorld->CheckAreaForPortalSky( j ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -97,6 +97,11 @@ public:
|
|||
void ReadPVS( const pvsHandle_t handle, const idBitMsg &msg );
|
||||
#endif
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
bool CheckAreasForPortalSky( const pvsHandle_t handle, const idVec3 &origin );
|
||||
|
||||
|
||||
private:
|
||||
int numAreas;
|
||||
int numPortals;
|
||||
|
|
|
@ -900,6 +900,22 @@ idTrigger_Count::Event_Trigger
|
|||
*/
|
||||
void idTrigger_Count::Event_Trigger( idEntity *activator ) {
|
||||
// goal of -1 means trigger has been exhausted
|
||||
|
||||
|
||||
//ELDOOM
|
||||
int update_only = 0;
|
||||
if ( goal == 0 && spawnArgs.GetFloat("recount") ) {
|
||||
goal = spawnArgs.GetFloat("recount");
|
||||
update_only = 1;
|
||||
}
|
||||
else {
|
||||
update_only = 0;
|
||||
} //END ELDOOM
|
||||
|
||||
//ELDOOM
|
||||
if ( !update_only ) {
|
||||
|
||||
//STOCK
|
||||
if (goal >= 0) {
|
||||
count++;
|
||||
if ( count >= goal ) {
|
||||
|
@ -910,7 +926,11 @@ void idTrigger_Count::Event_Trigger( idEntity *activator ) {
|
|||
}
|
||||
PostEventSec( &EV_TriggerAction, delay, activator );
|
||||
}
|
||||
}
|
||||
} //END STOCK
|
||||
|
||||
} //END ELDOOM
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -796,14 +796,85 @@ void idWeapon::GetWeaponDef( const char *objectname, int ammoinclip ) {
|
|||
|
||||
ammoType = GetAmmoNumForName( weaponDef->dict.GetString( "ammoType" ) );
|
||||
ammoRequired = weaponDef->dict.GetInt( "ammoRequired" );
|
||||
clipSize = weaponDef->dict.GetInt( "clipSize" );
|
||||
|
||||
|
||||
//ELDOOM - CHECK IF ELDOOM WEAPON IS TURNED ON
|
||||
int eldoomPistol = strcmp( objectname, "weapon_pistol" );
|
||||
int eldoomShotgun = strcmp( objectname, "weapon_shotgun" );
|
||||
int eldoomMachinegun = strcmp( objectname, "weapon_machinegun" );
|
||||
int eldoomChaingun = strcmp( objectname, "weapon_chaingun" );
|
||||
int eldoomGrenades = strcmp( objectname, "weapon_handgrenade" );
|
||||
|
||||
if ( ( eldoomPistol == 0 && g_eldoomPistol.GetInteger() ) ||
|
||||
( eldoomShotgun == 0 && g_eldoomShotgun.GetInteger() ) ||
|
||||
( eldoomMachinegun == 0 && g_eldoomMachinegun.GetInteger() ) ||
|
||||
( eldoomChaingun == 0 && g_eldoomChaingun.GetInteger() ) ||
|
||||
( eldoomGrenades == 0 && g_eldoomGrenades.GetInteger() ) ) {
|
||||
|
||||
//common->Printf("ELDOOM WEAPON = ON \n");
|
||||
g_eldoomWeapons.SetInteger( 1 );
|
||||
}
|
||||
else {
|
||||
//common->Printf("ELDOOM WEAPON = OFF \n");
|
||||
g_eldoomWeapons.SetInteger( 0 );
|
||||
}
|
||||
//DEBUG
|
||||
//common->Printf("objectname = %s \n", objectname );
|
||||
//common->Printf("eldoomPistol = %i \n", eldoomPistol);
|
||||
//common->Printf("eldoomShotgun = %i \n", eldoomShotgun);
|
||||
//common->Printf("eldoomMachinegun = %i \n", eldoomMachinegun);
|
||||
//common->Printf("eldoomChaingun = %i \n", eldoomChaingun);
|
||||
//common->Printf("eldoomGrenades = %i \n", eldoomGrenades);
|
||||
|
||||
|
||||
|
||||
//ELDOOM
|
||||
//clipSize = weaponDef->dict.GetInt( "clipSize" );
|
||||
if ( g_eldoomWeapons.GetInteger() ) {
|
||||
clipSize = weaponDef->dict.GetInt( "eldoomClipSize" );
|
||||
//DEBUG
|
||||
//common->Printf("using eldoom clipSize = %i \n", clipSize);
|
||||
|
||||
if ( !clipSize ) {
|
||||
clipSize = weaponDef->dict.GetInt( "clipSize" );
|
||||
//DEBUG
|
||||
//common->Printf("couldn't find eldoom clipSize = %i \n", clipSize);
|
||||
}
|
||||
}
|
||||
else {
|
||||
clipSize = weaponDef->dict.GetInt( "clipSize" );
|
||||
//DEBUG
|
||||
//common->Printf("not using eldoom clipSize = %i \n", clipSize);
|
||||
}
|
||||
|
||||
|
||||
lowAmmo = weaponDef->dict.GetInt( "lowAmmo" );
|
||||
|
||||
icon = weaponDef->dict.GetString( "icon" );
|
||||
silent_fire = weaponDef->dict.GetBool( "silent_fire" );
|
||||
powerAmmo = weaponDef->dict.GetBool( "powerAmmo" );
|
||||
|
||||
muzzle_kick_time = SEC2MS( weaponDef->dict.GetFloat( "muzzle_kick_time" ) );
|
||||
|
||||
//ELDOOM
|
||||
//muzzle_kick_time = SEC2MS( weaponDef->dict.GetFloat( "muzzle_kick_time" ) );
|
||||
if ( g_eldoomWeapons.GetInteger() ) {
|
||||
muzzle_kick_time = SEC2MS( weaponDef->dict.GetFloat( "eldoomMuzzleKickTime" ) );
|
||||
//DEBUG
|
||||
//common->Printf("using eldoom muzzle_kick_time = %i \n", muzzle_kick_time);
|
||||
|
||||
if ( !muzzle_kick_time ) {
|
||||
muzzle_kick_time = SEC2MS( weaponDef->dict.GetFloat( "muzzle_kick_time" ) );
|
||||
//DEBUG
|
||||
//common->Printf("couldn't find eldoom muzzle_kick_time = %i \n", muzzle_kick_time);
|
||||
}
|
||||
}
|
||||
else {
|
||||
muzzle_kick_time = SEC2MS( weaponDef->dict.GetFloat( "muzzle_kick_time" ) );
|
||||
//DEBUG
|
||||
//common->Printf("not using eldoom muzzle_kick_time = %i \n", muzzle_kick_time);
|
||||
}
|
||||
|
||||
|
||||
muzzle_kick_maxtime = SEC2MS( weaponDef->dict.GetFloat( "muzzle_kick_maxtime" ) );
|
||||
muzzle_kick_angles = weaponDef->dict.GetAngles( "muzzle_kick_angles" );
|
||||
muzzle_kick_offset = weaponDef->dict.GetVector( "muzzle_kick_offset" );
|
||||
|
|
|
@ -106,7 +106,11 @@ idCVar g_monsters( "g_monsters", "1", CVAR_GAME | CVAR_BOOL, "" );
|
|||
idCVar g_decals( "g_decals", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "show decals such as bullet holes" );
|
||||
idCVar g_knockback( "g_knockback", "1000", CVAR_GAME | CVAR_INTEGER, "" );
|
||||
idCVar g_skill( "g_skill", "1", CVAR_GAME | CVAR_INTEGER, "" );
|
||||
idCVar g_nightmare( "g_nightmare", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "if nightmare mode is allowed" );
|
||||
//idCVar g_nightmare( "g_nightmare", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "if nightmare mode is allowed" );
|
||||
|
||||
//ELDOOM CVAR - MODIFIED ID
|
||||
idCVar g_nightmare( "g_nightmare", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "if nightmare mode is allowed" );
|
||||
|
||||
idCVar g_gravity( "g_gravity", DEFAULT_GRAVITY_STRING, CVAR_GAME | CVAR_FLOAT, "" );
|
||||
idCVar g_skipFX( "g_skipFX", "0", CVAR_GAME | CVAR_BOOL, "" );
|
||||
idCVar g_skipParticles( "g_skipParticles", "0", CVAR_GAME | CVAR_BOOL, "" );
|
||||
|
@ -149,6 +153,11 @@ idCVar g_showEnemies( "g_showEnemies", "0", CVAR_GAME | CVAR_BOOL, "draws
|
|||
idCVar g_frametime( "g_frametime", "0", CVAR_GAME | CVAR_BOOL, "displays timing information for each game frame" );
|
||||
idCVar g_timeentities( "g_timeEntities", "0", CVAR_GAME | CVAR_FLOAT, "when non-zero, shows entities whose think functions exceeded the # of milliseconds specified" );
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
idCVar g_enablePortalSky( "g_enablePortalSky", "1", CVAR_GAME | CVAR_BOOL, "enables the portal sky" );
|
||||
|
||||
|
||||
idCVar ai_debugScript( "ai_debugScript", "-1", CVAR_GAME | CVAR_INTEGER, "displays script calls for the specified monster entity number" );
|
||||
idCVar ai_debugMove( "ai_debugMove", "0", CVAR_GAME | CVAR_BOOL, "draws movement information for monsters" );
|
||||
idCVar ai_debugTrajectory( "ai_debugTrajectory", "0", CVAR_GAME | CVAR_BOOL, "draws trajectory tests for monsters" );
|
||||
|
@ -335,3 +344,22 @@ 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 ;" );
|
||||
|
||||
|
||||
//ELDOOM CVAR'S
|
||||
idCVar ui_autoRun( "ui_autoRun", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "reverse the functionality of the run button" );
|
||||
idCVar ui_noStamina( "ui_noStamina", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "disable stamina" );
|
||||
idCVar ui_oldNightmare( "ui_oldNightmare", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "use classic nightmare theme" );
|
||||
idCVar ui_bossMusic( "ui_bossMusic", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "play music while fighting a boss" );
|
||||
idCVar ui_reduceKnockBack( "ui_reduceKnockBack", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "reduces player knockback when damaged" );
|
||||
idCVar ui_slowAirTanks( "ui_slowAirTanks", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "increase the amount of time it takes to run out of air" );
|
||||
|
||||
idCVar g_eldoomPistol( "g_eldoomPistol", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "increase the rate of fire for the pistol" );
|
||||
idCVar g_eldoomShotgun( "g_eldoomShotgun", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "decrease the spread for the shotgun" );
|
||||
idCVar g_eldoomMachinegun( "g_eldoomMachinegun", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "increase the rate of fire for the machinegun" );
|
||||
idCVar g_eldoomChaingun( "g_eldoomChaingun", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "increase the rate of fire for the chaingun" );
|
||||
idCVar g_eldoomGrenades( "g_eldoomGrenades", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "decrease the bounciness of grenades" );
|
||||
|
||||
idCVar g_eldoomWeapons( "g_eldoomWeapons", "1", CVAR_GAME | CVAR_INTEGER, "use modified eldoom weapon" );
|
||||
idCVar g_chaosMap( "g_chaosMap", "0", CVAR_GAME | CVAR_FLOAT, "use eldoom chaos map effects" );
|
||||
idCVar g_knockBackVar( "g_knockBackVar", "0.7", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "multiply dv, kick, blob effects time by this number" );
|
||||
|
|
|
@ -119,6 +119,11 @@ extern idCVar g_vehicleSuspensionKCompress;
|
|||
extern idCVar g_vehicleSuspensionDamping;
|
||||
extern idCVar g_vehicleTireFriction;
|
||||
|
||||
|
||||
//ELDOOM PORTAL SKY
|
||||
extern idCVar g_enablePortalSky;
|
||||
|
||||
|
||||
extern idCVar ik_enable;
|
||||
extern idCVar ik_debug;
|
||||
|
||||
|
@ -254,4 +259,24 @@ extern const char *si_gameTypeArgs[];
|
|||
|
||||
extern const char *ui_skinArgs[];
|
||||
|
||||
|
||||
//ELDOOM CVAR'S
|
||||
extern idCVar ui_autoRun;
|
||||
extern idCVar ui_noStamina;
|
||||
extern idCVar ui_oldNightmare;
|
||||
extern idCVar ui_bossMusic;
|
||||
extern idCVar ui_reduceKnockBack;
|
||||
extern idCVar ui_slowAirTanks;
|
||||
|
||||
extern idCVar g_eldoomPistol;
|
||||
extern idCVar g_eldoomShotgun;
|
||||
extern idCVar g_eldoomMachinegun;
|
||||
extern idCVar g_eldoomChaingun;
|
||||
extern idCVar g_eldoomGrenades;
|
||||
|
||||
extern idCVar g_eldoomWeapons;
|
||||
extern idCVar g_chaosMap;
|
||||
extern idCVar g_knockBackVar;
|
||||
|
||||
|
||||
#endif /* !__SYS_CVAR_H__ */
|
||||
|
|
Loading…
Reference in a new issue