Release 25 CGame

This commit is contained in:
Bryce Hutchings 2001-12-17 15:06:41 +00:00
parent f3fbe78e9c
commit 1520497f0b
9 changed files with 304 additions and 198 deletions

View file

@ -181,8 +181,8 @@ void CG_SpawnEffect( vec3_t org ) {
#endif
}
#ifdef MISSIONPACK
/*
===============
CG_LightningBoltBeam

View file

@ -15,11 +15,11 @@ Modifies the entities position and axis by the given
tag location
======================
*/
void CG_PositionEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
void CG_PositionEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
qhandle_t parentModel, char *tagName ) {
int i;
orientation_t lerped;
// lerp the tag
trap_R_LerpTag( &lerped, parentModel, parent->oldframe, parent->frame,
1.0 - parent->backlerp, tagName );
@ -71,7 +71,7 @@ Modifies the entities position and axis by the given
tag location
======================
*/
void CG_PositionRotatedEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
void CG_PositionRotatedEntityOnTag( refEntity_t *entity, const refEntity_t *parent,
qhandle_t parentModel, char *tagName ) {
int i;
orientation_t lerped;
@ -138,10 +138,10 @@ static void CG_EntityEffects( centity_t *cent ) {
// add loop sound
if ( cent->currentState.loopSound ) {
if (cent->currentState.eType != ET_SPEAKER) {
trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin,
trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin,
cgs.gameSounds[ cent->currentState.loopSound ] );
} else {
trap_S_AddRealLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin,
trap_S_AddRealLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin,
cgs.gameSounds[ cent->currentState.loopSound ] );
}
}
@ -239,7 +239,7 @@ static void CG_Item( centity_t *cent ) {
gitem_t *item;
int msec;
float frac;
// float scale;
float scale;
weaponInfo_t *wi;
es = &cent->currentState;
@ -269,7 +269,7 @@ static void CG_Item( centity_t *cent ) {
}
else if (item->giType == IT_HOLDABLE)
ent.radius = 10;
else
else
ent.radius = 6;
//ent.radius = 14;
ent.customShader = cg_items[es->modelindex].icon;
@ -322,7 +322,7 @@ 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]);
@ -344,26 +344,26 @@ static void CG_Item( centity_t *cent ) {
// models, so we need to offset them or they will rotate
// eccentricly
//Elder: added knife conditional
if ( item->giType == IT_WEAPON &&
if ( item->giType == IT_WEAPON &&
!(item->giTag == WP_KNIFE && ( (es->eFlags & FL_THROWN_KNIFE) == FL_THROWN_KNIFE) ) ) {
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");
//CG_Printf("Should not be in here if it's a thrown knife\n");
wi = &cg_weapons[item->giTag];
cent->lerpOrigin[0] -=
cent->lerpOrigin[0] -=
wi->weaponMidpoint[0] * ent.axis[0][0] +
wi->weaponMidpoint[1] * ent.axis[1][0] +
wi->weaponMidpoint[2] * ent.axis[2][0];
cent->lerpOrigin[1] -=
cent->lerpOrigin[1] -=
wi->weaponMidpoint[0] * ent.axis[0][1] +
wi->weaponMidpoint[1] * ent.axis[1][1] +
wi->weaponMidpoint[2] * ent.axis[2][1];
cent->lerpOrigin[2] -=
cent->lerpOrigin[2] -=
wi->weaponMidpoint[0] * ent.axis[0][2] +
wi->weaponMidpoint[1] * ent.axis[1][2] +
wi->weaponMidpoint[2] * ent.axis[2][2];
@ -375,7 +375,7 @@ static void CG_Item( centity_t *cent ) {
cent->lerpOrigin[2] -= 14;
// cent->lerpOrigin[2] += 8; // an extra height boost
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
@ -414,7 +414,7 @@ static void CG_Item( centity_t *cent ) {
// items without glow textures need to keep a minimum light value
// so they are always visible
if ( ( item->giType == IT_WEAPON ) ||
( item->giType == IT_ARMOR ) ||
( item->giType == IT_ARMOR ) ||
( item->giType == IT_AMMO) ||
( item->giType == IT_HOLDABLE) ) {
ent.renderfx |= RF_MINLIGHT;
@ -423,12 +423,17 @@ static void CG_Item( centity_t *cent ) {
// increase the size of the weapons when they are presented as items
// Elder: only for knives, which are hard to spot
// NiceAss: Scale code modified for weapons too.
if ( item->giTag == WP_KNIFE )
{
VectorScale( ent.axis[0], 1.2f, ent.axis[0] );
VectorScale( ent.axis[1], 1.2f, ent.axis[1] );
VectorScale( ent.axis[2], 1.2f, ent.axis[2] );
}
scale = WEAPON_KNIFE_SCALE;
else if ( item->giType == IT_WEAPON && item->giTag != WP_KNIFE )
scale = WEAPON_GUN_SCALE;
else
scale = WEAPON_OTHER_SCALE;
VectorScale( ent.axis[0], scale, ent.axis[0] );
VectorScale( ent.axis[1], scale, ent.axis[1] );
VectorScale( ent.axis[2], scale, ent.axis[2] );
//Blaze: Dont make models bigger
/*
@ -456,14 +461,18 @@ static void CG_Item( centity_t *cent ) {
trap_R_AddRefEntityToScene(&ent);
// add strobe effect -- should make this toggle?
if ( ( item->giType == IT_WEAPON ) ||
( item->giType == IT_ARMOR ) ||
( item->giType == IT_AMMO) ||
( item->giType == IT_HOLDABLE) ) {
// NiceAss: Temp Cvar usage for strobe shader.
if ( ( item->giType == IT_WEAPON ||
item->giType == IT_ARMOR ||
item->giType == IT_AMMO ||
item->giType == IT_HOLDABLE ) &&
cg_RQ3_strobe.integer == 1 ) {
ent.customShader = cgs.media.itemStrobeShader;
trap_R_AddRefEntityToScene(&ent);
}
#ifdef MISSIONPACK
if ( item->giType == IT_WEAPON && wi->barrelModel ) {
refEntity_t barrel;
@ -486,7 +495,7 @@ static void CG_Item( centity_t *cent ) {
#endif
// accompanying rings / spheres for powerups
if ( !cg_simpleItems.integer )
if ( !cg_simpleItems.integer )
{
vec3_t spinAngles;
@ -502,7 +511,7 @@ static void CG_Item( centity_t *cent ) {
spinAngles[1] = ( cg.time & 1023 ) * 360 / -1024.0f;
}
AnglesToAxis( spinAngles, ent.axis );
// scale up if respawning
if ( frac != 1.0 ) {
VectorScale( ent.axis[0], frac, ent.axis[0] );
@ -539,7 +548,7 @@ static void CG_Missile( centity_t *cent ) {
VectorCopy( s1->angles, cent->lerpAngles);
// add trails
if ( weapon->missileTrailFunc )
if ( weapon->missileTrailFunc )
{
weapon->missileTrailFunc( cent, weapon );
}
@ -556,13 +565,13 @@ static void CG_Missile( centity_t *cent ) {
// add dynamic light
if ( weapon->missileDlight ) {
trap_R_AddLightToScene(cent->lerpOrigin, weapon->missileDlight,
trap_R_AddLightToScene(cent->lerpOrigin, weapon->missileDlight,
weapon->missileDlightColor[col][0], weapon->missileDlightColor[col][1], weapon->missileDlightColor[col][2] );
}
*/
// add dynamic light
if ( weapon->missileDlight ) {
trap_R_AddLightToScene(cent->lerpOrigin, weapon->missileDlight,
trap_R_AddLightToScene(cent->lerpOrigin, weapon->missileDlight,
weapon->missileDlightColor[0], weapon->missileDlightColor[1], weapon->missileDlightColor[2] );
}
@ -614,11 +623,16 @@ static void CG_Missile( centity_t *cent ) {
if ( s1->weapon == WP_KNIFE ) {
vec3_t knifeVelocity;
BG_EvaluateTrajectoryDelta(&s1->pos, cg.time, knifeVelocity);
BG_EvaluateTrajectoryDelta(&s1->pos, cg.time, knifeVelocity);
vectoangles(knifeVelocity, cent->lerpAngles);
cent->lerpAngles[0] += cg.time / 6;
cent->lerpAngles[0] += cg.time; // was / 6
AnglesToAxis( cent->lerpAngles, ent.axis );
// NiceAss: Added for scaling of the knife in flight and not just when sticking in a wall.
VectorScale( ent.axis[0], WEAPON_KNIFE_SCALE, ent.axis[0] );
VectorScale( ent.axis[1], WEAPON_KNIFE_SCALE, ent.axis[1] );
VectorScale( ent.axis[2], WEAPON_KNIFE_SCALE, ent.axis[2] );
}
else
RotateAroundDirection( ent.axis, cg.time / 4 );
@ -899,7 +913,7 @@ static void CG_CalcEntityLerpPositions( centity_t *cent ) {
// adjust for riding a mover if it wasn't rolled into the predicted
// player state
if ( cent != &cg.predictedPlayerEntity ) {
CG_AdjustPositionForMover( cent->lerpOrigin, cent->currentState.groundEntityNum,
CG_AdjustPositionForMover( cent->lerpOrigin, cent->currentState.groundEntityNum,
cg.snap->serverTime, cg.time, cent->lerpOrigin );
}
}
@ -1150,7 +1164,7 @@ void CG_AddPacketEntities( void ) {
cg.frameInterpolation = (float)( cg.time - cg.snap->serverTime ) / delta;
}
} else {
cg.frameInterpolation = 0; // actually, it should never be used, because
cg.frameInterpolation = 0; // actually, it should never be used, because
// no entities should be marked as interpolating
}
@ -1189,6 +1203,7 @@ CG_LaserSight
Creates the laser dot
Elder's Note: Client does not use this if the dot is his/her own -- see CG_LocalLaser
NiceAss's Note: Lies?! It seems to for me =P I don't even think CG_LocalLaser gets called...
==================
*/
@ -1203,6 +1218,10 @@ static void CG_LaserSight( centity_t *cent ) {
if (cent->currentState.eventParm == 1)
{
// NiceAss: Testing for foglasers... maybe i'll get this to work some day
//if (cent->currentState.eFlags & EF_FIRING) {
// CG_LightningBolt( cent, cent->lerpOrigin );
//}
ent.reType = RT_SPRITE;
ent.radius = 3;
ent.rotation = 0;
@ -1247,3 +1266,37 @@ static void CG_Dlight( centity_t *cent ) {
//CG_Printf("cgame: (%f %f %f) %f\n", r, g, b, i );
}
/*
=================
CG_CalcViewAngle
Added by NiceAss.
Start not known. End known.
Used for calculating a player's viewing angle.
Currently used for spark directions (reflected off a plane).
=================
*/
void CG_CalcViewDir(const int sourceEntityNum, const vec3_t end, vec3_t viewDir) {
vec3_t delta, start;
CG_CalcMuzzlePoint(sourceEntityNum, start);
VectorSubtract(end, start, delta);
VectorNormalize2(delta, viewDir);
}
/*
=================
CG_CalcViewAngle2
Added by NiceAss.
Start known. End known.
Used for calculating a player's viewing angle.
Currently used for spark directions (reflected off a plane).
=================
*/
void CG_CalcViewDir2(const vec3_t start, const vec3_t end, vec3_t viewDir) {
vec3_t delta;
VectorSubtract(end, start, delta);
VectorNormalize2(delta, viewDir);
}

View file

@ -75,7 +75,7 @@ static void CG_Obituary( entityState_t *ent ) {
target = ent->otherEntityNum;
attacker = ent->otherEntityNum2;
mod = ent->eventParm;
if ( target < 0 || target >= MAX_CLIENTS ) {
CG_Error( "CG_Obituary: target out of range" );
}
@ -204,6 +204,7 @@ static void CG_Obituary( entityState_t *ent ) {
break;
}
}
//Blaze: This allows for the falling damage message to pass through if someone attacked them
if (!(attacker == ENTITYNUM_WORLD || attacker ==target)) message = NULL;
if (message) {
@ -216,7 +217,7 @@ static void CG_Obituary( entityState_t *ent ) {
char *s;
if ( cgs.gametype < GT_TEAM ) {
s = va("You fragged %s\n%s place with %i", targetName,
s = va("You fragged %s\n%s place with %i", targetName,
CG_PlaceString( cg.snap->ps.persistant[PERS_RANK] + 1 ),
cg.snap->ps.persistant[PERS_SCORE] );
} else {
@ -225,9 +226,9 @@ static void CG_Obituary( entityState_t *ent ) {
#ifdef MISSIONPACK
if (!(cg_singlePlayerActive.integer && cg_cameraOrbit.integer)) {
CG_CenterPrint( s, SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH );
}
}
#else
CG_CenterPrint( s, SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH );
CG_CenterPrint( s, SCREEN_HEIGHT * 0.25, (BIGCHAR_WIDTH+SMALLCHAR_WIDTH)*.5 );
#endif
// print the text message as well
@ -338,12 +339,12 @@ static void CG_Obituary( entityState_t *ent ) {
n = rand() % 2 + 1;
if (n == 1)
{
message = "accepts";
message = "accepts";
message2 = "'s M3 Super 90 Assault Shotgun in hole-y matrimony";
}
else
{
message = "is full of buckshot from";
message = "is full of buckshot from";
message2 = "'s M3 Super 90 Assault Shotgun";
}
break;
@ -351,12 +352,12 @@ static void CG_Obituary( entityState_t *ent ) {
n = rand() % 2 + 1;
if (n == 1)
{
message = "ate";
message = "ate";
message2 = "'s sawed-off 12 gauge";
}
else
{
message = "is full of buckshot from";
message = "is full of buckshot from";
message2 = "'s sawed off shotgun";
}
break;
@ -387,9 +388,9 @@ static void CG_Obituary( entityState_t *ent ) {
else
{
if (gender == GENDER_NEUTER)
message = "had a Bruce Lee put on it by";
message = "had a Bruce Lee put on it by";
else if (gender == GENDER_FEMALE)
message = "had a Bruce Lee put on her by";
message = "had a Bruce Lee put on her by";
else
message = "had a Bruce Lee put on him by";
message2 = ", with a quickness";
@ -413,7 +414,7 @@ static void CG_Obituary( entityState_t *ent ) {
}
if (message) {
CG_Printf( "%s %s %s%s\n",
CG_Printf( "%s %s %s%s\n",
targetName, message, attackerName, message2);
return;
}
@ -446,7 +447,7 @@ static void CG_Obituary_Head( entityState_t *ent ) {
target = ent->otherEntityNum;
attacker = ent->otherEntityNum2;
mod = ent->eventParm;
if ( target < 0 || target >= MAX_CLIENTS ) {
CG_Error( "CG_Obituary: target out of range" );
}
@ -513,6 +514,7 @@ static void CG_Obituary_Head( entityState_t *ent ) {
break;
}
}
if (!(attacker == ENTITYNUM_WORLD || attacker ==target)) message = NULL;
if (message) {
CG_Printf( "%s %s.\n", targetName, message);
@ -524,15 +526,17 @@ static void CG_Obituary_Head( entityState_t *ent ) {
char *s;
if ( cgs.gametype < GT_TEAM ) {
s = va("You fragged %s\n%s place with %i", targetName,
s = va("You fragged %s\n%s place with %i", targetName,
CG_PlaceString( cg.snap->ps.persistant[PERS_RANK] + 1 ),
cg.snap->ps.persistant[PERS_SCORE] );
} else {
s = va("You fragged %s", targetName );
}
// print the text message as well
CG_CenterPrint( s, SCREEN_HEIGHT * 0.25, (BIGCHAR_WIDTH+SMALLCHAR_WIDTH)*.5 );
}
// check for double client messages
if ( !attackerInfo ) {
attacker = ENTITYNUM_WORLD;
@ -576,7 +580,7 @@ static void CG_Obituary_Head( entityState_t *ent ) {
message = "saw the sniper bullet go through its scope thanks to";
else if (gender == GENDER_FEMALE)
message = "saw the sniper bullet go through her scope thanks to";
else
else
message = "saw the sniper bullet go through his scope thanks to";
}
else
@ -586,11 +590,11 @@ static void CG_Obituary_Head( entityState_t *ent ) {
break;
case MOD_KNIFE:
if (gender == GENDER_NEUTER)
message = "had its throat slit by";
message = "had its throat slit by";
else if (gender == GENDER_FEMALE)
message = "had her throat slit by";
else
message = "had his throat slit by";
message = "had her throat slit by";
else
message = "had his throat slit by";
break;
case MOD_KNIFE_THROWN:
message = "caught";
@ -621,7 +625,7 @@ static void CG_Obituary_Head( entityState_t *ent ) {
}
if (message) {
CG_Printf( "%s %s %s%s\n",
CG_Printf( "%s %s %s%s\n",
targetName, message, attackerName, message2);
return;
}
@ -655,7 +659,7 @@ static void CG_Obituary_Chest( entityState_t *ent ) {
target = ent->otherEntityNum;
attacker = ent->otherEntityNum2;
mod = ent->eventParm;
if ( target < 0 || target >= MAX_CLIENTS ) {
CG_Error( "CG_Obituary: target out of range" );
}
@ -721,6 +725,7 @@ static void CG_Obituary_Chest( entityState_t *ent ) {
break;
}
}
if (!(attacker == ENTITYNUM_WORLD || attacker ==target)) message = NULL;
if (message) {
CG_Printf( "%s %s.\n", targetName, message);
@ -732,13 +737,14 @@ static void CG_Obituary_Chest( entityState_t *ent ) {
char *s;
if ( cgs.gametype < GT_TEAM ) {
s = va("You fragged %s\n%s place with %i", targetName,
s = va("You fragged %s\n%s place with %i", targetName,
CG_PlaceString( cg.snap->ps.persistant[PERS_RANK] + 1 ),
cg.snap->ps.persistant[PERS_SCORE] );
} else {
s = va("You fragged %s", targetName );
}
// print the text message as well
CG_CenterPrint( s, SCREEN_HEIGHT * 0.25, (BIGCHAR_WIDTH+SMALLCHAR_WIDTH)*.5 );
}
// check for double client messages
@ -801,7 +807,7 @@ static void CG_Obituary_Chest( entityState_t *ent ) {
}
if (message) {
CG_Printf( "%s %s %s%s\n",
CG_Printf( "%s %s %s%s\n",
targetName, message, attackerName, message2);
return;
}
@ -834,7 +840,7 @@ static void CG_Obituary_Stomach( entityState_t *ent ) {
target = ent->otherEntityNum;
attacker = ent->otherEntityNum2;
mod = ent->eventParm;
if ( target < 0 || target >= MAX_CLIENTS ) {
CG_Error( "CG_Obituary: target out of range" );
}
@ -911,13 +917,14 @@ static void CG_Obituary_Stomach( entityState_t *ent ) {
char *s;
if ( cgs.gametype < GT_TEAM ) {
s = va("You fragged %s\n%s place with %i", targetName,
s = va("You fragged %s\n%s place with %i", targetName,
CG_PlaceString( cg.snap->ps.persistant[PERS_RANK] + 1 ),
cg.snap->ps.persistant[PERS_SCORE] );
} else {
s = va("You fragged %s", targetName );
}
// print the text message as well
CG_CenterPrint( s, SCREEN_HEIGHT * 0.25, (BIGCHAR_WIDTH+SMALLCHAR_WIDTH)*.5 );
}
// check for double client messages
@ -991,7 +998,7 @@ static void CG_Obituary_Stomach( entityState_t *ent ) {
}
if (message) {
CG_Printf( "%s %s %s%s\n",
CG_Printf( "%s %s %s%s\n",
targetName, message, attackerName, message2);
return;
}
@ -1088,6 +1095,7 @@ static void CG_Obituary_Legs( entityState_t *ent ) {
break;
}
}
if (!(attacker == ENTITYNUM_WORLD || attacker == target)) message = NULL;
if (message) {
CG_Printf( "%s %s.\n", targetName, message);
@ -1099,13 +1107,14 @@ static void CG_Obituary_Legs( entityState_t *ent ) {
char *s;
if ( cgs.gametype < GT_TEAM ) {
s = va("You fragged %s\n%s place with %i", targetName,
s = va("You fragged %s\n%s place with %i", targetName,
CG_PlaceString( cg.snap->ps.persistant[PERS_RANK] + 1 ),
cg.snap->ps.persistant[PERS_SCORE] );
} else {
s = va("You fragged %s", targetName );
}
// print the text message as well
CG_CenterPrint( s, SCREEN_HEIGHT * 0.25, (BIGCHAR_WIDTH+SMALLCHAR_WIDTH)*.5 );
}
// check for double client messages
@ -1154,10 +1163,10 @@ static void CG_Obituary_Legs( entityState_t *ent ) {
if (gender == GENDER_NEUTER)
message = "had its legs cut off thanks to";
else if (gender == GENDER_FEMALE)
message = "had her legs cut off thanks to";
message = "had her legs cut off thanks to";
else
message = "had his legs cut off thanks to";
message = "had his legs cut off thanks to";
message2 = "'s flying knife";
break;
case MOD_HANDCANNON:
@ -1180,7 +1189,7 @@ static void CG_Obituary_Legs( entityState_t *ent ) {
}
if (message) {
CG_Printf( "%s %s %s%s\n",
CG_Printf( "%s %s %s%s\n",
targetName, message, attackerName, message2);
return;
}
@ -1204,7 +1213,7 @@ static void CG_UseItem( centity_t *cent ) {
entityState_t *es;
es = &cent->currentState;
itemNum = (es->event & ~EV_EVENT_BITS) - EV_USE_ITEM0;
if ( itemNum < 0 || itemNum > HI_NUM_HOLDABLE ) {
itemNum = 0;
@ -1300,7 +1309,7 @@ void CG_PainEvent( centity_t *cent, int health ) {
} else {
snd = "*pain100_1.wav";
}
trap_S_StartSound( NULL, cent->currentState.number, CHAN_VOICE,
trap_S_StartSound( NULL, cent->currentState.number, CHAN_VOICE,
CG_CustomSound( cent->currentState.number, snd ) );
// save pain time for programitic twitch animation
@ -1342,13 +1351,13 @@ static void CG_DMRewardEvent( entityState_t *ent ) {
strcat( attackerName, S_COLOR_WHITE );
if ((mod > 3) && (mod < 8))
message = "2";
else if (mod < 16)
else if (mod < 16)
message = "4";
else if (mod < 32)
message = "8";
else
else
message = "16";
if (message) {
CG_Printf( "%s has %d kills in a row and receives %s frags for the kill!\n",
attackerName, mod, message);
@ -1422,14 +1431,14 @@ also called by CG_CheckPlayerstateEvents
void CG_EntityEvent( centity_t *cent, vec3_t position ) {
entityState_t *es;
int event;
vec3_t dir;
vec3_t dir, viewDir;
const char *s;
int clientNum;
clientInfo_t *ci;
es = &cent->currentState;
event = es->event & ~EV_EVENT_BITS;
if ( cg_debugEvents.integer ) {
CG_Printf( "ent:%3i event:%3i ", es->number, event );
}
@ -1445,6 +1454,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
}
ci = &cgs.clientinfo[ clientNum ];
CG_CalcViewDir2(es->origin2, position, viewDir);
switch ( event ) {
//
// movement generated events
@ -1452,21 +1463,21 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_FOOTSTEP:
DEBUGNAME("EV_FOOTSTEP");
if (cg_footsteps.integer) {
trap_S_StartSound (NULL, es->number, CHAN_BODY,
trap_S_StartSound (NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ ci->footsteps ][rand()&3] );
}
break;
case EV_FOOTSTEP_METAL:
DEBUGNAME("EV_FOOTSTEP_METAL");
if (cg_footsteps.integer) {
trap_S_StartSound (NULL, es->number, CHAN_BODY,
trap_S_StartSound (NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_METAL ][rand()&3] );
}
break;
case EV_FOOTSTEP_GRASS:
DEBUGNAME("EV_FOOTSTEP_GRASS");
if (cg_footsteps.integer) {
trap_S_StartSound (NULL, es->number, CHAN_BODY,
trap_S_StartSound (NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_GRASS ][rand()&3] );
}
break;
@ -1474,7 +1485,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_FOOTSTEP_GRAVEL:
DEBUGNAME("EV_FOOTSTEP_GRAVEL");
if (cg_footsteps.integer) {
trap_S_StartSound (NULL, es->number, CHAN_BODY,
trap_S_StartSound (NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_GRAVEL ][rand()&3] );
}
break;
@ -1482,42 +1493,42 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_FOOTSTEP_WOOD:
DEBUGNAME("EV_FOOTSTEP_WOOD");
if (cg_footsteps.integer) {
trap_S_StartSound (NULL, es->number, CHAN_BODY,
trap_S_StartSound (NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_WOOD ][rand()&3] );
}
break;
case EV_FOOTSTEP_CARPET:
DEBUGNAME("EV_FOOTSTEP_CARPET");
if (cg_footsteps.integer) {
trap_S_StartSound (NULL, es->number, CHAN_BODY,
trap_S_StartSound (NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_CARPET ][rand()&3] );
}
break;
case EV_FOOTSTEP_METAL2:
DEBUGNAME("EV_FOOTSTEP_METAL2");
if (cg_footsteps.integer) {
trap_S_StartSound (NULL, es->number, CHAN_BODY,
trap_S_StartSound (NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_METAL2 ][rand()&3] );
}
break;
case EV_FOOTSPLASH:
DEBUGNAME("EV_FOOTSPLASH");
if (cg_footsteps.integer) {
trap_S_StartSound (NULL, es->number, CHAN_BODY,
trap_S_StartSound (NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_SPLASH ][rand()&3] );
}
break;
case EV_FOOTWADE:
DEBUGNAME("EV_FOOTWADE");
if (cg_footsteps.integer) {
trap_S_StartSound (NULL, es->number, CHAN_BODY,
trap_S_StartSound (NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_SPLASH ][rand()&3] );
}
break;
case EV_SWIM:
DEBUGNAME("EV_SWIM");
if (cg_footsteps.integer) {
trap_S_StartSound (NULL, es->number, CHAN_BODY,
trap_S_StartSound (NULL, es->number, CHAN_BODY,
cgs.media.footsteps[ FOOTSTEP_SPLASH ][rand()&3] );
}
break;
@ -1525,9 +1536,9 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_FALL_SHORT:
DEBUGNAME("EV_FALL_SHORT");
trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.landSound );
if ( clientNum == cg.predictedPlayerState.clientNum ) {
// smooth landing z changes
@ -1537,7 +1548,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
break;
case EV_FALL_SHORT_NOSOUND:
DEBUGNAME("EV_FALL_SHORT_NOSOUND");
if ( clientNum == cg.predictedPlayerState.clientNum ) {
// smooth landing z changes
cg.landChange = -8;
@ -1547,9 +1558,9 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_FALL_MEDIUM:
DEBUGNAME("EV_FALL_MEDIUM");
// use normal pain sound
trap_S_StartSound( NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "*pain100_1.wav" ) );
if ( clientNum == cg.predictedPlayerState.clientNum ) {
// smooth landing z changes
@ -1569,9 +1580,9 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_FALL_FAR:
DEBUGNAME("EV_FALL_FAR");
trap_S_StartSound (NULL, es->number, CHAN_AUTO, CG_CustomSound( es->number, "*fall1.wav" ) );
cent->pe.painTime = cg.time; // don't play a pain sound right after this
if ( clientNum == cg.predictedPlayerState.clientNum ) {
@ -1634,17 +1645,18 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
vec3_t up = {0, 0, 1};
smoke = CG_SmokePuff( cent->lerpOrigin, up,
32,
smoke = CG_SmokePuff( cent->lerpOrigin, up,
32,
1, 1, 1, 0.33f,
1000,
1000,
cg.time, 0,
LEF_PUFF_DONT_SCALE,
LEF_PUFF_DONT_SCALE,
cgs.media.smokePuffShader );
}
// boing sound at origin, jump sound on player
trap_S_StartSound ( cent->lerpOrigin, -1, CHAN_VOICE, cgs.media.jumpPadSound );
// NiceAss: Allow for custom jump sounds. I have no clue what I am doing.
if (es->eventParm) trap_S_StartSound ( cent->lerpOrigin, -1, CHAN_VOICE, cgs.gameSounds[ es->eventParm ]); //cgs.media.jumpPadSound );
//Blaze: Get rid of jump noises
// trap_S_StartSound (NULL, es->number, CHAN_VOICE, CG_CustomSound( es->number, "*jump1.wav" ) );
break;
@ -1960,7 +1972,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
DEBUGNAME("EV_SCOREPLUM");
CG_ScorePlum( cent->currentState.otherEntityNum, cent->lerpOrigin, cent->currentState.time );
break;
//
// missile impacts
//
@ -1973,18 +1984,18 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_MISSILE_MISS:
DEBUGNAME("EV_MISSILE_MISS");
ByteToDir( es->eventParm, dir );
CG_MissileHitWall( es->weapon, 0, position, dir, IMPACTSOUND_DEFAULT, 0 );
CG_MissileHitWall( es->weapon, 0, position, dir, viewDir, IMPACTSOUND_DEFAULT, 0 );
break;
case EV_MISSILE_MISS_METAL:
DEBUGNAME("EV_MISSILE_MISS_METAL");
ByteToDir( es->eventParm, dir );
CG_MissileHitWall( es->weapon, 0, position, dir, IMPACTSOUND_METAL, 0 );
CG_MissileHitWall( es->weapon, 0, position, dir, viewDir, IMPACTSOUND_METAL, 0 );
break;
case EV_KNIFE_MISS:
DEBUGNAME("EV_KNIFE_MISS");
ByteToDir( es->eventParm, dir );
CG_MissileHitWall( es->weapon, 0, position, dir, IMPACTSOUND_METAL, RQ3_WPMOD_KNIFESLASH );
CG_MissileHitWall( es->weapon, 0, position, dir, viewDir, IMPACTSOUND_METAL, RQ3_WPMOD_KNIFESLASH );
break;
case EV_RAILTRAIL:
@ -1995,7 +2006,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
//CG_RailTrail( ci, es->origin2, es->pos.trBase );
if ( es->eventParm != 255 ) {
ByteToDir( es->eventParm, dir );
CG_MissileHitWall( es->weapon, es->clientNum, position, dir, IMPACTSOUND_DEFAULT, 0 );
CG_MissileHitWall( es->weapon, es->clientNum, position, dir, viewDir, IMPACTSOUND_DEFAULT, 0 );
}
break;
@ -2113,7 +2124,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
}
break;
case EV_RQ3_SOUND:
DEBUGNAME("EV_RQ3_SOUND");
switch (es->eventParm) {
@ -2128,7 +2139,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case RQ3_SOUND_HEADSHOT:
//CG_Printf("EV_RQ3_SOUND: Headshot\n");
//Elder: extra blood - synched with sound
//CG_Bleed( position, es->number );
//CG_Bleed( position, es->number );
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.headshotSound);
break;
*/
@ -2147,7 +2158,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case RQ3_SOUND_KNIFEDEATH:
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.knifeDeathSound);
break;
default:
break;
}
@ -2198,7 +2209,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
else {
if (cgs.clientinfo[cg.clientNum].team == TEAM_BLUE) {
#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.yourTeamTookTheFlagSound );
else
#endif
@ -2301,7 +2312,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_DEATH2:
case EV_DEATH3:
DEBUGNAME("EV_DEATHx");
trap_S_StartSound( NULL, es->number, CHAN_VOICE,
trap_S_StartSound( NULL, es->number, CHAN_VOICE,
CG_CustomSound( es->number, va("*death%i.wav", event - EV_DEATH1 + 1) ) );
break;

View file

@ -11,12 +11,20 @@
// If you absolutely need something stored, it can either be kept
// by the server in the server stored userinfos, or stashed in a cvar.
// NiceAss: Taken out until later.
// #define __ZCAM__
#ifdef MISSIONPACK
#define CG_FONT_THRESHOLD 0.1
#endif
#define POWERUP_BLINKS 5
// NiceAss: Weapon scales
#define WEAPON_KNIFE_SCALE 1.5
#define WEAPON_GUN_SCALE 1.2
#define WEAPON_OTHER_SCALE 1.0
#define POWERUP_BLINK_TIME 1000
#define FADE_TIME 200
#define PULSE_TIME 200
@ -1344,8 +1352,10 @@ extern vmCvar_t cg_RQ3_laserAssist;
extern vmCvar_t cg_RQ3_anouncer;
//Elder: different blood types
extern vmCvar_t cg_RQ3_bloodStyle;
//NiceAss: strobing weapons/items like quake 2
extern vmCvar_t cg_RQ3_strobe;
//Niceass: Q2-like prediction (or lack of)
extern vmCvar_t cg_RQ3_oldpredict;
// extern vmCvar_t cg_RQ3_oldpredict;
extern vmCvar_t cg_drawFriend;
extern vmCvar_t cg_teamChatsOnly;
extern vmCvar_t cg_noVoiceChats;
@ -1569,7 +1579,7 @@ void CG_RegisterItemVisuals( int itemNum );
void CG_FireWeapon( centity_t *cent, int weapModification );
void CG_ReloadWeapon( centity_t *cent, int reloadStage ); //Elder: added
void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
vec3_t dir, impactSound_t soundType, int weapModification ); //Elder: added weapMod
vec3_t dir, vec3_t viewdir, impactSound_t soundType, int weapModification ); //Elder: added weapMod
void CG_MissileHitPlayer( int weapon, vec3_t origin, vec3_t dir, int entityNum );
void CG_ShotgunFire( entityState_t *es, qboolean ism3 );
void CG_Bullet( vec3_t origin, int sourceEntityNum, vec3_t normal, qboolean flesh, int fleshEntityNum, impactSound_t soundType);
@ -1583,7 +1593,6 @@ void CG_DrawWeaponSelect( void );
void CG_OutOfAmmoChange( void ); // should this be in pmove?
void CG_CheckLaser (); //Elder: check laser to see if it's our own
//
// cg_marks.c
//

View file

@ -167,8 +167,8 @@ vmCvar_t cg_RQ3_laserAssist;
vmCvar_t cg_RQ3_anouncer;
//Elder: different blood types
vmCvar_t cg_RQ3_bloodStyle;
//NiceAss: Q2-like prediction
vmCvar_t cg_RQ3_oldpredict;
//NiceAss: Temporary boolean strobe cvar
vmCvar_t cg_RQ3_strobe;
vmCvar_t cg_drawFriend;
vmCvar_t cg_teamChatsOnly;
vmCvar_t cg_noVoiceChats;
@ -332,6 +332,8 @@ static cvarTable_t cvarTable[] = { // bk001129
{ &cg_RQ3_glasstime, "cg_RQ3_glasstime", "0", CVAR_ARCHIVE },
// Elder: added
{ &cg_RQ3_flash, "cg_RQ3_flash", "1", CVAR_ARCHIVE },
// NiceAss: added
{ &cg_RQ3_strobe, "cg_RQ3_strobe", "0", CVAR_ARCHIVE },
{ &cg_RQ3_painblend, "cg_RQ3_painblend", "1", CVAR_ARCHIVE },
{ &cg_RQ3_ssgZoomAssist, "cg_RQ3_ssgZoomAssist", "1", CVAR_ARCHIVE },
{ &cg_RQ3_ssgSensitivityAuto, "cg_RQ3_ssgSensitivityAuto", "1", CVAR_ARCHIVE },
@ -350,10 +352,8 @@ static cvarTable_t cvarTable[] = { // bk001129
{ &cg_oldRail, "cg_oldRail", "1", CVAR_ARCHIVE},
{ &cg_oldRocket, "cg_oldRocket", "1", CVAR_ARCHIVE},
{ &cg_oldPlasma, "cg_oldPlasma", "1", CVAR_ARCHIVE},
{ &cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE},
{ &cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE}
// { &cg_pmove_fixed, "cg_pmove_fixed", "0", CVAR_USERINFO | CVAR_ARCHIVE }
// NiceAss: Added:
{ &cg_RQ3_oldpredict, "cg_RQ3_oldpredict", "0", CVAR_ARCHIVE}
};
static int cvarTableSize = sizeof( cvarTable ) / sizeof( cvarTable[0] );
@ -791,7 +791,7 @@ static void CG_RegisterSounds( void ) {
}
for ( i = 1 ; i < MAX_SOUNDS ; i++ ) {
soundName = CG_ConfigString( CS_SOUNDS+i );
soundName = CG_ConfigString( CS_SOUNDS+i );
if ( !soundName[0] ) {
break;
}
@ -1227,6 +1227,9 @@ static void CG_RegisterGraphics( void ) {
cgs.media.glassMarkShader = trap_R_RegisterShader( "gfx/damage/glass_mrk" );
cgs.media.metalMarkShader = trap_R_RegisterShader( "gfx/damage/metal_mrk" );
// NiceAss: for foglaser
cgs.media.railCoreShader = trap_R_RegisterShader( "railCore" );
// register the inline models
cgs.numInlineModels = trap_CM_NumInlineModels();
for ( i = 1 ; i < cgs.numInlineModels ; i++ ) {

View file

@ -649,7 +649,7 @@ static void CG_LoadClientInfo( clientInfo_t *ci ) {
}
#endif
modelloaded = qtrue;
if ( !CG_RegisterClientModelname( ci, ci->modelName, ci->skinName, ci->headModelName, ci->headSkinName, teamname ) ) {
if ( !CG_RegisterClientModelname( ci, ci->modelName, ci->skinName, ci->headModelName, ci->headSkinName, teamname ) ) {
if ( cg_buildScript.integer ) {
CG_Error( "CG_RegisterClientModelname( %s, %s, %s, %s %s ) failed", ci->modelName, ci->skinName, ci->headModelName, ci->headSkinName, teamname );
}
@ -759,8 +759,8 @@ static qboolean CG_ScanForExistingClientInfo( clientInfo_t *ci ) {
if ( !Q_stricmp( ci->modelName, match->modelName )
&& !Q_stricmp( ci->skinName, match->skinName )
&& !Q_stricmp( ci->headModelName, match->headModelName )
&& !Q_stricmp( ci->headSkinName, match->headSkinName )
&& !Q_stricmp( ci->blueTeam, match->blueTeam )
&& !Q_stricmp( ci->headSkinName, match->headSkinName )
&& !Q_stricmp( ci->blueTeam, match->blueTeam )
&& !Q_stricmp( ci->redTeam, match->redTeam )
&& (cgs.gametype < GT_TEAM || ci->team == match->team) ) {
// this clientinfo is identical, so use it's handles
@ -1077,7 +1077,7 @@ CG_SetWeaponLerpFrame
may include ANIM_TOGGLEBIT
===============
*/
static void CG_SetWeaponLerpFrame( clientInfo_t *ci, lerpFrame_t *lf, int newAnimation )
static void CG_SetWeaponLerpFrame( clientInfo_t *ci, lerpFrame_t *lf, int newAnimation )
{
animation_t *anim;
@ -1106,7 +1106,7 @@ static void CG_SetWeaponLerpFrame( clientInfo_t *ci, lerpFrame_t *lf, int newAni
//Elder: reset frame so there is no lerping between new animations
lf->oldFrame = lf->frame = lf->animation->firstFrame;
}
@ -1269,13 +1269,13 @@ CG_WeaponAnimation
This is called from cg_weapons.c
===============
*/
void CG_WeaponAnimation( centity_t *cent, int *weaponOld, int *weapon, float *weaponBackLerp )
void CG_WeaponAnimation( centity_t *cent, int *weaponOld, int *weapon, float *weaponBackLerp )
{
clientInfo_t *ci;
int clientNum;
int stateAnimNum;
int weapAnimNum;
clientNum = cent->currentState.clientNum;
if ( cg_noPlayerAnims.integer ) {
@ -1284,7 +1284,7 @@ void CG_WeaponAnimation( centity_t *cent, int *weaponOld, int *weapon, float *we
}
ci = &cgs.clientinfo[ clientNum ];
// Elder: FIXME? - hack hehe
// Compare master copy with existing animation frames
// The only time when they are supposed to be mismatched is when
@ -1332,7 +1332,7 @@ void CG_WeaponAnimation( centity_t *cent, int *weaponOld, int *weapon, float *we
#if 0
if (cg_debugAnim.integer)
if(cent->pe.weapon.oldFrame || cent->pe.weapon.frame || cent->pe.weapon.backlerp) {
CG_Printf("weaponOld: %i weaponFrame: %i weaponBack: %i\n",
CG_Printf("weaponOld: %i weaponFrame: %i weaponBack: %i\n",
cent->pe.weapon.oldFrame, cent->pe.weapon.frame, cent->pe.weapon.backlerp);
}
#endif
@ -1418,7 +1418,7 @@ static void CG_SwingAngles( float destination, float swingTolerance, float clamp
if ( !*swinging ) {
return;
}
// modify the speed depending on the delta
// so it doesn't seem so linear
swing = AngleSubtract( destination, *angle );
@ -1512,7 +1512,7 @@ static void CG_PlayerAngles( centity_t *cent, vec3_t legs[3], vec3_t torso[3], v
// --------- yaw -------------
// allow yaw to drift a bit
if ( ( cent->currentState.legsAnim & ~ANIM_TOGGLEBIT ) != LEGS_IDLE
if ( ( cent->currentState.legsAnim & ~ANIM_TOGGLEBIT ) != LEGS_IDLE
|| ( cent->currentState.torsoAnim & ~ANIM_TOGGLEBIT ) != TORSO_STAND ) {
// if not standing still, always point all in the same direction
cent->pe.torso.yawing = qtrue; // always center
@ -1619,7 +1619,7 @@ static void CG_HCSmokeTrail( centity_t *cent ) {
vec3_t velocity;
int anim;
int smokeTime;
if ( cg_noProjectileTrail.integer || cent->trailTime > cg.time ) {
return;
}
@ -1636,7 +1636,7 @@ static void CG_HCSmokeTrail( centity_t *cent ) {
{
velocity[0] = rand() % 10 - 5;
velocity[1] = rand() % 8 - 4;
velocity[2] = 24 + rand() % 40;
velocity[2] = 24 + rand() % 40;
cent->trailTime += 350;
smokeTime = 2250 + rand() % 250;
}
@ -1655,11 +1655,11 @@ static void CG_HCSmokeTrail( centity_t *cent ) {
VectorCopy( cent->lerpOrigin, origin );
origin[2] -= 6;
smoke = CG_SmokePuff( origin, velocity,
20 + rand() % 4,
smoke = CG_SmokePuff( origin, velocity,
20 + rand() % 4,
1, 1, 1, 0.33f,
smokeTime,
smokeTime,
cg.time,
0,
0,
@ -1695,10 +1695,10 @@ static void CG_HasteTrail( centity_t *cent ) {
VectorCopy( cent->lerpOrigin, origin );
origin[2] -= 16;
smoke = CG_SmokePuff( origin, vec3_origin,
8,
smoke = CG_SmokePuff( origin, vec3_origin,
8,
1, 1, 1, 1,
500,
500,
cg.time,
0,
0,
@ -2161,7 +2161,7 @@ static void CG_PlayerSprites( centity_t *cent ) {
}
team = cgs.clientinfo[ cent->currentState.clientNum ].team;
if ( !(cent->currentState.eFlags & EF_DEAD) &&
if ( !(cent->currentState.eFlags & EF_DEAD) &&
cg.snap->ps.persistant[PERS_TEAM] == team &&
cgs.gametype >= GT_TEAM) {
if (cg_drawFriend.integer) {
@ -2218,11 +2218,11 @@ static qboolean CG_PlayerShadow( centity_t *cent, float *shadowPlane ) {
alpha = 1.0 - trace.fraction;
// bk0101022 - hack / FPE - bogus planes?
//assert( DotProduct( trace.plane.normal, trace.plane.normal ) != 0.0f )
//assert( DotProduct( trace.plane.normal, trace.plane.normal ) != 0.0f )
// add the mark as a temporary, so it goes directly to the renderer
// without taking a spot in the cg_marks array
CG_ImpactMark( cgs.media.shadowMarkShader, trace.endpos, trace.plane.normal,
CG_ImpactMark( cgs.media.shadowMarkShader, trace.endpos, trace.plane.normal,
cent->pe.legs.yawAngle, alpha,alpha,alpha,1, qfalse, 24, qtrue );
return qtrue;
@ -2344,7 +2344,7 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, entityState_t *state, int te
trap_R_AddRefEntityToScene( ent );
//}
if ( state->powerups & ( 1 << PW_QUAD ) )
{
if (team == TEAM_RED)
@ -2374,7 +2374,7 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, entityState_t *state, int te
trap_R_AddRefEntityToScene( ent );
}
}
}
}
@ -2401,7 +2401,7 @@ int CG_LightVerts( vec3_t normal, int numVerts, polyVert_t *verts )
verts[i].modulate[2] = ambientLight[2];
verts[i].modulate[3] = 255;
continue;
}
}
j = ( ambientLight[0] + incoming * directedLight[0] );
if ( j > 255 ) {
j = 255;
@ -2482,7 +2482,7 @@ void CG_Player( centity_t *cent ) {
// get the rotation information
CG_PlayerAngles( cent, legs.axis, torso.axis, head.axis );
// get the animation state (after rotation, to allow feet shuffle)
CG_PlayerAnimation( cent, &legs.oldframe, &legs.frame, &legs.backlerp,
&torso.oldframe, &torso.frame, &torso.backlerp );
@ -2563,7 +2563,7 @@ void CG_Player( centity_t *cent ) {
angle = ((cg.time / 4) & 255) * (M_PI * 2) / 255;
dir[2] = 15 + sin(angle) * 8;
VectorAdd(torso.origin, dir, skull.origin);
dir[2] = 0;
VectorCopy(dir, skull.axis[1]);
VectorNormalize(skull.axis[1]);
@ -2641,7 +2641,7 @@ void CG_Player( centity_t *cent ) {
dir[1] = cos(angle) * 20;
dir[2] = 0;
VectorAdd(torso.origin, dir, skull.origin);
VectorCopy(dir, skull.axis[1]);
VectorNormalize(skull.axis[1]);
VectorSet(skull.axis[2], 0, 0, 1);
@ -2764,6 +2764,12 @@ void CG_Player( centity_t *cent ) {
head.shadowPlane = shadowPlane;
head.renderfx = renderfx;
// NiceAss will have fun here: Big head mode!
//VectorScale( head.axis[0], 4.0f, head.axis[0] );
//VectorScale( head.axis[1], 4.0f, head.axis[1] );
//VectorScale( head.axis[2], 4.0f, head.axis[2] );
// End of fun
CG_AddRefEntityWithPowerups( &head, &cent->currentState, ci->team );
#ifdef MISSIONPACK
@ -2798,7 +2804,7 @@ A player just came into view or teleported, so reset all animation info
*/
void CG_ResetPlayerEntity( centity_t *cent ) {
cent->errorTime = -99999; // guarantee no error decay added
cent->extrapolated = qfalse;
cent->extrapolated = qfalse;
CG_ClearLerpFrame( &cgs.clientinfo[ cent->currentState.clientNum ], &cent->pe.legs, cent->currentState.legsAnim );
CG_ClearLerpFrame( &cgs.clientinfo[ cent->currentState.clientNum ], &cent->pe.torso, cent->currentState.torsoAnim );

View file

@ -415,7 +415,12 @@ void CG_PredictPlayerState( void ) {
// demo playback just copies the moves
if ( cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_FOLLOW) ) {
if ( cg.demoPlayback || (cg.snap->ps.pm_flags & PMF_FOLLOW)
#ifdef __ZCAM__
/* camera jitter fix (client side) */
|| (cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR)
#endif /* __ZCAM__ */
) {
CG_InterpolatePlayerState( qfalse );
return;
}

View file

@ -31,7 +31,7 @@ static int CG_ValidOrder(const char *p) {
int i;
for (i = 0; i < numValidOrders; i++) {
if (Q_stricmp(p, validOrders[i].order) == 0) {
return validOrders[i].taskNum;
return validOrders[i].taskNum;7
}
}
return -1;
@ -305,7 +305,7 @@ static void CG_ConfigStringModified( void ) {
cg.intermissionStarted = atoi( str );
} else if ( num >= CS_MODELS && num < CS_MODELS+MAX_MODELS ) {
cgs.gameModels[ num-CS_MODELS ] = trap_R_RegisterModel( str );
} else if ( num >= CS_SOUNDS && num < CS_SOUNDS+MAX_MODELS ) {
} else if ( num >= CS_SOUNDS && num < CS_SOUNDS+MAX_SOUNDS ) {
if ( str[0] != '*' ) { // player specific sounds don't register here
cgs.gameSounds[ num-CS_SOUNDS] = trap_S_RegisterSound( str, qfalse );
}
@ -327,7 +327,7 @@ static void CG_ConfigStringModified( void ) {
else if ( num == CS_SHADERSTATE ) {
CG_ShaderStateChanged();
}
}
@ -1056,13 +1056,13 @@ static void CG_ServerCommand( void ) {
cg.levelShot = qtrue;
return;
}
//Blaze: Dont think q3 can do
//Blaze: Dont think q3 can do
/*if ( !strcmp( cmd, "numCheatVars" ) )
{//set and clear the cheatvar structure
int numCheats;
numCheats = atoi(CG_Argv(1));
return;
return;
}*/
if ( !strcmp( cmd, "delCheatVar" ) )
@ -1076,7 +1076,7 @@ static void CG_ServerCommand( void ) {
char param[128];
int i;
float lowend, highend;
Q_strncpyz( param, CG_Argv(1), 128 );
lowend = atof(CG_Argv(2));
highend = atof(CG_Argv(3));

View file

@ -1211,6 +1211,8 @@ different than the muzzle point used for determining hits.
The cent should be the non-predicted cent if it is from the player,
so the endpoint will reflect the simulated strike (lagging the predicted
angle)
NiceAss; I've torn this function up with testing... ignore it =P
===============
*/
static void CG_LightningBolt( centity_t *cent, vec3_t origin ) {
@ -1218,24 +1220,23 @@ static void CG_LightningBolt( centity_t *cent, vec3_t origin ) {
refEntity_t beam;
vec3_t forward;
vec3_t muzzlePoint, endPoint;
centity_t *client;
//Blaze: LG No longer exists
// if ( cent->currentState.weapon != WP_LIGHTNING ) {
// return;
// }
memset( &beam, 0, sizeof( beam ) );
//client = &cg_entities[cg.predictedPlayerState.clientNum];
//CG_Printf("%d \n", cg.predictedPlayerState.clientNum);
// find muzzle point for this frame
VectorCopy( cent->lerpOrigin, muzzlePoint );
//BG_EvaluateTrajectory( &cent->currentState.apos, cg.time, cent->lerpAngles );
AngleVectors( cent->lerpAngles, forward, NULL, NULL );
// FIXME: crouch
muzzlePoint[2] += DEFAULT_VIEWHEIGHT;
VectorMA( muzzlePoint, 14, forward, muzzlePoint );
// project forward by the lightning range
VectorMA( muzzlePoint, LIGHTNING_RANGE, forward, endPoint );
VectorMA( muzzlePoint, 8192, forward, endPoint );
// see if it hit a wall
CG_Trace( &trace, muzzlePoint, vec3_origin, vec3_origin, endPoint,
@ -1254,23 +1255,7 @@ static void CG_LightningBolt( centity_t *cent, vec3_t origin ) {
// add the impact flare if it hit something
if ( trace.fraction < 1.0 ) {
vec3_t angles;
vec3_t dir;
VectorSubtract( beam.oldorigin, beam.origin, dir );
VectorNormalize( dir );
memset( &beam, 0, sizeof( beam ) );
beam.hModel = cgs.media.lightningExplosionModel;
VectorMA( trace.endpos, -16, dir, beam.origin );
// make a random orientation
angles[0] = rand() % 360;
angles[1] = rand() % 360;
angles[2] = rand() % 360;
AnglesToAxis( angles, beam.axis );
trap_R_AddRefEntityToScene( &beam );
}
}
@ -1574,6 +1559,9 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
}
*/
//CG_LightningBolt( nonPredictedCent, parent->lightingOrigin );
//Elder: re-added to fix loss of muzzle flashes!
// impulse flash
if ( cg.time - cent->muzzleFlashTime > MUZZLE_FLASH_TIME && !cent->pe.railgunFlash ) {
@ -1663,7 +1651,6 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
if ( ps || cg.renderingThirdPerson || cent->currentState.number != cg.predictedPlayerState.clientNum ) {
// add lightning bolt
//Blaze: No need for this
//CG_LightningBolt( nonPredictedCent, flash.origin );
// add rail trail
//Blaze: no need for this
@ -1690,6 +1677,9 @@ void CG_AddViewWeapon( playerState_t *ps ) {
float fovOffset;
vec3_t angles;
weaponInfo_t *weapon;
// remove this:
vec3_t origin;
//Blaze: Reaction vars for gun positions
float rxn_gunx, rxn_guny, rxn_gunz;
@ -1715,14 +1705,12 @@ void CG_AddViewWeapon( playerState_t *ps ) {
//Blaze: removed cg_drawGun checks and moved into other code.
if ( (cg.snap->ps.stats[STAT_RQ3] & RQ3_THROWWEAPON) == RQ3_THROWWEAPON) {
//Blaze: Removed these
// vec3_t origin;
// if ( cg.predictedPlayerState.eFlags & EF_FIRING ) {
if ( cg.predictedPlayerState.eFlags & EF_FIRING ) {
// special hack for lightning gun...
// VectorCopy( cg.refdef.vieworg, origin );
// VectorMA( origin, -8, cg.refdef.viewaxis[2], origin );
// CG_LightningBolt( &cg_entities[ps->clientNum], origin );
// }
//VectorCopy( cg.refdef.vieworg, origin );
//VectorMA( origin, -8, cg.refdef.viewaxis[2], origin );
//CG_LightningBolt( &cg_entities[ps->clientNum], origin );
}
return;
}
@ -2481,6 +2469,14 @@ void CG_FireWeapon( centity_t *cent, int weapModification ) {
cg.snap->ps.stats[STAT_BURST] > 0 ) {
return;
}
// KNIFE
// NicEass: This is if the knife slash is not the first (2,3,4,5)
if (weapModification == RQ3_WPMOD_KNIFENOMARK) {
return;
}
/*if ( cg.snap->ps.weapon == WP_KNIFE ) // { && cg.snap->ps.stats[STAT_BURST] > 0 ) {
return;
}*/
// mark the entity as muzzle flashing, so when it is added it will
// append the flash to the weapon model
@ -2518,7 +2514,7 @@ void CG_FireWeapon( centity_t *cent, int weapModification ) {
{
trap_S_StartSound( NULL, ent->number, CHAN_WEAPON, cgs.media.silencerSound );
}
else
else// if (cg.snap->ps.weapon != WP_KNIFE)
{
// play a sound
for ( c = 0 ; c < 4 ; c++ ) {
@ -2760,7 +2756,7 @@ Caused by an EV_MISSILE_MISS event, or directly by local bullet tracing
=================
*/
void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
vec3_t dir, impactSound_t soundType, int weapModification ) {
vec3_t dir, vec3_t viewdir, impactSound_t soundType, int weapModification ) {
qhandle_t mod;
qhandle_t mark;
qhandle_t shader;
@ -2783,8 +2779,9 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
int contentType;
//Elder: for impact sparks
vec3_t velocity;
vec3_t velocity, dir2;
int sparkCount;
float dot;
int i;
@ -3193,12 +3190,19 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
color[3] = 192;
break;
}
// NiceAss: Direction of bullet affects sparks
VectorCopy(dir, dir2);
if (weapon != WP_KNIFE) {
dot = DotProduct( viewdir, dir2 );
VectorMA( viewdir, -2*dot, dir2, dir2 );
}
// Elder: should probably dump this into another function
for ( i = 0; i < flashCount; i++ )
{
// introduce variance
VectorCopy( dir, temp );
VectorCopy( dir2, temp );
scale = crandom() + 1.8f;
temp[0] += (crandom() * 0.4f) - 0.2f;
temp[1] += (crandom() * 0.4f) - 0.2f;
@ -3207,7 +3211,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
VectorCopy( temp, offsetDir );
VectorScale( temp, scale, temp );
le = CG_MakeExplosion( origin, dir,
le = CG_MakeExplosion( origin, dir2,
mod, shader,
duration, isSprite );
@ -3319,20 +3323,29 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
else
sparkCount = 15 + rand() % 15;
// NiceAss: Direction of bullet affects sparks
VectorCopy(dir, dir2);
if (weapon != WP_KNIFE) {
dot = DotProduct( viewdir, dir2 );
VectorMA( viewdir, -2*dot, dir2, dir2 );
}
// Generate the particles
for (i = 0; i < sparkCount; i++)
{
if (weapon == WP_KNIFE)
VectorScale(dir, 50 + rand() % 10, velocity);
VectorScale(dir2, 50 + rand() % 10, velocity);
else
VectorScale(dir, 150 + rand() % 30, velocity);
VectorScale(dir2, 150 + rand() % 30, velocity);
//random upwards sparks
if ( rand() % 5 < 1)
velocity[2] += 120 + rand() % 30;
velocity[0] += rand() % 50 - 25;
velocity[1] += rand() % 50 - 25;
CG_ParticleSparks(origin, velocity, 100 + rand() % 120, 2, 2, -4, 1);
// CG_ParticleSparks(origin, velocity, 100 + rand() % 120, 2, 2, -4, 1);
// NiceAss: Longer life, faster sparks == more eye candy! =)
CG_ParticleSparks(origin, velocity, 150 + rand() % 120, 2, 2, -5, 1);
}
}
}
@ -3426,10 +3439,13 @@ We are not going to show every HC impact
*/
static void CG_ShotgunPellet( vec3_t start, vec3_t end, int skipNum, int shellWeapon ) {
trace_t tr;
vec3_t viewDir;
int sourceContentType, destContentType;
CG_Trace( &tr, start, NULL, NULL, end, skipNum, MASK_SHOT );
CG_CalcViewDir2(start, end, viewDir);
sourceContentType = trap_CM_PointContents( start, 0 );
destContentType = trap_CM_PointContents( tr.endpos, 0 );
@ -3473,22 +3489,22 @@ static void CG_ShotgunPellet( vec3_t start, vec3_t end, int skipNum, int shellWe
{
//Blaze: Changed WP_SHOTGUN to WP_M3
if (shellWeapon == WP_M3)
CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_METAL, 0 );
CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, viewDir, 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_METAL, 0 );
CG_MissileHitWall( WP_HANDCANNON, 0, tr.endpos, tr.plane.normal, viewDir, IMPACTSOUND_METAL, 0 );
}
}
else if ( tr.surfaceFlags & SURF_GLASS )
{
//Blaze: Changed WP_SHOTGUN to WP_M3
if (shellWeapon == WP_M3)
CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_GLASS, 0 );
CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, viewDir, IMPACTSOUND_GLASS, 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_GLASS, 0 );
CG_MissileHitWall( WP_HANDCANNON, 0, tr.endpos, tr.plane.normal, viewDir, IMPACTSOUND_GLASS, 0 );
}
}
else
@ -3496,11 +3512,11 @@ static void CG_ShotgunPellet( vec3_t start, vec3_t end, int skipNum, int shellWe
// 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_METAL, 0 );
CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, viewDir, 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_METAL, 0 );
CG_MissileHitWall( WP_HANDCANNON, 0, tr.endpos, tr.plane.normal, viewDir, IMPACTSOUND_METAL, 0 );
}
//CG_MissileHitWall( WP_M3, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT, 0 );
}
@ -3751,7 +3767,7 @@ void CG_Bullet( vec3_t end, int sourceEntityNum, vec3_t normal,
qboolean flesh, int fleshEntityNum, impactSound_t soundType) {
trace_t trace;
int sourceContentType, destContentType;
vec3_t start;
vec3_t start, viewAngle;
centity_t *cent;
// if the shooter is currently valid, calc a source point and possibly
@ -3800,12 +3816,15 @@ void CG_Bullet( vec3_t end, int sourceEntityNum, vec3_t normal,
}
}
// NiceAss: Added for better sparking.
CG_CalcViewDir(sourceEntityNum, end, viewAngle);
// impact splash and mark
if ( flesh ) {
CG_Bleed( end, fleshEntityNum );
} else {
//Blaze: Changed WP_MACHINEGUN to WP_PISTOL
CG_MissileHitWall( WP_PISTOL, 0, end, normal, soundType, 0 );
CG_MissileHitWall( WP_PISTOL, 0, end, normal, viewAngle, soundType, 0 );
}
}