mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-10 23:27:57 -05:00
Melee weapons: add proper melee swing sound
This commit is contained in:
112
scripts/zm/replaced/_zm_audio.csc
Normal file
112
scripts/zm/replaced/_zm_audio.csc
Normal file
@ -0,0 +1,112 @@
|
||||
#include clientscripts\mp\_utility;
|
||||
#include clientscripts\mp\_ambientpackage;
|
||||
#include clientscripts\mp\zombies\_zm_utility;
|
||||
#include clientscripts\mp\_music;
|
||||
#include clientscripts\mp\_audio;
|
||||
|
||||
sndmeleeswipe(localclientnum, notifystring)
|
||||
{
|
||||
player = undefined;
|
||||
|
||||
while (!isdefined(player))
|
||||
{
|
||||
player = getnonpredictedlocalplayer(localclientnum);
|
||||
wait 0.05;
|
||||
}
|
||||
|
||||
player endon("disconnect");
|
||||
|
||||
for (;;)
|
||||
{
|
||||
player waittill(notifystring);
|
||||
currentweapon = getcurrentweapon(localclientnum);
|
||||
|
||||
alias = "zmb_melee_whoosh_plr";
|
||||
|
||||
if (is_true(player.is_player_zombie))
|
||||
{
|
||||
alias = "zmb_melee_whoosh_zmb_plr";
|
||||
}
|
||||
else if (issubstr(currentweapon, "shield_zm"))
|
||||
{
|
||||
alias = "fly_riotshield_zm_swing";
|
||||
}
|
||||
else if (has_weapon_or_held(localclientnum, "bowie_knife_zm"))
|
||||
{
|
||||
alias = "zmb_bowie_swing_plr";
|
||||
}
|
||||
else if (has_weapon_or_held(localclientnum, "tazer_knuckles_zm"))
|
||||
{
|
||||
alias = "wpn_tazer_whoosh_plr";
|
||||
}
|
||||
else if (has_weapon_or_held(localclientnum, "spoon_zm_alcatraz"))
|
||||
{
|
||||
alias = "zmb_spoon_swing_plr";
|
||||
}
|
||||
else if (has_weapon_or_held(localclientnum, "spork_zm_alcatraz"))
|
||||
{
|
||||
alias = "zmb_spork_swing_plr";
|
||||
}
|
||||
else if (has_weapon_or_held(localclientnum, "one_inch_punch_zm"))
|
||||
{
|
||||
alias = "wpn_one_inch_punch_plr";
|
||||
}
|
||||
else if (has_weapon_or_held(localclientnum, "one_inch_punch_upgraded_zm"))
|
||||
{
|
||||
alias = "wpn_one_inch_punch_plr";
|
||||
}
|
||||
else if (has_weapon_or_held(localclientnum, "one_inch_punch_air_zm"))
|
||||
{
|
||||
alias = "wpn_one_inch_punch_air_plr";
|
||||
}
|
||||
else if (has_weapon_or_held(localclientnum, "one_inch_punch_fire_zm"))
|
||||
{
|
||||
alias = "wpn_one_inch_punch_fire_plr";
|
||||
}
|
||||
else if (has_weapon_or_held(localclientnum, "one_inch_punch_ice_zm"))
|
||||
{
|
||||
alias = "wpn_one_inch_punch_ice_plr";
|
||||
}
|
||||
else if (has_weapon_or_held(localclientnum, "one_inch_punch_lightning_zm"))
|
||||
{
|
||||
alias = "wpn_one_inch_punch_lightning_plr";
|
||||
}
|
||||
else if (has_staff_melee(localclientnum))
|
||||
{
|
||||
alias = "zmb_melee_staff_upgraded_plr";
|
||||
}
|
||||
|
||||
playsound(0, alias, player.origin);
|
||||
}
|
||||
}
|
||||
|
||||
has_weapon_or_held(localclientnum, weapon)
|
||||
{
|
||||
return hasweapon(localclientnum, weapon) || hasweapon(localclientnum, "held_" + weapon);
|
||||
}
|
||||
|
||||
has_staff_melee(localclientnum)
|
||||
{
|
||||
if (hasweapon(localclientnum, "staff_melee_zm"))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (hasweapon(localclientnum, "staff_air_melee_zm"))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (hasweapon(localclientnum, "staff_fire_melee_zm"))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (hasweapon(localclientnum, "staff_water_melee_zm"))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (hasweapon(localclientnum, "staff_lightning_melee_zm"))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -59,25 +59,6 @@
|
||||
#include maps\mp\zombies\_zm_challenges;
|
||||
#include maps\mp\zombies\_zm_laststand;
|
||||
|
||||
sndmeleewpn_isstaff(weapon)
|
||||
{
|
||||
switch (weapon)
|
||||
{
|
||||
case "staff_water_melee_zm":
|
||||
case "staff_melee_zm":
|
||||
case "staff_lightning_melee_zm":
|
||||
case "staff_fire_melee_zm":
|
||||
case "staff_air_melee_zm":
|
||||
isstaff = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
isstaff = 0;
|
||||
}
|
||||
|
||||
return isstaff;
|
||||
}
|
||||
|
||||
tomb_can_track_ammo_custom(weap)
|
||||
{
|
||||
if (!isdefined(weap))
|
||||
@ -128,4 +109,9 @@ tomb_can_track_ammo_custom(weap)
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
sndmeleewpnsound()
|
||||
{
|
||||
// removed - added to all maps in _zm_reimagined
|
||||
}
|
Reference in New Issue
Block a user