summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_event.c26
-rw-r--r--src/game/g_main.c39
-rw-r--r--src/game/g_weapon.c2
3 files changed, 44 insertions, 23 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c
index 80a82016..049cea33 100644
--- a/src/cgame/cg_event.c
+++ b/src/cgame/cg_event.c
@@ -92,7 +92,7 @@ static void CG_Obituary( entityState_t *ent )
message = "was in the wrong place";
break;
case MOD_HSPAWN:
- message = "should have run further";
+ message = "should have ran further";
break;
case MOD_ASPAWN:
message = "shouldn't have trod in the acid";
@@ -249,6 +249,18 @@ static void CG_Obituary( entityState_t *ent )
BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL1 ) );
message2 = className;
break;
+ case MOD_LEVEL2_CLAW:
+ message = "was clawed by";
+ Com_sprintf( className, 64, "'s %s",
+ BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL2 ) );
+ message2 = className;
+ break;
+ case MOD_LEVEL2_ZAP:
+ message = "was zapped by";
+ Com_sprintf( className, 64, "'s %s",
+ BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL2 ) );
+ message2 = className;
+ break;
case MOD_LEVEL3_CLAW:
message = "was chomped by";
Com_sprintf( className, 64, "'s %s",
@@ -261,16 +273,10 @@ static void CG_Obituary( entityState_t *ent )
BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL3 ) );
message2 = className;
break;
- case MOD_LEVEL2_CLAW:
- message = "was clawed by";
+ case MOD_LEVEL3_BOUNCEBALL:
+ message = "was sniped by";
Com_sprintf( className, 64, "'s %s",
- BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL2 ) );
- message2 = className;
- break;
- case MOD_LEVEL2_ZAP:
- message = "was zapped by";
- Com_sprintf( className, 64, "'s %s",
- BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL2 ) );
+ BG_FindHumanNameForClassNum( PCL_ALIEN_LEVEL3 ) );
message2 = className;
break;
case MOD_LEVEL4_CLAW:
diff --git a/src/game/g_main.c b/src/game/g_main.c
index f80bf043..c0c37589 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -968,8 +968,8 @@ void G_CalculateBuildPoints( void )
//may as well pump the stages here too
{
- float alienPlayerCountMod = (float)level.numAlienClients / PLAYER_COUNT_MOD;
- float humanPlayerCountMod = (float)level.numHumanClients / PLAYER_COUNT_MOD;
+ float alienPlayerCountMod = level.averageNumAlienClients / PLAYER_COUNT_MOD;
+ float humanPlayerCountMod = level.averageNumHumanClients / PLAYER_COUNT_MOD;
int alienNextStageThreshold, humanNextStageThreshold;
if( alienPlayerCountMod < 0.1f )
@@ -979,16 +979,16 @@ void G_CalculateBuildPoints( void )
humanPlayerCountMod = 0.1f;
if( g_alienStage.integer == S1 && g_alienMaxStage.integer > S1 )
- alienNextStageThreshold = (int)( (float)g_alienStage2Threshold.integer * alienPlayerCountMod );
+ alienNextStageThreshold = (int)( ceil( (float)g_alienStage2Threshold.integer * alienPlayerCountMod ) );
else if( g_alienStage.integer == S2 && g_alienMaxStage.integer > S2 )
- alienNextStageThreshold = (int)( (float)g_alienStage3Threshold.integer * alienPlayerCountMod );
+ alienNextStageThreshold = (int)( ceil( (float)g_alienStage3Threshold.integer * alienPlayerCountMod ) );
else
alienNextStageThreshold = -1;
if( g_humanStage.integer == S1 && g_humanMaxStage.integer > S1 )
- humanNextStageThreshold = (int)( (float)g_humanStage2Threshold.integer * humanPlayerCountMod );
+ humanNextStageThreshold = (int)( ceil( (float)g_humanStage2Threshold.integer * humanPlayerCountMod ) );
else if( g_humanStage.integer == S2 && g_humanMaxStage.integer > S2 )
- humanNextStageThreshold = (int)( (float)g_humanStage3Threshold.integer * humanPlayerCountMod );
+ humanNextStageThreshold = (int)( ceil( (float)g_humanStage3Threshold.integer * humanPlayerCountMod ) );
else
humanNextStageThreshold = -1;
@@ -1006,8 +1006,8 @@ G_CalculateStages
*/
void G_CalculateStages( void )
{
- float alienPlayerCountMod = (float)level.numAlienClients / PLAYER_COUNT_MOD;
- float humanPlayerCountMod = (float)level.numHumanClients / PLAYER_COUNT_MOD;
+ float alienPlayerCountMod = level.averageNumAlienClients / PLAYER_COUNT_MOD;
+ float humanPlayerCountMod = level.averageNumHumanClients / PLAYER_COUNT_MOD;
if( alienPlayerCountMod < 0.1f )
alienPlayerCountMod = 0.1f;
@@ -1016,7 +1016,7 @@ void G_CalculateStages( void )
humanPlayerCountMod = 0.1f;
if( g_alienKills.integer >=
- (int)( (float)g_alienStage2Threshold.integer * alienPlayerCountMod ) &&
+ (int)( ceil( (float)g_alienStage2Threshold.integer * alienPlayerCountMod ) ) &&
g_alienStage.integer == S1 && g_alienMaxStage.integer > S1 )
{
G_Checktrigger_stages( PTE_ALIENS, S2 );
@@ -1024,7 +1024,7 @@ void G_CalculateStages( void )
}
if( g_alienKills.integer >=
- (int)( (float)g_alienStage3Threshold.integer * alienPlayerCountMod ) &&
+ (int)( ceil( (float)g_alienStage3Threshold.integer * alienPlayerCountMod ) ) &&
g_alienStage.integer == S2 && g_alienMaxStage.integer > S2 )
{
G_Checktrigger_stages( PTE_ALIENS, S3 );
@@ -1032,7 +1032,7 @@ void G_CalculateStages( void )
}
if( g_humanKills.integer >=
- (int)( (float)g_humanStage2Threshold.integer * humanPlayerCountMod ) &&
+ (int)( ceil( (float)g_humanStage2Threshold.integer * humanPlayerCountMod ) ) &&
g_humanStage.integer == S1 && g_humanMaxStage.integer > S1 )
{
G_Checktrigger_stages( PTE_HUMANS, S2 );
@@ -1040,7 +1040,7 @@ void G_CalculateStages( void )
}
if( g_humanKills.integer >=
- (int)( (float)g_humanStage3Threshold.integer * humanPlayerCountMod ) &&
+ (int)( ceil( (float)g_humanStage3Threshold.integer * humanPlayerCountMod ) ) &&
g_humanStage.integer == S2 && g_humanMaxStage.integer > S2 )
{
G_Checktrigger_stages( PTE_HUMANS, S3 );
@@ -1057,6 +1057,21 @@ Calculates the average number of players playing this game
*/
void G_CalculateAvgPlayers( void )
{
+ //there are no clients or only spectators connected, so
+ //reset the number of samples in order to avoid the situation
+ //where the average tends to 0
+ if( !level.numAlienClients )
+ {
+ level.numAlienSamples = 0;
+ trap_Cvar_Set( "g_alienKills", "0" );
+ }
+
+ if( !level.numHumanClients )
+ {
+ level.numHumanSamples = 0;
+ trap_Cvar_Set( "g_humanKills", "0" );
+ }
+
//calculate average number of clients for stats
level.averageNumAlienClients =
( ( level.averageNumAlienClients * level.numAlienSamples )
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index 3518bb9c..84773855 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -815,7 +815,7 @@ void CheckGrabAttack( gentity_t *ent )
traceEnt->client->ps.stats[ STAT_STATE ] |= SS_GRABBED;
//if getting damaged, don't reset the grab time
- if( ( ent->client->lastDamageTime + ALIEN_REGEN_DAMAGE_TIME ) < level.time )
+ if( ( ent->client->lastDamageTime + LEVEL1_GRAB_TIME ) < level.time )
traceEnt->client->lastGrabTime = level.time;
}
else if( traceEnt->s.eType == ET_BUILDABLE &&