summaryrefslogtreecommitdiff
path: root/src/game/g_weapon.c
diff options
context:
space:
mode:
authorMichael Levin <risujin@fastmail.fm>2009-10-03 11:26:51 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:00 +0000
commit0cf04fe37fef2e827a95bb19926a3cbf8e98c581 (patch)
tree93ac01309f47edb27be26fb31e3886f6082579b1 /src/game/g_weapon.c
parentd9709deb95375f2462e5ca9fc98ebf92fd91ce04 (diff)
* Added charge meter to the UI, can be disabled via GUI
* Trample and Lucifer Cannon charging reworked and moved to PMove * Can no longer "cancel" a charging Lucifer Cannon * STAT_MISC2 is now unused, booster and charge information can be inferred elsewhere (STAT_UNUSED) * Trying to fire an empty weapon makes a clicking noise (also a bugfix, apparently the server would spam EV_NOAMMO which did nothing but is now used for the clicking noise -- audible to all players) * Created an alternate, muffled Lucifer Cannon warning noise for other people's Lucifer Cannons * Fixed bug which prevented players from switching to a different player while spectating someone in the spawn queue * Spectators are now properly moved to the lock view position when spectating a player in the spawn queue
Diffstat (limited to 'src/game/g_weapon.c')
-rw-r--r--src/game/g_weapon.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index fc915d86..f5a118fa 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -772,18 +772,13 @@ void LCChargeFire( gentity_t *ent, qboolean secondary )
gentity_t *m;
if( secondary && ent->client->ps.stats[ STAT_MISC ] <= 0 )
- {
m = fire_luciferCannon( ent, muzzle, forward, LCANNON_SECONDARY_DAMAGE,
- LCANNON_SECONDARY_RADIUS, LCANNON_SECONDARY_SPEED );
- ent->client->ps.stats[ STAT_MISC2 ] = LCANNON_REPEAT;
- }
+ LCANNON_SECONDARY_RADIUS, LCANNON_SECONDARY_SPEED );
else
- {
m = fire_luciferCannon( ent, muzzle, forward,
- ent->client->ps.stats[ STAT_MISC ], LCANNON_RADIUS, LCANNON_SPEED );
- ent->client->ps.stats[ STAT_MISC2 ] = LCANNON_CHARGEREPEAT -
- ( level.time - ent->client->lcannonStartTime );
- }
+ ent->client->ps.stats[ STAT_MISC ] *
+ LCANNON_DAMAGE / LCANNON_CHARGE_TIME_MAX,
+ LCANNON_RADIUS, LCANNON_SPEED );
ent->client->ps.stats[ STAT_MISC ] = 0;
}
@@ -1360,7 +1355,8 @@ void G_ChargeAttack( gentity_t *ent, gentity_t *victim )
int damage;
vec3_t forward, normal;
- if( ent->client->ps.stats[ STAT_MISC ] <= 0 || !ent->client->charging )
+ if( ent->client->ps.stats[ STAT_MISC ] <= 0 ||
+ !( ent->client->ps.stats[ STAT_STATE ] & SS_CHARGING ) )
return;
VectorSubtract( victim->s.origin, ent->s.origin, forward );
@@ -1372,11 +1368,11 @@ void G_ChargeAttack( gentity_t *ent, gentity_t *victim )
WideBloodSpurt( ent, victim, NULL );
- damage = (int)( ( (float)ent->client->ps.stats[ STAT_MISC ] /
- (float)LEVEL4_TRAMPLE_CHARGE_MAX ) * LEVEL4_TRAMPLE_DMG );
+ damage = LEVEL4_TRAMPLE_DMG * ent->client->ps.stats[ STAT_MISC ] /
+ LEVEL4_TRAMPLE_CHARGE_MAX;
G_Damage( victim, ent, ent, forward, victim->s.origin, damage,
- 0, MOD_LEVEL4_TRAMPLE );
+ 0, MOD_LEVEL4_TRAMPLE );
if( !victim->client )
ent->client->ps.stats[ STAT_MISC ] = 0;