diff options
author | Tim Angus <tim@ngus.net> | 2002-03-25 04:56:46 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2002-03-25 04:56:46 +0000 |
commit | 358bb181276c0811acd0ae4f4453d4584059c4de (patch) | |
tree | 9461d4c4e8f2672f01518bbf590ecfec1d742de6 /src/cgame | |
parent | 8ee003187800b7ce7561090a8d7f9e66b920d88a (diff) |
Client side flamer effects
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_ents.c | 16 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 4 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 24 |
3 files changed, 21 insertions, 23 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index 3b378fde..d6e8595b 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -289,21 +289,7 @@ static void CG_Missile( centity_t *cent ) break; case WP_FLAMER: -/* { - fraction = ( ( cg.time - s1->pos.trTime ) / FIREBALL_LIFETIME ); - - if( fraction > 1.0f ) - fraction = 1.0f; - - ent.reType = RT_SPRITE; - ent.radius = fraction * 32; - ent.rotation = s1->generic1; - - index = (int)( fraction * 31 ); - ent.customShader = cgs.media.flameShader[ index ]; - trap_R_AddRefEntityToScene( &ent ); - return; - }*/ + //TA: don't actually display the missile (use the particle engine) return; break; diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 5eab45c4..48dcac5a 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -186,7 +186,9 @@ typedef struct centity_s { lerpFrame_t lerpFrame; - buildableAnimNumber_t buildableAnim; //TA: persistant anim number + //TA: + buildableAnimNumber_t buildableAnim; //persistant anim number + int flamerTime; //limit flameball count } centity_t; diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 56232a7f..2d86fcfd 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -986,13 +986,17 @@ CG_FlameTrail */ static void CG_FlameTrail( centity_t *cent, vec3_t origin ) { - vec3_t forward; - vec3_t muzzlePoint; + vec3_t forward; + vec3_t muzzlePoint; if( cent->currentState.weapon != WP_FLAMER ) return; - if( cent->currentState.clientNum == cg.predictedPlayerState.clientNum ) + //not time for the next ball yet + if( cg.time < cent->flamerTime ) + return; + + if( cent->currentState.clientNum == cg.predictedPlayerState.clientNum && !cg.renderingThirdPerson ) { AngleVectors( cg.refdefViewAngles, forward, NULL, NULL ); VectorCopy( cg.predictedPlayerState.origin, muzzlePoint ); @@ -1004,12 +1008,18 @@ static void CG_FlameTrail( centity_t *cent, vec3_t origin ) } // FIXME: crouch - muzzlePoint[2] += DEFAULT_VIEWHEIGHT; + muzzlePoint[ 2 ] += DEFAULT_VIEWHEIGHT; + + VectorMA( muzzlePoint, 14.0f, forward, muzzlePoint ); + VectorScale( forward, FIREBALL_SPEED, forward ); - VectorMA( muzzlePoint, 8.0f, forward, muzzlePoint ); - VectorScale( forward, 300.0f, forward ); + CG_LaunchSprite( muzzlePoint, forward, vec3_origin, + 0.1f, 0.0f, 40.0f, 255.0f, 192.0f, + rand( ) % 360, cg.time, FIREBALL_LIFETIME, + cgs.media.flameShader[ 0 ], qfalse, qfalse ); - CG_LaunchSprite( muzzlePoint, forward, vec3_origin, 0.1f, 0.0f, 48.0f, 192.0f, 64.0f, rand( ) % 360, cg.time, FIREBALL_LIFETIME, cgs.media.smokePuffShader, qfalse, qfalse ); + //set next ball time + cent->flamerTime = cg.time + FIREBALL_GAP; } |