diff --git a/Source/Client/HUD.c b/Source/Client/HUD.c index ef3c038d..66666cd1 100644 --- a/Source/Client/HUD.c +++ b/Source/Client/HUD.c @@ -86,7 +86,7 @@ void HUD_Draw( void ) { HUD_DrawNums( getstatf( STAT_HEALTH ), vHealthPos + '72 0' ); // Armor - vector vArmorPos = [ 136, vVideoResolution_y - 42 ]; + vector vArmorPos = [ 112, vVideoResolution_y - 42 ]; drawsubpic( vArmorPos, '24 24 0', HUD_NUMFILE_LAYER, [ 0, NUMSIZE_Y], [ NUMSIZE_X, NUMSIZE_X ], VGUI_WINDOW_FGCOLOR, 1, DRAWFLAG_ADDITIVE ); HUD_DrawNums( getstatf( STAT_ARMOR ), vArmorPos + '72 0' ); diff --git a/Source/Client/Sound.c b/Source/Client/Sound.c index ff53f7c4..a7f10e76 100644 --- a/Source/Client/Sound.c +++ b/Source/Client/Sound.c @@ -24,6 +24,7 @@ float CSQC_Event_Sound( float entnum, float channel, string soundname, float vol 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 ); } diff --git a/Source/Server/Client.c b/Source/Server/Client.c index 806540d5..d84b0a03 100644 --- a/Source/Server/Client.c +++ b/Source/Server/Client.c @@ -72,6 +72,7 @@ void PutClientInServer( void ) { void SV_RunClientCommand( void ) { + // The individual zones will just override this behavior self.fInBombZone = FALSE; self.fInBuyZone = FALSE; self.fInHostageZone = FALSE; diff --git a/Source/Server/Defs.h b/Source/Server/Defs.h index 88d2f716..e6554399 100644 --- a/Source/Server/Defs.h +++ b/Source/Server/Defs.h @@ -82,8 +82,9 @@ string sCSPlayers[9] = { void Client_SendEvent( entity eClient, float fEVType ); +void OpenCSGunBase_AccuracyCalc( void ); void OpenCSGunBase_Draw( void ); float OpenCSGunBase_PrimaryFire( void ); float OpenCSGunBase_Reload( void ); -void TraceAttack_FireBullets( void ); +void TraceAttack_FireBullets( int iShots ); diff --git a/Source/Server/Entities.c b/Source/Server/Entities.c index 35f74251..39b10c2d 100644 --- a/Source/Server/Entities.c +++ b/Source/Server/Entities.c @@ -38,10 +38,6 @@ void func_door( void ) { func_wall(); } -void func_breakable( void ) { - func_wall(); -} - void func_button( void ) { func_wall(); } diff --git a/Source/Server/FuncBreakable.c b/Source/Server/FuncBreakable.c new file mode 100644 index 00000000..9b1831f5 --- /dev/null +++ b/Source/Server/FuncBreakable.c @@ -0,0 +1,130 @@ +/* +OpenCS Project +Copyright (C) 2015 Marco "eukara" Hladik + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +// Entity information from http://twhl.info/wiki.php?id=164 + + +// These are the material types apparently +.float material; +enum { + MATERIAL_GLASS = 0, + MATERIAL_WOOD, + MATERIAL_METAL, + MATERIAL_FLESH, + MATERIAL_CINDER, + MATERIAL_TILE, + MATERIAL_COMPUTER, + MATERIAL_GLASS_UNBREAKABLE, + MATERIAL_ROCK, + MATERIAL_NONE +}; + +// Whenever it gets damaged +void func_breakable_pain( void ) { + string sTypeSample = ""; + int iTypeCount = 0; + + switch ( self.material ) { + case MATERIAL_GLASS: + case MATERIAL_COMPUTER: + case MATERIAL_GLASS_UNBREAKABLE: + sTypeSample = "debris/glass"; + iTypeCount = 3; + break; + case MATERIAL_WOOD: + sTypeSample = "debris/wood"; + iTypeCount = 3; + break; + case MATERIAL_METAL: + sTypeSample = "debris/metal"; + iTypeCount = 3; + break; + case MATERIAL_FLESH: + sTypeSample = "debris/flesh"; + iTypeCount = 7; + break; + case MATERIAL_CINDER: + case MATERIAL_ROCK: + sTypeSample = "debris/concrete"; + iTypeCount = 3; + break; + } + + if ( iTypeCount >= 1 ) { + sound( self, CHAN_VOICE, sprintf( "%s%d.wav", sTypeSample, ceil( random() * iTypeCount ) ), 1.0, ATTN_NORM ); + } +} + +// Whenever it.. dies +void func_breakable_die( void ) { + string sTypeSample = ""; + int iTypeCount = 0; + + switch ( self.material ) { + case MATERIAL_GLASS: + case MATERIAL_GLASS_UNBREAKABLE: + sTypeSample = "debris/bustglass"; + iTypeCount = 2; + break; + case MATERIAL_WOOD: + sTypeSample = "debris/bustwood"; + iTypeCount = 2; + break; + case MATERIAL_METAL: + case MATERIAL_COMPUTER: + sTypeSample = "debris/bustmetal"; + iTypeCount = 2; + break; + case MATERIAL_FLESH: + sTypeSample = "debris/bustflesh"; + iTypeCount = 2; + break; + case MATERIAL_CINDER: + case MATERIAL_ROCK: + sTypeSample = "debris/bustconcrete"; + iTypeCount = 3; + break; + case MATERIAL_TILE: + sTypeSample = "debris/bustceiling"; + iTypeCount = 3; + break; + } + + if ( iTypeCount >= 1 ) { + sound( self, CHAN_VOICE, sprintf( "%s%d.wav", sTypeSample, ceil( random() * iTypeCount ) ), 1.0, ATTN_NORM ); + } + + remove( self ); +} + +/* +================= +SPAWN: func_breakable + +Entry function for the brushes that can die etc. +================= +*/ +void func_breakable( void ) { + func_wall(); + self.vPain = func_breakable_pain; + self.vDeath = func_breakable_die; + self.iBleeds = FALSE; + self.takedamage = DAMAGE_YES; +} diff --git a/Source/Server/FuncLadder.c b/Source/Server/FuncLadder.c index 86ab18a6..34f13861 100644 --- a/Source/Server/FuncLadder.c +++ b/Source/Server/FuncLadder.c @@ -23,8 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. func_ladder_sound ================= */ -void func_ladder_sound( entity target ) -{ +void func_ladder_sound( entity target ) { if ( ( target.velocity_z == 0 ) || ( target.fStepTime > time ) ) { return; } @@ -57,8 +56,7 @@ void func_ladder_sound( entity target ) func_ladder_touch ================= */ -void func_ladder_touch( void ) -{ +void func_ladder_touch( void ) { vector vPlayerVector; if ( other.classname != "player" ) { diff --git a/Source/Server/Timer.c b/Source/Server/Timer.c index 996768b8..54ae751e 100644 --- a/Source/Server/Timer.c +++ b/Source/Server/Timer.c @@ -48,7 +48,7 @@ void Timer_Update( void ) { } else { Timer_Begin( cvar( "mp_roundtime" ) * 60, GAME_ACTIVE ); // Unfreeze - float fRand = ceil( random() * 6 ); + float fRand = ceil( random() * 3 ); if ( fRand == 1 ) { sound(world, CHAN_VOICE, "radio/moveout.wav", 1, ATTN_NONE ); } else if ( fRand == 2 ) { diff --git a/Source/Server/TraceAttack.c b/Source/Server/TraceAttack.c index 509098ee..fa6e3a07 100644 --- a/Source/Server/TraceAttack.c +++ b/Source/Server/TraceAttack.c @@ -22,14 +22,12 @@ float Math_CRandom( void ) { return 2 * ( random() - 0.5 ); } -void TraceAttack_FireBullets( void ) { +void TraceAttack_FireBullets( int iShots ) { vector vSrc, vDir; makevectors(self.v_angle); vSrc = self.origin + self.view_ofs; - - int iShots = wptTable[ self.weapon ].iBullets; while ( iShots > 0) { vDir = aim( self, 100000 ) + Math_CRandom()*self.fAccuracy*v_right + Math_CRandom()*self.fAccuracy*v_up; diff --git a/Source/Server/progs.src b/Source/Server/progs.src index ce7349ec..6cc956ce 100644 --- a/Source/Server/progs.src +++ b/Source/Server/progs.src @@ -37,12 +37,13 @@ TraceAttack.c Timer.c Main.c EntHostage.c +Entities.c +FuncBreakable.c FuncLadder.c FuncHostageRescue.c FuncBombTarget.c FuncBuyZone.c Spawn.c -Entities.c Footsteps.c Input.c Client.c diff --git a/Source/Shared/WeaponAUG.c b/Source/Shared/WeaponAUG.c index fe59ce5f..93f0403d 100644 --- a/Source/Shared/WeaponAUG.c +++ b/Source/Shared/WeaponAUG.c @@ -56,9 +56,9 @@ enum { void WeaponAUG_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/aug_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_AUG_DRAW ); + Sound_Delayed( "weapons/aug_boltpull.wav", 1.0, 0.5 ); #endif } @@ -86,5 +86,10 @@ 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 } diff --git a/Source/Shared/WeaponAWP.c b/Source/Shared/WeaponAWP.c index 512099d8..5b980244 100644 --- a/Source/Shared/WeaponAWP.c +++ b/Source/Shared/WeaponAWP.c @@ -56,9 +56,9 @@ enum { void WeaponAWP_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/awp_deploy.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_AWP_DRAW ); + Sound_Delayed( "weapons/awp_deploy.wav", 1.0, 0.5 ); #endif } @@ -77,6 +77,8 @@ void WeaponAWP_PrimaryFire( void ) { } else { View_PlayAnimation( ANIM_AWP_SHOOT3 ); } + + Sound_Delayed( "weapons/awp_deploy.wav", 1.0, 0.4 ); #endif } @@ -87,5 +89,8 @@ 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 } diff --git a/Source/Shared/WeaponBase.c b/Source/Shared/WeaponBase.c index f4e404c8..1bcfa2a0 100644 --- a/Source/Shared/WeaponBase.c +++ b/Source/Shared/WeaponBase.c @@ -67,7 +67,7 @@ float OpenCSGunBase_PrimaryFire( void ) { } OpenCSGunBase_AccuracyCalc(); - TraceAttack_FireBullets(); + TraceAttack_FireBullets( wptTable[ self.weapon ].iBullets ); self.(wptTable[ self.weapon ].iClipfld) -= 1; self.fAttackFinished = time + wptTable[ self.weapon ].fAttackFinished; diff --git a/Source/Shared/WeaponElites.c b/Source/Shared/WeaponElites.c index e2665a47..8b1b288b 100644 --- a/Source/Shared/WeaponElites.c +++ b/Source/Shared/WeaponElites.c @@ -131,6 +131,13 @@ 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 } diff --git a/Source/Shared/WeaponFiveSeven.c b/Source/Shared/WeaponFiveSeven.c index abfcd5f1..bb50092f 100644 --- a/Source/Shared/WeaponFiveSeven.c +++ b/Source/Shared/WeaponFiveSeven.c @@ -56,9 +56,9 @@ enum { void WeaponFIVESEVEN_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/fiveseven_slidepull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_FIVESEVEN_DRAW ); + Sound_Delayed( "weapons/fiveseven_slidepull.wav", 1.0, 0.5 ); #endif } @@ -89,5 +89,9 @@ 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 } diff --git a/Source/Shared/WeaponG3SG1.c b/Source/Shared/WeaponG3SG1.c index 6763bc69..2f6d15fb 100644 --- a/Source/Shared/WeaponG3SG1.c +++ b/Source/Shared/WeaponG3SG1.c @@ -55,9 +55,9 @@ enum { void WeaponG3SG1_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/g3sg1_slide.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_G3SG1_DRAW ); + Sound_Delayed( "weapons/g3sg1_slide.wav", 1.0, 0.5 ); #endif } @@ -85,5 +85,10 @@ 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 } diff --git a/Source/Shared/WeaponGlock18.c b/Source/Shared/WeaponGlock18.c index 9bf748b1..91924e83 100644 --- a/Source/Shared/WeaponGlock18.c +++ b/Source/Shared/WeaponGlock18.c @@ -41,7 +41,7 @@ weaponinfo_t wptGLOCK18 = { 0.75, // Range Modifier TYPE_SEMI, 0.15, // Attack-Delay - 2.0, // Reload-Delay + 2.1, // Reload-Delay iAmmo_9MM, // Caliber Pointer iClip_GLOCK18, // Clip Pointer 200, // Accuracy Divisor @@ -81,13 +81,22 @@ void WeaponGLOCK18_Draw( void ) { void WeaponGLOCK18_PrimaryFire( void ) { #ifdef SSQC - if ( OpenCSGunBase_PrimaryFire() == TRUE ) { - // Play Sound - if ( self.iMode_GLOCK18 == FALSE ) { + if ( self.iMode_GLOCK18 == FALSE ) { + if ( OpenCSGunBase_PrimaryFire() == TRUE ) { sound( self, CHAN_WEAPON, "weapons/glock18-2.wav", 1, ATTN_NORM ); - } else { - sound( self, CHAN_WEAPON, "weapons/glock18-1.wav", 1, ATTN_NORM ); } + } else { + if ( (self.iClip_GLOCK18 - 3 ) < 0 ) { + return FALSE; + } + OpenCSGunBase_AccuracyCalc(); + TraceAttack_FireBullets( 3 ); + + self.iClip_GLOCK18 -= 3; + self.fAttackFinished = time + 0.5; + + sound( self, CHAN_WEAPON, "weapons/glock18-1.wav", 1, ATTN_NORM ); + Client_SendEvent( self, EV_WEAPON_PRIMARYATTACK ); } #else if ( iWeaponMode_GLOCK18 == FALSE ) { @@ -110,7 +119,7 @@ void WeaponGLOCK18_Secondary( void ) { #ifdef SSQC // Just switch the modes quickly self.iMode_GLOCK18 = 1 - self.iMode_GLOCK18; - self.fAttackFinished = time + 1.0; + self.fAttackFinished = time + 0.2; // Tell the client that we switched modes, too Client_SendEvent( self, EV_WEAPON_SECONDARYATTACK ); @@ -131,8 +140,11 @@ void WeaponGLOCK18_Reload( void ) { // Play Sound } #else - if ( getstatf( STAT_CURRENT_CLIP ) == 0 ) { + 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 ); diff --git a/Source/Shared/WeaponM3.c b/Source/Shared/WeaponM3.c index a907ced4..e99f7d14 100644 --- a/Source/Shared/WeaponM3.c +++ b/Source/Shared/WeaponM3.c @@ -63,9 +63,9 @@ enum { void WeaponM3_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/m3_pump.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_M3_DRAW ); + Sound_Delayed( "weapons/m3_pump.wav", 1.0, 0.5 ); #endif } @@ -114,6 +114,7 @@ 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 } @@ -138,10 +139,9 @@ void WeaponM3_Reload( void ) { if ( iWeaponMode_M3 == TRUE ) { View_PlayAnimation( ANIM_M3_RELOAD_START ); - print( "START!!!\n" ); } else { View_PlayAnimation( ANIM_M3_RELOAD_END ); - print( "ENDE!!!\n" ); + Sound_Delayed( "weapons/m3_pump.wav", 1.0, 0.5 ); } #endif } diff --git a/Source/Shared/WeaponM4A1.c b/Source/Shared/WeaponM4A1.c index 8f5f6fdd..8225e5aa 100644 --- a/Source/Shared/WeaponM4A1.c +++ b/Source/Shared/WeaponM4A1.c @@ -122,7 +122,7 @@ void WeaponM4A1_Secondary( void ) { #ifdef SSQC // Just switch the modes quickly self.iMode_M4A1 = 1 - self.iMode_M4A1; - self.fAttackFinished = time + 3.0; + self.fAttackFinished = time + 2; // Tell the client that we switched modes, too Client_SendEvent( self, EV_WEAPON_SECONDARYATTACK ); diff --git a/Source/Shared/WeaponMP5.c b/Source/Shared/WeaponMP5.c index 5d0f40e9..de65bc78 100644 --- a/Source/Shared/WeaponMP5.c +++ b/Source/Shared/WeaponMP5.c @@ -56,9 +56,9 @@ enum { void WeaponMP5_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/mp5_slideback.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_MP5_DRAW ); + Sound_Delayed( "weapons/mp5_slideback.wav", 1.0, 0.5 ); #endif } @@ -90,5 +90,8 @@ 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 } diff --git a/Source/Shared/WeaponMac10.c b/Source/Shared/WeaponMac10.c index fc1f6af9..8ac96da3 100644 --- a/Source/Shared/WeaponMac10.c +++ b/Source/Shared/WeaponMac10.c @@ -56,7 +56,6 @@ enum { void WeaponMAC10_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/mac10_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_MAC10_DRAW ); #endif @@ -87,5 +86,9 @@ 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 } diff --git a/Source/Shared/WeaponP228.c b/Source/Shared/WeaponP228.c index 8f7eab4d..b6632c0f 100644 --- a/Source/Shared/WeaponP228.c +++ b/Source/Shared/WeaponP228.c @@ -57,9 +57,9 @@ enum { void WeaponP228_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/p228_slidepull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_P228_DRAW ); + Sound_Delayed( "weapons/p228_slidepull.wav", 1.0, 0.5 ); #endif } @@ -94,5 +94,9 @@ 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 } diff --git a/Source/Shared/WeaponP90.c b/Source/Shared/WeaponP90.c index 388dfbae..ca427cd2 100644 --- a/Source/Shared/WeaponP90.c +++ b/Source/Shared/WeaponP90.c @@ -56,9 +56,9 @@ enum { void WeaponP90_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/p90_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_P90_DRAW ); + Sound_Delayed( "weapons/p90_boltpull.wav", 1.0, 0.5 ); #endif } @@ -87,5 +87,10 @@ 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 } diff --git a/Source/Shared/WeaponPara.c b/Source/Shared/WeaponPara.c index 3f3b64be..9fc0ddb0 100644 --- a/Source/Shared/WeaponPara.c +++ b/Source/Shared/WeaponPara.c @@ -46,17 +46,15 @@ weaponinfo_t wptPARA = { // Anim Table enum { ANIM_PARA_IDLE, - ANIM_PARA_RELOAD, - ANIM_PARA_DRAW, ANIM_PARA_SHOOT1, ANIM_PARA_SHOOT2, - ANIM_PARA_SHOOT3 + ANIM_PARA_RELOAD, + ANIM_PARA_DRAW }; void WeaponPARA_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/m249_chain.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_PARA_DRAW ); #endif @@ -72,13 +70,10 @@ void WeaponPARA_PrimaryFire( void ) { } } #else - int iRand = ceil( random() * 3 ); - if ( iRand == 1 ) { + if ( random() <= 0.5 ) { View_PlayAnimation( ANIM_PARA_SHOOT1 ); - } else if ( iRand == 2 ) { - View_PlayAnimation( ANIM_PARA_SHOOT2 ); } else { - View_PlayAnimation( ANIM_PARA_SHOOT3 ); + View_PlayAnimation( ANIM_PARA_SHOOT2 ); } #endif } @@ -90,5 +85,12 @@ 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 } diff --git a/Source/Shared/WeaponSG550.c b/Source/Shared/WeaponSG550.c index 6d698566..2680d0b5 100644 --- a/Source/Shared/WeaponSG550.c +++ b/Source/Shared/WeaponSG550.c @@ -55,7 +55,6 @@ enum { void WeaponSG550_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/sg550_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_SG550_DRAW ); #endif @@ -83,5 +82,8 @@ 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 } diff --git a/Source/Shared/WeaponSG552.c b/Source/Shared/WeaponSG552.c index a7fbaebf..b2678286 100644 --- a/Source/Shared/WeaponSG552.c +++ b/Source/Shared/WeaponSG552.c @@ -56,9 +56,9 @@ enum { void WeaponSG552_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/sg552_boltpull.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_SG552_DRAW ); + Sound_Delayed( "weapons/sg552_boltpull.wav", 1.0, 0.5 ); #endif } @@ -90,5 +90,8 @@ void WeaponSG552_Reload( void ) { } #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 } diff --git a/Source/Shared/WeaponScout.c b/Source/Shared/WeaponScout.c index 56bb535e..c8f3a8a7 100644 --- a/Source/Shared/WeaponScout.c +++ b/Source/Shared/WeaponScout.c @@ -55,7 +55,6 @@ enum { void WeaponSCOUT_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/scout_bolt.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_SCOUT_DRAW ); #endif @@ -73,6 +72,8 @@ void WeaponSCOUT_PrimaryFire( void ) { } else { View_PlayAnimation( ANIM_SCOUT_SHOOT2 ); } + + Sound_Delayed( "weapons/scout_bolt.wav", 1.0, 0.5 ); #endif } @@ -83,5 +84,9 @@ 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 } diff --git a/Source/Shared/WeaponTMP.c b/Source/Shared/WeaponTMP.c index b04b8636..328dfac6 100644 --- a/Source/Shared/WeaponTMP.c +++ b/Source/Shared/WeaponTMP.c @@ -89,5 +89,8 @@ 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 } diff --git a/Source/Shared/WeaponUMP45.c b/Source/Shared/WeaponUMP45.c index 8373639e..d9300bcf 100644 --- a/Source/Shared/WeaponUMP45.c +++ b/Source/Shared/WeaponUMP45.c @@ -56,7 +56,7 @@ enum { void WeaponUMP45_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/ump45_boltslap.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? + //sound( self, CHAN_WEAPON, "weapons/ump45_boltslap.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_UMP45_DRAW ); #endif @@ -87,5 +87,8 @@ 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 } diff --git a/Source/Shared/WeaponXM1014.c b/Source/Shared/WeaponXM1014.c index 48cfbfaf..df9495ff 100644 --- a/Source/Shared/WeaponXM1014.c +++ b/Source/Shared/WeaponXM1014.c @@ -63,7 +63,6 @@ enum { void WeaponXM1014_Draw( void ) { #ifdef SSQC OpenCSGunBase_Draw(); - sound( self, CHAN_WEAPON, "weapons/m3_pump.wav", 1, ATTN_IDLE ); // TODO: Move to the client...? #else View_PlayAnimation( ANIM_XM1014_DRAW ); #endif @@ -114,6 +113,7 @@ 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 }