diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_ents.c | 92 | ||||
-rw-r--r-- | src/cgame/cg_players.c | 6 | ||||
-rw-r--r-- | src/cgame/cg_playerstate.c | 1 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 21 |
4 files changed, 79 insertions, 41 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index 1c36c2f8..57b89fc6 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -377,10 +377,12 @@ static void CG_Item( centity_t *cent ) { CG_Missile =============== */ -static void CG_Missile( centity_t *cent ) { - refEntity_t ent; - entityState_t *s1; - const weaponInfo_t *weapon; +static void CG_Missile( centity_t *cent ) +{ + refEntity_t ent; + entityState_t *s1; + const weaponInfo_t *weapon; + vec3_t up; s1 = ¢->currentState; if ( s1->weapon > WP_NUM_WEAPONS ) { @@ -421,43 +423,55 @@ static void CG_Missile( centity_t *cent ) { VectorCopy( cent->lerpOrigin, ent.origin); VectorCopy( cent->lerpOrigin, ent.oldorigin); - if( cent->currentState.weapon == WP_PLASMAGUN ) - { - ent.reType = RT_SPRITE; - ent.radius = 16; - ent.rotation = 0; - ent.customShader = cgs.media.plasmaBallShader; - trap_R_AddRefEntityToScene( &ent ); - return; - } - - if( cent->currentState.weapon == WP_FLAMER ) + switch( cent->currentState.weapon ) { - ent.reType = RT_SPRITE; - ent.radius = ( ( cg.time - s1->pos.trTime ) * ( cg.time - s1->pos.trTime ) ) / 9000; - ent.rotation = 0; - ent.customShader = cgs.media.flameShader; - trap_R_AddRefEntityToScene( &ent ); - return; - } - - // flicker between two skins - ent.skinNum = cg.clientFrame & 1; - ent.hModel = weapon->missileModel; - ent.renderfx = weapon->missileRenderfx | RF_NOSHADOW; - - // convert direction of travel into axis - if ( VectorNormalize2( s1->pos.trDelta, ent.axis[0] ) == 0 ) { - ent.axis[0][2] = 1; - } - - // spin as it moves - if ( s1->pos.trType != TR_STATIONARY ) { - RotateAroundDirection( ent.axis, cg.time / 4 ); - } else { - RotateAroundDirection( ent.axis, s1->time ); + case WP_PLASMAGUN: + ent.reType = RT_SPRITE; + ent.radius = 16; + ent.rotation = 0; + ent.customShader = cgs.media.plasmaBallShader; + trap_R_AddRefEntityToScene( &ent ); + return; + break; + + case WP_FLAMER: + ent.reType = RT_SPRITE; + ent.radius = ( ( cg.time - s1->pos.trTime ) * ( cg.time - s1->pos.trTime ) ) / 9000; + ent.rotation = 0; + ent.customShader = cgs.media.flameShader; + trap_R_AddRefEntityToScene( &ent ); + return; + break; + + case WP_SAWBLADE_LAUNCHER: + ent.hModel = weapon->missileModel; + + // convert direction of travel into axis + AngleVectors( s1->angles, NULL, NULL, up ); + if( VectorNormalize2( up, ent.axis[ 0 ] ) == 0 ) + ent.axis[ 0 ][ 2 ] = 1; + + // spin as it moves + RotateAroundDirection( ent.axis, cg.time ); + break; + + default: + // flicker between two skins + ent.skinNum = cg.clientFrame & 1; + ent.hModel = weapon->missileModel; + ent.renderfx = weapon->missileRenderfx | RF_NOSHADOW; + + // convert direction of travel into axis + if ( VectorNormalize2( s1->pos.trDelta, ent.axis[ 0 ] ) == 0 ) + ent.axis[ 0 ][ 2 ] = 1; + + // spin as it moves + if( s1->pos.trType != TR_STATIONARY ) + RotateAroundDirection( ent.axis, cg.time / 4 ); + else + RotateAroundDirection( ent.axis, s1->time ); } - + // add to refresh list, possibly with quad glow CG_AddRefEntityWithPowerups( &ent, s1->powerups, TEAM_FREE ); } diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index 9cb8c47a..77c01f81 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -1753,7 +1753,8 @@ int CG_AmbientLight( vec3_t point ) CG_Player =============== */ -void CG_Player( centity_t *cent ) { +void CG_Player( centity_t *cent ) +{ clientInfo_t *ci; refEntity_t legs; refEntity_t torso; @@ -1932,7 +1933,8 @@ void CG_Player( centity_t *cent ) { // CG_AddPlayerWeapon( &torso, NULL, cent ); - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_DROIDS ) + if( ( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_DROIDS ) && + ( ( cent->currentState.powerups & 0xFF ) == PTE_HUMANS ) ) trap_R_AddAdditiveLightToScene( cent->lerpOrigin, 64, 0.1, 0.1, 0.4 ); } diff --git a/src/cgame/cg_playerstate.c b/src/cgame/cg_playerstate.c index 032a1841..c31216b2 100644 --- a/src/cgame/cg_playerstate.c +++ b/src/cgame/cg_playerstate.c @@ -55,6 +55,7 @@ void CG_CheckAmmo( void ) { switch ( i ) { case WP_ROCKET_LAUNCHER: + case WP_SAWBLADE_LAUNCHER: case WP_GRENADE_LAUNCHER: case WP_RAILGUN: case WP_SHOTGUN: diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index a53336f9..7640fb0c 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -549,6 +549,19 @@ void CG_RegisterWeapon( int weaponNum ) { cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" ); break; + case WP_SAWBLADE_LAUNCHER: + weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/sawblade/sawblade.md3" ); + weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/rocket/rockfly.wav", qfalse ); +/* weaponInfo->missileTrailFunc = CG_RocketTrail; + weaponInfo->missileDlight = 200; + weaponInfo->wiTrailTime = 2000; + weaponInfo->trailRadius = 64; + MAKERGB( weaponInfo->missileDlightColor, 1, 0.75f, 0 ); + MAKERGB( weaponInfo->flashDlightColor, 1, 0.75f, 0 );*/ + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); + /*cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" );*/ + break; + case WP_GRENADE_LAUNCHER: weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/grenade1.md3" ); weaponInfo->missileTrailFunc = CG_GrenadeTrail; @@ -1625,6 +1638,14 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im lightColor[1] = 0.75; lightColor[2] = 0.0; break; + case WP_SAWBLADE_LAUNCHER: + mod = cgs.media.dishFlashModel; + shader = cgs.media.rocketExplosionShader; + sfx = cgs.media.sfx_rockexp; + mark = cgs.media.burnMarkShader; + radius = 64; + isSprite = qtrue; + break; case WP_RAILGUN: mod = cgs.media.ringFlashModel; shader = cgs.media.railExplosionShader; |