0-15-00 VMs
Client-side
This commit is contained in:
Victor Chow 2001-10-30 23:23:04 +00:00
parent af767d3b8f
commit 19d863fa5d
5 changed files with 415 additions and 329 deletions

View file

@ -303,14 +303,16 @@ static void CG_Item( centity_t *cent ) {
// autorotate at one of two speeds
//Blaze: no rotating
// if ( item->giType == IT_HEALTH ) {
// VectorCopy( cg.autoAnglesFast, cent->lerpAngles );
// AxisCopy( cg.autoAxisFast, ent.axis );
// } else {
// VectorCopy( cg.autoAngles, cent->lerpAngles );
// AxisCopy( cg.autoAxis, ent.axis );
// }
//Blaze: no rotating
/*
if ( item->giType == IT_HEALTH ) {
VectorCopy( cg.autoAnglesFast, cent->lerpAngles );
AxisCopy( cg.autoAxisFast, ent.axis );
} else {
VectorCopy( cg.autoAngles, cent->lerpAngles );
AxisCopy( cg.autoAxis, ent.axis );
}
*/
if (item->giType == IT_WEAPON && item->giTag != WP_KNIFE &&
(es->pos.trDelta[0] != 0 || es->pos.trDelta[1] != 0 || es->pos.trDelta[2] != 0) ) {
@ -320,16 +322,21 @@ static void CG_Item( centity_t *cent ) {
//It's out here because the wi calculations mess up the lerpOrigin
VectorCopy( cg.autoAnglesFast, cent->lerpAngles );
AxisCopy( cg.autoAxisFast, ent.axis );
VectorCopy(ent.axis[1], myvec);
VectorNegate(ent.axis[2], ent.axis[1]);
VectorCopy(myvec, ent.axis[2]);
}
else if (item->giType == IT_HOLDABLE &&
(es->pos.trDelta[0] != 0 || es->pos.trDelta[1] != 0 || es->pos.trDelta[2] != 0))
else if (item->giType == IT_HOLDABLE)
{
VectorCopy( cg.autoAnglesFast, cent->lerpAngles );
AxisCopy( cg.autoAxisFast, ent.axis );
//Elder: rotate item if moving
if (es->pos.trDelta[0] != 0 || es->pos.trDelta[1] != 0 || es->pos.trDelta[2] != 0)
{
VectorCopy( cg.autoAnglesFast, cent->lerpAngles );
AxisCopy( cg.autoAxisFast, ent.axis );
}
else
AnglesToAxis(es->angles, ent.axis);
}
wi = NULL;
@ -342,6 +349,10 @@ static void CG_Item( centity_t *cent ) {
vec3_t myvec;
// Elder: bad hack -- but oh well.
if (es->pos.trDelta[0] == 0 && es->pos.trDelta[1] == 0 && es->pos.trDelta[2] == 0)
AnglesToAxis(es->angles, ent.axis);
//CG_Printf("Should not be in here if it's a thrown knife\n");
wi = &cg_weapons[item->giTag];
cent->lerpOrigin[0] -=
@ -356,16 +367,17 @@ static void CG_Item( centity_t *cent ) {
wi->weaponMidpoint[0] * ent.axis[0][2] +
wi->weaponMidpoint[1] * ent.axis[1][2] +
wi->weaponMidpoint[2] * ent.axis[2][2];
//Blaze: Dont raise the weapon, but lower it
//Elder: increased value
//Blaze: Dont raise the weapon, but lower it
//Elder: don't lower knives by much - this is bad hardcode but oh well
if ( item->giTag == WP_KNIFE)
cent->lerpOrigin[2] -= 10;
else
cent->lerpOrigin[2] -= 14;
// cent->lerpOrigin[2] += 8; // an extra height boost
// cent->lerpOrigin[2] += 8; // an extra height boost
if (es->pos.trDelta[0] == 0 && es->pos.trDelta[1] == 0 && es->pos.trDelta[2] == 0) {
if (es->pos.trDelta[0] == 0 && es->pos.trDelta[1] == 0 && es->pos.trDelta[2] == 0)
{
// Blaze: rotate the gun by 90 degrees to place it on the ground
VectorCopy(ent.axis[1], myvec);
VectorNegate(ent.axis[2], ent.axis[1]);

View file

@ -446,7 +446,7 @@ static void CG_Obituary_Head( entityState_t *ent ) {
target = ent->otherEntityNum;
attacker = ent->otherEntityNum2;
mod = ent->eventParm;
CG_Printf("(%s) (%s) (%d) (%d)\n",targetName, attackerName,target,attacker);
if ( target < 0 || target >= MAX_CLIENTS ) {
CG_Error( "CG_Obituary: target out of range" );
}
@ -655,7 +655,7 @@ static void CG_Obituary_Chest( entityState_t *ent ) {
target = ent->otherEntityNum;
attacker = ent->otherEntityNum2;
mod = ent->eventParm;
CG_Printf("(%s) (%s) (%d) (%d)\n",targetName, attackerName,target,attacker);
if ( target < 0 || target >= MAX_CLIENTS ) {
CG_Error( "CG_Obituary: target out of range" );
}
@ -834,7 +834,7 @@ static void CG_Obituary_Stomach( entityState_t *ent ) {
target = ent->otherEntityNum;
attacker = ent->otherEntityNum2;
mod = ent->eventParm;
CG_Printf("(%s) (%s) (%d) (%d)\n",targetName, attackerName,target,attacker);
if ( target < 0 || target >= MAX_CLIENTS ) {
CG_Error( "CG_Obituary: target out of range" );
}
@ -2360,19 +2360,28 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
DEBUGNAME("EV_BREAK_GLASS1");
// Change cgs.media.gibSound to whatever sound you want it to use
// I think the gib sound sounds pretty good
//Elder: gonna move this into the function
trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.glassSound );
//Elder: gonna move this into the function some day
if ( rand() % 2 )
trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.glassSound );
else
trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.glass2Sound );
//Elder: modified
CG_BreakGlass( cent->lerpOrigin, es->eventParm, 0 );
break;
case EV_BREAK_GLASS2:
DEBUGNAME("EV_BREAK_GLASS2");
trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.glassSound );
if ( rand() % 2 )
trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.glassSound );
else
trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.glass2Sound );
CG_BreakGlass( cent->lerpOrigin, es->eventParm, 1 );
break;
case EV_BREAK_GLASS3:
DEBUGNAME("EV_BREAK_GLASS3");
trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.glassSound );
if ( rand() % 2 )
trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.glassSound );
else
trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.glass2Sound );
CG_BreakGlass( cent->lerpOrigin, es->eventParm, 2 );
break;
case EV_STOPLOOPINGSOUND:

View file

@ -861,6 +861,7 @@ typedef struct {
qhandle_t rq3_healthicon2;
qhandle_t smokePuffShader;
qhandle_t smokePuffAnimShader;
qhandle_t smokePuffRageProShader;
qhandle_t shotgunSmokePuffShader;
qhandle_t plasmaBallShader;
@ -1025,7 +1026,8 @@ typedef struct {
sfxHandle_t youSuckSound;
#endif
sfxHandle_t gibSound;
sfxHandle_t glassSound;//Blaze: Reaction breakable glass
sfxHandle_t glassSound; //Blaze: Reaction breakable glass
sfxHandle_t glass2Sound;
sfxHandle_t gibBounce1Sound;
sfxHandle_t gibBounce2Sound;
sfxHandle_t gibBounce3Sound;

View file

@ -656,6 +656,7 @@ static void CG_RegisterSounds( void ) {
cgs.media.gibSound = trap_S_RegisterSound( "sound/player/gibsplt1.wav", qfalse );
//Blaze: Reaction breakable glass
cgs.media.glassSound = trap_S_RegisterSound( "sound/world/glassbk.wav", qfalse );
cgs.media.glass2Sound = trap_S_RegisterSound( "sound/world/glassbk2.wav", qfalse );
cgs.media.gibBounce1Sound = trap_S_RegisterSound( "sound/player/gibimp1.wav", qfalse );
cgs.media.gibBounce2Sound = trap_S_RegisterSound( "sound/player/gibimp2.wav", qfalse );
cgs.media.gibBounce3Sound = trap_S_RegisterSound( "sound/player/gibimp3.wav", qfalse );
@ -924,6 +925,8 @@ static void CG_RegisterGraphics( void ) {
cgs.media.scoreboardTime = trap_R_RegisterShaderNoMip( "menu/tab/time.tga" );
cgs.media.smokePuffShader = trap_R_RegisterShader( "smokePuff" );
// Elder: expanding animated smoke puff
cgs.media.smokePuffAnimShader = trap_R_RegisterShader( "smokePuff-rq3" );
cgs.media.smokePuffRageProShader = trap_R_RegisterShader( "smokePuffRagePro" );
cgs.media.shotgunSmokePuffShader = trap_R_RegisterShader( "shotgunSmokePuff" );
#ifdef MISSIONPACK

View file

@ -1021,6 +1021,12 @@ void CG_RegisterWeapon( int weaponNum ) {
//weaponInfo->reloadSound2 = trap_S_RegisterSound( "sound/weapons/mp5/mp5in.wav", qfalse );
//weaponInfo->reloadSound3 = trap_S_RegisterSound( "sound/weapons/mp5/mp5slide.wav", qfalse );
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
Com_sprintf( filename, sizeof(filename), "models/weapons2/mp5/animation.cfg" );
if ( !CG_ParseWeaponAnimFile(filename, weaponInfo) ) {
Com_Printf("Failed to load weapon animation file %s\n", filename);
weapAnimLoad = qfalse;
}
break;
case WP_HANDCANNON:
@ -1847,29 +1853,32 @@ void CG_AddViewWeapon( playerState_t *ps ) {
AnglesToAxis( angles, hand.axis );
//Elder: temp hack
//if ( ps->weapon != WP_PISTOL && ps->weapon != WP_M3)
//{
// map torso animations to weapon animations
if ( cg_gun_frame.integer ||
ps->weapon == WP_PISTOL ||
ps->weapon == WP_M3 ||
ps->weapon == WP_HANDCANNON ||
ps->weapon == WP_SSG3000 ||
ps->weapon == WP_M4 ||
ps->weapon == WP_AKIMBO ||
ps->weapon == WP_GRENADE ||
ps->weapon == WP_KNIFE) {
// development tool
hand.frame = hand.oldframe = cg_gun_frame.integer;
hand.backlerp = 0;
} else {
// get clientinfo for animation map
ci = &cgs.clientinfo[ cent->currentState.clientNum ];
hand.frame = CG_MapTorsoToWeaponFrame( ci, cent->pe.torso.frame );
hand.oldframe = CG_MapTorsoToWeaponFrame( ci, cent->pe.torso.oldFrame );
hand.backlerp = cent->pe.torso.backlerp;
}
//}
// map torso animations to weapon animations
/*
if ( cg_gun_frame.integer ||
ps->weapon == WP_PISTOL ||
ps->weapon == WP_M3 ||
ps->weapon == WP_HANDCANNON ||
ps->weapon == WP_SSG3000 ||
ps->weapon == WP_M4 ||
ps->weapon == WP_MP5 ||
ps->weapon == WP_AKIMBO ||
ps->weapon == WP_GRENADE ||
ps->weapon == WP_KNIFE ) {
*/
// development tool
hand.frame = hand.oldframe = cg_gun_frame.integer;
hand.backlerp = 0;
/*
} else {
// get clientinfo for animation map
ci = &cgs.clientinfo[ cent->currentState.clientNum ];
hand.frame = CG_MapTorsoToWeaponFrame( ci, cent->pe.torso.frame );
hand.oldframe = CG_MapTorsoToWeaponFrame( ci, cent->pe.torso.oldFrame );
hand.backlerp = cent->pe.torso.backlerp;
}
*/
hand.hModel = weapon->handsModel;
hand.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON | RF_MINLIGHT;
@ -2389,7 +2398,6 @@ void CG_Weapon_f( void ) {
}
if (cg.snap->ps.weapon == WP_SSG3000) {
//trap_S_StartSound( NULL, cg.snap->ps.clientNum, CHAN_ITEM, cgs.media.lensSound);
trap_S_StartLocalSound( cgs.media.lensSound, CHAN_ITEM);
if (cg_RQ3_ssgZoomAssist.integer)
CG_RQ3_Zoom();
@ -2398,12 +2406,14 @@ void CG_Weapon_f( void ) {
{
CG_RQ3_GrenadeMode();
}
else
// only play "click" sound for M4/MP5/Pistol
else if (cg.snap->ps.weapon == WP_M4 || cg.snap->ps.weapon == WP_MP5 ||
cg.snap->ps.weapon == WP_PISTOL )
{
//do weapon select sound
trap_S_StartLocalSound( cgs.media.weapToggleSound, CHAN_ITEM);
}
trap_SendClientCommand("weapon");
//Elder: added to get out of function at this point
return;
}
@ -2848,280 +2858,321 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
duration = 600;
switch ( weapon ) {
case WP_M4:
case WP_MP5:
case WP_PISTOL:
case WP_AKIMBO:
case WP_SSG3000:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
//Blaze: Reaction M4
case WP_M4:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if (soundType == IMPACTSOUND_METAL)
{
if ( r < 2 )
sfx = cgs.media.sfx_metalric1;
else if ( r == 2 )
sfx = cgs.media.sfx_metalric2;
else
sfx = cgs.media.sfx_metalric3;
}
else if (soundType == IMPACTSOUND_GLASS)
{
if ( r < 2 )
sfx = cgs.media.sfx_glassric1;
else if ( r == 2 )
sfx = cgs.media.sfx_glassric2;
else
sfx = cgs.media.sfx_glassric3;
}
else
{
if ( r == 0 )
sfx = cgs.media.sfx_ric1;
else if ( r == 1 )
sfx = cgs.media.sfx_ric2;
else
sfx = cgs.media.sfx_ric3;
}
radius = 8;
break;
r = rand() & 3;
if (soundType == IMPACTSOUND_METAL)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_metalric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_metalric2;
} else {
sfx = cgs.media.sfx_metalric3;
}
}
else if (soundType == IMPACTSOUND_GLASS)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_glassric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_glassric2;
} else {
sfx = cgs.media.sfx_glassric3;
}
}
else
{
if ( r < 2 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
}
radius = 8;
break;
//Blaze: Reaction Pistol
case WP_PISTOL:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if (soundType == IMPACTSOUND_METAL)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_metalric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_metalric2;
} else {
sfx = cgs.media.sfx_metalric3;
}
}
else if (soundType == IMPACTSOUND_GLASS)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_glassric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_glassric2;
} else {
sfx = cgs.media.sfx_glassric3;
}
}
else
{
if ( r < 2 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
}
radius = 8;
break;
case WP_SSG3000:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if (soundType == IMPACTSOUND_METAL)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_metalric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_metalric2;
} else {
sfx = cgs.media.sfx_metalric3;
}
}
else if (soundType == IMPACTSOUND_GLASS)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_glassric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_glassric2;
} else {
sfx = cgs.media.sfx_glassric3;
}
}
else
{
if ( r < 2 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
}
radius = 8;
break;
case WP_AKIMBO:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if (soundType == IMPACTSOUND_METAL)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_metalric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_metalric2;
} else {
sfx = cgs.media.sfx_metalric3;
}
}
else if (soundType == IMPACTSOUND_GLASS)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_glassric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_glassric2;
} else {
sfx = cgs.media.sfx_glassric3;
}
}
else
{
if ( r < 2 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
}
radius = 8;
break;
//Blaze: Reaction MP5
case WP_MP5:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if (soundType == IMPACTSOUND_METAL)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_metalric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_metalric2;
} else {
sfx = cgs.media.sfx_metalric3;
}
}
else if (soundType == IMPACTSOUND_GLASS)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_glassric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_glassric2;
} else {
sfx = cgs.media.sfx_glassric3;
}
}
else
{
if ( r == 0 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 1 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
}
radius = 8;
break;
//Blaze: Reaction Shotgun
case WP_M3:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
sfx = 0;
radius = 4;
break;
case WP_HANDCANNON:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
sfx = 0;
radius = 4;
break;
case WP_GRENADE:
mod = cgs.media.dishFlashModel;
shader = cgs.media.grenadeExplosionShader;
sfx = cgs.media.sfx_rockexp;
mark = cgs.media.burnMarkShader;
radius = 96; //64
light = 350; //300
isSprite = qtrue;
break;
case WP_KNIFE:
/*
mod = cgs.media.dishFlashModel;
//shader = cgs.media.grenadeExplosionShader;
sfx = cgs.media.sfx_rockexp;
mark = cgs.media.burnMarkShader;
radius = 64;
light = 300;
isSprite = qtrue;
break;
//Blaze: Reaction M4
case WP_M4:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if (soundType == IMPACTSOUND_METAL)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_metalric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_metalric2;
} else {
sfx = cgs.media.sfx_metalric3;
}
}
else if (soundType == IMPACTSOUND_GLASS)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_glassric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_glassric2;
} else {
sfx = cgs.media.sfx_glassric3;
}
}
else
{
if ( r < 2 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
}
radius = 8;
break;
//Blaze: Reaction Pistol
case WP_PISTOL:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if (soundType == IMPACTSOUND_METAL)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_metalric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_metalric2;
} else {
sfx = cgs.media.sfx_metalric3;
}
}
else if (soundType == IMPACTSOUND_GLASS)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_glassric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_glassric2;
} else {
sfx = cgs.media.sfx_glassric3;
}
}
else
{
if ( r < 2 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
}
radius = 8;
break;
case WP_SSG3000:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if (soundType == IMPACTSOUND_METAL)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_metalric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_metalric2;
} else {
sfx = cgs.media.sfx_metalric3;
}
}
else if (soundType == IMPACTSOUND_GLASS)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_glassric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_glassric2;
} else {
sfx = cgs.media.sfx_glassric3;
}
}
else
{
if ( r < 2 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
}
radius = 8;
break;
case WP_AKIMBO:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if (soundType == IMPACTSOUND_METAL)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_metalric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_metalric2;
} else {
sfx = cgs.media.sfx_metalric3;
}
}
else if (soundType == IMPACTSOUND_GLASS)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_glassric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_glassric2;
} else {
sfx = cgs.media.sfx_glassric3;
}
}
else
{
if ( r < 2 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
}
radius = 8;
break;
//Blaze: Reaction MP5
case WP_MP5:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
r = rand() & 3;
if (soundType == IMPACTSOUND_METAL)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_metalric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_metalric2;
} else {
sfx = cgs.media.sfx_metalric3;
}
}
else if (soundType == IMPACTSOUND_GLASS)
{
if ( r < 2 ) {
sfx = cgs.media.sfx_glassric1;
} else if ( r == 2 ) {
sfx = cgs.media.sfx_glassric2;
} else {
sfx = cgs.media.sfx_glassric3;
}
}
else
{
if ( r == 0 ) {
sfx = cgs.media.sfx_ric1;
} else if ( r == 1 ) {
sfx = cgs.media.sfx_ric2;
} else {
sfx = cgs.media.sfx_ric3;
}
}
radius = 8;
break;
*/
if (weapModification == RQ3_WPMOD_KNIFESLASH)
{
case WP_M3:
case WP_HANDCANNON:
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
mark = cgs.media.slashMarkShader;
sfx = cgs.media.knifeClankSound;
radius = rand() % 4 + 6;
}
else
{
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
sfx = cgs.media.knifeClankSound;
}
break;
default:
break;
if (soundType == IMPACTSOUND_GLASS)
mark = cgs.media.glassMarkShader;
else
mark = cgs.media.bulletMarkShader;
sfx = 0;
radius = 4;
break;
case WP_GRENADE:
mod = cgs.media.dishFlashModel;
shader = cgs.media.grenadeExplosionShader;
sfx = cgs.media.sfx_rockexp;
mark = cgs.media.burnMarkShader;
radius = 96; //64
light = 350; //300
isSprite = qtrue;
break;
case WP_KNIFE:
/*
mod = cgs.media.dishFlashModel;
//shader = cgs.media.grenadeExplosionShader;
sfx = cgs.media.sfx_rockexp;
mark = cgs.media.burnMarkShader;
radius = 64;
light = 300;
isSprite = qtrue;
break;
*/
if (weapModification == RQ3_WPMOD_KNIFESLASH)
{
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
mark = cgs.media.slashMarkShader;
sfx = cgs.media.knifeClankSound;
radius = rand() % 4 + 6;
}
else
{
mod = cgs.media.bulletFlashModel;
shader = cgs.media.bulletExplosionShader;
sfx = cgs.media.knifeClankSound;
}
break;
default:
break;
}
// Knives, SSG, and grenades always play sound
if (weapon == WP_KNIFE || weapon == WP_SSG3000 || weapon == WP_GRENADE)
//
// ricochet sound
//
if (weapon == WP_KNIFE || weapon == WP_SSG3000 || weapon == WP_GRENADE ||
soundType == IMPACTSOUND_METAL )
i = 1;
else
//Elder: 90% of the time render a bullet ricochet sound
@ -3153,18 +3204,21 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
// impact mark
//
alphaFade = (mark == cgs.media.energyMarkShader); // plasma fades alpha, all others fade color
//Blaze: No more railgun
//if ( weapon == WP_RAILGUN ) {
// float *color;
/*
if ( weapon == WP_RAILGUN ) {
float *color;
// colorize with client color
// color = cgs.clientinfo[clientNum].color;
// CG_ImpactMark( mark, origin, dir, random()*360, color[0],color[1], color[2],1, alphaFade, radius, qfalse );
//} else {
color = cgs.clientinfo[clientNum].color;
CG_ImpactMark( mark, origin, dir, random()*360, color[0],color[1], color[2],1, alphaFade, radius, qfalse );
} else {
*/
// Elder: Our knife slashes aren't vertical so don't go beyond 45 degrees
// Elder: Our knife slashes are vertical
if (weapon == WP_KNIFE)
angle = random() * 90 + 45;
angle = random() * 90;
else
angle = random() * 360;
@ -3172,6 +3226,10 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
CG_ImpactMark( mark, origin, dir, angle, 1,1,1,1, alphaFade, radius, qfalse );
//}
//
// impact visual effects
//
//Elder: 75% of the time render a smoke puff
i = rand() % 4;
@ -3184,6 +3242,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
case WP_MP5:
case WP_M4:
case WP_PISTOL:
case WP_AKIMBO:
case WP_SSG3000:
puffDir[0] = 0;
puffDir[1] = 0;
@ -3200,7 +3259,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
650,
cg.time, 0,
LEF_PUFF_DONT_SCALE,
cgs.media.smokePuffShader );
cgs.media.smokePuffAnimShader );
break;
}
}
@ -3370,7 +3429,7 @@ static void CG_ShotgunPellet( vec3_t start, vec3_t end, int skipNum, int shellWe
// SURF_NOIMPACT will not make a flame puff or a mark
return;
}
if ( tr.surfaceFlags & SURF_METALSTEPS )
if ( (tr.surfaceFlags & SURF_METALSTEPS) || (tr.surfaceFlags & SURF_METAL2) )
{
//Blaze: Changed WP_SHOTGUN to WP_M3
if (shellWeapon == WP_M3)
@ -3394,13 +3453,14 @@ static void CG_ShotgunPellet( vec3_t start, vec3_t end, int skipNum, int shellWe
}
else
{
//Blaze: Changed WP_SHOTGUN to WP_M3
// Elder: By default, the M3 and HC will spark on all surfaces
// Blaze: Changed WP_SHOTGUN to WP_M3
if (shellWeapon == WP_M3)
CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT, 0 );
CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_METAL, 0 );
else if (shellWeapon == WP_HANDCANNON && crandom() > 0.5)
{
//Elder: show only approximately every other impact mark
CG_MissileHitWall( WP_HANDCANNON, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT, 0 );
CG_MissileHitWall( WP_HANDCANNON, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_METAL, 0 );
}
//CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT, 0 );
}