mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-07 21:59:49 -05:00
Melee weapons: add proper melee swing sound
This commit is contained in:
parent
32c4638caa
commit
145ad352cb
@ -275,6 +275,7 @@
|
||||
|
||||
## Weapons
|
||||
* Switch to melee weapon by pressing the Melee Weapon button (same button as Time Bomb and Maxis Drone)
|
||||
* Added proper melee swing sound to all melee weapons
|
||||
* Fixed world model position of certain melee weapons
|
||||
* Grenades: improved projectile upward speed
|
||||
* Grenades: can no longer be thrown faster than intended by throwing a grenade right after throwing one
|
||||
|
@ -4,6 +4,7 @@
|
||||
main()
|
||||
{
|
||||
replaceFunc(clientscripts\mp\zombies\_zm::init_wallbuy_fx, scripts\zm\replaced\_zm::init_wallbuy_fx);
|
||||
replaceFunc(clientscripts\mp\zombies\_zm_audio::sndmeleeswipe, scripts\zm\replaced\_zm_audio::sndmeleeswipe);
|
||||
replaceFunc(clientscripts\mp\zombies\_zm_weapons::init, scripts\zm\replaced\_zm_weapons::init);
|
||||
|
||||
powerup_changes();
|
||||
|
@ -376,6 +376,7 @@ on_player_connect()
|
||||
player thread on_player_fake_revive();
|
||||
|
||||
player thread grenade_fire_watcher();
|
||||
player thread sndmeleewpnsound();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1901,6 +1902,121 @@ temp_disable_offhand_weapons()
|
||||
}
|
||||
}
|
||||
|
||||
sndmeleewpnsound()
|
||||
{
|
||||
self endon("disconnect");
|
||||
level endon("end_game");
|
||||
|
||||
while (1)
|
||||
{
|
||||
while (!self ismeleeing())
|
||||
{
|
||||
wait 0.05;
|
||||
}
|
||||
|
||||
current_melee_weapon = self get_player_melee_weapon();
|
||||
current_weapon = self getcurrentweapon();
|
||||
|
||||
alias = "zmb_melee_whoosh_npc";
|
||||
|
||||
if (is_true(self.is_player_zombie))
|
||||
{
|
||||
alias = "zmb_melee_whoosh_zmb_npc";
|
||||
}
|
||||
else if (issubstr(current_weapon, "shield_zm"))
|
||||
{
|
||||
alias = "fly_riotshield_zm_swing";
|
||||
}
|
||||
else if (current_melee_weapon == "bowie_knife_zm")
|
||||
{
|
||||
alias = "zmb_bowie_swing";
|
||||
}
|
||||
else if (current_melee_weapon == "tazer_knuckles_zm")
|
||||
{
|
||||
alias = "wpn_tazer_whoosh_npc";
|
||||
}
|
||||
else if (current_melee_weapon == "spoon_zm_alcatraz")
|
||||
{
|
||||
alias = "zmb_spoon_swing";
|
||||
}
|
||||
else if (current_melee_weapon == "spork_zm_alcatraz")
|
||||
{
|
||||
alias = "zmb_spork_swing";
|
||||
}
|
||||
else if (current_melee_weapon == "one_inch_punch_zm")
|
||||
{
|
||||
alias = "wpn_one_inch_punch_npc";
|
||||
}
|
||||
else if (current_melee_weapon == "one_inch_punch_upgraded_zm")
|
||||
{
|
||||
alias = "wpn_one_inch_punch_npc";
|
||||
}
|
||||
else if (current_melee_weapon == "one_inch_punch_fire_zm")
|
||||
{
|
||||
alias = "wpn_one_inch_punch_fire_npc";
|
||||
}
|
||||
else if (current_melee_weapon == "one_inch_punch_air_zm")
|
||||
{
|
||||
alias = "wpn_one_inch_punch_air_npc";
|
||||
}
|
||||
else if (current_melee_weapon == "one_inch_punch_ice_zm")
|
||||
{
|
||||
alias = "wpn_one_inch_punch_ice_npc";
|
||||
}
|
||||
else if (current_melee_weapon == "one_inch_punch_lightning_zm")
|
||||
{
|
||||
alias = "wpn_one_inch_punch_lightning_npc";
|
||||
}
|
||||
else if (sndmeleewpn_isstaff(current_melee_weapon))
|
||||
{
|
||||
alias = "zmb_melee_staff_upgraded_npc";
|
||||
}
|
||||
|
||||
if (maps\mp\zombies\_zm_audio::sndisnetworksafe())
|
||||
{
|
||||
self play_sound_to_nearby_players(alias);
|
||||
}
|
||||
|
||||
while (self ismeleeing())
|
||||
{
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
play_sound_to_nearby_players(alias, range = 500)
|
||||
{
|
||||
players = get_players();
|
||||
|
||||
foreach (player in players)
|
||||
{
|
||||
if (player != self && distancesquared(player.origin, self.origin) <= range * range)
|
||||
{
|
||||
self playsoundtoplayer(alias, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sndmeleewpn_isstaff(weapon)
|
||||
{
|
||||
switch (weapon)
|
||||
{
|
||||
case "staff_melee_zm":
|
||||
case "staff_air_melee_zm":
|
||||
case "staff_fire_melee_zm":
|
||||
case "staff_water_melee_zm":
|
||||
case "staff_lightning_melee_zm":
|
||||
|
||||
isstaff = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
isstaff = 0;
|
||||
}
|
||||
|
||||
return isstaff;
|
||||
}
|
||||
|
||||
buildbuildables()
|
||||
{
|
||||
wait 1; // need a wait or else some buildables dont build
|
||||
|
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))
|
||||
@ -129,3 +110,8 @@ tomb_can_track_ammo_custom(weap)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
sndmeleewpnsound()
|
||||
{
|
||||
// removed - added to all maps in _zm_reimagined
|
||||
}
|
@ -5,8 +5,8 @@
|
||||
|
||||
main()
|
||||
{
|
||||
replaceFunc(maps\mp\zm_tomb::sndmeleewpn_isstaff, scripts\zm\replaced\zm_tomb::sndmeleewpn_isstaff);
|
||||
replaceFunc(maps\mp\zm_tomb::tomb_can_track_ammo_custom, scripts\zm\replaced\zm_tomb::tomb_can_track_ammo_custom);
|
||||
replaceFunc(maps\mp\zm_tomb::sndmeleewpnsound, scripts\zm\replaced\zm_tomb::sndmeleewpnsound);
|
||||
replaceFunc(maps\mp\zm_tomb_main_quest::main_quest_init, scripts\zm\replaced\zm_tomb_main_quest::main_quest_init);
|
||||
replaceFunc(maps\mp\zm_tomb_main_quest::place_staff_in_charger, scripts\zm\replaced\zm_tomb_main_quest::place_staff_in_charger);
|
||||
replaceFunc(maps\mp\zm_tomb_main_quest::watch_for_player_pickup_staff, scripts\zm\replaced\zm_tomb_main_quest::watch_for_player_pickup_staff);
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -709,6 +709,12 @@ wpn_slipgun_flux_last_l_npc_pap,raw\sound\wpn\pap\pap_flux_left.LN65.pc.snd,,,wp
|
||||
wpn_slipgun_flux_last_l_plr_pap,raw\sound\wpn\pap\pap_flux_left.LN65.pc.snd,,,wpn_slipgun_flux_last_r_plr_pap,grp_weapon,3685,3685,,25,900,900,default,default,allon,allon,8,priority,4,priority,32129,33416,,85,90,63,-1,,loaded,nonlooping,variant,-1,0,10386,,snp_wpn_3p,3d,0,0,0,0,63,,no,no,left_shot,4000,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_fx,
|
||||
wpn_slipgun_flux_last_r_npc_pap,raw\sound\wpn\pap\pap_flux_right.LN65.pc.snd,,,wpn_slipgun_fire_last_npc,grp_weapon,3685,3685,,25,900,900,default,default,allon,allon,8,priority,4,priority,32129,33416,,85,90,63,-1,,loaded,nonlooping,variant,-1,0,10386,,snp_wpn_3p,3d,0,0,0,0,63,,no,no,right_shot,4000,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_fx,
|
||||
wpn_slipgun_flux_last_r_plr_pap,raw\sound\wpn\pap\pap_flux_right.LN65.pc.snd,,,wpn_slipgun_fire_last_plr,grp_weapon,3685,3685,,25,900,900,default,default,allon,allon,8,priority,4,priority,32129,33416,,85,90,63,-1,,loaded,nonlooping,variant,-1,0,10386,,snp_wpn_3p,3d,0,0,0,0,63,,no,no,right_shot,4000,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_fx,
|
||||
zmb_melee_whoosh_npc,raw\sound\wpn\melee\knife\knife_new\swing\swings\swing_00.LN50.pc.snd,,,,grp_hdrfx,16461,20723,,150,500,500,default,default,allon,allon,4,priority,8,oldest,31143,32767,,40,90,63,-1,,loaded,nonlooping,volume,-1,0,20,,snp_igc,3d,0,25,75,20723,63,,no,yes,none,0,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_hdrfx,
|
||||
zmb_melee_whoosh_npc,raw\sound\wpn\melee\knife\knife_new\swing\swings\swing_01.LN50.pc.snd,,,,grp_hdrfx,16461,20723,,150,500,500,default,default,allon,allon,4,priority,8,oldest,31143,32767,,40,90,63,-1,,loaded,nonlooping,volume,-1,0,20,,snp_igc,3d,0,25,75,20723,63,,no,yes,none,0,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_hdrfx,
|
||||
zmb_melee_whoosh_npc,raw\sound\wpn\melee\knife\knife_new\swing\swings\swing_02.LN50.pc.snd,,,,grp_hdrfx,16461,20723,,150,500,500,default,default,allon,allon,4,priority,8,oldest,31143,32767,,40,90,63,-1,,loaded,nonlooping,volume,-1,0,20,,snp_igc,3d,0,25,75,20723,63,,no,yes,none,0,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_hdrfx,
|
||||
zmb_melee_whoosh_npc,raw\sound\wpn\melee\knife\knife_new\swing\swings\swing_03.LN50.pc.snd,,,,grp_hdrfx,16461,20723,,150,500,500,default,default,allon,allon,4,priority,8,oldest,31143,32767,,40,90,63,-1,,loaded,nonlooping,volume,-1,0,20,,snp_igc,3d,0,25,75,20723,63,,no,yes,none,0,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_hdrfx,
|
||||
zmb_melee_whoosh_npc,raw\sound\wpn\melee\knife\knife_new\swing\swings\swing_04.LN50.pc.snd,,,,grp_hdrfx,16461,20723,,150,500,500,default,default,allon,allon,4,priority,8,oldest,31143,32767,,40,90,63,-1,,loaded,nonlooping,volume,-1,0,20,,snp_igc,3d,0,25,75,20723,63,,no,yes,none,0,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_hdrfx,
|
||||
zmb_melee_whoosh_npc,raw\sound\wpn\melee\knife\knife_new\swing\swings\swing_05.LN50.pc.snd,,,,grp_hdrfx,16461,20723,,150,500,500,default,default,allon,allon,4,priority,8,oldest,31143,32767,,40,90,63,-1,,loaded,nonlooping,volume,-1,0,20,,snp_igc,3d,0,25,75,20723,63,,no,yes,none,0,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_hdrfx,
|
||||
wpn_com_knife_cloth_plr,raw\sound\mpl\riot_shield\melee_swing\new\cloth\riot_shield_swing_cloth_00.LN65.pc.snd,,,wpn_com_knife_swish,grp_hdrfx,9257,13075,,0,5000,5000,default,default,allon,allon,8,priority,8,oldest,31143,33727,,90,90,63,-1,,loaded,nonlooping,volume,-1,0,20,,snp_hdrfx,2d,29273,0,0,0,63,,yes,yes,none,0,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_hdrfx,
|
||||
wpn_com_knife_cloth_plr,raw\sound\mpl\riot_shield\melee_swing\new\cloth\riot_shield_swing_cloth_01.LN65.pc.snd,,,wpn_com_knife_swish,grp_hdrfx,9257,13075,,0,5000,5000,default,default,allon,allon,8,priority,8,oldest,31143,33727,,90,90,63,-1,,loaded,nonlooping,volume,-1,0,20,,snp_hdrfx,2d,29273,0,0,0,63,,yes,yes,none,0,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_hdrfx,
|
||||
wpn_com_knife_swish,raw\sound\wpn\melee\knife\held_knife\fly_knife_swish.LN65.pc.snd,,,,grp_hdrfx,9257,13075,,0,5000,5000,default,default,allon,allon,8,priority,8,oldest,31143,33727,,90,90,63,-1,,loaded,nonlooping,volume,-1,20,20,,snp_hdrfx,2d,29273,0,0,0,63,,yes,yes,none,0,,,,no,0,0,0,,yes,no,0,0,,yes,no,bus_hdrfx,
|
||||
|
|
Loading…
x
Reference in New Issue
Block a user