From 04fa335c32eca9a86bcc4912351bb5190665420d Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sun, 29 Mar 2020 20:59:17 +0200 Subject: Getting this ready for testing --- src/game/g_active.c | 4 +++- src/game/g_client.c | 13 +++++++++++++ src/game/g_local.h | 3 +++ src/game/g_main.c | 10 +++++++++- 4 files changed, 28 insertions(+), 2 deletions(-) (limited to 'src/game') diff --git a/src/game/g_active.c b/src/game/g_active.c index 4059259..baba182 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -658,6 +658,8 @@ void G_Coronavirus( gentity_t *ent ) else if( distance < COVID_RANGE / 2.0f ) chance *= 2.0f; + chance *= g_covidInfectionFactor.value; + trap_SendServerCommand( (int)( ent - g_entities ), va( "print \"^1COVID:^7 Chance to infect %s^7 is ^1%f^7\n\"", target->client->pers.netname, chance ) ); @@ -699,7 +701,7 @@ void G_Coronavirus( gentity_t *ent ) G_AddEvent( ent, EV_COUGH, 0 ); } - client->covidDamage += client->covidSeverity; + client->covidDamage += client->covidSeverity * g_covidSeverityFactor.value; if( client->covidDamage > 1.0f ) { int damage; diff --git a/src/game/g_client.c b/src/game/g_client.c index 9f6710c..9801ff9 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1915,7 +1915,20 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles // 1 in 10 chance they spawn sick //if( rand( ) % 10 == 0 ) if( client->pers.classSelection != PCL_NONE ) + { + for( i = 0; i < level.maxclients; i++ ) + { + gentity_t *ent = g_entities + i; + + if( ent->client && ent->health > 0 && ent->client->covidKind > COVID_NONE + && ent->client->covidKind < COVID_RECOVERED ) + goto spawn_healthy; + } + + trap_SendServerCommand( ent - g_entities, "print \"^1COVID^7: You're patient zero.\n\"" ); G_ContractCoronavirus( ent ); + } +spawn_healthy: // health will count down towards max_health ent->health = client->ps.stats[ STAT_HEALTH ] = client->ps.stats[ STAT_MAX_HEALTH ]; //* 1.25; diff --git a/src/game/g_local.h b/src/game/g_local.h index a088551..47375d2 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -1521,6 +1521,9 @@ extern vmCvar_t g_maxGhosts; extern vmCvar_t g_specNoclip; extern vmCvar_t g_practise; +extern vmCvar_t g_covidInfectionFactor; +extern vmCvar_t g_covidSeverityFactor; + void trap_Printf( const char *fmt ); void trap_Error( const char *fmt ); int trap_Milliseconds( void ); diff --git a/src/game/g_main.c b/src/game/g_main.c index 9bf9b38..410926a 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -246,6 +246,10 @@ vmCvar_t g_adminAutobahnNotify; vmCvar_t g_maxGhosts; vmCvar_t g_specNoclip; vmCvar_t g_practise; +vmCvar_t g_tyrantNerf; + +vmCvar_t g_covidInfectionFactor; +vmCvar_t g_covidSeverityFactor; static cvarTable_t gameCvarTable[ ] = { @@ -471,7 +475,11 @@ static cvarTable_t gameCvarTable[ ] = { &g_adminAutobahnNotify, "g_adminAutobahnNotify", "1", CVAR_ARCHIVE, 0, qfalse }, { &g_maxGhosts, "g_maxGhosts", "0", CVAR_ARCHIVE, 0, qfalse }, { &g_specNoclip, "g_specNoclip", "0", CVAR_ARCHIVE, 0, qtrue }, - { &g_practise, "g_practise", "0", CVAR_ARCHIVE, 0, qfalse } + { &g_practise, "g_practise", "0", CVAR_ARCHIVE, 0, qfalse }, + { &g_tyrantNerf, "g_tyrantNerf", "0", CVAR_ARCHIVE, 0, qfalse }, + + { &g_covidInfectionFactor, "g_covidInfectionFactor", "1", CVAR_ARCHIVE, 0, qtrue }, + { &g_covidSeverityFactor, "g_covidSeverityFactor", "1", CVAR_ARCHIVE, 0, qtrue }, }; static int gameCvarTableSize = sizeof( gameCvarTable ) / sizeof( gameCvarTable[ 0 ] ); -- cgit