Last commit for tonight, slowly adding in clientside sounds for the viewmodels
This commit is contained in:
parent
6378be9043
commit
2a69d07ee0
19 changed files with 78 additions and 53 deletions
|
@ -37,4 +37,9 @@ float fInputKeyDown;
|
|||
float fMouseClick;
|
||||
vector vMousePos;
|
||||
|
||||
// Sound Stuff
|
||||
.string sSoundSample;
|
||||
.float fVolume;
|
||||
|
||||
void View_PlayAnimation( int iSequence );
|
||||
void Sound_Delayed( string sSample, float fVol, float fDelay );
|
||||
|
|
|
@ -21,3 +21,15 @@ 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 ) {
|
||||
|
||||
}
|
||||
|
||||
void Sound_Delayed( string sSample, float fVol, float fDelay ) {
|
||||
static void Sound_Delayed_PlayBack( void ) {
|
||||
localsound( self.sSoundSample, CHAN_AUTO, self.fVolume );
|
||||
remove( self );
|
||||
}
|
||||
entity eSound = spawn();
|
||||
eSound.think = Sound_Delayed_PlayBack;
|
||||
eSound.sSoundSample = sSample;
|
||||
eSound.fVolume = fVol;
|
||||
eSound.nextthink = time + fDelay;
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ VGUI_BuyMenu_Rifles
|
|||
void VGUI_BuyMenu_Rifles( vector vPos ) {
|
||||
vVGUIButtonPos = vPos + '16 116 0';
|
||||
|
||||
if ( getplayerkeyvalue( player_localnum, "team" ) == "t" ) {
|
||||
if ( getstati( STAT_TEAM ) == TEAM_T ) {
|
||||
VGUI_BuyMenu_Button( WEAPON_AK47 );
|
||||
VGUI_BuyMenu_Button( WEAPON_SG552 );
|
||||
|
||||
|
@ -213,7 +213,7 @@ void VGUI_BuyMenu_Rifles( vector vPos ) {
|
|||
VGUI_BuyMenu_Button( WEAPON_G3SG1 );
|
||||
}
|
||||
|
||||
if ( getplayerkeyvalue( player_localnum, "team" ) == "ct" ) {
|
||||
if ( getstati( STAT_TEAM ) == TEAM_CT ) {
|
||||
VGUI_BuyMenu_Button( WEAPON_M4A1 );
|
||||
VGUI_BuyMenu_Button( WEAPON_AUG );
|
||||
|
||||
|
|
|
@ -35,7 +35,8 @@ enum {
|
|||
STAT_SLOT_SECONDARY,
|
||||
STAT_SLOT_GRENADE,
|
||||
STAT_CURRENT_CLIP,
|
||||
STAT_CURRENT_CALIBER
|
||||
STAT_CURRENT_CALIBER,
|
||||
STAT_TEAM
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
|
@ -30,6 +30,7 @@ void hostage_pain( void ) {
|
|||
}
|
||||
|
||||
void hostage_die( void ) {
|
||||
sound( world, CHAN_VOICE, "radio/hosdown.wav", 1.0, ATTN_NONE );
|
||||
self.frame = 30 + ceil( random() * 5);
|
||||
self.solid = SOLID_NOT;
|
||||
self.takedamage = DAMAGE_NO;
|
||||
|
|
|
@ -61,6 +61,7 @@ void worldspawn( void ) {
|
|||
precache_sound( "radio/letsgo.wav" );
|
||||
precache_sound( "radio/locknload.wav" );
|
||||
precache_sound( "radio/rescued.wav" );
|
||||
precache_sound( "radio/hosdown.wav" );
|
||||
|
||||
precache_sound( "hostage/hos1.wav" );
|
||||
precache_sound( "hostage/hos2.wav" );
|
||||
|
@ -237,6 +238,7 @@ void worldspawn( void ) {
|
|||
clientstat( STAT_SLOT_GRENADE, EV_INTEGER, iSlotGrenade );
|
||||
clientstat( STAT_CURRENT_CLIP, EV_INTEGER, iCurrentClip );
|
||||
clientstat( STAT_CURRENT_CALIBER, EV_INTEGER, iCurrentCaliber );
|
||||
clientstat( STAT_TEAM, EV_INTEGER, team );
|
||||
pointerstat( STAT_GAMETIME, EV_FLOAT, &fGameTime );
|
||||
}
|
||||
|
||||
|
|
|
@ -32,16 +32,14 @@ void Spawn_GameClient( float fTeam ) {
|
|||
return;
|
||||
} else if( fTeam < 5 ) {
|
||||
eSpawn = find ( world, classname, "info_player_deathmatch" );
|
||||
self.team = TEAM_T; // This is only important to the Server codebase
|
||||
forceinfokey( self, "team", "t" ); // This is for the Client codebase
|
||||
self.team = TEAM_T;
|
||||
|
||||
// TODO: Move this away from here
|
||||
Weapon_AddItem( WEAPON_GLOCK18 );
|
||||
Weapon_GiveAmmo( WEAPON_GLOCK18, 40 );
|
||||
} else {
|
||||
eSpawn = find ( world, classname, "info_player_start" );
|
||||
self.team = TEAM_CT; // This is only important to the Server codebase
|
||||
forceinfokey( self, "team", "ct" ); // This is for the Client codebase
|
||||
self.team = TEAM_CT;
|
||||
|
||||
// TODO: Move this away from here
|
||||
Weapon_AddItem( WEAPON_USP45 );
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
#pragma progs_dat "../../Main/progs.dat"
|
||||
|
||||
#define SSQC
|
||||
|
||||
#includelist
|
||||
../Builtins.h
|
||||
../Globals.h
|
||||
|
|
|
@ -56,9 +56,9 @@ enum {
|
|||
void WeaponAK47_Draw( void ) {
|
||||
#ifdef SSQC
|
||||
OpenCSGunBase_Draw();
|
||||
sound( self, CHAN_WEAPON, "weapons/ak47_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
|
||||
#else
|
||||
View_PlayAnimation( ANIM_AK47_DRAW );
|
||||
Sound_Delayed( "weapons/ak47_boltpull.wav", 1.0, 0.5 );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -90,5 +90,7 @@ 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
|
||||
}
|
||||
|
|
|
@ -38,9 +38,9 @@ weaponinfo_t wptDEAGLE = {
|
|||
2.1, // Reload-Delay
|
||||
iAmmo_50AE, // Caliber Pointer
|
||||
iClip_DEAGLE, // Clip Pointer
|
||||
-1, // Accuracy Divisor
|
||||
0, // Accuracy Offset
|
||||
0 // Max Inaccuracy
|
||||
200, // Accuracy Divisor
|
||||
0.55, // Accuracy Offset
|
||||
1.4 // Max Inaccuracy
|
||||
};
|
||||
|
||||
// Anim Table
|
||||
|
@ -56,7 +56,6 @@ enum {
|
|||
void WeaponDEAGLE_Draw( void ) {
|
||||
#ifdef SSQC
|
||||
OpenCSGunBase_Draw();
|
||||
sound( self, CHAN_WEAPON, "weapons/de_deploy.wav", 1, ATTN_IDLE ); // TODO: Move to the client..
|
||||
#else
|
||||
View_PlayAnimation( ANIM_DEAGLE_DRAW );
|
||||
#endif
|
||||
|
@ -92,5 +91,7 @@ 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
|
||||
}
|
||||
|
|
|
@ -44,9 +44,9 @@ weaponinfo_t wptELITES = {
|
|||
4.6, // Reload-Delay
|
||||
iAmmo_9MM, // Caliber Pointer
|
||||
iClip_ELITES, // Clip Pointer
|
||||
-1, // Accuracy Divisor
|
||||
0, // Accuracy Offset
|
||||
0 // Max Inaccuracy
|
||||
200, // Accuracy Divisor
|
||||
0.55, // Accuracy Offset
|
||||
1.4 // Max Inaccuracy
|
||||
};
|
||||
|
||||
// Anim Table
|
||||
|
|
|
@ -38,9 +38,9 @@ weaponinfo_t wptFIVESEVEN = {
|
|||
3.1, // Reload-Delay
|
||||
iAmmo_57MM, // Caliber Pointer
|
||||
iClip_FIVESEVEN, // Clip Pointer
|
||||
-1, // Accuracy Divisor
|
||||
0, // Accuracy Offset
|
||||
0 // Max Inaccuracy
|
||||
200, // Accuracy Divisor
|
||||
0.55, // Accuracy Offset
|
||||
1.4 // Max Inaccuracy
|
||||
};
|
||||
|
||||
// Anim Table
|
||||
|
|
|
@ -38,9 +38,9 @@ weaponinfo_t wptG3SG1 = {
|
|||
4.6, // Reload-Delay
|
||||
iAmmo_762MM, // Caliber Pointer
|
||||
iClip_G3SG1, // Clip Pointer
|
||||
-1, // Accuracy Divisor
|
||||
0, // Accuracy Offset
|
||||
0 // Max Inaccuracy
|
||||
200, // Accuracy Divisor
|
||||
0.55, // Accuracy Offset
|
||||
1.4 // Max Inaccuracy
|
||||
};
|
||||
|
||||
// Anim Table
|
||||
|
|
|
@ -44,9 +44,9 @@ weaponinfo_t wptGLOCK18 = {
|
|||
2.0, // Reload-Delay
|
||||
iAmmo_9MM, // Caliber Pointer
|
||||
iClip_GLOCK18, // Clip Pointer
|
||||
-1, // Accuracy Divisor
|
||||
0, // Accuracy Offset
|
||||
0 // Max Inaccuracy
|
||||
200, // Accuracy Divisor
|
||||
0.55, // Accuracy Offset
|
||||
1.4 // Max Inaccuracyy
|
||||
};
|
||||
|
||||
// Anim Table
|
||||
|
@ -69,13 +69,13 @@ enum {
|
|||
void WeaponGLOCK18_Draw( void ) {
|
||||
#ifdef SSQC
|
||||
OpenCSGunBase_Draw();
|
||||
sound( self, CHAN_WEAPON, "weapons/slideback1.wav", 1, ATTN_IDLE ); // TODO: Move to the client...?
|
||||
#else
|
||||
if ( random() <= 0.5 ) {
|
||||
View_PlayAnimation( ANIM_GLOCK_DRAW1 );
|
||||
} else {
|
||||
View_PlayAnimation( ANIM_GLOCK_DRAW2 );
|
||||
}
|
||||
Sound_Delayed( "weapons/slideback1.wav", 1.0, 0.5 );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -135,6 +135,9 @@ void WeaponGLOCK18_Reload( void ) {
|
|||
View_PlayAnimation( ANIM_GLOCK_RELOAD1 );
|
||||
} 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
|
||||
}
|
||||
|
|
|
@ -75,6 +75,8 @@ void WeaponM4A1_Draw( void ) {
|
|||
} else {
|
||||
View_PlayAnimation( ANIM_M4A1_DRAW );
|
||||
}
|
||||
|
||||
Sound_Delayed( "weapons/m4a1_boltpull.wav", 1.0, 0.5 );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -124,20 +126,15 @@ void WeaponM4A1_Secondary( void ) {
|
|||
|
||||
// Tell the client that we switched modes, too
|
||||
Client_SendEvent( self, EV_WEAPON_SECONDARYATTACK );
|
||||
|
||||
if ( self.iMode_M4A1 == TRUE ) {
|
||||
sound( self, CHAN_WEAPON, "weapons/m4a1_silencer_on.wav", 1, ATTN_NORM );
|
||||
} else {
|
||||
sound( self, CHAN_WEAPON, "weapons/m4a1_silencer_off.wav", 1, ATTN_NORM );
|
||||
}
|
||||
|
||||
#else
|
||||
iWeaponMode_M4A1 = 1 - iWeaponMode_M4A1;
|
||||
|
||||
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
|
||||
}
|
||||
|
@ -153,5 +150,9 @@ 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
|
||||
}
|
||||
|
|
|
@ -38,9 +38,9 @@ weaponinfo_t wptP228 = {
|
|||
2.7, // Reload-Delay
|
||||
iAmmo_357SIG, // Caliber Pointer
|
||||
iClip_P228, // Clip Pointer
|
||||
-1, // Accuracy Divisor
|
||||
0, // Accuracy Offset
|
||||
0 // Max Inaccuracy
|
||||
200, // Accuracy Divisor
|
||||
0.55, // Accuracy Offset
|
||||
1.4 // Max Inaccuracy
|
||||
};
|
||||
|
||||
// Anim Table
|
||||
|
|
|
@ -38,9 +38,9 @@ weaponinfo_t wptSG550 = {
|
|||
3.8, // Reload-Delay
|
||||
iAmmo_556MM, // Caliber Pointer
|
||||
iClip_SG550, // Clip Pointer
|
||||
-1, // Accuracy Divisor
|
||||
0, // Accuracy Offset
|
||||
0 // Max Inaccuracy
|
||||
200, // Accuracy Divisor
|
||||
0.55, // Accuracy Offset
|
||||
1.4 // Max Inaccuracy
|
||||
};
|
||||
|
||||
// Anim Table
|
||||
|
|
|
@ -38,9 +38,9 @@ weaponinfo_t wptSCOUT = {
|
|||
2.0, // Reload-Delay
|
||||
iAmmo_762MM, // Caliber Pointer
|
||||
iClip_SCOUT, // Clip Pointer
|
||||
-1, // Accuracy Divisor
|
||||
0, // Accuracy Offset
|
||||
0 // Max Inaccuracy
|
||||
200, // Accuracy Divisor
|
||||
0.55, // Accuracy Offset
|
||||
1.4 // Max Inaccuracy
|
||||
};
|
||||
|
||||
// Anim Table
|
||||
|
|
|
@ -44,9 +44,9 @@ weaponinfo_t wptUSP45 = {
|
|||
2.5, // Reload-Delay
|
||||
iAmmo_45ACP, // Caliber Pointer
|
||||
iClip_USP45, // Clip Pointer
|
||||
-1, // Accuracy Divisor
|
||||
0, // Accuracy Offset
|
||||
0 // Max Inaccuracy
|
||||
200, // Accuracy Divisor
|
||||
0.55, // Accuracy Offset
|
||||
1.4 // Max Inaccuracy
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -77,6 +77,8 @@ void WeaponUSP45_Draw( void ) {
|
|||
} else {
|
||||
View_PlayAnimation( ANIM_USP45_DRAW );
|
||||
}
|
||||
|
||||
Sound_Delayed( "weapons/usp_slideback.wav", 1.0, 0.5 );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -134,20 +136,15 @@ void WeaponUSP45_Secondary( void ) {
|
|||
|
||||
// Tell the client that we switched modes, too
|
||||
Client_SendEvent( self, EV_WEAPON_SECONDARYATTACK );
|
||||
|
||||
if ( self.iMode_M4A1 == TRUE ) {
|
||||
sound( self, CHAN_WEAPON, "weapons/usp_silencer_on.wav", 1, ATTN_NORM );
|
||||
} else {
|
||||
sound( self, CHAN_WEAPON, "weapons/usp_silencer_off.wav", 1, ATTN_NORM );
|
||||
}
|
||||
|
||||
#else
|
||||
iWeaponMode_USP45 = 1 - iWeaponMode_USP45;
|
||||
|
||||
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
|
||||
}
|
||||
|
@ -163,5 +160,9 @@ 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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue