diff options
Diffstat (limited to 'src/cgame/cg_weapons.c')
-rw-r--r-- | src/cgame/cg_weapons.c | 23 |
1 files changed, 19 insertions, 4 deletions
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 ); |