summaryrefslogtreecommitdiff
path: root/src/game/g_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r--src/game/g_main.c48
1 files changed, 43 insertions, 5 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 7011827..57b4af4 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -26,9 +26,12 @@ TREMULOUS EDGE MOD SRC FILE
===========================================================================
*/
#include "g_local.h"
+#include "edge_version.h"
#define G_MOD_VERSION "Aardvark 0.5x" SVN_VERSION
-#define EDGE_MOD_VERSION "7.0.x"
+#ifndef EDGE_MOD_VERSION
+#define EDGE_MOD_VERSION "7.5.x"
+#endif
level_locals_t level;
typedef struct
@@ -200,6 +203,8 @@ vmCvar_t g_AutoLevelMinTeamSize;
vmCvar_t g_RageQuitScorePenalty;
vmCvar_t g_DretchTurretDamage;
vmCvar_t g_DretchBuildingDamage;
+vmCvar_t g_OwnTeamBPFactor;
+vmCvar_t g_EnemyTeamBPFactor;
// copy cvars that can be set in worldspawn so they can be restored later
static char cv_gravity[ MAX_CVAR_VALUE_STRING ];
@@ -369,7 +374,9 @@ static cvarTable_t gameCvarTable[ ] =
{ &g_AutoLevelMinTeamSize, "g_AutoLevelMinTeamSize", "3", CVAR_ARCHIVE, 0, qfalse },
{ &g_RageQuitScorePenalty, "g_RageQuitScorePenalty", "2000", CVAR_ARCHIVE, 0, qfalse },
{ &g_DretchTurretDamage, "g_DretchTurretDamage", "1", CVAR_ARCHIVE, 0, qfalse },
- { &g_DretchBuildingDamage, "g_DretchBuildingDamage", "0.5", CVAR_ARCHIVE, 0, qfalse }
+ { &g_DretchBuildingDamage, "g_DretchBuildingDamage", "0.5", CVAR_ARCHIVE, 0, qfalse },
+ { &g_OwnTeamBPFactor, "g_OwnTeamBPFactor", "1.0", CVAR_ARCHIVE, 0, qfalse },
+ { &g_EnemyTeamBPFactor, "g_EnemyTeamBPFactor", "0.0", CVAR_ARCHIVE, 0, qfalse }
};
static int gameCvarTableSize = sizeof( gameCvarTable ) / sizeof( gameCvarTable[ 0 ] );
void G_InitGame( int levelTime, int randomSeed, int restart );
@@ -646,6 +653,7 @@ void G_InitGame( int levelTime, int randomSeed, int restart )
level.humanStage2Time = level.humanStage3Time = level.humanStage4Time = level.humanStage5Time = level.startTime;
level.snd_fry = G_SoundIndex( "sound/misc/fry.wav" ); // FIXME standing in lava / slime
level.humanRewardKills = level.alienRewardKills = 0.0f;
+ level.alienNoBPFlashTime = level.humanNoBPFlashTime = -1;
trap_Cvar_Set( "g_version", G_MOD_VERSION );
trap_Cvar_Set( "edge_version", EDGE_MOD_VERSION );
if( g_logFile.string[ 0 ] )
@@ -1087,6 +1095,7 @@ void G_SpawnClients( team_t team )
if( g_teamForceBalance.integer == 2 &&
!level.humanTeamLocked &&
!level.alienTeamLocked &&
+ level.numHumanSpawns > 0 &&
level.numLiveAlienClients-level.numHumanClients > 0 )
numSpawns = -1;
}
@@ -1097,6 +1106,7 @@ void G_SpawnClients( team_t team )
if( g_teamForceBalance.integer == 2 &&
!level.humanTeamLocked &&
!level.alienTeamLocked &&
+ level.numAlienSpawns > 0 &&
level.numLiveHumanClients-level.numAlienClients > 0 )
numSpawns = -1;
}
@@ -1389,12 +1399,33 @@ void G_CalculateBuildPoints( void )
hFixed = h_refineries * g_humanRefineryBuildPoints.value;
// LimitSum( g_maxFixedBuildPoints.value, 1.0f, &aFixed, &hFixed );
- level.alienExtraBuildPoints = aVar + aFixed;
- level.humanExtraBuildPoints = hVar + hFixed;
+ level.alienExtraBuildPoints = g_OwnTeamBPFactor.value * (aVar + aFixed) + g_EnemyTeamBPFactor.value * (hVar + hFixed);
+ level.humanExtraBuildPoints = g_OwnTeamBPFactor.value * (hVar + hFixed) + g_EnemyTeamBPFactor.value * (aVar + aFixed);
level.humanBuildPoints += level.humanExtraBuildPoints;
level.alienBuildPoints += level.alienExtraBuildPoints;
}
+
+ if( level.alienNoBPFlash )
+ {
+ level.alienNoBPFlash = qfalse;
+ level.alienNoBPFlashTime = level.time;
+ }
+
+ if( level.humanNoBPFlash )
+ {
+ level.humanNoBPFlash = qfalse;
+ level.humanNoBPFlashTime = level.time;
+ }
+
+ trap_SetConfigstring( CS_BUILD_POOLS, va( "%d %d %d %d %d %d",
+ g_alienBuildPoints.integer + level.alienExtraBuildPoints,
+ g_alienBuildPoints.integer,
+ level.alienNoBPFlashTime,
+ g_humanBuildPoints.integer + level.humanExtraBuildPoints,
+ g_humanBuildPoints.integer,
+ level.humanNoBPFlashTime ) );
+
//zero bp not allowed
// if( level.humanBuildPoints < 0 )
// level.humanBuildPoints = 0;
@@ -1465,7 +1496,14 @@ void G_CheckForNegativeBuildPoints( void )
{
surviveprobcur = pow( surviveprob1min, thinkduration / 60000.0f );
if( surviveprobcur * RAND_MAX < rand( ) )
+ {
G_Suicide( ent, MOD_NOBP );
+
+ if( ent->buildableTeam == TEAM_ALIENS )
+ level.alienNoBPFlash = qtrue;
+ else
+ level.humanNoBPFlash = qtrue;
+ }
}
}
}
@@ -2614,7 +2652,7 @@ void G_ArmageddonStep( void )
if (thresholdOther > 0.0f) if (random() < thresholdOther) {
ent->health = -999;
ent->enemy = &g_entities[ ENTITYNUM_WORLD ];
- ent->die( ent, ent->enemy, ent->enemy, 999, MOD_UNKNOWN );
+ ent->die( ent, ent->enemy, ent->enemy, 999, MOD_HDOG );
}
break;
}