From d9d4a8c3cb1fb226738278923cf8d5ba2b74efdf Mon Sep 17 00:00:00 2001 From: Michael Levin Date: Sat, 3 Oct 2009 11:13:10 +0000 Subject: Added armour files to version control. --- src/cgame/cg_weapons.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/cgame/cg_weapons.c') diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index fc8dc058..a74a15f4 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -1061,12 +1061,27 @@ void CG_AddViewWeapon( playerState_t *ps ) VectorMA( hand.origin, cg_gun_y.value, cg.refdef.viewaxis[ 1 ], hand.origin ); VectorMA( hand.origin, ( cg_gun_z.value + fovOffset ), cg.refdef.viewaxis[ 2 ], hand.origin ); - if( weapon == WP_LUCIFER_CANNON && ps->stats[ STAT_MISC ] > 0 ) + if( weapon == WP_LUCIFER_CANNON ) { - float fraction = (float)ps->stats[ STAT_MISC ] / (float)LCANNON_TOTAL_CHARGE; + float fraction; - VectorMA( hand.origin, random( ) * fraction, cg.refdef.viewaxis[ 0 ], hand.origin ); - VectorMA( hand.origin, random( ) * fraction, cg.refdef.viewaxis[ 1 ], hand.origin ); + if( ps->stats[ STAT_MISC ] > 0 ) + { + // vibration effect + fraction = (float)ps->stats[ STAT_MISC ] / (float)LCANNON_TOTAL_CHARGE; + VectorMA( hand.origin, random( ) * fraction, cg.refdef.viewaxis[ 0 ], + hand.origin ); + VectorMA( hand.origin, random( ) * fraction, cg.refdef.viewaxis[ 1 ], + hand.origin ); + } + else if( ps->stats[ STAT_MISC2 ] > 0 ) + { + // reloading effect + fraction = (float)ps->stats[ STAT_MISC2 ] / 250.0f; + fraction = ( fraction > 1.0f ) ? 1.0f : fraction; + VectorMA( hand.origin, fraction * -3.0f, cg.refdef.viewaxis[ 2 ], + hand.origin ); + } } AnglesToAxis( angles, hand.axis ); -- cgit