mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-13 00:24:29 +00:00
Elder:
VM 0-17-00 Client-side
This commit is contained in:
parent
c4638e632a
commit
4371354291
7 changed files with 66 additions and 173 deletions
|
@ -48,10 +48,6 @@ static void CG_DropWeapon_f (void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Elder: don't allow weapon dropping when in the middle of bursts
|
|
||||||
if (cg.snap->ps.stats[STAT_BURST] > 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ((cg.snap->ps.stats[STAT_RQ3] & RQ3_BANDAGE_WORK) == RQ3_BANDAGE_WORK)
|
if ((cg.snap->ps.stats[STAT_RQ3] & RQ3_BANDAGE_WORK) == RQ3_BANDAGE_WORK)
|
||||||
{
|
{
|
||||||
CG_Printf("You are too busy bandaging!\n");
|
CG_Printf("You are too busy bandaging!\n");
|
||||||
|
@ -85,10 +81,6 @@ static void CG_DropItem_f (void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Elder: don't allow item dropping when in the middle of bursts
|
|
||||||
//if (cg.snap->ps.stats[STAT_BURST] > 0)
|
|
||||||
//return;
|
|
||||||
|
|
||||||
trap_SendClientCommand("dropitem");
|
trap_SendClientCommand("dropitem");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -608,8 +608,8 @@ static void CG_DrawStatusBar( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Elder: temporary
|
// Elder: temporary
|
||||||
if (cg.snap->ps.stats[STAT_RELOADTIME] > 0)
|
//if (cg.snap->ps.stats[STAT_RELOADTIME] > 0)
|
||||||
UI_DrawProportionalString( 10, 400, va("%i", cg.snap->ps.stats[STAT_RELOADTIME]), style, colors[2]);
|
//UI_DrawProportionalString( 10, 400, va("%i", cg.snap->ps.stats[STAT_RELOADTIME]), style, colors[2]);
|
||||||
|
|
||||||
//Elder: draw grenades, if any, on the side
|
//Elder: draw grenades, if any, on the side
|
||||||
if (cg.snap->ps.ammo[ WP_GRENADE ] > 0)
|
if (cg.snap->ps.ammo[ WP_GRENADE ] > 0)
|
||||||
|
|
|
@ -418,6 +418,7 @@ static void CG_Item( centity_t *cent ) {
|
||||||
( item->giType == IT_AMMO) ||
|
( item->giType == IT_AMMO) ||
|
||||||
( item->giType == IT_HOLDABLE) ) {
|
( item->giType == IT_HOLDABLE) ) {
|
||||||
ent.renderfx |= RF_MINLIGHT;
|
ent.renderfx |= RF_MINLIGHT;
|
||||||
|
//ent.customShader = cgs.media.itemStrobeShader;
|
||||||
}
|
}
|
||||||
|
|
||||||
// increase the size of the weapons when they are presented as items
|
// increase the size of the weapons when they are presented as items
|
||||||
|
|
|
@ -2125,7 +2125,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
|
||||||
*/
|
*/
|
||||||
case RQ3_SOUND_LCA:
|
case RQ3_SOUND_LCA:
|
||||||
//Global sound
|
//Global sound
|
||||||
trap_S_StartSound( NULL, cg.snap->ps.clientNum, CHAN_AUTO, cgs.media.lcaSound);
|
//trap_S_StartSound( NULL, cg.snap->ps.clientNum, CHAN_AUTO, cgs.media.lcaSound);
|
||||||
break;
|
break;
|
||||||
case RQ3_SOUND_KEVLARHIT:
|
case RQ3_SOUND_KEVLARHIT:
|
||||||
//TODO: make sparks from hit position
|
//TODO: make sparks from hit position
|
||||||
|
|
|
@ -403,18 +403,16 @@ typedef struct {
|
||||||
#define MAX_OTHER_SOUNDS 5
|
#define MAX_OTHER_SOUNDS 5
|
||||||
|
|
||||||
#define MAX_ANIM_SOUNDS 16
|
#define MAX_ANIM_SOUNDS 16
|
||||||
// Singly-linked list
|
|
||||||
|
|
||||||
struct sfxSyncInfo_s {
|
struct sfxSyncInfo_s {
|
||||||
int frame;
|
int frame;
|
||||||
sfxHandle_t sound;
|
sfxHandle_t sound;
|
||||||
qboolean played;
|
qboolean played;
|
||||||
//struct sfxSyncInfo_s *next;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct sfxSyncInfo_s sfxSyncInfo_t;
|
typedef struct sfxSyncInfo_s sfxSyncInfo_t;
|
||||||
|
|
||||||
typedef struct sfxWeapTiming_s {
|
typedef struct {
|
||||||
int numFrames;
|
int numFrames;
|
||||||
sfxSyncInfo_t sfxInfo[MAX_ANIM_SOUNDS];
|
sfxSyncInfo_t sfxInfo[MAX_ANIM_SOUNDS];
|
||||||
} sfxWeapTiming_t;
|
} sfxWeapTiming_t;
|
||||||
|
@ -462,19 +460,11 @@ typedef struct weaponInfo_s {
|
||||||
|
|
||||||
sfxHandle_t readySound;
|
sfxHandle_t readySound;
|
||||||
sfxHandle_t firingSound;
|
sfxHandle_t firingSound;
|
||||||
|
|
||||||
sfxWeapTiming_t animationSounds[MAX_ANIM_SOUNDS];
|
|
||||||
// Elder: sounds to queue
|
// Elder: sounds to queue
|
||||||
/*
|
sfxWeapTiming_t animationSounds[MAX_ANIM_SOUNDS];
|
||||||
sfxSyncInfo_t activateSound[2]; // last one is an endpoint node
|
sfxHandle_t worldReloadSound[3];
|
||||||
sfxSyncInfo_t disarmSound[2]; // last one is an endpoint node
|
|
||||||
sfxSyncInfo_t reloadSounds[MAX_RELOAD_SOUNDS];
|
|
||||||
sfxSyncInfo_t otherSounds[MAX_OTHER_SOUNDS];
|
|
||||||
*/
|
|
||||||
// Deprecated
|
|
||||||
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;
|
qboolean loopFireSound;
|
||||||
} weaponInfo_t;
|
} weaponInfo_t;
|
||||||
|
|
||||||
|
@ -850,6 +840,9 @@ typedef struct {
|
||||||
qhandle_t backTileShader;
|
qhandle_t backTileShader;
|
||||||
qhandle_t noammoShader;
|
qhandle_t noammoShader;
|
||||||
|
|
||||||
|
//Elder: item strobe to increase brightness
|
||||||
|
qhandle_t itemStrobeShader;
|
||||||
|
|
||||||
//Elder: C3A Laser tutorial
|
//Elder: C3A Laser tutorial
|
||||||
qhandle_t laserShader;
|
qhandle_t laserShader;
|
||||||
|
|
||||||
|
@ -967,7 +960,7 @@ typedef struct {
|
||||||
// sounds
|
// sounds
|
||||||
sfxHandle_t kickSound; //Elder: kick sound
|
sfxHandle_t kickSound; //Elder: kick sound
|
||||||
sfxHandle_t headshotSound; //Elder: splat
|
sfxHandle_t headshotSound; //Elder: splat
|
||||||
sfxHandle_t lcaSound; //Elder: lights, camera, action!
|
//sfxHandle_t lcaSound; //Elder: lights, camera, action!
|
||||||
sfxHandle_t lensSound; //Elder: sniper lens zoom
|
sfxHandle_t lensSound; //Elder: sniper lens zoom
|
||||||
sfxHandle_t silencerSound;
|
sfxHandle_t silencerSound;
|
||||||
sfxHandle_t kevlarHitSound;
|
sfxHandle_t kevlarHitSound;
|
||||||
|
|
|
@ -665,7 +665,7 @@ static void CG_RegisterSounds( void ) {
|
||||||
cgs.media.kickSound = trap_S_RegisterSound( "sound/misc/kick.wav", qfalse);
|
cgs.media.kickSound = trap_S_RegisterSound( "sound/misc/kick.wav", qfalse);
|
||||||
cgs.media.lensSound = trap_S_RegisterSound( "sound/misc/lens.wav", qfalse);
|
cgs.media.lensSound = trap_S_RegisterSound( "sound/misc/lens.wav", qfalse);
|
||||||
cgs.media.headshotSound = trap_S_RegisterSound( "sound/misc/headshot.wav", qfalse);
|
cgs.media.headshotSound = trap_S_RegisterSound( "sound/misc/headshot.wav", qfalse);
|
||||||
cgs.media.lcaSound = trap_S_RegisterSound( "sound/misc/lca.wav", qfalse);
|
//cgs.media.lcaSound = trap_S_RegisterSound( "sound/misc/lca.wav", qfalse);
|
||||||
cgs.media.silencerSound = trap_S_RegisterSound( "sound/misc/silencershot.wav", qfalse);
|
cgs.media.silencerSound = trap_S_RegisterSound( "sound/misc/silencershot.wav", qfalse);
|
||||||
cgs.media.kevlarHitSound = trap_S_RegisterSound( "sound/misc/vest.wav", qfalse);
|
cgs.media.kevlarHitSound = trap_S_RegisterSound( "sound/misc/vest.wav", qfalse);
|
||||||
cgs.media.weapToggleSound = trap_S_RegisterSound( "sound/misc/click.wav", qfalse);
|
cgs.media.weapToggleSound = trap_S_RegisterSound( "sound/misc/click.wav", qfalse);
|
||||||
|
@ -962,6 +962,7 @@ static void CG_RegisterGraphics( void ) {
|
||||||
|
|
||||||
// Elder: RQ3 misc. shaders
|
// Elder: RQ3 misc. shaders
|
||||||
cgs.media.irPlayerShader = trap_R_RegisterShader("powerups/irdetail");
|
cgs.media.irPlayerShader = trap_R_RegisterShader("powerups/irdetail");
|
||||||
|
cgs.media.itemStrobeShader = trap_R_RegisterShader("rq3-itemstrobe");
|
||||||
|
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
if ( cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF || cgs.gametype == GT_HARVESTER || cg_buildScript.integer ) {
|
if ( cgs.gametype == GT_CTF || cgs.gametype == GT_1FCTF || cgs.gametype == GT_HARVESTER || cg_buildScript.integer ) {
|
||||||
|
|
|
@ -20,12 +20,8 @@ static qboolean CG_ParseWeaponSoundFile( const char *filename, weaponInfo_t *wea
|
||||||
int skip; // Elder: What's this for?
|
int skip; // Elder: What's this for?
|
||||||
char text[20000];
|
char text[20000];
|
||||||
fileHandle_t f;
|
fileHandle_t f;
|
||||||
//animation_t *animations;
|
|
||||||
//sfxSyncInfo_t *reloadSounds;
|
|
||||||
sfxWeapTiming_t *weapTiming;
|
sfxWeapTiming_t *weapTiming;
|
||||||
|
|
||||||
//animations = weapon->animations;
|
|
||||||
//reloadSounds = weapon->reloadSounds;
|
|
||||||
weapTiming = weapon->animationSounds;
|
weapTiming = weapon->animationSounds;
|
||||||
|
|
||||||
// load the file
|
// load the file
|
||||||
|
@ -54,7 +50,7 @@ static qboolean CG_ParseWeaponSoundFile( const char *filename, weaponInfo_t *wea
|
||||||
// Add it to the array
|
// Add it to the array
|
||||||
if ( atoi( token ) )
|
if ( atoi( token ) )
|
||||||
{
|
{
|
||||||
Com_Printf("(%i): %s\n", i, token);
|
//Com_Printf("(%i): %s\n", i, token);
|
||||||
weapTiming->sfxInfo[i].frame = atoi(token);
|
weapTiming->sfxInfo[i].frame = atoi(token);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -66,106 +62,18 @@ static qboolean CG_ParseWeaponSoundFile( const char *filename, weaponInfo_t *wea
|
||||||
if ( !token ) break;
|
if ( !token ) break;
|
||||||
//return qfalse;
|
//return qfalse;
|
||||||
|
|
||||||
Com_Printf("(%i): %s\n", i, token);
|
//Com_Printf("(%i): %s\n", i, token);
|
||||||
weapTiming->sfxInfo[i].sound = trap_S_RegisterSound( token, qfalse );
|
weapTiming->sfxInfo[i].sound = trap_S_RegisterSound( token, qfalse );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store total number
|
// Store total number
|
||||||
weapTiming->numFrames = i;
|
weapTiming->numFrames = i;
|
||||||
Com_Printf("Total Frames: %i\n", weapTiming->numFrames);
|
//Com_Printf("Total Frames: %i\n", weapTiming->numFrames);
|
||||||
|
|
||||||
return qtrue;
|
return qtrue;
|
||||||
|
|
||||||
// Old crap code
|
|
||||||
/*
|
|
||||||
// read information for each phase of a reload
|
|
||||||
for ( i = 0 ; i < MAX_RELOAD_SOUNDS ; i++ )
|
|
||||||
{
|
|
||||||
token = COM_Parse( &text_p );
|
|
||||||
if ( !token ) break;
|
|
||||||
// handle "0"/blank listings
|
|
||||||
if ( !atoi( token ) )
|
|
||||||
{
|
|
||||||
// set these to the end frames
|
|
||||||
reloadSounds[i].frame = animations[WP_ANIM_RELOAD].firstFrame + animations[WP_ANIM_RELOAD].numFrames;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
reloadSounds[i].frame = atoi( token );
|
|
||||||
|
|
||||||
token = COM_Parse( &text_p );
|
|
||||||
if ( !token ) break;
|
|
||||||
reloadSounds[i].sound = trap_S_RegisterSound(token, qfalse);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( i != MAX_RELOAD_SOUNDS ) {
|
|
||||||
CG_Printf( "Error parsing weapon sound file in reload stage: %s", filename );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
|
|
||||||
// link our reload sound nodes
|
|
||||||
for ( i = 0; i < MAX_RELOAD_SOUNDS ; i++ )
|
|
||||||
{
|
|
||||||
// end frames
|
|
||||||
if (reloadSounds[i].frame == animations[WP_ANIM_RELOAD].firstFrame + animations[WP_ANIM_RELOAD].numFrames)
|
|
||||||
reloadSounds[i].next = &reloadSounds[0];
|
|
||||||
// normal case
|
|
||||||
else if (i + 1 < MAX_RELOAD_SOUNDS && reloadSounds[i+1].frame != 0)
|
|
||||||
reloadSounds[i].next = &reloadSounds[i+1];
|
|
||||||
// shouldn't be here
|
|
||||||
else
|
|
||||||
reloadSounds[i].next = &reloadSounds[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
// disarm sound
|
|
||||||
token = COM_Parse( &text_p );
|
|
||||||
if ( !token ) {
|
|
||||||
CG_Printf( "Error parsing weapon sound file in disarm stage: %s", filename );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
if ( !atoi( token ) )
|
|
||||||
CG_Printf( "No disarm sound for %s\n", weapon->item->pickup_name);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
weapon->disarmSound[0].frame = atoi( token );
|
|
||||||
token = COM_Parse( &text_p );
|
|
||||||
if ( !token ) {
|
|
||||||
CG_Printf( "Error parsing weapon sound file in disarm stage: %s", filename );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
weapon->disarmSound[0].sound = trap_S_RegisterSound( token, qfalse );
|
|
||||||
weapon->disarmSound[0].next = &weapon->disarmSound[1];
|
|
||||||
weapon->disarmSound[1].frame = animations[WP_ANIM_DISARM].firstFrame + animations[WP_ANIM_DISARM].numFrames;
|
|
||||||
weapon->disarmSound[1].next = &weapon->disarmSound[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
// activate sound
|
|
||||||
token = COM_Parse( &text_p );
|
|
||||||
if ( !token ) {
|
|
||||||
CG_Printf( "Error parsing weapon sound file in activate stage: %s", filename );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
if ( !atoi( token ) )
|
|
||||||
CG_Printf( "No activate sound for %s\n", weapon->item->pickup_name);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
weapon->activateSound[0].frame = atoi( token );
|
|
||||||
token = COM_Parse( &text_p );
|
|
||||||
if ( !token ) {
|
|
||||||
CG_Printf( "Error parsing weapon sound file in activate stage: %s", filename );
|
|
||||||
return qfalse;
|
|
||||||
}
|
|
||||||
weapon->activateSound[0].sound = trap_S_RegisterSound( token, qfalse );
|
|
||||||
weapon->activateSound[0].next = &weapon->activateSound[1];
|
|
||||||
weapon->activateSound[1].frame = animations[WP_ANIM_ACTIVATE].firstFrame + animations[WP_ANIM_ACTIVATE].numFrames;
|
|
||||||
weapon->activateSound[1].next = &weapon->activateSound[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
return qtrue;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* [QUARANTINE] - Weapon Animations - CG_ParseWeaponAnimFile
|
/* [QUARANTINE] - Weapon Animations - CG_ParseWeaponAnimFile
|
||||||
==========================
|
==========================
|
||||||
CG_ParseWeaponAnimFile
|
CG_ParseWeaponAnimFile
|
||||||
|
@ -312,12 +220,11 @@ static void CG_ShotgunEjectBrass( centity_t *cent ) {
|
||||||
vec3_t velocity, xvelocity;
|
vec3_t velocity, xvelocity;
|
||||||
vec3_t offset, xoffset;
|
vec3_t offset, xoffset;
|
||||||
vec3_t v[3];
|
vec3_t v[3];
|
||||||
int i,isHC;
|
int i, isHC;
|
||||||
if (cent->currentState.weapon == WP_HANDCANNON) isHC=1;
|
if (cent->currentState.weapon == WP_HANDCANNON)
|
||||||
|
isHC=1;
|
||||||
else
|
else
|
||||||
{
|
|
||||||
isHC=0;
|
isHC=0;
|
||||||
}
|
|
||||||
|
|
||||||
if ( cg_brassTime.integer <= 0 ) {
|
if ( cg_brassTime.integer <= 0 ) {
|
||||||
return;
|
return;
|
||||||
|
@ -917,12 +824,14 @@ void CG_RegisterWeapon( int weaponNum ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
weaponInfo->loopFireSound = qfalse;
|
weaponInfo->loopFireSound = qfalse;
|
||||||
|
|
||||||
switch ( weaponNum ) {
|
switch ( weaponNum ) {
|
||||||
|
|
||||||
//Blaze: Reaction Pistol
|
//Blaze: Reaction Pistol
|
||||||
case WP_PISTOL:
|
case WP_PISTOL:
|
||||||
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
|
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
|
||||||
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/mk23/mk23fire.wav", qfalse );
|
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/mk23/mk23fire.wav", qfalse );
|
||||||
|
weaponInfo->worldReloadSound[0] = trap_S_RegisterSound( "sound/weapons/mk23/mk23reload.wav", qfalse );
|
||||||
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
|
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
|
||||||
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
||||||
|
|
||||||
|
@ -970,6 +879,7 @@ void CG_RegisterWeapon( int weaponNum ) {
|
||||||
//Elder: added
|
//Elder: added
|
||||||
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
|
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
|
||||||
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/m4/m4fire.wav", qfalse );
|
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/m4/m4fire.wav", qfalse );
|
||||||
|
weaponInfo->worldReloadSound[0] = trap_S_RegisterSound( "sound/weapons/m4/m4reload.wav", qfalse );
|
||||||
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
|
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
|
||||||
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
||||||
|
|
||||||
|
@ -994,6 +904,9 @@ void CG_RegisterWeapon( int weaponNum ) {
|
||||||
//Elder: added
|
//Elder: added
|
||||||
MAKERGB( weaponInfo->flashDlightColor, 1, 0.5f, 0 );
|
MAKERGB( weaponInfo->flashDlightColor, 1, 0.5f, 0 );
|
||||||
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/ssg3000/ssgfire.wav", qfalse );
|
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/ssg3000/ssgfire.wav", qfalse );
|
||||||
|
weaponInfo->worldReloadSound[0] = trap_S_RegisterSound( "sound/weapons/ssg3000/ssgbolt.wav", qfalse );
|
||||||
|
weaponInfo->worldReloadSound[1] = trap_S_RegisterSound( "sound/weapons/ssg3000/ssgin.wav", qfalse );
|
||||||
|
weaponInfo->worldReloadSound[2] = trap_S_RegisterSound( "sound/weapons/ssg3000/ssgbolt.wav", qfalse );
|
||||||
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
|
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
|
||||||
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
||||||
Com_sprintf( filename, sizeof(filename), "models/weapons2/ssg3000/animation.cfg" );
|
Com_sprintf( filename, sizeof(filename), "models/weapons2/ssg3000/animation.cfg" );
|
||||||
|
@ -1016,6 +929,7 @@ void CG_RegisterWeapon( int weaponNum ) {
|
||||||
//Elder: added
|
//Elder: added
|
||||||
MAKERGB( weaponInfo->flashDlightColor, 1, 0.75f, 0 );
|
MAKERGB( weaponInfo->flashDlightColor, 1, 0.75f, 0 );
|
||||||
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/mp5/mp5fire.wav", qfalse );
|
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/mp5/mp5fire.wav", qfalse );
|
||||||
|
weaponInfo->worldReloadSound[0] = trap_S_RegisterSound( "sound/weapons/mp5/mp5reload.wav", qfalse );
|
||||||
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
|
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
|
||||||
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
||||||
|
|
||||||
|
@ -1040,7 +954,8 @@ void CG_RegisterWeapon( int weaponNum ) {
|
||||||
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
|
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
|
||||||
//Elder: changed to hcfire from cannon_fire
|
//Elder: changed to hcfire from cannon_fire
|
||||||
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/handcannon/hcfire.wav", qfalse );
|
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/handcannon/hcfire.wav", qfalse );
|
||||||
weaponInfo->ejectBrassFunc = CG_ShotgunEjectBrass;
|
weaponInfo->worldReloadSound[0] = trap_S_RegisterSound( "sound/weapons/handcannon/hcreload.wav", qfalse );
|
||||||
|
//weaponInfo->ejectBrassFunc = CG_ShotgunEjectBrass;
|
||||||
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
||||||
|
|
||||||
Com_sprintf( filename, sizeof(filename), "models/weapons2/handcannon/animation.cfg" );
|
Com_sprintf( filename, sizeof(filename), "models/weapons2/handcannon/animation.cfg" );
|
||||||
|
@ -1063,6 +978,7 @@ void CG_RegisterWeapon( int weaponNum ) {
|
||||||
case WP_M3:
|
case WP_M3:
|
||||||
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
|
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
|
||||||
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/m3/m3fire.wav", qfalse );
|
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/m3/m3fire.wav", qfalse );
|
||||||
|
weaponInfo->worldReloadSound[1] = trap_S_RegisterSound( "sound/weapons/m3/m3in.wav", qfalse );
|
||||||
weaponInfo->ejectBrassFunc = CG_ShotgunEjectBrass;
|
weaponInfo->ejectBrassFunc = CG_ShotgunEjectBrass;
|
||||||
|
|
||||||
Com_sprintf( filename, sizeof(filename), "models/weapons2/m3/animation.cfg" );
|
Com_sprintf( filename, sizeof(filename), "models/weapons2/m3/animation.cfg" );
|
||||||
|
@ -1087,6 +1003,7 @@ void CG_RegisterWeapon( int weaponNum ) {
|
||||||
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0.5f );
|
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0.5f );
|
||||||
// Elder: no more pseudo-dual sound needed :)
|
// Elder: no more pseudo-dual sound needed :)
|
||||||
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/mk23/mk23fire.wav", qfalse );
|
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/mk23/mk23fire.wav", qfalse );
|
||||||
|
weaponInfo->worldReloadSound[0] = trap_S_RegisterSound( "sound/weapons/akimbo/akimboreload.wav", qfalse );
|
||||||
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
|
weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass;
|
||||||
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" );
|
||||||
Com_sprintf( filename, sizeof(filename), "models/weapons2/akimbo/animation.cfg" );
|
Com_sprintf( filename, sizeof(filename), "models/weapons2/akimbo/animation.cfg" );
|
||||||
|
@ -1110,7 +1027,7 @@ void CG_RegisterWeapon( int weaponNum ) {
|
||||||
case WP_GRENADE:
|
case WP_GRENADE:
|
||||||
//Use the projectile model
|
//Use the projectile model
|
||||||
weaponInfo->missileModel = trap_R_RegisterModel( "models/weapons2/grenade/gren_projectile.md3" );
|
weaponInfo->missileModel = trap_R_RegisterModel( "models/weapons2/grenade/gren_projectile.md3" );
|
||||||
//Elder: removed for the last time! :)
|
//Elder: removed smoke for the last time! :)
|
||||||
//weaponInfo->missileTrailFunc = CG_GrenadeTrail;
|
//weaponInfo->missileTrailFunc = CG_GrenadeTrail;
|
||||||
weaponInfo->wiTrailTime = 700;
|
weaponInfo->wiTrailTime = 700;
|
||||||
weaponInfo->trailRadius = 32;
|
weaponInfo->trailRadius = 32;
|
||||||
|
@ -1584,7 +1501,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
|
||||||
if (cg.curSyncSound.played == qfalse)
|
if (cg.curSyncSound.played == qfalse)
|
||||||
{
|
{
|
||||||
cg.curSyncSound.played = qtrue;
|
cg.curSyncSound.played = qtrue;
|
||||||
CG_Printf("Playing a timed sound (%i %i %1.1f)\n", gun.frame, gun.oldframe, gun.backlerp);
|
//CG_Printf("Playing a timed sound (%i %i %1.1f)\n", gun.frame, gun.oldframe, gun.backlerp);
|
||||||
trap_S_StartLocalSound ( cg.curSyncSound.sound, CHAN_WEAPON );
|
trap_S_StartLocalSound ( cg.curSyncSound.sound, CHAN_WEAPON );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3126,6 +3043,8 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin,
|
||||||
shader = cgs.media.bulletExplosionShader;
|
shader = cgs.media.bulletExplosionShader;
|
||||||
if (soundType == IMPACTSOUND_GLASS)
|
if (soundType == IMPACTSOUND_GLASS)
|
||||||
mark = cgs.media.glassMarkShader;
|
mark = cgs.media.glassMarkShader;
|
||||||
|
else if (soundType == IMPACTSOUND_METAL)
|
||||||
|
mark = cgs.media.metalMarkShader;
|
||||||
else
|
else
|
||||||
mark = cgs.media.bulletMarkShader;
|
mark = cgs.media.bulletMarkShader;
|
||||||
sfx = 0;
|
sfx = 0;
|
||||||
|
@ -3884,52 +3803,39 @@ void CG_ReloadWeapon (centity_t *cent, int reloadStage)
|
||||||
weaponInfo_t *weap;
|
weaponInfo_t *weap;
|
||||||
|
|
||||||
ent = ¢->currentState;
|
ent = ¢->currentState;
|
||||||
if ( ent->weapon == WP_NONE ) {
|
if ( ent->weapon == WP_NONE )
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
if ( ent->weapon >= WP_NUM_WEAPONS ) {
|
if ( ent->weapon >= WP_NUM_WEAPONS )
|
||||||
|
{
|
||||||
CG_Error( "CG_ReloadWeapon: ent->weapon >= WP_NUM_WEAPONS" );
|
CG_Error( "CG_ReloadWeapon: ent->weapon >= WP_NUM_WEAPONS" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
weap = &cg_weapons[ ent->weapon ];
|
weap = &cg_weapons[ent->weapon];
|
||||||
/*
|
switch ( reloadStage )
|
||||||
switch (reloadStage)
|
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if (weap->reloadSound1)
|
if (weap->worldReloadSound[0] && ent->clientNum != cg.snap->ps.clientNum)
|
||||||
{
|
trap_S_StartSound(cent->lerpOrigin, ent->number, CHAN_AUTO, weap->worldReloadSound[0]);
|
||||||
if (ent->clientNum == cg.snap->ps.clientNum)
|
|
||||||
trap_S_StartLocalSound(weap->reloadSound1, CHAN_AUTO);
|
break;
|
||||||
else
|
case 1:
|
||||||
trap_S_StartSound(cent->lerpOrigin, ent->number,
|
if (weap->worldReloadSound[1] && ent->clientNum != cg.snap->ps.clientNum)
|
||||||
CHAN_AUTO, weap->reloadSound1);
|
trap_S_StartSound(cent->lerpOrigin, ent->number, CHAN_AUTO, weap->worldReloadSound[1]);
|
||||||
}
|
|
||||||
break;
|
if ( ent->weapon == WP_HANDCANNON )
|
||||||
case 1:
|
CG_ShotgunEjectBrass( cent );
|
||||||
if (weap->reloadSound2)
|
|
||||||
{
|
break;
|
||||||
if (ent->clientNum == cg.snap->ps.clientNum)
|
case 2:
|
||||||
trap_S_StartLocalSound(weap->reloadSound2, CHAN_AUTO);
|
if (weap->worldReloadSound[2] && ent->clientNum != cg.snap->ps.clientNum)
|
||||||
else
|
trap_S_StartSound(cent->lerpOrigin, ent->number, CHAN_AUTO, weap->worldReloadSound[2]);
|
||||||
trap_S_StartSound(cent->lerpOrigin, ent->number,
|
|
||||||
CHAN_AUTO, weap->reloadSound2);
|
break;
|
||||||
}
|
default:
|
||||||
//TODO: drop handcannon shells here
|
CG_Error("CG_ReloadWeapon: Reload stage > 2\n");
|
||||||
break;
|
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;
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue