From a8c620187f089a4f7b0602d56ed5bbca9d6afd96 Mon Sep 17 00:00:00 2001 From: Mikko Tiusanen Date: Sat, 19 Jul 2014 20:07:41 +0300 Subject: The credit gain/loss at armageddon can now be customized through cvar. --- src/game/g_active.c | 17 ++++++++--------- src/game/g_local.h | 5 +++++ src/game/g_main.c | 2 ++ 3 files changed, 15 insertions(+), 9 deletions(-) (limited to 'src/game') diff --git a/src/game/g_active.c b/src/game/g_active.c index 9a4eb00..fc32ed6 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -1100,16 +1100,15 @@ void G_ArmaFreeLove( gentity_t *ent ) for( i = 0; i < g_maxclients.integer; i++ ) { - cl = level.clients + i; + cl = level.clients + i; - if( cl->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) - G_AddCreditToClient( cl, 7200, qtrue ); - else if( cl->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) - G_AddCreditToClient( cl, 4000, qtrue ); - } - trap_SendServerCommand( -1, "print \"^5A flying hotdog does its weener magic and converts buildings into pure joy!\n\"" ); - G_Sound( ent, CHAN_VOICE, G_SoundIndex( "sound/edge/hdoglove.wav" ) ); - + if( cl->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) + G_AddCreditToClient( cl, g_armageddonCreditAmount.integer, qtrue ); + else if( cl->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) + G_AddCreditToClient( cl, g_armageddonCreditAmount.integer, qtrue ); + } + trap_SendServerCommand( -1, "print \"^5A flying hotdog does its weener magic and converts buildings into pure joy!\n\"" ); + G_Sound( ent, CHAN_VOICE, G_SoundIndex( "sound/edge/hdoglove.wav" ) ); } diff --git a/src/game/g_local.h b/src/game/g_local.h index ab0809f..1804d1c 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -1147,6 +1147,11 @@ extern vmCvar_t g_minNameChangePeriod; extern vmCvar_t g_maxNameChanges; extern vmCvar_t g_timelimit; extern vmCvar_t g_suddenDeathTime; +extern vmCvar_t g_armageddonTimeStep; +extern vmCvar_t g_armageddonInitialTimeStep; +extern vmCvar_t g_armageddonDefensiveKillPercent; +extern vmCvar_t g_armageddonOtherKillPercent; +extern vmCvar_t g_armageddonCreditAmount; extern vmCvar_t g_friendlyFire; extern vmCvar_t g_friendlyBuildableFire; extern vmCvar_t g_dretchPunt; diff --git a/src/game/g_main.c b/src/game/g_main.c index 1a4857f..70c3e49 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -55,6 +55,7 @@ vmCvar_t g_armageddonTimeStep; vmCvar_t g_armageddonInitialTimeStep; vmCvar_t g_armageddonDefensiveKillPercent; vmCvar_t g_armageddonOtherKillPercent; +vmCvar_t g_armageddonCreditAmount; vmCvar_t g_friendlyFire; vmCvar_t g_friendlyBuildableFire; vmCvar_t g_dretchPunt; @@ -217,6 +218,7 @@ static cvarTable_t gameCvarTable[ ] = { &g_armageddonInitialTimeStep, "g_armageddonInitialTimeStep", "10", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, { &g_armageddonDefensiveKillPercent, "g_armageddonDefensiveKillPercent", "10", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, { &g_armageddonOtherKillPercent, "g_armageddonOtherKillPercent", "5", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, + { &g_armageddonCreditAmount, "g_armageddonCreditAmount", "500", CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_NORESTART, 0, qtrue }, { &g_synchronousClients, "g_synchronousClients", "0", CVAR_SYSTEMINFO, 0, qfalse }, { &g_friendlyFreeze, "g_friendlyFreeze", "0", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qfalse }, { &g_friendlyFire, "g_friendlyFire", "0", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qtrue }, -- cgit