diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2015-04-11 21:17:39 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2015-04-11 21:17:39 +0200 |
commit | 397f8c6f86aa68eeef6a94cc33473c0ffd69372d (patch) | |
tree | 75c44e5265f1d94607b9fd3e573b418ba3b2fc63 /src/cgame/cg_view.c | |
parent | 22bfcab00937a147a91073796d71538dadbee491 (diff) |
Revert the removal of stamina and sprinting.
Diffstat (limited to 'src/cgame/cg_view.c')
-rw-r--r-- | src/cgame/cg_view.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index 333e421..1221fe9 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -809,6 +809,18 @@ void CG_OffsetFirstPersonView( void ) cg.predictedPlayerState.pm_type == PM_JETPACK ) ) { angles[PITCH] += cg.bobfracsin * bob2 * 0.5; + + // heavy breathing effects //FIXME: sound + if( cg.predictedPlayerState.stats[ STAT_STAMINA ] < STAMINA_BREATHING_LEVEL ) + { + float deltaBreath = ( cg.predictedPlayerState.stats[ STAT_STAMINA ] - + STAMINA_BREATHING_LEVEL ) / -250.0; + float deltaAngle = cos( (float)cg.time/150.0 ) * deltaBreath; + + deltaAngle += ( deltaAngle < 0 ? -deltaAngle : deltaAngle ) * 0.5; + + angles[ PITCH ] -= deltaAngle; + } } //=================================== |