summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorenneract <trem.redman@gmail.com>2014-12-12 20:45:09 +0100
committerenneract <trem.redman@gmail.com>2014-12-12 20:45:09 +0100
commit964371805c751877c99ed2faeb8214355c2b3d6b (patch)
tree60cce1719928b9d8a376e0040841748e99cf3b84 /src/game
parent9d1b014b113ae04fe2d15ea12bf2e21b74f7df60 (diff)
Flash BP display when MOD_NOBP kills a building.
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_local.h5
-rw-r--r--src/game/g_main.c26
2 files changed, 29 insertions, 2 deletions
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 32b6075..eb5f37e 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -713,6 +713,11 @@ typedef struct
buildLog_t buildLog[ MAX_BUILDLOG ];
int buildId;
int numBuildLogs;
+
+ qboolean alienNoBPFlash;
+ qboolean humanNoBPFlash;
+ int alienNoBPFlashTime;
+ int humanNoBPFlashTime;
} level_locals_t;
#define CMD_CHEAT 0x0001
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 62df632..57b4af4 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -653,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 ] )
@@ -1405,11 +1406,25 @@ void G_CalculateBuildPoints( void )
level.alienBuildPoints += level.alienExtraBuildPoints;
}
- trap_SetConfigstring( CS_BUILD_POOLS, va( "a\\%d\\ad\\%d\\h\\%d\\hd\\%d",
+ 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 ) );
+ g_humanBuildPoints.integer,
+ level.humanNoBPFlashTime ) );
//zero bp not allowed
// if( level.humanBuildPoints < 0 )
@@ -1481,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;
+ }
}
}
}