From 921d0b7f04fb683b0a34add71dced0f286e7c887 Mon Sep 17 00:00:00 2001 From: Michael Levin Date: Sat, 3 Oct 2009 11:22:09 +0000 Subject: * Turrets back to their "dumb" behavior Pounce changes: * Mechanics simplified, descriptions in tremulous.h * Client side prediction (no jerkiness) * Pounce will gradually cancel if released in midair or release with insufficent charge --- src/cgame/cg_view.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'src/cgame') diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index ae7cf7bb..16a16478 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -503,26 +503,24 @@ static void CG_OffsetFirstPersonView( void ) #define LEVEL3_FEEDBACK 20.0f //provide some feedback for pouncing - if( cg.predictedPlayerState.weapon == WP_ALEVEL3 || - cg.predictedPlayerState.weapon == WP_ALEVEL3_UPG ) + if( ( cg.predictedPlayerState.weapon == WP_ALEVEL3 || + cg.predictedPlayerState.weapon == WP_ALEVEL3_UPG ) && + cg.predictedPlayerState.stats[ STAT_MISC ] > 0 ) { - if( cg.predictedPlayerState.stats[ STAT_MISC ] > 0 ) - { - float fraction1, fraction2; - vec3_t forward; - - AngleVectors( angles, forward, NULL, NULL ); - VectorNormalize( forward ); + float fraction1, fraction2; + vec3_t forward; - fraction1 = (float)( cg.time - cg.weapon2Time ) / (float)LEVEL3_POUNCE_CHARGE_TIME; + AngleVectors( angles, forward, NULL, NULL ); + VectorNormalize( forward ); - if( fraction1 > 1.0f ) - fraction1 = 1.0f; + fraction1 = (float)cg.predictedPlayerState.stats[ STAT_MISC ] / + LEVEL3_POUNCE_TIME_UPG; + if( fraction1 > 1.0f ) + fraction1 = 1.0f; - fraction2 = -sin( fraction1 * M_PI / 2 ); + fraction2 = -sin( fraction1 * M_PI / 2 ); - VectorMA( origin, LEVEL3_FEEDBACK * fraction2, forward, origin ); - } + VectorMA( origin, LEVEL3_FEEDBACK * fraction2, forward, origin ); } #define STRUGGLE_DIST 5.0f -- cgit