diff --git a/source/client/defs/custom.qc b/source/client/defs/custom.qc index 69e9e0a..8f38fe6 100644 --- a/source/client/defs/custom.qc +++ b/source/client/defs/custom.qc @@ -210,22 +210,11 @@ int stopwatch_round_hr; int stopwatch_round_isactive; float stopwatch_round_starttime; -//controller buttons - -/* - reference: - 0: A - 1: B - 2: X - 3: Y - 4: DPAD UP - 5: DPAD DOWN - 6: DPAD LEFT - 7: DPAD RIGHT - -*/ -float GPActive[32]; -float GPButtonHeldBeginTime[24]; +// +// GamePad Input Variables +// +float GPButtonHeldBeginTime[24]; // Tracks time button down event is called, to track holding down for different actions. +float last_input_deviceid; // The Device ID of the input hardware that last called CSQC_InputEvent, to target it directly. string build_datetime; #define VERSION_STRING "v1.0" diff --git a/source/client/main.qc b/source/client/main.qc index 7d7c9b9..738b348 100644 --- a/source/client/main.qc +++ b/source/client/main.qc @@ -923,6 +923,12 @@ void(float button, string key) setToBind = noref float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent = { + + if (last_input_deviceid != devid) + print(sprintf("device id swapped to %d\n", last_input_deviceid)); + + last_input_deviceid = devid; + if (evtype == IE_KEYDOWN) { switch (scanx) { case K_GP_A: @@ -1068,45 +1074,12 @@ noref float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent return TRUE; } } - - // Controller Menu Navigation - if (scanx == K_JOY2) { - GPActive[0] = TRUE; - } - - if (scanx == K_JOY4) { - GPActive[1] = TRUE; - } - - if (scanx == K_JOY1) { - GPActive[2] = TRUE; - } - } Input_Movecheck(scanx, 1); - return FALSE; case IE_KEYUP: - - // Controller Menu Navigation - if(in_menu != MENU_NONE) { - if (scanx == K_JOY2) { - GPActive[0] = FALSE; - } - - if (scanx == K_JOY4) { - GPActive[1] = FALSE; - } - - if (scanx == K_JOY1) { - GPActive[2] = FALSE; - } - } - - Input_Movecheck(scanx, 0); - return FALSE; case IE_MOUSEDELTA: return FALSE; @@ -1192,6 +1165,9 @@ noref void() CSQC_Parse_Event = screenflash_worktime = 0; screenflash_starttime = time; break; + case CSQC_EVENT_RUMBLE: + gp_rumble(last_input_deviceid, readshort(), readshort(), readshort()); + break; case EVENT_WEAPONRECOIL: local vector rec; rec_x = readcoord()/5; diff --git a/source/client/menu.qc b/source/client/menu.qc index 82f6444..1843381 100644 --- a/source/client/menu.qc +++ b/source/client/menu.qc @@ -1089,15 +1089,6 @@ void(float index) Update_Button = } }; -float xd; -void() Controller_UpdateButton = -{ - /*if (GPActive[0]) { - - }*/ - drawstring([0.025*g_width, 0.375*g_height, 0], ftos(GPActive[2]), [g_height * 0.020, g_height * 0.020, 1], [0.8,0.8,0.8], 1, 0); -} - float button_timer; void(float index, float type) Button_Click = { @@ -2188,9 +2179,4 @@ void() Draw_Menu = { Update_Button(i); } - - // TODO - Controller Support - /*if (cvar("in_xinput")) { - Controller_UpdateButton(); - }*/ }; diff --git a/source/server/ai/zombie_core.qc b/source/server/ai/zombie_core.qc index d77c129..83c063e 100644 --- a/source/server/ai/zombie_core.qc +++ b/source/server/ai/zombie_core.qc @@ -637,6 +637,9 @@ void() zombie_attack2 = DamageHandler (self.enemy, self, 40, DMG_TYPE_ZOMBIESWIPE); else DamageHandler (self.enemy, self, 50, DMG_TYPE_ZOMBIESWIPE); + + // Getting hit by Zombies triggers a GamePad rumble. + nzp_rumble(self.enemy, 1000, 1200, 75); } } else return; diff --git a/source/server/clientfuncs.qc b/source/server/clientfuncs.qc index 09ad3a9..f3e84a5 100644 --- a/source/server/clientfuncs.qc +++ b/source/server/clientfuncs.qc @@ -265,6 +265,22 @@ void(entity target, float color, float duration, float type) nzp_screenflash = } }; +// +// nzp_rumble(target, low_frequency, high_frequency, duration) +// FTE equivalent of the nzp_rumble builtin. +// +void(entity target, float low_frequency, float high_frequency, float duration) nzp_rumble = +{ + WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); + WriteByte(MSG_MULTICAST, CSQC_EVENT_RUMBLE); + WriteShort(MSG_MULTICAST, low_frequency); + WriteShort(MSG_MULTICAST, high_frequency); + WriteShort(MSG_MULTICAST, duration); + + msg_entity = target; + multicast('0 0 0', MULTICAST_ONE); +}; + #endif // FTE void(float count) UpdatePlayerCount = { diff --git a/source/server/damage.qc b/source/server/damage.qc index 4525e00..7958699 100644 --- a/source/server/damage.qc +++ b/source/server/damage.qc @@ -474,6 +474,9 @@ void(entity inflictor, entity attacker, float damage2, float mindamage, float ra while(distance_y > 10 || distance_y < -10) { distance_y /= 2; } + + // Give a heavy rumble for feedback of being in explosion vicinity. + nzp_rumble(ent, 1400, 2000, 200); // apply ent.punchangle_x = distance_x; diff --git a/source/server/defs/standard.qc b/source/server/defs/standard.qc index c286739..ef451f6 100644 --- a/source/server/defs/standard.qc +++ b/source/server/defs/standard.qc @@ -276,6 +276,7 @@ void (entity who, string name) void (entity who, float version) nzp_setdoubletapver = #506; void (entity who, float color, float duration, float type) nzp_screenflash = #507; void (entity who, float state) nzp_lockviewmodel = #508; +void (entity who, float low_frequency, float high_frequency, float duration) nzp_rumble = #509; // // constants diff --git a/source/server/player/player_core.qc b/source/server/player/player_core.qc index b557e1d..444e303 100644 --- a/source/server/player/player_core.qc +++ b/source/server/player/player_core.qc @@ -114,7 +114,7 @@ void() PAnim_EnterDive3 =[ 4, PAnim_EnterDive4 ] {self.frame = 206;} void() PAnim_EnterDive4 =[ 5, SUB_Null ] {self.frame = 207;} // Flop from Dive -void() PAnim_Flop =[ 1, PAnim_Flop1 ] {self.frame = 208; self.tp_anim_time = time + 1;} +void() PAnim_Flop =[ 1, PAnim_Flop1 ] {self.frame = 208; self.tp_anim_time = time + 1; nzp_rumble(self, 1000, 1200, 75);} void() PAnim_Flop1 =[ 2, PAnim_Flop2 ] {self.frame = 209;} void() PAnim_Flop2 =[ 3, PAnim_Flop3 ] {self.frame = 210;} void() PAnim_Flop3 =[ 4, SUB_Null ] {self.frame = 211;} diff --git a/source/server/weapons/bouncing_betty.qc b/source/server/weapons/bouncing_betty.qc index 155617d..e8d2ccc 100644 --- a/source/server/weapons/bouncing_betty.qc +++ b/source/server/weapons/bouncing_betty.qc @@ -124,6 +124,8 @@ void() Betty_Drop = self.animend = W_PlayTakeOut; self.callfuncat = 0; self.isBuying = false; + + nzp_rumble(self, 1000, 1200, 75); } // diff --git a/source/server/weapons/frames_core.qc b/source/server/weapons/frames_core.qc index da0005f..3667295 100644 --- a/source/server/weapons/frames_core.qc +++ b/source/server/weapons/frames_core.qc @@ -88,7 +88,11 @@ void () W2_Frame_Update = } } } - PlayWeaponSound(self.weapon, self.weapon2_anim_type, FALSE, self.weapon2frame); + + if (PlayWeaponSound(self.weapon, self.weapon2_anim_type, FALSE, self.weapon2frame)) { + // Slight rumble because we triggered a weapon sound + nzp_rumble(self, 1000, 1200, 75); + } return; } else @@ -151,11 +155,17 @@ void () W_Frame_Update = } } } - PlayWeaponSound(self.weapon, self.weapon_anim_type, FALSE, self.weaponframe); + + if (PlayWeaponSound(self.weapon, self.weapon_anim_type, FALSE, self.weaponframe)) { + // Slight rumble because we triggered a weapon sound + nzp_rumble(self, 1000, 1200, 75); + } // FIXME: We need a way to play sounds at specific frames for any viewmodel, not just weapons - if (self.weaponmodel == "models/weapons/grenade/v_betty.mdl" && self.weaponframe == 9) + if (self.weaponmodel == "models/weapons/grenade/v_betty.mdl" && self.weaponframe == 9) { sound (self, CHAN_WEAPON, "sounds/weapons/grenade/prime.wav", 1, ATTN_NORM); + nzp_rumble(self, 1000, 1200, 75); + } return; } else diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index d38f9d0..4d5b0c7 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -100,6 +100,9 @@ void() ReturnWeaponModel = W_SprintStart(); W_ShowCrosshair(self); + + // Slight rumble whenever we pull our weapon out again. + nzp_rumble(self, 1000, 1200, 75); } void() W_PlayTakeOut = @@ -1113,6 +1116,9 @@ void(float side) W_Fire = startframe = endframe = GetFrame(self.weapon, FIRE_HOLD); } + // Rumble the GamePad a fixed amount when we fire a weapon. + nzp_rumble(self, 1400, 2000, 200); + // Increment the amount of shots fired while downed if (self.downed == true) self.teslacount++; @@ -1442,6 +1448,7 @@ void() checkHold = sound (self, CHAN_WEAPON, "sounds/weapons/grenade/throw.wav", 1, ATTN_NORM); self.reload_delay2 = self.fire_delay2 = self.reload_delay = self.fire_delay = time + 0.4; self.throw_delay = time + 0.9; + nzp_rumble(self, 1000, 1200, 75); } else { @@ -1476,6 +1483,8 @@ void() W_Grenade = self.primary_grenades -= 1; self.reload_delay2 = self.fire_delay2 = self.throw_delay = self.reload_delay = self.fire_delay = time + 6; self.grenade_delay = time + 5; + + nzp_rumble(self, 1000, 1200, 75); } void(float wepnum) CheckButton = { diff --git a/source/shared/shared_defs.qc b/source/shared/shared_defs.qc index f9309a6..3df9276 100644 --- a/source/shared/shared_defs.qc +++ b/source/shared/shared_defs.qc @@ -77,20 +77,24 @@ // screenflash_duration // screenflash_type -#define EVENT_UPDATE 19 -#define EVENT_BLACKOUT 20 -#define EVENT_WORLDDATA 21 -#define EVENT_PLAYERUPDATE 22 -#define EVENT_REVIVEON 23 -#define EVENT_REVIVEOFF 24 -#define EVENT_REVIVECHANGE 25 -#define EVENT_WEAPONRECOIL 26 -#define EVENT_GRENADEPULSE 27 -#define EVENT_BETTYPROMPT 28 -#define EVENT_CHATMESSAGE 29 -#define EVENT_DOUBLETAPUPDATE 30 -#define EVENT_ENDGAME 31 -#define EVENT_MAPTYPE 32 +#define CSQC_EVENT_RUMBLE 19 // low_frequency + // high_frequency + // duration + +#define EVENT_UPDATE 20 +#define EVENT_BLACKOUT 21 +#define EVENT_WORLDDATA 22 +#define EVENT_PLAYERUPDATE 23 +#define EVENT_REVIVEON 24 +#define EVENT_REVIVEOFF 25 +#define EVENT_REVIVECHANGE 26 +#define EVENT_WEAPONRECOIL 27 +#define EVENT_GRENADEPULSE 28 +#define EVENT_BETTYPROMPT 29 +#define EVENT_CHATMESSAGE 30 +#define EVENT_DOUBLETAPUPDATE 31 +#define EVENT_ENDGAME 32 +#define EVENT_MAPTYPE 33 // // Types of screen-flashes, global. diff --git a/source/shared/weapon_stats.qc b/source/shared/weapon_stats.qc index 69b9b41..0ab1da3 100644 --- a/source/shared/weapon_stats.qc +++ b/source/shared/weapon_stats.qc @@ -3090,7 +3090,7 @@ float(float wep) EqualPapWeapon = } } -void (float wep, float anim_style, float dualwep, float curweaponframe) PlayWeaponSound = +float(float wep, float anim_style, float dualwep, float curweaponframe) PlayWeaponSound = { if (anim_style == KNIFE) { if (curweaponframe == 6) { @@ -3106,22 +3106,30 @@ void (float wep, float anim_style, float dualwep, float curweaponframe) PlayWeap { if (wep == W_KAR || wep == W_ARMAGEDDON || wep == W_KAR_SCOPE || wep == W_HEADCRACKER || wep == W_SPRING || wep == W_PULVERIZER) { - if (curweaponframe == 6) + if (curweaponframe == 6) { sound (self ,5, "sounds/weapons/boltaction/boltup.wav", 1, ATTN_NORM); - else if (curweaponframe == 7) + return true; + } + else if (curweaponframe == 7) { sound (self ,5, "sounds/weapons/boltaction/boltback.wav", 1, ATTN_NORM); - else if (curweaponframe == 9) + return true; + } else if (curweaponframe == 9) { sound (self ,5, "sounds/weapons/boltaction/boltforward.wav", 1, ATTN_NORM); - else if (curweaponframe == 10) + return true; + } else if (curweaponframe == 10) { sound (self ,5, "sounds/weapons/boltaction/boltdown.wav", 1, ATTN_NORM); + return true; + } } else if (wep == W_TRENCH || wep == W_GUT) { - if (curweaponframe == 7) + if (curweaponframe == 7) { sound (self ,5, "sounds/weapons/shotgun/pump.wav", 1, ATTN_NORM); + return true; + } } } else if (anim_style != RELOAD) { - return; + return false; } @@ -3129,306 +3137,411 @@ void (float wep, float anim_style, float dualwep, float curweaponframe) PlayWeap case W_COLT: if (curweaponframe == 5) { sound (self ,5, "sounds/weapons/colt/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 12) { sound (self ,5, "sounds/weapons/colt/magin.wav", 1, ATTN_NORM); + return true; } else if(curweaponframe == 18) { sound (self ,5, "sounds/weapons/colt/slide.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_KAR: case W_ARMAGEDDON: case W_SPRING: case W_PULVERIZER: if (curweaponframe == 15) { sound (self ,5, "sounds/weapons/boltaction/boltup.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 16) { sound (self ,5, "sounds/weapons/boltaction/boltback.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 20) { sound (self ,5, "sounds/weapons/boltaction/clipin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 25) { sound (self ,5, "sounds/weapons/boltaction/boltforward.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 26) { sound (self ,5, "sounds/weapons/boltaction/clipoff.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 27) { sound (self ,5, "sounds/weapons/boltaction/boltdown.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_THOMPSON: case W_GIBS: if (curweaponframe == 6) { sound (self ,5, "sounds/weapons/thomp/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 12) { - sound (self ,5, "sounds/weapons/thomp/magin.wav", 1, ATTN_NORM);} - else if (curweaponframe == 19) { + sound (self ,5, "sounds/weapons/thomp/magin.wav", 1, ATTN_NORM); + return true; + } else if (curweaponframe == 19) { sound (self ,5, "sounds/weapons/thomp/boltback.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_357: case W_KILLU: if (curweaponframe == 5) { sound (self ,5, "sounds/weapons/357/open.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 9) { sound (self ,5, "sounds/weapons/357/out.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 15) { sound (self ,5, "sounds/weapons/357/in.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 20) { sound (self ,5, "sounds/weapons/357/close.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_BAR: case W_WIDOW: if (curweaponframe == 6 || curweaponframe == 31) { sound (self ,5, "sounds/weapons/bar/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 19 || curweaponframe == 29) { sound (self ,5, "sounds/weapons/bar/magin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 23) { sound (self ,5, "sounds/weapons/bar/maghit.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_BROWNING: case W_ACCELERATOR: if (curweaponframe == 6 || curweaponframe == 60) { sound (self ,5, "sounds/weapons/browning/boltback.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 16 || curweaponframe == 69) { sound (self ,5, "sounds/weapons/browning/topopen.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 21) { sound (self ,5, "sounds/weapons/browning/chainoff.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 27) { sound (self ,5, "sounds/weapons/browning/chainon.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 30) { sound (self ,5, "sounds/weapons/browning/chainplace.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 36) { sound (self ,5, "sounds/weapons/browning/topclose.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 41) { sound (self ,5, "sounds/weapons/browning/tophit.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 48) { sound (self ,5, "sounds/weapons/browning/boltforward.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_DB: case W_SAWNOFF: case W_BORE: if (curweaponframe == 6) { sound (self ,5, "sounds/weapons/shotgun/open.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 12) { sound (self ,5, "sounds/weapons/shotgun/out.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 20) { sound (self ,5, "sounds/weapons/shotgun/in.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 26) { sound (self ,5, "sounds/weapons/shotgun/close.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_SNUFF: if (curweaponframe == 15) { sound (self ,5, "sounds/weapons/shotgun/open.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 23) { sound (self ,5, "sounds/weapons/shotgun/out.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 33) { sound (self ,5, "sounds/weapons/shotgun/in.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 40) { sound (self ,5, "sounds/weapons/shotgun/close.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_FG: case W_IMPELLER: if (curweaponframe == 6) { sound (self ,5, "sounds/weapons/fg42/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 14) { sound (self ,5, "sounds/weapons/fg42/magin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 23) { sound (self ,5, "sounds/weapons/fg42/boltback.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 26) { sound (self ,5, "sounds/weapons/fg42/boltforward.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_GEWEHR: case W_COMPRESSOR: if (curweaponframe == 21) { sound (self ,5, "sounds/weapons/gewehr/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 32) { sound (self ,5, "sounds/weapons/gewehr/magin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 36) { sound (self ,5, "sounds/weapons/gewehr/maghit.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 45) { sound (self ,5, "sounds/weapons/gewehr/boltrelease.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_KAR_SCOPE: case W_HEADCRACKER: case W_SPRING: case W_PULVERIZER: if (curweaponframe == 15) { sound (self ,5, "sounds/weapons/boltaction/boltup.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 16) { sound (self ,5, "sounds/weapons/boltaction/boltback.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 20) { sound (self ,5, "sounds/weapons/boltaction/insert.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 25) { sound (self ,5, "sounds/weapons/boltaction/boltforward.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 27) { sound (self ,5, "sounds/weapons/boltaction/boltdown.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_M1: case W_M1000: if (curweaponframe == 5 || curweaponframe == 25) { sound (self ,5, "sounds/weapons/garand/clipout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 13) { sound (self ,5, "sounds/weapons/garand/clipin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 15) { sound (self ,5, "sounds/weapons/garand/boltrelease.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 24) { sound (self ,5, "sounds/weapons/garand/clippush.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_M1A1: case W_WIDDER: if (curweaponframe == 6) { sound (self ,5, "sounds/weapons/m1carbine/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 14) { sound (self ,5, "sounds/weapons/m1carbine/magin.wav", 1, ATTN_NORM); + return true; } else if(curweaponframe == 16) { sound (self ,5, "sounds/weapons/m1carbine/maghit.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 24) { sound (self ,5, "sounds/weapons/m1carbine/bolt.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_MP40: case W_AFTERBURNER: if (curweaponframe == 7) { sound (self ,5, "sounds/weapons/mp40/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 17) { sound (self ,5, "sounds/weapons/mp40/magin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 25) { sound (self ,5, "sounds/weapons/mp40/boltback.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_MP5K: case W_KOLLIDER: if (curweaponframe == 16) { sound (self ,5, "sounds/weapons/mp5k/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 31) { sound (self ,5, "sounds/weapons/mp5k/magin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 39) { sound (self ,5, "sounds/weapons/mp5k/slap.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_PANZER: case W_LONGINUS: if (curweaponframe == 12) { sound (self ,5, "sounds/weapons/panzer/move.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 16) { sound (self ,5, "sounds/weapons/panzer/insert.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_MG: case W_BARRACUDA: if (curweaponframe == 8) { sound (self ,5, "sounds/weapons/mg42/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 19) { sound (self ,5, "sounds/weapons/mg42/magin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 29) { sound (self ,5, "sounds/weapons/mg42/charge.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_PPSH: case W_REAPER: - if (curweaponframe == 8) { + if (curweaponframe == 8) { sound (self ,5, "sounds/weapons/ppsh/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 20) { sound (self ,5, "sounds/weapons/ppsh/magin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 22) { sound (self ,5, "sounds/weapons/ppsh/maghit.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 30) { sound (self ,5, "sounds/weapons/ppsh/boltback.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 33) { sound (self ,5, "sounds/weapons/ppsh/boltrelease.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_PTRS: case W_PENETRATOR: if (curweaponframe == 7) { sound (self ,5, "sounds/weapons/ptrs/open.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 13 || curweaponframe == 31) { sound (self ,5, "sounds/weapons/ptrs/magin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 21) { sound (self ,5, "sounds/weapons/ptrs/maghit.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 23) { sound (self ,5, "sounds/weapons/ptrs/close.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_RAY: case W_PORTER: if (curweaponframe == 10) { sound (self ,5, "sounds/weapons/raygun/open.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 19) { sound (self ,5, "sounds/weapons/raygun/out.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 33) { sound (self ,5, "sounds/weapons/raygun/in.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 41) { sound (self ,5, "sounds/weapons/raygun/close.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_STG: case W_SPATZ: if (curweaponframe == 15) { sound (self ,5, "sounds/weapons/stg/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 28) { sound (self ,5, "sounds/weapons/stg/magin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 37) { sound (self ,5, "sounds/weapons/stg/boltback.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 41) { sound (self ,5, "sounds/weapons/stg/boltrelease.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_TRENCH: case W_GUT: if (curweaponframe == 19) { sound (self ,5, "sounds/weapons/shotgun/insert.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_TYPE: case W_SAMURAI: if (curweaponframe == 6) { sound (self ,5, "sounds/weapons/type100/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 15) { sound (self ,5, "sounds/weapons/type100/magin.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe == 20) { sound (self ,5, "sounds/weapons/type100/boltpull.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_BIATCH: if (curweaponframe == 23) { sound (self ,5, "sounds/weapons/colt/magout.wav", 1, ATTN_NORM); + return true; } else if (curweaponframe ==30) { sound (self ,5, "sounds/weapons/colt/magin.wav", 1, ATTN_NORM); + return true; } else if(curweaponframe == 36) { sound (self ,5, "sounds/weapons/biatch/slideback.wav", 1, ATTN_NORM); + return true; } else if(curweaponframe == 42) { sound (self ,5, "sounds/weapons/biatch/sliderelease.wav", 1, ATTN_NORM); + return true; } - break; + return false; case W_TESLA: case W_DG3: - if (curweaponframe == 20) + if (curweaponframe == 20) { sound (self ,5, "sounds/weapons/tesla/switchoff.wav", 1, ATTN_NORM); - else if (curweaponframe == 25) + return true; + } else if (curweaponframe == 25) { sound (self ,5, "sounds/weapons/tesla/pulllever.wav", 1, ATTN_NORM); - else if (curweaponframe == 31) + return true; + } else if (curweaponframe == 31) { sound (self ,5, "sounds/weapons/tesla/glassbreak.wav", 1, ATTN_NORM); - else if (curweaponframe == 38) + return true; + } else if (curweaponframe == 38) { sound (self ,5, "sounds/weapons/tesla/clipin.wav", 1, ATTN_NORM); - else if (curweaponframe == 43) + return true; + } else if (curweaponframe == 43) { sound (self ,5, "sounds/weapons/tesla/clipoff.wav", 1, ATTN_NORM); - else if (curweaponframe == 51) + return true; + } else if (curweaponframe == 51) { sound (self ,5, "sounds/weapons/tesla/switchon.wav", 1, ATTN_NORM); - break; + return true; + } + return false; case W_BK: case W_KRAUS: - if (curweaponframe == 41) + if (curweaponframe == 41) { sound(self, 5, "sounds/weapons/ballknife/insert.wav", 1, ATTN_NORM); - break; + return true; + } + return false; + default: + return false; } + + return false; }