summaryrefslogtreecommitdiff
path: root/src/cgame/cg_weapons.c
diff options
context:
space:
mode:
authorMichael Levin <risujin@fastmail.fm>2009-10-03 11:13:10 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:14:46 +0000
commitd9d4a8c3cb1fb226738278923cf8d5ba2b74efdf (patch)
tree23637261238f8791a95e33eef077079608de4030 /src/cgame/cg_weapons.c
parentae1fb9aecf949fb7261b3e4b065a4bddd016de6b (diff)
Added armour files to version control.
Diffstat (limited to 'src/cgame/cg_weapons.c')
-rw-r--r--src/cgame/cg_weapons.c23
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 );