diff options
author | Roman Tetelman <kevlarman@gmail.com> | 2009-10-03 12:18:29 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:15:50 +0000 |
commit | da6e5c087e80781a18025d692b53e17dd91c6d66 (patch) | |
tree | 66dcc3ce5459c73c246424a7d94e3cc7017cc8de /src/game | |
parent | e8e306e2e8e57d7d612ad7c9cc70a0314ef1d58c (diff) |
* Revert stagedowns (fixes #2)
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_local.h | 12 | ||||
-rw-r--r-- | src/game/g_main.c | 169 | ||||
-rw-r--r-- | src/game/g_spawn.c | 27 | ||||
-rw-r--r-- | src/game/tremulous.h | 7 |
4 files changed, 49 insertions, 166 deletions
diff --git a/src/game/g_local.h b/src/game/g_local.h index 56985299..e0a9cca1 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -616,10 +616,6 @@ typedef struct int humanStage2Time; int humanStage3Time; - int alienStagedownCredits; // Credits at the time the opposing team - int humanStagedownCredits; // became vulnerable to a stage-down - - qboolean uncondAlienWin; qboolean uncondHumanWin; qboolean alienTeamLocked; @@ -1129,13 +1125,13 @@ extern vmCvar_t g_alienBuildPoints; extern vmCvar_t g_humanStage; extern vmCvar_t g_humanCredits; extern vmCvar_t g_humanMaxStage; -extern vmCvar_t g_humanMaxReachedStage; -extern vmCvar_t g_humanStageThreshold; +extern vmCvar_t g_humanStage2Threshold; +extern vmCvar_t g_humanStage3Threshold; extern vmCvar_t g_alienStage; extern vmCvar_t g_alienCredits; extern vmCvar_t g_alienMaxStage; -extern vmCvar_t g_alienMaxReachedStage; -extern vmCvar_t g_alienStageThreshold; +extern vmCvar_t g_alienStage2Threshold; +extern vmCvar_t g_alienStage3Threshold; extern vmCvar_t g_unlagged; diff --git a/src/game/g_main.c b/src/game/g_main.c index 61cf36e5..ebfea1ef 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -92,15 +92,13 @@ vmCvar_t g_alienBuildPoints; vmCvar_t g_humanStage; vmCvar_t g_humanCredits; vmCvar_t g_humanMaxStage; -vmCvar_t g_humanMaxReachedStage; -vmCvar_t g_humanStageThreshold; - +vmCvar_t g_humanStage2Threshold; +vmCvar_t g_humanStage3Threshold; vmCvar_t g_alienStage; vmCvar_t g_alienCredits; vmCvar_t g_alienMaxStage; -vmCvar_t g_alienMaxReachedStage; -vmCvar_t g_alienStageThreshold; -vmCvar_t g_allowStageDowns; +vmCvar_t g_alienStage2Threshold; +vmCvar_t g_alienStage3Threshold; vmCvar_t g_unlagged; @@ -223,13 +221,13 @@ static cvarTable_t gameCvarTable[ ] = { &g_humanStage, "g_humanStage", "0", 0, 0, qfalse }, { &g_humanCredits, "g_humanCredits", "0", 0, 0, qfalse }, { &g_humanMaxStage, "g_humanMaxStage", DEFAULT_HUMAN_MAX_STAGE, 0, 0, qfalse }, - { &g_humanMaxReachedStage, "g_humanMaxReachedStage", "0", 0, 0, qfalse }, - { &g_humanStageThreshold, "g_humanStageThreshold", DEFAULT_HUMAN_STAGE_THRESH, 0, 0, qfalse }, + { &g_humanStage2Threshold, "g_humanStage2Threshold", DEFAULT_HUMAN_STAGE2_THRESH, 0, 0, qfalse }, + { &g_humanStage3Threshold, "g_humanStage3Threshold", DEFAULT_HUMAN_STAGE3_THRESH, 0, 0, qfalse }, { &g_alienStage, "g_alienStage", "0", 0, 0, qfalse }, { &g_alienCredits, "g_alienCredits", "0", 0, 0, qfalse }, { &g_alienMaxStage, "g_alienMaxStage", DEFAULT_ALIEN_MAX_STAGE, 0, 0, qfalse }, - { &g_alienMaxReachedStage, "g_alienMaxReachedStage", "0", 0, 0, qfalse }, - { &g_alienStageThreshold, "g_alienStageThreshold", DEFAULT_ALIEN_STAGE_THRESH, 0, 0, qfalse }, + { &g_alienStage2Threshold, "g_alienStage2Threshold", DEFAULT_ALIEN_STAGE2_THRESH, 0, 0, qfalse }, + { &g_alienStage3Threshold, "g_alienStage3Threshold", DEFAULT_ALIEN_STAGE3_THRESH, 0, 0, qfalse }, { &g_unlagged, "g_unlagged", "1", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qfalse }, @@ -541,7 +539,6 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) level.startTime = levelTime; level.alienStage2Time = level.alienStage3Time = level.humanStage2Time = level.humanStage3Time = level.startTime; - level.alienStagedownCredits = level.humanStagedownCredits = -1; level.snd_fry = G_SoundIndex( "sound/misc/fry.wav" ); // FIXME standing in lava / slime @@ -636,8 +633,6 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) //reset stages trap_Cvar_Set( "g_alienStage", va( "%d", S1 ) ); trap_Cvar_Set( "g_humanStage", va( "%d", S1 ) ); - trap_Cvar_Set( "g_humanMaxReachedStage", va( "%d", S1 ) ); - trap_Cvar_Set( "g_alienMaxReachedStage", va( "%d", S1 ) ); trap_Cvar_Set( "g_alienCredits", 0 ); trap_Cvar_Set( "g_humanCredits", 0 ); @@ -1172,18 +1167,17 @@ void G_CalculateBuildPoints( void ) if( humanPlayerCountMod < 0.1f ) humanPlayerCountMod = 0.1f; - if( g_alienStage.integer < g_alienMaxStage.integer ) - alienNextStageThreshold = (int)( ceil( (float)g_alienStageThreshold.integer * (g_alienStage.integer + 1) * alienPlayerCountMod ) ); - else if( g_humanStage.integer > S1 ) - alienNextStageThreshold = (int)( ceil( (float)level.alienStagedownCredits + g_alienStageThreshold.integer * alienPlayerCountMod ) ); + if( g_alienStage.integer == S1 && g_alienMaxStage.integer > S1 ) + alienNextStageThreshold = (int)( ceil( (float)g_alienStage2Threshold.integer * alienPlayerCountMod ) ); + else if( g_alienStage.integer == S2 && g_alienMaxStage.integer > S2 ) + alienNextStageThreshold = (int)( ceil( (float)g_alienStage3Threshold.integer * alienPlayerCountMod ) ); else alienNextStageThreshold = -1; - - if( g_humanStage.integer < g_humanMaxStage.integer ) - humanNextStageThreshold = (int)( ceil( (float)g_humanStageThreshold.integer * (g_humanStage.integer + 1) * humanPlayerCountMod ) ); - else if( g_alienStage.integer > S1 ) - humanNextStageThreshold = (int)( ceil( (float)level.humanStagedownCredits + g_humanStageThreshold.integer * humanPlayerCountMod ) ); + if( g_humanStage.integer == S1 && g_humanMaxStage.integer > S1 ) + humanNextStageThreshold = (int)( ceil( (float)g_humanStage2Threshold.integer * humanPlayerCountMod ) ); + else if( g_humanStage.integer == S2 && g_humanMaxStage.integer > S2 ) + humanNextStageThreshold = (int)( ceil( (float)g_humanStage3Threshold.integer * humanPlayerCountMod ) ); else humanNextStageThreshold = -1; @@ -1213,7 +1207,6 @@ void G_CalculateStages( void ) static int lastAlienStageModCount = 1; static int lastHumanStageModCount = 1; - if( alienPlayerCountMod < 0.1f ) alienPlayerCountMod = 0.1f; @@ -1221,165 +1214,63 @@ void G_CalculateStages( void ) humanPlayerCountMod = 0.1f; if( g_alienCredits.integer >= - (int)( ceil( (float)g_alienStageThreshold.integer * S2 * alienPlayerCountMod ) ) && + (int)( ceil( (float)g_alienStage2Threshold.integer * alienPlayerCountMod ) ) && g_alienStage.integer == S1 && g_alienMaxStage.integer > S1 ) { trap_Cvar_Set( "g_alienStage", va( "%d", S2 ) ); level.alienStage2Time = level.time; - lastAlienStageModCount = g_alienMaxReachedStage.modificationCount; - if( g_humanStage.integer == S3 ) - level.humanStagedownCredits = g_humanCredits.integer; - G_LogPrintf( "stagedownlog: aliens s2, humans s%d; %d %d %d %d\n", - g_humanStage.integer + 1, - g_humanCredits.integer, - level.humanStagedownCredits, - g_alienCredits.integer, - level.alienStagedownCredits ); + lastAlienStageModCount = g_alienStage.modificationCount; } if( g_alienCredits.integer >= - (int)( ceil( (float)g_alienStageThreshold.integer * S3 * alienPlayerCountMod ) ) && + (int)( ceil( (float)g_alienStage3Threshold.integer * alienPlayerCountMod ) ) && g_alienStage.integer == S2 && g_alienMaxStage.integer > S2 ) { trap_Cvar_Set( "g_alienStage", va( "%d", S3 ) ); level.alienStage3Time = level.time; - lastAlienStageModCount = g_alienMaxReachedStage.modificationCount; - if( g_humanStage.integer > S1 ) - level.alienStagedownCredits = g_alienCredits.integer; - G_LogPrintf( "stagedownlog: aliens s3, humans s%d; %d %d %d %d\n", - g_humanStage.integer + 1, - g_humanCredits.integer, - level.humanStagedownCredits, - g_alienCredits.integer, - level.alienStagedownCredits ); + lastAlienStageModCount = g_alienStage.modificationCount; } if( g_humanCredits.integer >= - (int)( ceil( (float)g_humanStageThreshold.integer * S2 * humanPlayerCountMod ) ) && + (int)( ceil( (float)g_humanStage2Threshold.integer * humanPlayerCountMod ) ) && g_humanStage.integer == S1 && g_humanMaxStage.integer > S1 ) { trap_Cvar_Set( "g_humanStage", va( "%d", S2 ) ); - level.humanStage2Time = level.time; - lastHumanStageModCount = g_humanMaxReachedStage.modificationCount; - if( g_alienStage.integer == S3 ) - level.alienStagedownCredits = g_alienCredits.integer; - G_LogPrintf( "stagedownlog: humans s2, aliens s%d; %d %d %d %d\n", - g_alienStage.integer + 1, - g_humanCredits.integer, - level.humanStagedownCredits, - g_alienCredits.integer, - level.alienStagedownCredits ); + lastHumanStageModCount = g_humanStage.modificationCount; } - - if( g_humanCredits.integer >= - (int)( ceil( (float)g_humanStageThreshold.integer * S3 * humanPlayerCountMod ) ) && + (int)( ceil( (float)g_humanStage3Threshold.integer * humanPlayerCountMod ) ) && g_humanStage.integer == S2 && g_humanMaxStage.integer > S2 ) { trap_Cvar_Set( "g_humanStage", va( "%d", S3 ) ); level.humanStage3Time = level.time; - lastHumanStageModCount = g_humanMaxReachedStage.modificationCount; - if( g_alienStage.integer > S1 ) - level.humanStagedownCredits = g_humanCredits.integer; - G_LogPrintf( "stagedownlog: humans s3, aliens s%d; %d %d %d %d\n", - g_alienStage.integer + 1, - g_humanCredits.integer, - level.humanStagedownCredits, - g_alienCredits.integer, - level.alienStagedownCredits ); - } - if( g_alienStage.integer > S1 && - g_humanStage.integer == S3 && - g_humanCredits.integer - level.humanStagedownCredits >= - (int) ceil( g_humanStageThreshold.integer * humanPlayerCountMod ) ) - { - G_LogPrintf( "stagedownlog: aliens staging down\n" - "stagedownlog: before: %d %d %d %d %d %d\n", - g_humanStage.integer, - g_humanCredits.integer, - level.humanStagedownCredits, - g_alienStage.integer, - g_alienCredits.integer, - level.alienStagedownCredits); - - if( g_alienStage.integer == S3 ) - level.alienStage3Time = level.startTime; - if( g_alienStage.integer == S2 ) - level.alienStage2Time = level.startTime; - lastAlienStageModCount = g_alienStage.modificationCount; - trap_Cvar_Set( "g_alienStage", va( "%d", g_alienStage.integer - 1 ) ); - trap_Cvar_Set( "g_alienCredits", va( "%d", (int)ceil(g_alienCredits.integer - g_alienStageThreshold.integer * alienPlayerCountMod) ) ); - trap_Cvar_Set( "g_humanCredits", va( "%d", (int)ceil(g_humanCredits.integer - g_humanStageThreshold.integer * humanPlayerCountMod) ) ); - G_LogPrintf( "stagedownlog: after: %d %d %d %d %d %d\n", - trap_Cvar_VariableIntegerValue( "g_humanStage" ), - trap_Cvar_VariableIntegerValue( "g_humanCredits" ), - level.humanStagedownCredits, - trap_Cvar_VariableIntegerValue( "g_alienStage" ), - trap_Cvar_VariableIntegerValue( "g_alienCredits" ), - level.alienStagedownCredits); - trap_Cvar_Update( &g_humanCredits ); - trap_Cvar_Update( &g_alienCredits ); - trap_Cvar_Update( &g_humanStage ); - - } - if( g_humanStage.integer > S1 && - g_alienStage.integer == S3 && - g_alienCredits.integer - level.alienStagedownCredits >= - (int) ceil( g_alienStageThreshold.integer * alienPlayerCountMod ) ) - { - G_LogPrintf( "stagedownlog: humans staging down\n" - "stagedownlog: before: %d %d %d %d %d %d\n", - g_humanStage.integer, - g_humanCredits.integer, - level.humanStagedownCredits, - g_alienStage.integer, - g_alienCredits.integer, - level.alienStagedownCredits); - - if( g_humanStage.integer == S3 ) - level.humanStage3Time = level.startTime; - if( g_humanStage.integer == S2 ) - level.humanStage2Time = level.startTime; lastHumanStageModCount = g_humanStage.modificationCount; - trap_Cvar_Set( "g_humanStage", va( "%d", g_humanStage.integer - 1 ) ); - trap_Cvar_Set( "g_humanCredits", va( "%d", (int)ceil(g_humanCredits.integer - g_humanStageThreshold.integer * humanPlayerCountMod) ) ); - trap_Cvar_Set( "g_alienCredits", va( "%d", (int)ceil(g_alienCredits.integer - g_alienStageThreshold.integer * alienPlayerCountMod) ) ); - G_LogPrintf( "stagedownlog: after: %d %d %d %d %d %d\n", - trap_Cvar_VariableIntegerValue( "g_humanStage" ), - trap_Cvar_VariableIntegerValue( "g_humanCredits" ), - level.humanStagedownCredits, - trap_Cvar_VariableIntegerValue( "g_alienStage" ), - trap_Cvar_VariableIntegerValue( "g_alienCredits" ), - level.alienStagedownCredits); - trap_Cvar_Update( &g_humanCredits ); - trap_Cvar_Update( &g_alienCredits ); - trap_Cvar_Update( &g_humanStage ); } - - if( g_alienMaxReachedStage.modificationCount > lastAlienStageModCount ) + + if( g_alienStage.modificationCount > lastAlienStageModCount ) { - G_Checktrigger_stages( TEAM_ALIENS, g_alienMaxReachedStage.integer ); + G_Checktrigger_stages( TEAM_ALIENS, g_alienStage.integer ); if( g_alienStage.integer == S2 ) level.alienStage2Time = level.time; else if( g_alienStage.integer == S3 ) level.alienStage3Time = level.time; - lastAlienStageModCount = g_alienMaxReachedStage.modificationCount; + lastAlienStageModCount = g_alienStage.modificationCount; } - if( g_humanMaxReachedStage.modificationCount > lastHumanStageModCount ) + if( g_humanStage.modificationCount > lastHumanStageModCount ) { - G_Checktrigger_stages( TEAM_HUMANS, g_humanMaxReachedStage.integer ); + G_Checktrigger_stages( TEAM_HUMANS, g_humanStage.integer ); if( g_humanStage.integer == S2 ) level.humanStage2Time = level.time; else if( g_humanStage.integer == S3 ) level.humanStage3Time = level.time; - lastHumanStageModCount = g_humanMaxReachedStage.modificationCount; + lastHumanStageModCount = g_humanStage.modificationCount; } } diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c index c6fe5e06..e505a21b 100644 --- a/src/game/g_spawn.c +++ b/src/game/g_spawn.c @@ -626,28 +626,23 @@ void SP_worldspawn( void ) G_SpawnString( "humanMaxStage", DEFAULT_HUMAN_MAX_STAGE, &s ); trap_Cvar_Set( "g_humanMaxStage", s ); - //for compatibility with 1.1 maps - if( G_SpawnString( "humanStage2Threshold", DEFAULT_HUMAN_STAGE_THRESH, &s ) ) - trap_Cvar_Set( "g_humanStageThreshold", s ); - else - { - //proper way - G_SpawnString( "humanStageThreshold", DEFAULT_HUMAN_STAGE_THRESH, &s ); - trap_Cvar_Set( "g_humanStageThreshold", s ); - } + G_SpawnString( "humanStage2Threshold", DEFAULT_HUMAN_STAGE2_THRESH, &s ); + trap_Cvar_Set( "g_humanStage2Threshold", s ); + + G_SpawnString( "humanStage3Threshold", DEFAULT_HUMAN_STAGE3_THRESH, &s ); + trap_Cvar_Set( "g_humanStage3Threshold", s ); + G_SpawnString( "alienBuildPoints", DEFAULT_ALIEN_BUILDPOINTS, &s ); trap_Cvar_Set( "g_alienBuildPoints", s ); G_SpawnString( "alienMaxStage", DEFAULT_ALIEN_MAX_STAGE, &s ); trap_Cvar_Set( "g_alienMaxStage", s ); - if( G_SpawnString( "alienStage2Threshold", DEFAULT_ALIEN_STAGE_THRESH, &s ) ) - trap_Cvar_Set( "g_alienStageThreshold", s ); - else - { - G_SpawnString( "alienStage2Threshold", DEFAULT_ALIEN_STAGE_THRESH, &s ); - trap_Cvar_Set( "g_alienStageThreshold", s ); - } + G_SpawnString( "alienStage2Threshold", DEFAULT_ALIEN_STAGE2_THRESH, &s ); + trap_Cvar_Set( "g_alienStage2Threshold", s ); + + G_SpawnString( "alienStage3Threshold", DEFAULT_ALIEN_STAGE3_THRESH, &s ); + trap_Cvar_Set( "g_alienStage3Threshold", s ); G_SpawnString( "enableDust", "0", &s ); trap_Cvar_Set( "g_enableDust", s ); diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 83723690..d54f3e3f 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -655,11 +655,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define FREEKILL_HUMAN LEVEL0_VALUE #define DEFAULT_ALIEN_BUILDPOINTS "100" -#define DEFAULT_ALIEN_STAGE_THRESH "8000" +#define DEFAULT_ALIEN_STAGE2_THRESH "8000" +#define DEFAULT_ALIEN_STAGE3_THRESH "16000" #define DEFAULT_ALIEN_MAX_STAGE "2" #define DEFAULT_HUMAN_BUILDPOINTS "100" -#define DEFAULT_HUMAN_STAGE_THRESH "4000" - +#define DEFAULT_HUMAN_STAGE2_THRESH "4000" +#define DEFAULT_HUMAN_STAGE3_THRESH "8000" #define DEFAULT_HUMAN_MAX_STAGE "2" #define DAMAGE_FRACTION_FOR_KILL 0.5f //how much damage players (versus structures) need to |