diff options
author | Tim Angus <tim@ngus.net> | 2001-09-25 22:27:28 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-09-25 22:27:28 +0000 |
commit | 688d528f2860d456248363cb1c041de7dabe1911 (patch) | |
tree | bb7dc0f1d009f29ed6ca91628523d7c442aaf371 /src/cgame | |
parent | d511ec1caee3717f9652c8366a054c3046f6e2f6 (diff) |
Added 2 experimental weapons
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 4 | ||||
-rw-r--r-- | src/cgame/cg_ents.c | 9 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 35 | ||||
-rw-r--r-- | src/cgame/cg_scanner.c | 15 | ||||
-rw-r--r-- | src/cgame/cg_view.c | 2 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 28 |
6 files changed, 83 insertions, 10 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 647b2fd0..5bbc23ed 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -2310,8 +2310,8 @@ static void CG_Draw2D( void ) { if ( cgs.gametype >= GT_TEAM ) { CG_DrawTeamInfo(); } - if( cg.snap->ps.weapon == WP_SCANNER ) - CG_Scanner(); + if( BG_gotItem( UP_HELMET, cg.snap->ps.stats ) ) + CG_Scanner( ); } CG_DrawVote(); diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index c523378f..6e5fbdcf 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -436,6 +436,15 @@ static void CG_Missile( centity_t *cent ) return; break; + case WP_PULSE_RIFLE: + ent.reType = RT_SPRITE; + ent.radius = 4; + ent.rotation = 0; + ent.customShader = cgs.media.plasmaBallShader; + trap_R_AddRefEntityToScene( &ent ); + return; + break; + case WP_FLAMER: fraction = ( ( cg.time - s1->pos.trTime ) / FIREBALL_LIFETIME ); diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 1d2bf6eb..29b77974 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -464,14 +464,15 @@ also called by CG_CheckPlayerstateEvents ============== */ #define DEBUGNAME(x) if(cg_debugEvents.integer){CG_Printf(x"\n");} -void CG_EntityEvent( centity_t *cent, vec3_t position ) { +void CG_EntityEvent( centity_t *cent, vec3_t position ) +{ entityState_t *es; int event; vec3_t dir; const char *s; int clientNum; clientInfo_t *ci; - int steptime; + int steptime, i; steptime = BG_FindSteptimeForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] ); @@ -899,6 +900,36 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) { CG_Bullet( es->pos.trBase, es->otherEntityNum, dir, qtrue, es->eventParm ); break; +#define MASS_EJECTION_VEL 300 + case EV_MASS_DRIVER_HIT: + DEBUGNAME("EV_MASS_DRIVER_HIT"); + for( i = 0; i <= 10; i++ ) + { + qhandle_t spark; + vec3_t velocity; + vec3_t accel = { 0.0f, 0.0f, -DEFAULT_GRAVITY }; + vec3_t origin, normal; + + ByteToDir( es->eventParm, normal ); + + VectorMA( es->pos.trBase, 10.0f, normal, origin ); + + if( crandom( ) > 0.5f ) + spark = cgs.media.gibSpark1; + else + spark = cgs.media.gibSpark2; + + velocity[ 0 ] = crandom( ) * MASS_EJECTION_VEL; + velocity[ 1 ] = crandom( ) * MASS_EJECTION_VEL; + velocity[ 2 ] = MASS_EJECTION_VEL + crandom( ) * MASS_EJECTION_VEL; + + CG_LaunchSprite( origin, velocity, accel, 0.6, 4.0f, 2.0f, 255, 0, rand( ) % 360, + cg.time, 5000 + ( crandom( ) * 3000 ), + spark, qfalse, qfalse ); + } + + break; + case EV_SHOTGUN: DEBUGNAME("EV_SHOTGUN"); CG_ShotgunFire( es ); diff --git a/src/cgame/cg_scanner.c b/src/cgame/cg_scanner.c index 75b7eefa..e67bd0b6 100644 --- a/src/cgame/cg_scanner.c +++ b/src/cgame/cg_scanner.c @@ -48,11 +48,18 @@ static void CG_DrawBlips( vec3_t origin, vec4_t colour ) drawOrigin[ 0 ] /= ( 2 * RANGE / WIDTH ); drawOrigin[ 1 ] /= ( 2 * RANGE / HEIGHT ); drawOrigin[ 2 ] /= ( 2 * RANGE / WIDTH ); - + trap_R_SetColor( colour ); - CG_DrawPic( XPOS + ( WIDTH / 2 ) - ( STALKWIDTH / 2 ) - drawOrigin[ 0 ], - YPOS + ( HEIGHT / 2 ) + drawOrigin[ 1 ], - STALKWIDTH, -drawOrigin[ 2 ], cgs.media.scannerLineShader ); + + if( drawOrigin[ 2 ] > 0 ) + CG_DrawPic( XPOS + ( WIDTH / 2 ) - ( STALKWIDTH / 2 ) - drawOrigin[ 0 ], + YPOS + ( HEIGHT / 2 ) + drawOrigin[ 1 ] - drawOrigin[ 2 ], + STALKWIDTH, drawOrigin[ 2 ], cgs.media.scannerLineShader ); + else + CG_DrawPic( XPOS + ( WIDTH / 2 ) - ( STALKWIDTH / 2 ) - drawOrigin[ 0 ], + YPOS + ( HEIGHT / 2 ) + drawOrigin[ 1 ], + STALKWIDTH, -drawOrigin[ 2 ], cgs.media.scannerLineShader ); + CG_DrawPic( XPOS + ( WIDTH / 2 ) - ( BLIPX / 2 ) - drawOrigin[ 0 ], YPOS + ( HEIGHT / 2 ) - ( BLIPY / 2 ) + drawOrigin[ 1 ] - drawOrigin[ 2 ], BLIPX, BLIPY, cgs.media.scannerBlipShader ); diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index b70fc0e8..36dccc49 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -1148,7 +1148,7 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo memcpy( cg.refdef.areamask, cg.snap->areamask, sizeof( cg.refdef.areamask ) ); // warning sounds when powerup is wearing off - CG_PowerupTimerSounds(); + /*CG_PowerupTimerSounds();*/ // update audio positions trap_S_Respatialize( cg.snap->ps.clientNum, cg.refdef.vieworg, cg.refdef.viewaxis, inwater ); diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 50a97655..fc425d7f 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -662,6 +662,14 @@ void CG_RegisterWeapon( int weaponNum ) { cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" ); break; + case WP_MASS_DRIVER: + MAKERGB( weaponInfo->flashDlightColor, 0, 0, 1 ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse ); + weaponInfo->flashSound[1] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf2b.wav", qfalse ); + weaponInfo->flashSound[2] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf3b.wav", qfalse ); + weaponInfo->flashSound[3] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf4b.wav", qfalse ); + break; + case WP_CHAINGUN: MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 ); weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse ); @@ -730,6 +738,14 @@ void CG_RegisterWeapon( int weaponNum ) { cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); break; + case WP_PULSE_RIFLE: + weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/plasma/lasfly.wav", qfalse ); + MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/plasma/hyprbf1a.wav", qfalse ); + cgs.media.plasmaExplosionShader = trap_R_RegisterShader( "plasmaExplosion" ); + cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); + break; + case WP_RAILGUN: weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/railgun/rg_hum.wav", qfalse ); MAKERGB( weaponInfo->flashDlightColor, 1, 0.5f, 0 ); @@ -767,7 +783,6 @@ void CG_RegisterWeapon( int weaponNum ) { case WP_DBUILD2: case WP_HBUILD: case WP_HBUILD2: - case WP_SCANNER: //nowt break; @@ -1850,6 +1865,13 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im mark = cgs.media.energyMarkShader; radius = 16; break; + case WP_PULSE_RIFLE: + mod = cgs.media.ringFlashModel; + shader = cgs.media.plasmaExplosionShader; + sfx = cgs.media.sfx_plasmaexp; + mark = cgs.media.energyMarkShader; + radius = 16; + break; case WP_BFG: mod = cgs.media.dishFlashModel; shader = cgs.media.bfgExplosionShader; @@ -1865,6 +1887,10 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im sfx = 0; radius = 4; break; + case WP_MASS_DRIVER: + shader = cgs.media.bulletExplosionShader; + mark = cgs.media.bulletMarkShader; + break; case WP_MACHINEGUN: mod = cgs.media.bulletFlashModel; shader = cgs.media.bulletExplosionShader; |