Added viewmodel muzzleflashes

Redone the model-event sound stuff using next-generation FTE features (TM)
Cleaned and fixed things here and there
This commit is contained in:
Marco Cawthorne 2017-01-12 03:49:59 +01:00
parent 30e2e5b76a
commit e67ab0380f
33 changed files with 75 additions and 157 deletions

View File

@ -182,8 +182,10 @@ Available options:
#define FTE_FORCEINFOKEY /* Provides an easy way to change a user's userinfo from the server. */
#define FTE_GFX_QUAKE3SHADERS /* specifies that the engine has full support for vanilla quake3 shaders */
#define FTE_GFX_REMAPSHADER /* With the raw power of stuffcmds, the r_remapshader console command is exposed! This mystical command can be used to remap any shader to another. Remapped shaders that specify $diffuse etc in some form will inherit the textures implied by the surface. */
#define FTE_GFX_MODELEVENTS /* Provides a query for per-animation events in model files, including from progs/foo.mdl.events files. */
#define FTE_ISBACKBUFFERED /* Allows you to check if a client has too many reliable messages pending. */
#define FTE_MEMALLOC /* Allows dynamically allocating memory. Use pointers to access this memory. Memory will not be saved into saved games. */
#define FTE_MEDIA_AVI /* playfilm command supports avi files. */
#define FTE_MEDIA_CIN /* playfilm command supports q2 cin files. */
#define FTE_MEDIA_ROQ /* playfilm command supports q3 roq files. */
#define FTE_MULTIPROGS /* Multiple progs.dat files can be loaded inside the same qcvm. Insert new ones with addprogs inside the 'init' function, and use externvalue+externset to rewrite globals (and hook functions) to link them together. Note that the result is generally not very clean unless you carefully design for it beforehand. */
@ -1886,8 +1888,10 @@ void(string dest, string content) sendpacket = #242; /* Part of FTE_QC_SENDPACKE
#ifdef CSQC
vector(entity ent, float tagnum) rotatevectorsbytag = #244;
#endif
#ifdef SSQC
#if defined(CSQC) || defined(SSQC)
float(float dividend, float divisor) mod = #245;
#endif
#ifdef SSQC
float(optional string host, optional string user, optional string pass, optional string defaultdb, optional string driver) sqlconnect = #250; /* Part of FTE_SQL*/
void(float serveridx) sqldisconnect = #251; /* Part of FTE_SQL*/
float(float serveridx, void(float serveridx, float queryidx, float rows, float columns, float eof, float firstrow) callback, float querytype, string query) sqlopenquery = #252; /* Part of FTE_SQL*/
@ -1969,6 +1973,12 @@ float(float modidx, string framename) frameforname = #276; /* Part of FTE_CSQC_S
float(float modidx, float framenum) frameduration = #277; /* Part of FTE_CSQC_SKELETONOBJECTS
Retrieves the duration (in seconds) of the specified framegroup. */
float(float modidx, float framenum, __inout float basetime, float targettime, __inout float code, __inout string data) getnextmodelevent = #0:getnextmodelevent; /* Part of FTE_GFX_MODELEVENTS
Reports the next event within a model's animation. Returns a boolean if an event was found between basetime and targettime. Writes to basetime,code,data arguments (if an event was found, basetime is set to the event's time, otherwise to targettime). WARNING: this builtin cannot deal with multiple events with the same timestamp (only the first will be reported). */
float(float modidx, float framenum, int eventidx, __out float timestamp, __out int code, __out string data) getmodeleventidx = #0:getmodeleventidx; /*
Reports an indexed event within a model's animation. Writes to timestamp,code,data arguments on success. Returns false if the animation/event/model was out of range/invalid. Does not consider looping animations (retry from index 0 if it fails and you know that its a looping animation). This builtin is more annoying to use than getnextmodelevent, but can be made to deal with multiple events with the exact same timestamp. */
#endif
#define dotproduct(v1,v2) ((vector)(v1)*(vector)(v2))
vector(vector v1, vector v2) crossproduct = #0:crossproduct; /* Part of FTE_QC_CROSSPRODUCT
@ -2220,12 +2230,13 @@ void(vector pivot, vector mins, vector maxs, string pic, vector txmin, vector tx
#endif
#ifdef CSQC
float(float stnum) getstati = #330; /*
#define getstati_punf(stnum) (float)(__variant)getstati(stnum)
int(float stnum) getstati = #330; /*
Retrieves the numerical value of the given EV_INTEGER or EV_ENTITY stat (converted to a float). */
#define getstatbits getstatf
float(float stnum, optional float firstbit, optional float bitcount) getstatf = #331; /*
Retrieves the numerical value of the given EV_FLOAT stat. If firstbit and bitcount are specified, retrieves the upper bits of the STAT_ITEMS stat. */
Retrieves the numerical value of the given EV_FLOAT stat. If firstbit and bitcount are specified, retrieves the upper bits of the STAT_ITEMS stat (converted into a float, so there are no VM dependancies). */
string(float stnum) getstats = #332; /*
Retrieves the value of the given EV_STRING stat, as a tempstring.

View File

@ -75,7 +75,6 @@ vector vCameraAngle;
float fCameraTime;
void View_PlayAnimation( int iSequence );
void Sound_Delayed( string sSample, float fVol, float fDelay );
// This actually belongs in Builtins.h since its an undocumented global
vector pmove_vel;

View File

@ -32,6 +32,8 @@ void CSQC_Init(float apilevel, string enginename, float engineversion) {
//}
precache_model( HUD_NUMFILE );
precache_model( "sprites/muzzleflash1.spr" );
precache_model( "sprites/radar640.spr" );
precache_model( "sprites/640hud1.spr" );
precache_model( "sprites/640hud16.spr" );
@ -59,7 +61,7 @@ void CSQC_Init(float apilevel, string enginename, float engineversion) {
precache_sound( "debris/bustconcrete2.wav" );
precache_sound( "debris/bustceiling1.wav" );
for ( int i = 1; i < CS_WEAPON_COUNT; i++ ) {
for ( int i = 0; i < ( CS_WEAPON_COUNT - 1 ); i++ ) {
precache_model( sViewModels[ i ] );
}

View File

@ -58,7 +58,7 @@ CFT_00_LB=_Compile
CFT_00_CM=fteqcc
CFT_00_WD=
CFT_01_LB=_Build
CFT_01_CM=fteqcc"
CFT_01_CM=fteqcc
CFT_01_WD=
CFT_02_LB=_Lint
CFT_02_CM=fteqcc

View File

@ -21,24 +21,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/*float CSQC_Event_Sound( float entnum, float channel, string soundname, float vol, float attenuation, vector pos, float pitchmod, float flags ) {
}*/
/*
=================
Sound_Delayed
Now you can call sounds in advance
=================
*/
void Sound_Delayed( string sSample, float fVol, float fDelay ) {
static void Sound_Delayed_PlayBack( void ) {
//print( sprintf( "[SOUND] Playing Event %s\n", self.sSoundSample ) );
localsound( self.sSoundSample, CHAN_AUTO, self.fVolume );
remove( self );
}
entity eSound = spawn();
eSound.classname = "event_sound";
eSound.think = Sound_Delayed_PlayBack;
eSound.sSoundSample = sSample;
eSound.fVolume = fVol;
eSound.nextthink = time + fDelay;
}

View File

@ -247,7 +247,7 @@ VGUI_BuyMenu_Rifles
void VGUI_BuyMenu_Rifles( vector vPos ) {
vVGUIButtonPos = vPos + '16 116 0';
if ( getstati( STAT_TEAM ) == TEAM_T ) {
if ( stof( getplayerkeyvalue( player_localnum, "*team" ) ) == TEAM_T ) {
VGUI_BuyMenu_WeaponButton( WEAPON_AK47 );
VGUI_BuyMenu_WeaponButton( WEAPON_SG552 );
@ -257,7 +257,7 @@ void VGUI_BuyMenu_Rifles( vector vPos ) {
VGUI_BuyMenu_WeaponButton( WEAPON_G3SG1 );
}
if ( getstati( STAT_TEAM ) == TEAM_CT ) {
if ( stof( getplayerkeyvalue( player_localnum, "*team" ) ) == TEAM_CT ) {
VGUI_BuyMenu_WeaponButton( WEAPON_M4A1 );
VGUI_BuyMenu_WeaponButton( WEAPON_AUG );

View File

@ -18,8 +18,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
string sViewModels[ CS_WEAPON_COUNT ] = {
"",
string sViewModels[ CS_WEAPON_COUNT - 1 ] = {
"models/v_knife.mdl",
"models/v_usp.mdl",
"models/v_glock18.mdl",
@ -82,23 +81,56 @@ float View_CalcBob( void ) {
return fBob;
}
entity eViewModel;
entity eMuzzleflash;
void View_DrawViewModel( void ) {
static float fLastTime;
static float fBob;
static float fLastWeapon;
if( !eViewModel ) {
eViewModel = spawn();
eViewModel.renderflags = RF_DEPTHHACK;
eMuzzleflash = spawn();
setmodel( eMuzzleflash, "sprites/muzzleflash1.spr" );
eMuzzleflash.renderflags = RF_DEPTHHACK | RF_ADDITIVE;
}
// Don't update when paused
if ( time != fLastTime ) {
fBob = View_CalcBob();
if( getstatf( STAT_ACTIVEWEAPON ) < CS_WEAPON_COUNT ) {
setmodel( eViewModel, sViewModels[ getstatf( STAT_ACTIVEWEAPON ) ] );
if ( fLastWeapon != getstatf( STAT_ACTIVEWEAPON ) ) {
setmodel( eViewModel, sViewModels[ getstatf( STAT_ACTIVEWEAPON ) - 1 ] );
eMuzzleflash.skeletonindex = skel_create( eViewModel.modelindex );
eMuzzleflash.skin = skel_get_numbones( eMuzzleflash.skeletonindex ) + 1;
fLastWeapon = getstatf( STAT_ACTIVEWEAPON );
}
}
// Take away alpha once it has drawn fully at least once
if ( eMuzzleflash.alpha > 0.0f ) {
eMuzzleflash.alpha -= ( frametime * 45 );
}
static float fBaseTime;
static float fCode;
static string sData ;
getnextmodelevent( eViewModel.modelindex, eViewModel.frame, fBaseTime, eViewModel.frame1time - 0.001, fCode, sData );
if ( fCode == 5004 ) {
localsound( sData, CHAN_AUTO, 1.0 );
} else if ( fCode == 5001 ) {
eMuzzleflash.alpha = 1.0f;
eMuzzleflash.scale = stof( sData ) * 0.01;
}
eViewModel.frame1time += frametime;
}
@ -112,10 +144,18 @@ void View_DrawViewModel( void ) {
}
fLastTime = time;
// Update muzzleflash position and draw it
if ( eMuzzleflash.alpha > 0.0f ) {
eMuzzleflash.origin = gettaginfo( eViewModel, eMuzzleflash.skin );
dynamiclight_add( eMuzzleflash.origin, 400 * eMuzzleflash.alpha, '1 0.45 0');
addentity( eMuzzleflash );
}
addentity( eViewModel );
}
void View_PlayAnimation( int iSequence ) {
eViewModel.frame = (float)iSequence;
eViewModel.frame1time = 0;
eViewModel.frame1time = 0.0f;
}

View File

@ -62,7 +62,6 @@ void WeaponAK47_Draw( void ) {
OpenCSGunBase_Draw();
#else
View_PlayAnimation( ANIM_AK47_DRAW );
Sound_Delayed( "weapons/ak47_boltpull.wav", 1.0, 0.5 );
#endif
}
@ -96,7 +95,5 @@ void WeaponAK47_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_AK47_RELOAD );
Sound_Delayed( "weapons/ak47_clipout.wav", 1.0, 0.6 );
Sound_Delayed( "weapons/ak47_clipin.wav", 1.0, 1.5 );
#endif
}

View File

@ -62,7 +62,6 @@ void WeaponAUG_Draw( void ) {
OpenCSGunBase_Draw();
#else
View_PlayAnimation( ANIM_AUG_DRAW );
Sound_Delayed( "weapons/aug_boltpull.wav", 1.0, 0.5 );
#endif
}
@ -104,10 +103,5 @@ void WeaponAUG_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_AUG_RELOAD );
Sound_Delayed( "weapons/aug_boltpull.wav", 1.0, 0.5 );
Sound_Delayed( "weapons/aug_clipout.wav", 1.0, 1.3 );
Sound_Delayed( "weapons/aug_clipin.wav", 1.0, 2.2 );
Sound_Delayed( "weapons/aug_boltslap.wav", 1.0, 2.8 );
#endif
}

View File

@ -62,7 +62,6 @@ void WeaponAWP_Draw( void ) {
OpenCSGunBase_Draw();
#else
View_PlayAnimation( ANIM_AWP_DRAW );
Sound_Delayed( "weapons/awp_deploy.wav", 1.0, 0.5 );
#endif
}
@ -83,7 +82,6 @@ void WeaponAWP_PrimaryFire( void ) {
}
OpenCSGunBase_ShotMultiplierHandle( 1 );
Sound_Delayed( "weapons/awp_deploy.wav", 1.0, 0.4 );
#endif
}
@ -108,8 +106,5 @@ void WeaponAWP_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_AWP_RELOAD );
Sound_Delayed( "weapons/awp_clipout.wav", 1.0, 0.9 );
Sound_Delayed( "weapons/awp_clipin.wav", 1.0, 1.8 );
#endif
}

View File

@ -110,7 +110,6 @@ float OpenCSGunBase_PrimaryFire( void ) {
self.(wptTable[ self.weapon ].iMagfld) -= 1;
self.fAttackFinished = time + wptTable[ self.weapon ].fAttackFinished;
Client_SendEvent( self, EV_WEAPON_PRIMARYATTACK );
self.effects = self.effects | EF_MUZZLEFLASH;
return TRUE;
}

View File

@ -221,12 +221,5 @@ void WeaponC4BOMB_PrimaryFire( void ) {
}
#else
View_PlayAnimation( ANIM_C4_ENTERCODE );
Sound_Delayed( "weapons/c4_click.wav", 1.0, 1.18 );
Sound_Delayed( "weapons/c4_click.wav", 1.0, 1.42 );
Sound_Delayed( "weapons/c4_click.wav", 1.0, 1.63 );
Sound_Delayed( "weapons/c4_click.wav", 1.0, 1.88 );
Sound_Delayed( "weapons/c4_click.wav", 1.0, 2.12 );
Sound_Delayed( "weapons/c4_click.wav", 1.0, 2.36 );
Sound_Delayed( "weapons/c4_click.wav", 1.0, 2.55 );
#endif
}

View File

@ -96,7 +96,5 @@ void WeaponDEAGLE_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_DEAGLE_RELOAD );
Sound_Delayed( "weapons/de_clipout.wav", 1.0, 0.5 );
Sound_Delayed( "weapons/de_clipin.wav", 1.0, 1.2 );
#endif
}

View File

@ -136,13 +136,6 @@ void WeaponELITES_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_ELITES_RELOAD );
Sound_Delayed( "weapons/elite_reloadstart.wav", 1.0, 0.0 );
Sound_Delayed( "weapons/elite_leftclipin.wav", 1.0, 1.5 );
Sound_Delayed( "weapons/elite_clipout.wav", 1.0, 2.5 );
Sound_Delayed( "weapons/elite_sliderelease.wav", 1.0, 2.7 );
Sound_Delayed( "weapons/elite_rightclipin.wav", 1.0, 3.8 );
Sound_Delayed( "weapons/elite_sliderelease.wav", 1.0, 4.2 );
iWeaponMode_ELITES = 0;
#endif
}

View File

@ -62,7 +62,6 @@ void WeaponFIVESEVEN_Draw( void ) {
OpenCSGunBase_Draw();
#else
View_PlayAnimation( ANIM_FIVESEVEN_DRAW );
Sound_Delayed( "weapons/fiveseven_slidepull.wav", 1.0, 0.5 );
#endif
}
@ -92,9 +91,5 @@ void WeaponFIVESEVEN_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_FIVESEVEN_RELOAD );
Sound_Delayed( "weapons/p228_clipout.wav", 1.0, 0.5 );
Sound_Delayed( "weapons/p228_clipin.wav", 1.0, 1.5 );
Sound_Delayed( "weapons/p228_sliderelease.wav", 1.0, 2.4 );
#endif
}

View File

@ -61,7 +61,6 @@ void WeaponG3SG1_Draw( void ) {
OpenCSGunBase_Draw();
#else
View_PlayAnimation( ANIM_G3SG1_DRAW );
Sound_Delayed( "weapons/g3sg1_slide.wav", 1.0, 0.5 );
#endif
}
@ -104,10 +103,5 @@ void WeaponG3SG1_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_G3SG1_RELOAD );
Sound_Delayed( "weapons/g3sg1_slide.wav", 1.0, 0.5 );
Sound_Delayed( "weapons/g3sg1_clipout.wav", 1.0, 1.7 );
Sound_Delayed( "weapons/g3sg1_clipin.wav", 1.0, 2.7 );
Sound_Delayed( "weapons/g3sg1_slide.wav", 1.0, 3.7 );
#endif
}

View File

@ -79,7 +79,6 @@ void WeaponGLOCK18_Draw( void ) {
} else {
View_PlayAnimation( ANIM_GLOCK_DRAW2 );
}
Sound_Delayed( "weapons/slideback1.wav", 1.0, 0.5 );
#endif
}
@ -150,14 +149,8 @@ void WeaponGLOCK18_Reload( void ) {
#else
if ( random() <= 0.5 ) {
View_PlayAnimation( ANIM_GLOCK_RELOAD1 );
Sound_Delayed( "weapons/clipout1.wav", 1.0, 0.6 );
Sound_Delayed( "weapons/clipin1.wav", 1.0, 1.2 );
Sound_Delayed( "weapons/sliderelease1.wav", 1.0, 1.9 );
} else {
View_PlayAnimation( ANIM_GLOCK_RELOAD2 );
Sound_Delayed( "weapons/clipout1.wav", 1.0, 0.6 );
Sound_Delayed( "weapons/clipin1.wav", 1.0, 1.0 );
Sound_Delayed( "weapons/sliderelease1.wav", 1.0, 1.7 );
}
#endif
}

View File

@ -69,7 +69,6 @@ void WeaponM3_Draw( void ) {
OpenCSGunBase_Draw();
#else
View_PlayAnimation( ANIM_M3_DRAW );
Sound_Delayed( "weapons/m3_pump.wav", 1.0, 0.5 );
#endif
}
@ -119,7 +118,6 @@ void WeaponM3_Secondary( void ) {
self.nextthink = time + 0.5;
#else
View_PlayAnimation( ANIM_M3_INSERT );
Sound_Delayed( "weapons/m3_insertshell.wav", 1.0, 0.25 );
#endif
}
@ -146,7 +144,6 @@ void WeaponM3_Reload( void ) {
View_PlayAnimation( ANIM_M3_RELOAD_START );
} else {
View_PlayAnimation( ANIM_M3_RELOAD_END );
Sound_Delayed( "weapons/m3_pump.wav", 1.0, 0.5 );
}
#endif
}

View File

@ -79,8 +79,6 @@ void WeaponM4A1_Draw( void ) {
} else {
View_PlayAnimation( ANIM_M4A1_DRAW );
}
Sound_Delayed( "weapons/m4a1_boltpull.wav", 1.0, 0.5 );
#endif
}
@ -136,10 +134,8 @@ void WeaponM4A1_Secondary( void ) {
if ( iWeaponMode_M4A1 == TRUE ) {
View_PlayAnimation( ANIM_M4A1_SILENCER_ADD );
Sound_Delayed( "weapons/m4a1_silencer_on.wav", 1.0, 0.95 );
} else {
View_PlayAnimation( ANIM_M4A1_SILENCER_REMOVE );
Sound_Delayed( "weapons/m4a1_silencer_off.wav", 1.0, 0.6 );
}
#endif
}
@ -155,9 +151,5 @@ void WeaponM4A1_Reload( void ) {
} else {
View_PlayAnimation( ANIM_M4A1_RELOAD );
}
Sound_Delayed( "weapons/m4a1_clipout.wav", 1.0, 0.5 );
Sound_Delayed( "weapons/m4a1_clipin.wav", 1.0, 1.5 );
Sound_Delayed( "weapons/m4a1_boltpull.wav", 1.0, 2.4 );
#endif
}

View File

@ -62,7 +62,6 @@ void WeaponMP5_Draw( void ) {
OpenCSGunBase_Draw();
#else
View_PlayAnimation( ANIM_MP5_DRAW );
Sound_Delayed( "weapons/mp5_slideback.wav", 1.0, 0.5 );
#endif
}
@ -95,8 +94,5 @@ void WeaponMP5_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_MP5_RELOAD );
Sound_Delayed( "weapons/mp5_clipout.wav", 1.0, 0.6 );
Sound_Delayed( "weapons/mp5_clipin.wav", 1.0, 1.2 );
Sound_Delayed( "weapons/mp5_slideback.wav", 1.0, 2.0 );
#endif
}

View File

@ -91,9 +91,5 @@ void WeaponMAC10_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_MAC10_RELOAD );
Sound_Delayed( "weapons/mac10_clipout.wav", 1.0, 0.6 );
Sound_Delayed( "weapons/mac10_clipin.wav", 1.0, 1.6 );
Sound_Delayed( "weapons/mac10_boltpull.wav", 1.0, 2.5 );
#endif
}

View File

@ -62,7 +62,6 @@ void WeaponP228_Draw( void ) {
OpenCSGunBase_Draw();
#else
View_PlayAnimation( ANIM_P228_DRAW );
Sound_Delayed( "weapons/p228_slidepull.wav", 1.0, 0.5 );
#endif
}
@ -97,9 +96,5 @@ void WeaponP228_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_P228_RELOAD );
Sound_Delayed( "weapons/p228_clipout.wav", 1.0, 0.5 );
Sound_Delayed( "weapons/p228_clipin.wav", 1.0, 1.5 );
Sound_Delayed( "weapons/p228_sliderelease.wav", 1.0, 2.4 );
#endif
}

View File

@ -62,7 +62,6 @@ void WeaponP90_Draw( void ) {
OpenCSGunBase_Draw();
#else
View_PlayAnimation( ANIM_P90_DRAW );
Sound_Delayed( "weapons/p90_boltpull.wav", 1.0, 0.5 );
#endif
}
@ -92,10 +91,5 @@ void WeaponP90_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_P90_RELOAD );
Sound_Delayed( "weapons/p90_cliprelease.wav", 1.0, 0.5 );
Sound_Delayed( "weapons/p90_clipout.wav", 1.0, 1 );
Sound_Delayed( "weapons/p90_clipin.wav", 1.0, 2.0 );
Sound_Delayed( "weapons/p90_boltpull.wav", 1.0, 2.7 );
#endif
}

View File

@ -90,12 +90,5 @@ void WeaponPARA_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_PARA_RELOAD );
//sound( self, CHAN_WEAPON, "weapons/m249_chain.wav", 1, ATTN_IDLE ); // TODO: Move to the client...
Sound_Delayed( "weapons/m249_coverup.wav", 1.0, 0.75 );
Sound_Delayed( "weapons/m249_boxout.wav", 1.0, 1.6 );
Sound_Delayed( "weapons/m249_boxin.wav", 1.0, 2.5 );
Sound_Delayed( "weapons/m249_chain.wav", 1.0, 3.0 );
Sound_Delayed( "weapons/m249_coverdown.wav", 1.0, 3.9 );
#endif
}

View File

@ -101,8 +101,5 @@ void WeaponSG550_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_SG550_RELOAD );
Sound_Delayed( "weapons/sg550_clipout.wav", 1.0, 0.7 );
Sound_Delayed( "weapons/sg550_clipin.wav", 1.0, 1.7 );
Sound_Delayed( "weapons/sg550_boltpull.wav", 1.0, 2.9 );
#endif
}

View File

@ -58,16 +58,15 @@ enum {
};
void WeaponSG552_Draw( void ) {
#ifdef SSQC
#ifdef SSQC
OpenCSGunBase_Draw();
#else
#else
View_PlayAnimation( ANIM_SG552_DRAW );
Sound_Delayed( "weapons/sg552_boltpull.wav", 1.0, 0.5 );
#endif
#endif
}
void WeaponSG552_PrimaryFire( void ) {
#ifdef SSQC
#ifdef SSQC
if ( OpenCSGunBase_PrimaryFire() == TRUE ) {
if ( random() <= 0.5 ) {
sound( self, CHAN_WEAPON, "weapons/sg552-1.wav", 1, ATTN_NORM );
@ -75,7 +74,7 @@ void WeaponSG552_PrimaryFire( void ) {
sound( self, CHAN_WEAPON, "weapons/sg552-2.wav", 1, ATTN_NORM );
}
}
#else
#else
int iRand = (int)floor( random( 1, 4 ) );
if ( iRand == 1 ) {
View_PlayAnimation( ANIM_SG552_SHOOT1 );
@ -86,7 +85,7 @@ void WeaponSG552_PrimaryFire( void ) {
}
OpenCSGunBase_ShotMultiplierHandle( 1 );
#endif
#endif
}
void WeaponSG552_SecondaryFire( void ) {
@ -102,14 +101,11 @@ void WeaponSG552_SecondaryFire( void ) {
}
void WeaponSG552_Reload( void ) {
#ifdef SSQC
#ifdef SSQC
if ( OpenCSGunBase_Reload() == TRUE ) {
// Play Sound
}
#else
#else
View_PlayAnimation( ANIM_SG552_RELOAD );
Sound_Delayed( "weapons/sg552_clipout.wav", 1.0, 0.7 );
Sound_Delayed( "weapons/sg552_clipin.wav", 1.0, 1.7 );
Sound_Delayed( "weapons/sg552_boltpull.wav", 1.0, 2.4 );
#endif
#endif
}

View File

@ -78,7 +78,6 @@ void WeaponSCOUT_PrimaryFire( void ) {
}
OpenCSGunBase_ShotMultiplierHandle( 1 );
Sound_Delayed( "weapons/scout_bolt.wav", 1.0, 0.5 );
#endif
}
@ -103,9 +102,5 @@ void WeaponSCOUT_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_SCOUT_RELOAD );
Sound_Delayed( "weapons/scout_clipout.wav", 1.0, 0.75 );
Sound_Delayed( "weapons/scout_clipin.wav", 1.0, 1.25 );
#endif
}

View File

@ -95,8 +95,5 @@ void WeaponTMP_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_TMP_RELOAD );
Sound_Delayed( "weapons/mac10_clipout.wav", 1.0, 0.6 );
Sound_Delayed( "weapons/mac10_clipin.wav", 1.0, 1.6 );
#endif
}

View File

@ -93,8 +93,5 @@ void WeaponUMP45_Reload( void ) {
}
#else
View_PlayAnimation( ANIM_UMP45_RELOAD );
Sound_Delayed( "weapons/ump45_clipout.wav", 1.0, 0.7 );
Sound_Delayed( "weapons/ump45_clipin.wav", 1.0, 1.8 );
Sound_Delayed( "weapons/ump45_boltslap.wav", 1.0, 2.7 );
#endif
}

View File

@ -81,8 +81,6 @@ void WeaponUSP45_Draw( void ) {
} else {
View_PlayAnimation( ANIM_USP45_DRAW );
}
Sound_Delayed( "weapons/usp_slideback.wav", 1.0, 0.5 );
#endif
}
@ -147,10 +145,8 @@ void WeaponUSP45_Secondary( void ) {
if ( iWeaponMode_USP45 == TRUE ) {
View_PlayAnimation( ANIM_USP45_SILENCER_ADD );
Sound_Delayed( "weapons/usp_silencer_on.wav", 1.0, 0.95 );
} else {
View_PlayAnimation( ANIM_USP45_SILENCER_REMOVE );
Sound_Delayed( "weapons/usp_silencer_off.wav", 1.0, 0.6 );
}
#endif
}
@ -166,9 +162,5 @@ void WeaponUSP45_Reload( void ) {
} else {
View_PlayAnimation( ANIM_USP45_RELOAD );
}
Sound_Delayed( "weapons/usp_clipout.wav", 1.0, 0.5 );
Sound_Delayed( "weapons/usp_clipin.wav", 1.0, 1.1 );
Sound_Delayed( "weapons/usp_sliderelease.wav", 1.0, 2.2 );
#endif
}

View File

@ -119,7 +119,6 @@ void WeaponXM1014_Secondary( void ) {
self.nextthink = time + 0.5;
#else
View_PlayAnimation( ANIM_XM1014_INSERT );
Sound_Delayed( "weapons/m3_insertshell.wav", 1.0, 0.25 );
#endif
}

Binary file not shown.

Binary file not shown.