Various fixes succeeding the VM 0-07-xx series
This commit is contained in:
Victor Chow 2001-08-06 19:15:00 +00:00
parent 4acc3b34d7
commit 67ac416c21
18 changed files with 476 additions and 327 deletions

View file

@ -80,8 +80,8 @@ static void CG_DropItem_f (void) {
}
//Elder: don't allow item dropping when in the middle of bursts
if (cg.snap->ps.stats[STAT_BURST] > 0)
return;
//if (cg.snap->ps.stats[STAT_BURST] > 0)
//return;
trap_SendClientCommand("dropitem");
}
@ -97,7 +97,6 @@ the client command to reduce bandwidth use slightly
*/
static void CG_Bandage_f (void) {
if ( !cg.snap ) {
//CG_Printf("No snapshot: normally exiting\n");
return;
}
@ -119,8 +118,6 @@ static void CG_Bandage_f (void) {
if ( (cg.snap->ps.stats[STAT_RQ3] & RQ3_BANDAGE_WORK) == RQ3_BANDAGE_WORK) {
CG_Printf("You are already bandaging!\n");
//cg.zoomed = 0;
//cg.zoomLevel = 0;
return;
}
@ -134,6 +131,9 @@ static void CG_Bandage_f (void) {
//CG_Printf("You are too busy with your weapon!\n");
//return;
//}
if (cg.snap->ps.weaponTime > 0)
return;
if ( (cg.snap->ps.stats[STAT_RQ3] & RQ3_BANDAGE_NEED) == RQ3_BANDAGE_NEED) {
CG_RQ3_Zoom1x();
}
@ -191,7 +191,7 @@ static void CG_Reload_f (void) {
return;
}
//cg.rq3_reloadDown = qtrue;
cg.rq3_reloadDown = qtrue;
//Elder: prevent "reloading" when dead hehe
if ( cg.snap->ps.stats[STAT_HEALTH] <= 0 ) {
@ -693,6 +693,38 @@ static void CG_SayTeam_f ( void ) {
trap_SendClientCommand("say_team");
}
/*
==================
CG_IRVision_f
Elder: Attempt to turn on IR Vision
==================
*/
static void CG_IRVision_f ( void ) {
if (bg_itemlist[cg.snap->ps.stats[STAT_HOLDABLE_ITEM]].giTag == HI_BANDOLIER)
{
if (cg.rq3_irvision)
{
CG_Printf("IR vision enabled.\n");
cg.rq3_irvision = qfalse;
}
else
{
CG_Printf("IR vision disabled.\n");
cg.rq3_irvision = qtrue;
}
trap_S_StartLocalSound(cgs.media.weapToggleSound, CHAN_ITEM);
}
else
{
CG_Printf("You do not have IR goggles.\n");
}
}
typedef struct {
char *cmd;
@ -761,7 +793,8 @@ static consoleCommand_t commands[] = {
#endif
{ "startOrbit", CG_StartOrbit_f },
//{ "camera", CG_Camera_f },
{ "loaddeferred", CG_LoadDeferredPlayers }
{ "loaddeferred", CG_LoadDeferredPlayers },
{ "irvision", CG_IRVision_f }
};
@ -851,4 +884,5 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand ("messagemode");
trap_AddCommand ("messagemode2");
trap_AddCommand ("playerorigin");
trap_AddCommand ("irvision");
}

View file

@ -1792,9 +1792,11 @@ static void CG_DrawDisconnect( void ) {
if ( ( cg.time >> 9 ) & 1 ) {
return;
}
x = 640 - 48;
y = 480 - 48;
//Elder: changed position
x = 0;
y = 0;
//x = 640 - 48;
//y = 480 - 48;
CG_DrawPic( x, y, 48, 48, trap_R_RegisterShader("gfx/2d/net.tga" ) );
}
@ -1827,8 +1829,11 @@ static void CG_DrawLagometer( void ) {
x = 640 - 48;
y = 480 - 144;
#else
x = 640 - 48;
y = 480 - 48;
//Elder: changed position
x = 0;
y = 0;
//x = 640 - 48;
//y = 480 - 48;
#endif
trap_R_SetColor( NULL );

View file

@ -1402,6 +1402,13 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
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,
cgs.media.footsteps[ FOOTSTEP_GRASS ][rand()&3] );
}
break;
case EV_FOOTSPLASH:
DEBUGNAME("EV_FOOTSPLASH");
if (cg_footsteps.integer) {
@ -1679,7 +1686,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
DEBUGNAME("EV_NOAMMO");
//Elder: Only play on non-grenade/knife
//Todo: use "out of ammo sound" for specific gun?
switch ( cg.snap->ps.weapon )
switch ( cent->currentState.weapon )
{
case WP_GRENADE:
case WP_KNIFE:
@ -1704,14 +1711,10 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
//Elder: modified
CG_FireWeapon( cent, es->eventParm );
break;
// Reaction Zoom
/*
case EV_ZOOM:
DEBUGNAME("EV_ZOOM");
CG_rxn_zoom(es->eventParm);
case EV_RELOAD_WEAPON:
DEBUGNAME("EV_RELOAD_WEAPON");
CG_ReloadWeapon( cent, es->eventParm );
break;
*/
case EV_USE_ITEM0:
DEBUGNAME("EV_USE_ITEM0");
CG_UseItem( cent );
@ -1964,6 +1967,9 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
//TODO: make sparks from hit position
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.kevlarHitSound);
break;
//case RQ3_SOUND_RELOAD_PISTOL:
//trap_S_StartSound( es->pos.trBase, es->number, CHAN_AUTO, cgs.media.reloadmk23Sound);
//break;
default:
break;
}
@ -2094,7 +2100,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
//Elder: headshot spray + sound
DEBUGNAME("EV_HEADSHOT");
//trap_S_StartSound( es->pos.trBase, es->number, CHAN_AUTO, cgs.media.headshotSound);
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.headshotSound);
trap_S_StartSound( cent->lerpOrigin, es->number, CHAN_AUTO, cgs.media.headshotSound);
ByteToDir(es->eventParm, dir);
VectorAdd(es->pos.trBase, dir, dir);
CG_BleedSpray(es->pos.trBase, dir, es->otherEntityNum, 8);

View file

@ -92,6 +92,7 @@ typedef enum {
FOOTSTEP_ENERGY,
FOOTSTEP_METAL,
FOOTSTEP_SPLASH,
FOOTSTEP_GRASS, // Elder: new surface sounds
FOOTSTEP_TOTAL
} footstep_t;
@ -377,16 +378,13 @@ typedef struct weaponInfo_s {
gitem_t *item;
qhandle_t handsModel; // the hands don't actually draw, they just position the weapon
qhandle_t weaponModel;
qhandle_t weaponModel; // Third-person/world model
qhandle_t barrelModel;
qhandle_t flashModel;
//Elder: added third person model to weaponInfo structure
qhandle_t firstModel;
//Blaze: for animations
qhandle_t animHandModel;
animation_t animations[MAX_WEAPON_ANIMATIONS];
qhandle_t firstModel; //Elder: view model
qhandle_t animHandModel; //Blaze: for animations
animation_t animations[MAX_WEAPON_ANIMATIONS];
vec3_t weaponMidpoint; // so it will rotate centered instead of by tag
@ -413,6 +411,9 @@ typedef struct weaponInfo_s {
sfxHandle_t readySound;
sfxHandle_t firingSound;
sfxHandle_t reloadSound1; // Elder: for various reload stages such as
sfxHandle_t reloadSound2; // Clip in, clip out, sliding, sliding bolt,
sfxHandle_t reloadSound3; // etc. Three should be enough
qboolean loopFireSound;
} weaponInfo_t;
@ -661,6 +662,7 @@ typedef struct {
qboolean laserSight; //Whether to draw local laser sight
localEntity_t *laserEnt; //Local model -- NULL if not in-use
qboolean rq3_irvision; // Elder: enabled IR vision
} cg_t;
@ -1462,6 +1464,7 @@ void CG_RegisterWeapon( int weaponNum );
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 );
void CG_MissileHitPlayer( int weapon, vec3_t origin, vec3_t dir, int entityNum );
void CG_ShotgunFire( entityState_t *es, qboolean ism3 );

View file

@ -737,6 +737,10 @@ static void CG_RegisterSounds( void ) {
Com_sprintf (name, sizeof(name), "sound/player/footsteps/clank%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_METAL][i] = trap_S_RegisterSound (name, qfalse);
//Elder: new footsteps
Com_sprintf (name, sizeof(name), "sound/player/footsteps/grass%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_GRASS][i] = trap_S_RegisterSound (name, qfalse);
}
// only register the items that the server says we need

View file

@ -1095,6 +1095,14 @@ static void CG_SetWeaponLerpFrame( clientInfo_t *ci, lerpFrame_t *lf, int newAni
if ( cg_debugAnim.integer ) {
CG_Printf( "Weapon Anim: %i\n", newAnimation );
}
//Elder: reset frame?
if ( cg_debugAnim.integer ) {
CG_Printf("Anim: %d, Old lf->frame %d, New lf->frame: %d\n",
newAnimation, lf->frame, anim->firstFrame);
}
lf->frame = anim->firstFrame;
}
@ -2219,6 +2227,16 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, entityState_t *state, int te
ent->customShader = cgs.media.battleSuitShader;
trap_R_AddRefEntityToScene( ent );
}
//Elder: IR Vision
if (bg_itemlist[cg.snap->ps.stats[STAT_HOLDABLE_ITEM]].giTag == HI_BANDOLIER &&
cg.rq3_irvision && !(state->eFlags & EF_DEAD))
{
//Temporary heh
ent->customShader = cgs.media.quadShader;
trap_R_AddRefEntityToScene( ent );
}
}
}

View file

@ -243,6 +243,7 @@ void CG_Respawn( void ) {
//Elder: added to reset zoom stuff LOCALLY
CG_RQ3_Zoom1x();
}
extern char *eventnames[];

View file

@ -733,10 +733,9 @@ void CG_RegisterWeapon( int weaponNum ) {
strcat( path, "_hand.md3" );
weaponInfo->handsModel = trap_R_RegisterModel( path );
//Elder: added to cache 3rd-person models (hopefully)
//Elder: added to cache 1st-person models
strcpy( path, item->world_model[0] );
COM_StripExtension( path, path );
//Elder: changed from _3rd to _1st
strcat( path, "_1st.md3" );
weaponInfo->firstModel = trap_R_RegisterModel( path );
@ -757,22 +756,26 @@ void CG_RegisterWeapon( int weaponNum ) {
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/mk23/mk23fire.wav", qfalse );
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
weaponInfo->reloadSound1 = trap_S_RegisterSound( "sound/weapons/mk23/mk23out.wav", qfalse );
weaponInfo->reloadSound2 = trap_S_RegisterSound( "sound/weapons/mk23/mk23in.wav", qfalse );
weaponInfo->reloadSound3 = trap_S_RegisterSound( "sound/weapons/mk23/mk23slide.wav", qfalse );
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
Com_sprintf( filename, sizeof(filename), "models/weapons2/mk23/animation.cfg" );
if ( !CG_ParseWeaponAnimFile(filename, weaponInfo) ) {
Com_Printf("Failed to load weapon animation file %s\n", filename);
}
break;
case WP_KNIFE:
MAKERGB( weaponInfo->flashDlightColor, 1, 0.70f, 0 );
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/knife/slash.wav", qfalse );
weaponInfo->missileModel = trap_R_RegisterModel("models/weapons2/knife/knife.md3");
//weaponInfo->missileTrailFunc = CG_GrenadeTrail;
MAKERGB( weaponInfo->flashDlightColor, 1, 0.70f, 0 );
//cgs.media.grenadeExplosionShader = trap_R_RegisterShader( "grenadeExplosion" );
weaponInfo->wiTrailTime = 700;
weaponInfo->trailRadius = 32;
//weaponInfo->wiTrailTime = 700;
//weaponInfo->trailRadius = 32;
break;
case WP_M4:
@ -780,6 +783,8 @@ void CG_RegisterWeapon( int weaponNum ) {
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/m4/m4fire.wav", qfalse );
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
weaponInfo->reloadSound1 = trap_S_RegisterSound( "sound/weapons/m4/m4out.wav", qfalse );
weaponInfo->reloadSound2 = trap_S_RegisterSound( "sound/weapons/m4/m4in.wav", qfalse );
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
break;
@ -811,6 +816,7 @@ void CG_RegisterWeapon( int weaponNum ) {
case WP_M3:
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/m3/m3fire.wav", qfalse );
weaponInfo->reloadSound1 = trap_S_RegisterSound( "sound/weapons/m3/m3in.wav", qfalse );
weaponInfo->ejectBrassFunc = CG_ShotgunEjectBrass;
Com_sprintf( filename, sizeof(filename), "models/weapons2/m3/animation.cfg" );
if ( !CG_ParseWeaponAnimFile(filename, weaponInfo) ) {
@ -832,7 +838,8 @@ void CG_RegisterWeapon( int weaponNum ) {
case WP_GRENADE:
//Changed from _3rd
weaponInfo->missileModel = trap_R_RegisterModel( "models/weapons2/grenade/grenade.md3" );
weaponInfo->missileTrailFunc = CG_GrenadeTrail;
//Elder: removed for the last time!! ;
//weaponInfo->missileTrailFunc = CG_GrenadeTrail;
weaponInfo->wiTrailTime = 700;
weaponInfo->trailRadius = 32;
MAKERGB( weaponInfo->flashDlightColor, 1, 0.70f, 0 );
@ -904,28 +911,25 @@ CG_MapTorsoToWeaponFrame
*/
static int CG_MapTorsoToWeaponFrame( clientInfo_t *ci, int frame ) {
//Elder: another hack
if (ci->curWeapon != WP_PISTOL && ci->curWeapon != WP_M3)
{
// change weapon
if ( frame >= ci->animations[TORSO_DROP].firstFrame
&& frame < ci->animations[TORSO_DROP].firstFrame + 9 ) {
return frame - ci->animations[TORSO_DROP].firstFrame + 6;
}
// stand attack
if ( frame >= ci->animations[TORSO_ATTACK].firstFrame
&& frame < ci->animations[TORSO_ATTACK].firstFrame + 6 ) {
return 1 + frame - ci->animations[TORSO_ATTACK].firstFrame;
}
// stand attack 2
if ( frame >= ci->animations[TORSO_ATTACK2].firstFrame
&& frame < ci->animations[TORSO_ATTACK2].firstFrame + 6 ) {
return 1 + frame - ci->animations[TORSO_ATTACK2].firstFrame;
}
// change weapon
if ( frame >= ci->animations[TORSO_DROP].firstFrame
&& frame < ci->animations[TORSO_DROP].firstFrame + 9 ) {
return frame - ci->animations[TORSO_DROP].firstFrame + 6;
}
// stand attack
if ( frame >= ci->animations[TORSO_ATTACK].firstFrame
&& frame < ci->animations[TORSO_ATTACK].firstFrame + 6 ) {
return 1 + frame - ci->animations[TORSO_ATTACK].firstFrame;
}
// stand attack 2
if ( frame >= ci->animations[TORSO_ATTACK2].firstFrame
&& frame < ci->animations[TORSO_ATTACK2].firstFrame + 6 ) {
return 1 + frame - ci->animations[TORSO_ATTACK2].firstFrame;
}
return 0;
}
@ -1199,43 +1203,6 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
{
//Elder: We are in third person, use the third-person model (DEFAULT)
gun.hModel = weapon->weaponModel;
/* Elder: use the cached model above
switch (weaponNum)//Blaze: Used to make the third person weapon models different then 1st person
{
case 0:
//gun.hModel = trap_R_RegisterModel( "models/weapons2/mk23/3rd_mk23.md3" );
//No Case zero
break;
case 1:
gun.hModel = trap_R_RegisterModel("models/weapons2/knife/3rd_knife.md3");
break;
case 2:
gun.hModel = trap_R_RegisterModel("models/weapons2/mk23/3rd_mk23.md3");
break;
case 3:
gun.hModel = trap_R_RegisterModel("models/weapons2/m4/3rd_m4.md3");
break;
case 4:
gun.hModel = trap_R_RegisterModel("models/weapons2/ssg3000/3rd_ssg3000.md3");
break;
case 5:
gun.hModel = trap_R_RegisterModel("models/weapons2/mp5/3rd_mp5.md3");
break;
case 6:
gun.hModel = trap_R_RegisterModel("models/weapons2/m3/3rd_m3.md3");
break;
case 7:
gun.hModel = trap_R_RegisterModel("models/weapons2/handcannon/3rd_handcannon.md3");
break;
case 8:
gun.hModel = trap_R_RegisterModel("models/weapons2/mk23/3rd_mk23.md3");
break;
case 9:
gun.hModel = trap_R_RegisterModel("models/weapons2/grenade/3rd_grenade.md3");
break;
}
*/
}
else {
//Elder: we are in first-person, use the first-person (NOT default) model
@ -1528,18 +1495,22 @@ void CG_AddViewWeapon( playerState_t *ps ) {
AnglesToAxis( angles, hand.axis );
// map torso animations to weapon animations
if ( cg_gun_frame.integer ) {
// 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;
}
//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) {
// 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;
@ -2243,7 +2214,8 @@ CG_MissileHitWall
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 ) {
void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
vec3_t dir, impactSound_t soundType ) {
qhandle_t mod;
qhandle_t mark;
qhandle_t shader;
@ -2957,3 +2929,66 @@ void CG_CheckLaser()
}
}
/*
==================
CG_ReloadWeapon
Elder: Does local reload effects like
reload shell drops, sounds, etc.
==================
*/
void CG_ReloadWeapon (centity_t *cent, int reloadStage)
{
entityState_t *ent;
weaponInfo_t *weap;
ent = &cent->currentState;
if ( ent->weapon == WP_NONE ) {
return;
}
if ( ent->weapon >= WP_NUM_WEAPONS ) {
CG_Error( "CG_ReloadWeapon: ent->weapon >= WP_NUM_WEAPONS" );
return;
}
weap = &cg_weapons[ ent->weapon ];
switch (reloadStage)
{
case 0:
if (weap->reloadSound1)
{
if (ent->clientNum == cg.snap->ps.clientNum)
trap_S_StartLocalSound(weap->reloadSound1, CHAN_AUTO);
else
trap_S_StartSound(cent->lerpOrigin, ent->number,
CHAN_AUTO, weap->reloadSound1);
}
break;
case 1:
if (weap->reloadSound2)
{
if (ent->clientNum == cg.snap->ps.clientNum)
trap_S_StartLocalSound(weap->reloadSound2, CHAN_AUTO);
else
trap_S_StartSound(cent->lerpOrigin, ent->number,
CHAN_AUTO, weap->reloadSound2);
}
//TODO: drop handcannon shells here
break;
case 2:
if (weap->reloadSound3)
{
if (ent->clientNum == cg.snap->ps.clientNum)
trap_S_StartLocalSound(weap->reloadSound3, CHAN_AUTO);
else
trap_S_StartSound(cent->lerpOrigin, ent->number,
CHAN_AUTO, weap->reloadSound3);
}
break;
default:
CG_Error("CG_ReloadWeapon: Reload stage > 2\n");
break;
}
}

View file

@ -1278,6 +1278,7 @@ char *eventnames[] = {
"EV_FOOTSTEP",
"EV_FOOTSTEP_METAL",
"EV_FOOTSTEP_GRASS", // Elder: grass stuff
"EV_FOOTSPLASH",
"EV_FOOTWADE",
"EV_SWIM",
@ -1308,7 +1309,7 @@ char *eventnames[] = {
"EV_NOAMMO",
"EV_CHANGE_WEAPON",
"EV_FIRE_WEAPON",
"EV_ZOOM", // activates weapon command
"EV_RELOAD_WEAPON," // Elder: reload weapon sounds
"EV_USE_ITEM0",
"EV_USE_ITEM1",

View file

@ -1144,6 +1144,10 @@ static int PM_FootstepForSurface( void ) {
if ( pml.groundTrace.surfaceFlags & SURF_METALSTEPS ) {
return EV_FOOTSTEP_METAL;
}
//Elder: added for footstep support
if ( pml.groundTrace.surfaceFlags & SURF_GRASS ) {
return EV_FOOTSTEP_GRASS;
}
return EV_FOOTSTEP;
}
@ -1283,6 +1287,7 @@ void PM_CheckStuck(void) {
pm->trace (&trace, pm->ps->origin, pm->mins, pm->maxs, pm->ps->origin, pm->ps->clientNum, pm->tracemask);
if (trace.allsolid) {
//Elder: LMAO! WTF is this?
//int shit = qtrue;
}
}
@ -1758,31 +1763,31 @@ static void PM_BeginWeaponChange( int weapon ) {
//Elder: dependent time for each weapon
switch (pm->ps->weapon) {
case WP_PISTOL:
pm->ps->weaponTime += RQ3_PISTOL_SWITCH1_DELAY;
pm->ps->weaponTime += RQ3_PISTOL_DISARM_DELAY;
break;
case WP_M3:
pm->ps->weaponTime += RQ3_M3_SWITCH1_DELAY;
pm->ps->weaponTime += RQ3_M3_DISARM_DELAY;
break;
case WP_M4:
pm->ps->weaponTime += RQ3_M4_SWITCH1_DELAY;
pm->ps->weaponTime += RQ3_M4_DISARM_DELAY;
break;
case WP_MP5:
pm->ps->weaponTime += RQ3_MP5_SWITCH1_DELAY;
pm->ps->weaponTime += RQ3_MP5_DISARM_DELAY;
break;
case WP_HANDCANNON:
pm->ps->weaponTime += RQ3_HANDCANNON_SWITCH1_DELAY;
pm->ps->weaponTime += RQ3_HANDCANNON_DISARM_DELAY;
break;
case WP_SSG3000:
pm->ps->weaponTime += RQ3_SSG3000_SWITCH1_DELAY;
pm->ps->weaponTime += RQ3_SSG3000_DISARM_DELAY;
break;
case WP_AKIMBO:
pm->ps->weaponTime += RQ3_AKIMBO_SWITCH1_DELAY;
pm->ps->weaponTime += RQ3_AKIMBO_DISARM_DELAY;
break;
case WP_KNIFE:
pm->ps->weaponTime += RQ3_KNIFE_SWITCH1_DELAY;
pm->ps->weaponTime += RQ3_KNIFE_DISARM_DELAY;
break;
case WP_GRENADE:
pm->ps->weaponTime += RQ3_GRENADE_SWITCH1_DELAY;
pm->ps->weaponTime += RQ3_GRENADE_DISARM_DELAY;
break;
default:
//Elder: shouldn't be here
@ -1791,6 +1796,9 @@ static void PM_BeginWeaponChange( int weapon ) {
break;
}
//Elder: temp hack
if (pm->ps->weapon == WP_PISTOL || pm->ps->weapon == WP_M3)
PM_StartWeaponAnim(WP_ANIM_DISARM);
PM_StartTorsoAnim( TORSO_DROP );
@ -1826,33 +1834,33 @@ static void PM_FinishWeaponChange( void ) {
pm->ps->weaponstate = WEAPON_RAISING;
//pm->ps->weaponTime += 250;
//Elder: weapon-dependent timing
switch (pm->ps->weapon) {
switch (pm->ps->weapon) {
case WP_PISTOL:
pm->ps->weaponTime += RQ3_PISTOL_SWITCH2_DELAY;
pm->ps->weaponTime += RQ3_PISTOL_ACTIVATE_DELAY;
break;
case WP_M3:
pm->ps->weaponTime += RQ3_M3_SWITCH2_DELAY;
pm->ps->weaponTime += RQ3_M3_ACTIVATE_DELAY;
break;
case WP_M4:
pm->ps->weaponTime += RQ3_M4_SWITCH2_DELAY;
pm->ps->weaponTime += RQ3_M4_ACTIVATE_DELAY;
break;
case WP_MP5:
pm->ps->weaponTime += RQ3_MP5_SWITCH2_DELAY;
pm->ps->weaponTime += RQ3_MP5_ACTIVATE_DELAY;
break;
case WP_HANDCANNON:
pm->ps->weaponTime += RQ3_HANDCANNON_SWITCH2_DELAY;
pm->ps->weaponTime += RQ3_HANDCANNON_ACTIVATE_DELAY;
break;
case WP_SSG3000:
pm->ps->weaponTime += RQ3_SSG3000_SWITCH2_DELAY;
pm->ps->weaponTime += RQ3_SSG3000_ACTIVATE_DELAY;
break;
case WP_AKIMBO:
pm->ps->weaponTime += RQ3_AKIMBO_SWITCH2_DELAY;
pm->ps->weaponTime += RQ3_AKIMBO_ACTIVATE_DELAY;
break;
case WP_KNIFE:
pm->ps->weaponTime += RQ3_KNIFE_SWITCH2_DELAY;
pm->ps->weaponTime += RQ3_KNIFE_ACTIVATE_DELAY;
break;
case WP_GRENADE:
pm->ps->weaponTime += RQ3_GRENADE_SWITCH2_DELAY;
pm->ps->weaponTime += RQ3_GRENADE_ACTIVATE_DELAY;
break;
default:
//Elder: shouldn't be here
@ -1861,6 +1869,10 @@ static void PM_FinishWeaponChange( void ) {
break;
}
//Elder: temp hack
if (pm->ps->weapon == WP_PISTOL || pm->ps->weapon == WP_M3)
PM_StartWeaponAnim(WP_ANIM_ACTIVATE);
PM_StartTorsoAnim( TORSO_RAISE );
}
@ -1900,16 +1912,13 @@ static void PM_WeaponAnimation( void ) {
if (pm->ps->weaponstate == WEAPON_RELOADING)
{
PM_ContinueWeaponAnim( WP_ANIM_RELOAD );
//Elder - using the above now
//PM_StartWeaponAnim( WP_ANIM_RELOAD );
//Elder: only reason it's like this is b/c reloading causes WEAPON_DROPPING
//and we can't see the weapon -- but this screws with fast-reloads
//Remedy is to not call a TORSO_DROP in Cmd_Reload
//pm->ps->weaponstate = WEAPON_READY;
}
else if (pm->ps->weaponstate == WEAPON_READY)
PM_ContinueWeaponAnim( WP_ANIM_IDLE );
else if (pm->ps->weaponstate == WEAPON_DROPPING)
PM_ContinueWeaponAnim( WP_ANIM_DISARM );
else if (pm->ps->weaponstate == WEAPON_RAISING)
PM_ContinueWeaponAnim( WP_ANIM_ACTIVATE );
return;
}
@ -1988,6 +1997,13 @@ static void PM_Weapon( void ) {
PM_BeginWeaponChange( pm->cmd.weapon );
}
else
{
//Elder: added
if (pm->ps->weaponstate == WEAPON_READY &&
(pm->ps->weapon == WP_PISTOL || pm->ps->weapon == WP_M3))
PM_ContinueWeaponAnim(WP_ANIM_IDLE);
}
}
//Elder: drop the primed grenade if bandaging
@ -2084,10 +2100,17 @@ static void PM_Weapon( void ) {
return;
}*/
//Elder: custom fire animations go here
// start the animation even if out of ammo
// check for out of ammo
if ( ! pm->ps->ammo[ pm->ps->weapon ]) {
PM_AddEvent( EV_NOAMMO );
pm->ps->weaponTime += 500;
return;
}
//Elder: custom player model fire animations go here
// start the animation even if out of ammo -- Elder: NO WAY
if ( pm->ps->weapon == WP_KNIFE ) {
// the guantlet only "fires" when it actually hits something
// the gauntlet only "fires" when it actually hits something
// if ( !pm->gauntletHit ) {
// pm->ps->weaponTime = 0;
// pm->ps->weaponstate = WEAPON_READY;
@ -2095,23 +2118,24 @@ static void PM_Weapon( void ) {
// }
PM_StartTorsoAnim( TORSO_ATTACK2 );
} else {
PM_StartTorsoAnim( TORSO_ATTACK );
// Elder: don't repeat if semi-auto
if ( !(pm->ps->weapon == WP_PISTOL && pm->ps->stats[STAT_BURST] ||
pm->ps->weapon == WP_M4 && pm->ps->stats[STAT_BURST] > 2 ||
pm->ps->weapon == WP_MP5 && pm->ps->stats[STAT_BURST] > 2) )
{
PM_StartTorsoAnim( TORSO_ATTACK );
// QUARANTINE - Weapon animations
// This should change pm->ps->generic1 so we can animate
// Elder: don't repeat if on semi-auto
if (pm->ps->weapon == WP_PISTOL || pm->ps->weapon == WP_M3)
PM_StartWeaponAnim( WP_ANIM_FIRE );
}
}
pm->ps->weaponstate = WEAPON_FIRING;
// check for out of ammo
if ( ! pm->ps->ammo[ pm->ps->weapon ]) {
PM_AddEvent( EV_NOAMMO );
pm->ps->weaponTime += 500;
return;
}
// QUARANTINE - Weapon animations
// This should change pm->ps->generic1 so we can animate
PM_StartWeaponAnim( WP_ANIM_FIRE );
//Elder: M4 kick code
//ent->client->ps.delta_angles[0] = ANGLE2SHORT(SHORT2ANGLE(ent->client->ps.delta_angles[0]) - 0.7);
if ( pm->ps->weapon == WP_M4 && ((pm->ps->persistant[PERS_WEAPONMODES] & RQ3_M4MODE) != RQ3_M4MODE) )

View file

@ -247,29 +247,29 @@ typedef enum {
#define RQ3_KNIFE_RELOAD_DELAY 0 // Elder: shouldn't need
#define RQ3_GRENADE_RELOAD_DELAY 0 // Elder: shouldn't need
//Elder: each weapon also has a different weapon switch down delay and...
#define RQ3_PISTOL_SWITCH1_DELAY 900 //300
#define RQ3_M3_SWITCH1_DELAY 700 //600
#define RQ3_M4_SWITCH1_DELAY 1000 //500
#define RQ3_MP5_SWITCH1_DELAY 1000 //400
#define RQ3_HANDCANNON_SWITCH1_DELAY 600 //400
#define RQ3_SSG3000_SWITCH1_DELAY 800 //900
#define RQ3_AKIMBO_SWITCH1_DELAY 600 //800
#define RQ3_KNIFE_SWITCH1_DELAY 500 //700
#define RQ3_THROW_SWITCH1_DELAY 500 //700
#define RQ3_GRENADE_SWITCH1_DELAY 500 //300 Elder: I made this up
//Elder: each weapon also has a different weapon switch up delay... ugh bloody hell
#define RQ3_PISTOL_SWITCH2_DELAY 300
#define RQ3_M3_SWITCH2_DELAY 600
#define RQ3_M4_SWITCH2_DELAY 500
#define RQ3_MP5_SWITCH2_DELAY 400
#define RQ3_HANDCANNON_SWITCH2_DELAY 400
#define RQ3_SSG3000_SWITCH2_DELAY 150 //900 For some reason it's auto-used with WEAPON_RAISING
#define RQ3_AKIMBO_SWITCH2_DELAY 800
#define RQ3_KNIFE_SWITCH2_DELAY 700
#define RQ3_THROW_SWITCH2_DELAY 700
#define RQ3_GRENADE_SWITCH2_DELAY 300 //Elder: I made this up
#define RQ3_PISTOL_ACTIVATE_DELAY 900
#define RQ3_M3_ACTIVATE_DELAY 700
#define RQ3_M4_ACTIVATE_DELAY 1000
#define RQ3_MP5_ACTIVATE_DELAY 1000
#define RQ3_HANDCANNON_ACTIVATE_DELAY 600
#define RQ3_SSG3000_ACTIVATE_DELAY 800
#define RQ3_AKIMBO_ACTIVATE_DELAY 600
#define RQ3_KNIFE_ACTIVATE_DELAY 500
#define RQ3_THROW_ACTIVATE_DELAY 500
#define RQ3_GRENADE_ACTIVATE_DELAY 500 //300 Elder: I made this up
//Elder: each weapon also has a different weapon switch down delay and...
#define RQ3_PISTOL_DISARM_DELAY 300
#define RQ3_M3_DISARM_DELAY 600
#define RQ3_M4_DISARM_DELAY 500
#define RQ3_MP5_DISARM_DELAY 400
#define RQ3_HANDCANNON_DISARM_DELAY 400
#define RQ3_SSG3000_DISARM_DELAY 150 //900 For some reason it's auto-used with WEAPON_RAISING
#define RQ3_AKIMBO_DISARM_DELAY 800
#define RQ3_KNIFE_DISARM_DELAY 700
#define RQ3_THROW_DISARM_DELAY 700
#define RQ3_GRENADE_DISARM_DELAY 300 //Elder: I made this up
//Elder: special for grenade: speeds depending on distance select
@ -368,21 +368,22 @@ typedef enum {
} pmtype_t;
typedef enum {
WEAPON_READY,
WEAPON_READY, //sync with WP_ANIM_IDLE
WEAPON_COCKED,
WEAPON_RAISING,
WEAPON_DROPPING,
WEAPON_FIRING,
WEAPON_RELOADING
WEAPON_RAISING, //sync with WP_ANIM_ACTIVATE
WEAPON_DROPPING, //sync with WP_ANIM_DISARM
WEAPON_FIRING, //sync with WP_ANIM_FIRE
WEAPON_RELOADING //sync with WP_ANIM_RELOAD
} weaponstate_t;
//Blaze: for the weapon animation states
typedef enum {
//WP_ANIM_READY,
WP_ANIM_FIRE,
WP_ANIM_RELOAD,
WP_ANIM_IDLE,
//WP_ANIM_ACTIVATE,
//WP_ANIM_DISARM,
WP_ANIM_DISARM,
WP_ANIM_ACTIVATE,
//WP_ANIM_FIRE2,
MAX_WEAPON_ANIMATIONS
} wpAnimNumber_t;
@ -642,6 +643,7 @@ typedef enum {
EV_FOOTSTEP,
EV_FOOTSTEP_METAL,
EV_FOOTSTEP_GRASS, // Elder: new surfaces
EV_FOOTSPLASH,
EV_FOOTWADE,
EV_SWIM,
@ -672,7 +674,7 @@ typedef enum {
EV_NOAMMO,
EV_CHANGE_WEAPON,
EV_FIRE_WEAPON,
//EV_ZOOM, // SSG zoom(reaction)
EV_RELOAD_WEAPON, // Elder: reload weapon sounds
EV_USE_ITEM0,
EV_USE_ITEM1,

View file

@ -22,7 +22,7 @@ global pain sound events for all clients.
===============
*/
void P_DamageFeedback( gentity_t *player ) {
gentity_t *tent;
// gentity_t *tent;
gclient_t *client;
float count, side;
vec3_t angles, v;
@ -560,14 +560,11 @@ void ClientTimerActions( gentity_t *ent, int msec ) {
ent->client->bleeding = 0;
ent->client->bleedtick = 0;
ent->client->bleedBandageCount = 0;
//Elder: added
//ent->client->isBandaging = qfalse;
//Elder: remove bandage work
ent->client->ps.stats[STAT_RQ3] &= ~RQ3_BANDAGE_WORK;
//Elder: moved from somewhere - err, g_cmds.c I think
ent->client->ps.stats[STAT_RQ3] &= ~RQ3_LEGDAMAGE;
// ent->client->ps.weaponTime += 2500;
// ent->client->ps.weaponstate = WEAPON_RAISING;
// ent->client->ps.torsoAnim = ( ( ent->client->ps.torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | TORSO_RAISE;
@ -925,35 +922,22 @@ void ThrowWeapon( gentity_t *ent )
ThrowItem
Used to toss an item much like weapons except a bit leaner
You can throw items ANY time (firing, bandaging, etc.)
=============
*/
void ThrowItem( gentity_t *ent )
{
gclient_t *client;
usercmd_t *ucmd;
gitem_t *xr_item;
gentity_t *xr_drop;
int item;
client = ent->client;
ucmd = &ent->client->pers.cmd;
//Elder: TODO: have to add a reloading case:
//itemonTime > 0 or itemonState == itemon_dropping? Or both?
//Still firing
if ( (ucmd->buttons & BUTTON_ATTACK) == BUTTON_ATTACK || client->ps.weaponTime > 0) {
return;
}
//Elder: Bandaging case
if ( (ent->client->ps.stats[STAT_RQ3] & RQ3_BANDAGE_WORK) == RQ3_BANDAGE_WORK) {
trap_SendServerCommand( ent-g_entities, va("print \"You are too busy bandaging...\n\""));
return;
}
//item = 0;
if (client->uniqueItems > 0)
{
item = bg_itemlist[client->ps.stats[STAT_HOLDABLE_ITEM]].giTag;
@ -1334,40 +1318,6 @@ void ClientThink_real( gentity_t *ent ) {
G_Printf("(%i) ClientThink: attempting SSG fast-reload...\n", ent->s.clientNum);
Cmd_Reload( ent );
}
/*
if ( ent->client->weaponfireNextTime != 0 &&
level.time >= ent->client->weaponfireNextTime) {
//Elder: restore last zoom and clear the variable
ent->client->ps.stats[STAT_RQ3] |= ent->client->lastzoom;
ent->client->lastzoom = 0;
ent->client->weaponfireNextTime = 0;
}
else if (level.time < ent->client->weaponfireNextTime) {
//Elder: stay in 1x until bolt is ready
ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_LOW;
ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_MED;
}*/
/* else if (level.time - ent->client->lastReloadTime > ent->client->ps.weaponTime) {
//Elder: Too buggy at the moment
if (level.time - ent->client->lastReloadTime > RQ3_SSG3000_RELOAD_DELAY)
ent->client->fastReloads = 0;
if (!ent->client->fastReloads) {
//Elder: For reloading
ent->client->ps.stats[STAT_RQ3] |= ent->client->lastzoom;
ent->client->lastzoom = 0;
}
} */
break;
//case WP_MP5:
case WP_M4:
/*
if (ent->client->weaponfireNextTime != 0 &&
level.time >= ent->client->weaponfireNextTime) {
//Burst three shots and subtract ammo accordingly
FireWeapon(ent);
ent->client->ps.ammo[WP_M4]--;
}*/
break;
default:
break;
@ -1484,6 +1434,98 @@ void SpectatorClientEndFrame( gentity_t *ent ) {
}
}
/*
==============
RQ3_ClientReloadStages
Added by Elder
Check to see if any reload events need
to occur and dispatch if necessary
This would be completely client-side
except other players need to hear the reloading
==============
*/
/* // Elder -- bad code -- and should go in pmove anyways
static void RQ3_ClientReloadStages ( gentity_t *ent )
{
gentity_t *tent;
// no events for dead people
if (ent->client->ps.pm_type == PM_DEAD)
{
ent->client->reloadStage = -1;
return;
}
if ( ent->client->ps.weaponstate == WEAPON_RELOADING &&
ent->client->ps.weaponTime > 0)
{
switch (ent->client->ps.weapon)
{
//Elder: hardcoded timing values :p
case WP_PISTOL:
if (ent->client->ps.weaponTime < RQ3_PISTOL_RELOAD_DELAY - 1900 &&
ent->client->reloadStage == 1)
{
tent = G_TempEntity2(ent->client->ps.origin, EV_RELOAD_WEAPON, 2);
ent->client->reloadStage = 2;
}
else if (ent->client->ps.weaponTime < RQ3_PISTOL_RELOAD_DELAY - 1500 &&
ent->client->reloadStage == 0)
{
tent = G_TempEntity2(ent->client->ps.origin, EV_RELOAD_WEAPON, 1);
ent->client->reloadStage = 1;
}
else if (ent->client->ps.weaponTime < RQ3_PISTOL_RELOAD_DELAY - 100 &&
ent->client->reloadStage == -1)
{
tent = G_TempEntity2(ent->client->ps.origin, EV_RELOAD_WEAPON, 0);
ent->client->reloadStage = 0;
}
break;
case WP_M3:
if ( ent->client->ps.weaponTime % RQ3_M3_RELOAD_DELAY < RQ3_M3_RELOAD_DELAY - 500 &&
ent->client->reloadStage == -1)
{
tent = G_TempEntity2(ent->client->ps.origin, EV_RELOAD_WEAPON, 0);
ent->client->reloadStage = 0;
}
break;
case WP_M4:
if (ent->client->ps.weaponTime < RQ3_M4_RELOAD_DELAY - 1600 &&
ent->client->reloadStage == 0)
{
tent = G_TempEntity2(ent->client->ps.origin, EV_RELOAD_WEAPON, 1);
ent->client->reloadStage = 1;
}
else if (ent->client->ps.weaponTime < RQ3_M4_RELOAD_DELAY - 300 &&
ent->client->reloadStage == -1)
{
tent = G_TempEntity2(ent->client->ps.origin, EV_RELOAD_WEAPON, 0);
ent->client->reloadStage = 0;
}
break;
}
if (tent)
{
tent->s.weapon = ent->client->ps.weapon;
tent->s.clientNum = ent->client->ps.clientNum;
}
}
else if (ent->client->reloadStage != -1)
{
// Reset reload stage
ent->client->reloadStage = -1;
}
}
*/
/*
==============
ClientEndFrame
@ -1586,16 +1628,7 @@ void ClientEndFrame( gentity_t *ent ) {
//Moved to pmove.c
//Elder: M4 ride-up/kick -- condition for non-burst and ammo only
//if ( ent->client->ps.weapon == WP_M4 && ent->client->ps.ammo[WP_M4] > 0 &&
//(ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_M4MODE) != RQ3_M4MODE &&
//ent->client->ps.weaponstate == WEAPON_FIRING)
//(ent->client->buttons & BUTTON_ATTACK) == BUTTON_ATTACK)
//{
//G_Printf("bullets: %d, viewangle: %f\n", ent->client->consecutiveShots, ent->client->ps.viewangles[0]);
//ent->client->ps.delta_angles[0] = ANGLE2SHORT(SHORT2ANGLE(ent->client->ps.delta_angles[0]) - 0.7);
//}
//else if (ent->client->consecutiveShots)
if (ent->client->consecutiveShots &&
(ent->client->ps.ammo[WP_M4] <= 0 || ent->client->ps.weaponstate != WEAPON_FIRING))
{
@ -1611,6 +1644,7 @@ void ClientEndFrame( gentity_t *ent ) {
Laser_Gen(ent, qtrue);
}
//RQ3_ClientReloadStages(ent);
G_SetClientSound (ent);

View file

@ -1278,7 +1278,7 @@ void ClientSpawn(gentity_t *ent) {
// set default animations
client->ps.torsoAnim = TORSO_STAND;
client->ps.legsAnim = LEGS_IDLE;
if ( level.intermissiontime ) {
MoveClientToIntermission( ent );
} else {

View file

@ -1620,23 +1620,12 @@ void Cmd_Stats_f( gentity_t *ent ) {
*/
void Cmd_Bandage (gentity_t *ent)
{
// Zoom out when bandaging.
//if( ent->client->zoomed ){
//ent->client->zoomed = 0;
//}
//Elder: can't use events
//G_AddEvent(ent,EV_ZOOM,0);
//}
//Elder: added so you can't "rebandage"
if ( (ent->client->ps.stats[STAT_RQ3] & RQ3_BANDAGE_WORK) == RQ3_BANDAGE_WORK) {
//if (ent->client->isBandaging == qtrue) {
trap_SendServerCommand( ent-g_entities, va("print \"You are already bandaging!\n\""));
return;
}
//if (ent->client->bleeding || (ent->client->ps.stats[STAT_RQ3] & RQ3_LEGDAMAGE) == RQ3_LEGDAMAGE)
if ( (ent->client->ps.stats[STAT_RQ3] & RQ3_BANDAGE_NEED) == RQ3_BANDAGE_NEED ||
(ent->client->ps.stats[STAT_RQ3] & RQ3_LEGDAMAGE) == RQ3_LEGDAMAGE)
{
@ -1652,26 +1641,26 @@ void Cmd_Bandage (gentity_t *ent)
ent->client->ps.weaponstate == WEAPON_COCKED) {
FireWeapon(ent);
ent->client->ps.ammo[WP_GRENADE]--;
//if (ent->client->ps.ammo[WP_GRENADE] == 0)
//{
//ent->client->ps.stats[STAT_WEAPONS] &= ~(1 << WP_GRENADE);
//ent->client->ps.weapon = WP_PISTOL;
//trap_SendServerCommand( ent-g_entities, "selectpistol" );
//}
}
ent->client->ps.weaponstate = WEAPON_DROPPING;
ent->client->ps.torsoAnim = ( ( ent->client->ps.torsoAnim & ANIM_TOGGLEBIT )
^ ANIM_TOGGLEBIT ) | TORSO_DROP;
//Elder: temp hack
if (ent->client->ps.weapon == WP_PISTOL || ent->client->ps.weapon == WP_M3)
{
ent->client->ps.generic1 = ( ( ent->client->ps.generic1 & ANIM_TOGGLEBIT )
^ ANIM_TOGGLEBIT ) | WP_ANIM_DISARM;
}
//Elder: always lower the player model
ent->client->ps.torsoAnim = ( ( ent->client->ps.torsoAnim & ANIM_TOGGLEBIT )
^ ANIM_TOGGLEBIT ) | TORSO_DROP;
ent->client->ps.weaponTime += 6000;
ent->client->bleedtick = 4;
//Elder: added to track health to bleed off
ent->client->bleedBandageCount = BLEED_BANDAGE;
//Elder: moved to g_active where it will be unset after 2 bleedticks
//ent->client->ps.stats[STAT_RQ3] &= !RQ3_LEGDAMAGE;
}
else
{
@ -1683,14 +1672,14 @@ void Cmd_Bandage (gentity_t *ent)
==================
Cmd_Reload
Added by Duffman
Fastreloads:
a_cmds in action source for proper behavior.
void Cmd_Reload_f (edict_t *ent)
==================
*/
void Cmd_Reload( gentity_t *ent ) {
// whoever does reloading, dont' forget fast reloading for ssg and M3 (reloading several
// at a time reduces delay between each shell/round
// a_cmds in action source for proper behavior.
// void Cmd_Reload_f (edict_t *ent)
void Cmd_Reload( gentity_t *ent )
{
int weapon;
int ammotoadd;
int delay = 0;
@ -1698,7 +1687,6 @@ void Cmd_Reload( gentity_t *ent ) {
//G_Printf("(%i) Cmd_Reload: Attempting reload\n", ent->s.clientNum);
//Elder: added for redundant check but shouldn't need to come here - handled in cgame
//if (ent->client->isBandaging == qtrue) {
if ( (ent->client->ps.stats[STAT_RQ3] & RQ3_BANDAGE_WORK) == RQ3_BANDAGE_WORK) {
ent->client->fastReloads = 0;
ent->client->reloadAttempts = 0;
@ -1710,11 +1698,7 @@ void Cmd_Reload( gentity_t *ent ) {
if ( ent->client->ps.stats[STAT_BURST] > 0)
return;
//Elder: release fire button
//if ( (ent->client->buttons & BUTTON_ATTACK) == BUTTON_ATTACK)
//ent->client->buttons &= ~BUTTON_ATTACK;
weapon = ent->client->ps.weapon;
weapon = ent->client->ps.weapon;
//Elder: changed to new function
ammotoadd = ClipAmountForReload(weapon);
@ -1723,17 +1707,7 @@ void Cmd_Reload( gentity_t *ent ) {
return;
}*/
// Hawkins: Zoom out when reloading.
//Elder: shouldn't need to know about it
// To Do: Must remember to zoom back in
//if( ent->client->zoomed ){
//ent->client->zoomed=0;
//}
//Elder: can't use events
//G_AddEvent(ent,EV_ZOOM,0);
//Elder: serious debug code
//Elder: serious debug code
/*
G_Printf("STAT: %d, KNIFE: %d, MK23: %d, M4: %d, SSG: %d, MP5: %d, M3: %d, HC: %d, AKIMBO: %d, GREN: %d\n",
ent->client->ps.stats[STAT_WEAPONS], WP_KNIFE, WP_PISTOL, WP_M4, WP_SSG3000,
@ -1814,7 +1788,7 @@ void Cmd_Reload( gentity_t *ent ) {
}
}
//Fast-reload virgin
else if (level.time - ent->client->lastReloadTime >= RQ3_M3_ALLOW_FAST_RELOAD_DELAY &&
else if (//level.time - ent->client->lastReloadTime >= RQ3_M3_ALLOW_FAST_RELOAD_DELAY &&
level.time - ent->client->lastReloadTime <= RQ3_M3_RELOAD_DELAY)
{
ent->client->fastReloads = 1;
@ -1832,10 +1806,13 @@ void Cmd_Reload( gentity_t *ent ) {
if (ent->client->fastReloads) {
//Fast reload
//G_Printf("Using fast reloads\n");
//Toggle the first-person reload animation so it will start again
ent->client->ps.generic1 = ( ( ent->client->ps.generic1 & ANIM_TOGGLEBIT )
^ ANIM_TOGGLEBIT ) | WP_ANIM_RELOAD;
delay = RQ3_M3_FAST_RELOAD_DELAY;
ent->client->fastReloads = 1;
//Elder: reset reload stage so we can hear sound
ent->client->reloadStage = -1;
}
else {
//Regular reload
@ -1911,7 +1888,7 @@ void Cmd_Reload( gentity_t *ent ) {
}
}
//Fast-reload virgin
else if (level.time - ent->client->lastReloadTime >= RQ3_SSG3000_ALLOW_FAST_RELOAD_DELAY &&
else if (//level.time - ent->client->lastReloadTime >= RQ3_SSG3000_ALLOW_FAST_RELOAD_DELAY &&
level.time - ent->client->lastReloadTime <= RQ3_SSG3000_RELOAD_DELAY)
{
ent->client->fastReloads = 1;
@ -1974,8 +1951,8 @@ void Cmd_Reload( gentity_t *ent ) {
break;
}
//Elder: added handcannon and akimbo conditional
if (ent->client->numClips[weapon] == 0) {
// Elder: added handcannon and akimbo conditional
if (ent->client->numClips[weapon] == 0) {
ent->client->fastReloads = 0;
ent->client->reloadAttempts = 0;
trap_SendServerCommand( ent-g_entities, va("print \"Out of ammo\n\""));
@ -1985,25 +1962,29 @@ void Cmd_Reload( gentity_t *ent ) {
trap_SendServerCommand( ent-g_entities, va("print \"Not enough ammo\n\""));
return;
}
// Elder: check if still in recoil
else if ( ent->client->ps.weaponTime > 0 && !ent->client->fastReloads )
{
return;
}
//Save once only
if (RQ3_isZoomed(ent) && weapon == WP_SSG3000) {
if (RQ3_isZoomed(ent) && weapon == WP_SSG3000)
{
RQ3_SaveZoomLevel(ent);
//Elder: remove zoom bits
//ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_LOW;
//ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_MED;
}
//ent->client->ps.weaponstate = WEAPON_RELOADING;
ent->client->ps.weaponstate = WEAPON_RELOADING;
//Elder: temporary hack to drop weapon if it's not the MK23
if (ent->client->ps.weapon != WP_PISTOL &&
ent->client->ps.weapon != WP_M3)
{
//if (ent->client->ps.weapon != WP_PISTOL &&
//ent->client->ps.weapon != WP_M3)
//{
ent->client->ps.torsoAnim = ( ( ent->client->ps.torsoAnim & ANIM_TOGGLEBIT )
^ ANIM_TOGGLEBIT ) | TORSO_DROP;
}
//}
ent->client->ps.weaponTime += delay;
//Elder: at this point there should be sufficient ammo requirements to reload
@ -2308,18 +2289,15 @@ Cmd_DropWeapon_f XRAY FMJ
void Cmd_DropWeapon_f( gentity_t *ent ) {
//Elder: added
//if (ent->client->isBandaging == qtrue) {
if ( (ent->client->ps.stats[STAT_RQ3] & RQ3_BANDAGE_WORK) == RQ3_BANDAGE_WORK) {
if ( (ent->client->ps.stats[STAT_RQ3] & RQ3_BANDAGE_WORK) == RQ3_BANDAGE_WORK)
{
trap_SendServerCommand( ent-g_entities, va("print \"You are too busy bandaging!\n\""));
return;
}
else {
else
{
//Elder: remove zoom bits
Cmd_Unzoom(ent);
//ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_LOW;
//ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_MED;
//ent->client->zoomed=0;
//G_AddEvent(ent,EV_ZOOM,0);
ThrowWeapon( ent );
}
}
@ -2331,12 +2309,7 @@ Cmd_DropItem_f
*/
void Cmd_DropItem_f( gentity_t *ent )
{
if ( (ent->client->ps.stats[STAT_RQ3] & RQ3_BANDAGE_WORK) == RQ3_BANDAGE_WORK)
{
trap_SendServerCommand( ent-g_entities, va("print \"You are too busy bandaging!\n\""));
return;
}
else
if (ent->client->ps.stats[STAT_HOLDABLE_ITEM])
{
//Elder: reset item totals if using bandolier
if (bg_itemlist[ent->client->ps.stats[STAT_HOLDABLE_ITEM]].giTag == HI_BANDOLIER)

View file

@ -519,9 +519,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
char *killerName, *obit;
//Elder: Can't send events.
//G_AddEvent(self,EV_ZOOM,0);
//Blaze: Stop bleeding when dead
if ( self->client )
{
@ -538,14 +535,10 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
//Elder: remove zoom bits
Cmd_Unzoom(self);
//self->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_LOW;
//self->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_MED;
//self->client->zoomed = 0;
self->client->bleeding = 0;
//targ->client->bleedcount = 0;
self->client->bleed_remain = 0;
//Elder: added;
//self->client->isBandaging = qfalse;
self->client->ps.stats[STAT_RQ3] &= ~RQ3_BANDAGE_WORK;
self->client->ps.stats[STAT_RQ3] &= ~RQ3_BANDAGE_NEED;
self->client->ps.stats[STAT_STREAK] = 0;
@ -607,13 +600,17 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
// broadcast the death event to everyone
// Elder: use appropriate obit event
if ( (self->client->lasthurt_location & LOCATION_HEAD) == LOCATION_HEAD)
if ( (self->client->lasthurt_location & LOCATION_HEAD) == LOCATION_HEAD ||
(self->client->lasthurt_location & LOCATION_FACE) == LOCATION_FACE )
ent = G_TempEntity( self->r.currentOrigin, EV_OBITUARY_HEAD );
else if ( (self->client->lasthurt_location & LOCATION_CHEST) == LOCATION_CHEST)
else if ( (self->client->lasthurt_location & LOCATION_CHEST) == LOCATION_CHEST ||
(self->client->lasthurt_location & LOCATION_SHOULDER) == LOCATION_SHOULDER)
ent = G_TempEntity( self->r.currentOrigin, EV_OBITUARY_CHEST );
else if ( (self->client->lasthurt_location & LOCATION_STOMACH) == LOCATION_STOMACH)
else if ( (self->client->lasthurt_location & LOCATION_STOMACH) == LOCATION_STOMACH ||
(self->client->lasthurt_location & LOCATION_GROIN) == LOCATION_GROIN)
ent = G_TempEntity( self->r.currentOrigin, EV_OBITUARY_STOMACH );
else if ( (self->client->lasthurt_location & LOCATION_LEG) == LOCATION_LEG)
else if ( (self->client->lasthurt_location & LOCATION_LEG) == LOCATION_LEG ||
(self->client->lasthurt_location & LOCATION_FOOT) == LOCATION_FOOT)
ent = G_TempEntity( self->r.currentOrigin, EV_OBITUARY_LEGS );
else
ent = G_TempEntity( self->r.currentOrigin, EV_OBITUARY );
@ -737,6 +734,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
}
else if ( self->client->ps.powerups[PW_BLUEFLAG] ) { // only happens in standard CTF
Team_ReturnFlag(TEAM_BLUE);
//Elder: include immediate item and weapon return here
}
}
#ifdef MISSIONPACK
@ -1662,7 +1660,8 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
take = take * 0.325;
}
else
{ trap_SendServerCommand( attacker-g_entities, va("print \"%s^7 has a Kevlar Vest - AIM FOR THE HEAD!\n\"", targ->client->pers.netname));
{
trap_SendServerCommand( attacker-g_entities, va("print \"%s^7 has a Kevlar Vest - AIM FOR THE HEAD!\n\"", targ->client->pers.netname));
trap_SendServerCommand( targ-g_entities, va("print \"Kevlar Vest absorbed most of %s shot\n\"", attacker->client->pers.netname ));
take = take/10;
instant_dam = 1;

View file

@ -392,6 +392,7 @@ struct gclient_s {
int fastReloads; // Elder: for queuing M3/SSG reloads
int lastReloadTime; // Elder: for queuing M3/SSG reloads
int reloadAttempts; // Elder: for queuing M3/SSG reloads
int reloadStage;
int consecutiveShots; // Elder: for M4 ride-up/kick
int uniqueWeapons; // Elder: formerly a stat, now just a server var

View file

@ -396,11 +396,16 @@ void Bullet_Fire (gentity_t *ent, float spread, int damage, int MOD ) {
}
//Elder: *******************TEST CODE *****************
//} else if ( tr.surfaceFlags & SURF_GRASS ) {
//tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_FLESH);
//tent->s.eventParm = DirToByte( tr.plane.normal );
} else {
tent = G_TempEntity( tr.endpos, EV_BULLET_HIT_WALL );
tent->s.eventParm = DirToByte( tr.plane.normal );
}
tent->s.otherEntityNum = ent->s.number;
//G_Printf("Surfaceflags: %d\n", tr.surfaceFlags);
if ( traceEnt->takedamage) {
#ifdef MISSIONPACK
@ -2185,8 +2190,9 @@ void Laser_Think( gentity_t *self )
vec3_t end, start, forward, up;
trace_t tr;
//If the player dies, or wrong weapon, kill the dot
//If the player dies, is spectator, or wrong weapon, kill the dot
if (self->parent->client->ps.pm_type == PM_DEAD ||
self->parent->client->ps.pm_type == PM_SPECTATOR ||
(self->parent->client->ps.weapon != WP_PISTOL &&
self->parent->client->ps.weapon != WP_MP5 &&
self->parent->client->ps.weapon != WP_M4))

View file

@ -58,3 +58,6 @@
#define SURF_ALPHASHADOW 0x10000 // do per-pixel light shadow casting in q3map
#define SURF_NODLIGHT 0x20000 // don't dlight even if solid (solid lava, skies)
#define SURF_DUST 0x40000 // leave a dust trail when walking on this surface
//Elder: new surfaces
#define SURF_GRASS 0x80000 // grass footsteps and turf hits later
//#define SURF_CERAMIC 0x100000