diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 2 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 5 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 3 | ||||
-rw-r--r-- | src/cgame/cg_players.c | 24 | ||||
-rw-r--r-- | src/cgame/cg_view.c | 24 |
5 files changed, 41 insertions, 17 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 5002fc9a..32b7f44b 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -487,6 +487,8 @@ static void CG_DrawPlayerStaminaBolt( rectDef_t *rect, vec4_t color, qhandle_t s if( stamina < 0 ) color[ 3 ] = HH_MIN_ALPHA; + else if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_SPEEDBOOST ) + color[ 3 ] = 1.0f; else color[ 3 ] = HH_MAX_ALPHA; diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 8dfd09a4..540d3d62 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -657,6 +657,8 @@ typedef struct centity_s particleSystem_t *jetPackPS; jetPackState_t jetPackState; + particleSystem_t *poisonCloudedPS; + particleSystem_t *entityPS; qboolean entityPSMissing; @@ -1122,6 +1124,7 @@ typedef struct int numConsoleLines; particleSystem_t *poisonCloudPS; + particleSystem_t *poisonCloudedPS; float painBlendValue; float painBlendTarget; @@ -1252,6 +1255,7 @@ typedef struct sfxHandle_t buildableRepairedSound; qhandle_t poisonCloudPS; + qhandle_t poisonCloudedPS; qhandle_t alienEvolvePS; qhandle_t alienAcidTubePS; @@ -1514,6 +1518,7 @@ extern vmCvar_t cg_painBlendScale; extern vmCvar_t cg_painBlendZoom; extern vmCvar_t cg_stickySpec; +extern vmCvar_t cg_alwaysSprint; extern vmCvar_t ui_currentClass; extern vmCvar_t ui_carriage; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index a2027b3e..7ad1c21f 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -225,6 +225,7 @@ vmCvar_t cg_painBlendScale; vmCvar_t cg_painBlendZoom; vmCvar_t cg_stickySpec; +vmCvar_t cg_alwaysSprint; vmCvar_t ui_currentClass; vmCvar_t ui_carriage; @@ -326,6 +327,7 @@ static cvarTable_t cvarTable[ ] = { &cg_wwFollow, "cg_wwFollow", "1", CVAR_ARCHIVE|CVAR_USERINFO }, { &cg_wwToggle, "cg_wwToggle", "1", CVAR_ARCHIVE|CVAR_USERINFO }, { &cg_stickySpec, "cg_stickySpec", "1", CVAR_ARCHIVE|CVAR_USERINFO }, + { &cg_alwaysSprint, "cg_alwaysSprint", "0", CVAR_ARCHIVE|CVAR_USERINFO }, { &cg_depthSortParticles, "cg_depthSortParticles", "1", CVAR_ARCHIVE }, { &cg_bounceParticles, "cg_bounceParticles", "0", CVAR_ARCHIVE }, { &cg_consoleLatency, "cg_consoleLatency", "3000", CVAR_ARCHIVE }, @@ -853,6 +855,7 @@ static void CG_RegisterGraphics( void ) cgs.media.wakeMarkShader = trap_R_RegisterShader( "gfx/marks/wake" ); cgs.media.poisonCloudPS = CG_RegisterParticleSystem( "firstPersonPoisonCloudPS" ); + cgs.media.poisonCloudedPS = CG_RegisterParticleSystem( "poisonCloudedPS" ); cgs.media.alienEvolvePS = CG_RegisterParticleSystem( "alienEvolvePS" ); cgs.media.alienAcidTubePS = CG_RegisterParticleSystem( "alienAcidTubePS" ); diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index 95ec60bb..cdfbc747 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -1667,13 +1667,6 @@ static void CG_PlayerSprites( centity_t *cent ) CG_PlayerFloatSprite( cent, cgs.media.connectionShader ); return; } - - if( cent->currentState.eFlags & EF_TALK ) - { - // the masses have decreed this to be wrong -/* CG_PlayerFloatSprite( cent, cgs.media.balloonShader ); - return;*/ - } } /* @@ -2165,6 +2158,21 @@ void CG_Player( centity_t *cent ) head.renderfx = renderfx; trap_R_AddRefEntityToScene( &head ); + + // if this player has been hit with poison cloud, add an effect PS + if( ( es->eFlags & EF_POISONCLOUDED ) && + ( es->number != cg.snap->ps.clientNum || cg.renderingThirdPerson ) ) + { + if( !CG_IsParticleSystemValid( ¢->poisonCloudedPS ) ) + cent->poisonCloudedPS = CG_SpawnNewParticleSystem( cgs.media.poisonCloudedPS ); + + CG_SetAttachmentTag( ¢->poisonCloudedPS->attachment, + head, head.hModel, "tag_head" ); + CG_SetAttachmentCent( ¢->poisonCloudedPS->attachment, cent ); + CG_AttachToTag( ¢->poisonCloudedPS->attachment ); + } + else if( CG_IsParticleSystemValid( ¢->poisonCloudedPS ) ) + CG_DestroyParticleSystem( ¢->poisonCloudedPS ); } // @@ -2179,7 +2187,7 @@ void CG_Player( centity_t *cent ) } CG_PlayerUpgrades( cent, &torso ); - + //sanity check that particle systems are stopped when dead if( es->eFlags & EF_DEAD ) { diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index 9772e1f5..94e7187c 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -577,14 +577,18 @@ static void CG_OffsetFirstPersonView( void ) cg.upMoveTime = cg.time; } - if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_POISONCLOUDED && + if( ( cg.predictedPlayerEntity.currentState.eFlags & EF_POISONCLOUDED ) && !( cg.snap->ps.pm_flags & PMF_FOLLOW ) ) { - float fraction = sin( ( (float)cg.time / 1000.0f ) * M_PI * 2 * PCLOUD_ROLL_FREQUENCY ); - float pitchFraction = sin( ( (float)cg.time / 1000.0f ) * M_PI * 5 * PCLOUD_ROLL_FREQUENCY ); - - fraction *= 1.0f - ( ( cg.time - cg.poisonedTime ) / (float)LEVEL1_PCLOUD_TIME ); - pitchFraction *= 1.0f - ( ( cg.time - cg.poisonedTime ) / (float)LEVEL1_PCLOUD_TIME ); + float scale, fraction, pitchFraction; + + scale = 1.0f - (float)( cg.time - cg.poisonedTime ) / + BG_PlayerPoisonCloudTime( &cg.predictedPlayerState ); + if( scale < 0.0f ) + scale = 0.0f; + fraction = sin( cg.time / 500.0f * M_PI * PCLOUD_ROLL_FREQUENCY ) * scale; + pitchFraction = sin( cg.time / 200.0f * M_PI * PCLOUD_ROLL_FREQUENCY ) * + scale; angles[ ROLL ] += fraction * PCLOUD_ROLL_AMPLITUDE; angles[ YAW ] += fraction * PCLOUD_ROLL_AMPLITUDE; @@ -780,13 +784,15 @@ static int CG_CalcFov( void ) else inwater = qfalse; - if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_POISONCLOUDED && + if( ( cg.predictedPlayerEntity.currentState.eFlags & EF_POISONCLOUDED ) && cg.predictedPlayerState.stats[ STAT_HEALTH ] > 0 && !( cg.snap->ps.pm_flags & PMF_FOLLOW ) ) { + float scale = 1.0f - (float)( cg.time - cg.poisonedTime ) / + BG_PlayerPoisonCloudTime( &cg.predictedPlayerState ); + phase = cg.time / 1000.0 * PCLOUD_ZOOM_FREQUENCY * M_PI * 2; - v = PCLOUD_ZOOM_AMPLITUDE * sin( phase ); - v *= 1.0f - ( ( cg.time - cg.poisonedTime ) / (float)LEVEL1_PCLOUD_TIME ); + v = PCLOUD_ZOOM_AMPLITUDE * sin( phase ) * scale; fov_x += v; fov_y += v; } |