mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-08 22:31:36 -05:00
Weapons: fix alt weapon switch when trading weapons
This commit is contained in:
parent
e5c169ef08
commit
b65a4578db
@ -283,6 +283,7 @@
|
|||||||
* Added proper melee swing sound to all melee weapons
|
* Added proper melee swing sound to all melee weapons
|
||||||
* Fixed world model position of certain melee weapons
|
* Fixed world model position of certain melee weapons
|
||||||
* Fixed projectile angles of certain grenades and projectile weapons
|
* Fixed projectile angles of certain grenades and projectile weapons
|
||||||
|
* Fixed alt weapons being switched from when trading weapons
|
||||||
* Grenades: improved projectile upward speed
|
* Grenades: improved projectile upward speed
|
||||||
* Grenades: can no longer be thrown faster than intended by throwing a grenade right after throwing one
|
* Grenades: can no longer be thrown faster than intended by throwing a grenade right after throwing one
|
||||||
* Grenades: changed damage scalar to 25 multiplied by round number (normally random number between 100 and 200 added by round number)
|
* Grenades: changed damage scalar to 25 multiplied by round number (normally random number between 100 and 200 added by round number)
|
||||||
|
@ -69,6 +69,9 @@ main()
|
|||||||
replaceFunc(maps\mp\zombies\_zm_weapons::createballisticknifewatcher_zm, scripts\zm\replaced\_zm_weapons::createballisticknifewatcher_zm);
|
replaceFunc(maps\mp\zombies\_zm_weapons::createballisticknifewatcher_zm, scripts\zm\replaced\_zm_weapons::createballisticknifewatcher_zm);
|
||||||
replaceFunc(maps\mp\zombies\_zm_weapons::weapon_spawn_think, scripts\zm\replaced\_zm_weapons::weapon_spawn_think);
|
replaceFunc(maps\mp\zombies\_zm_weapons::weapon_spawn_think, scripts\zm\replaced\_zm_weapons::weapon_spawn_think);
|
||||||
replaceFunc(maps\mp\zombies\_zm_weapons::weapon_set_first_time_hint, scripts\zm\replaced\_zm_weapons::weapon_set_first_time_hint);
|
replaceFunc(maps\mp\zombies\_zm_weapons::weapon_set_first_time_hint, scripts\zm\replaced\_zm_weapons::weapon_set_first_time_hint);
|
||||||
|
replaceFunc(maps\mp\zombies\_zm_weapons::get_player_weapondata, scripts\zm\replaced\_zm_weapons::get_player_weapondata);
|
||||||
|
replaceFunc(maps\mp\zombies\_zm_weapons::get_nonalternate_weapon, scripts\zm\replaced\_zm_weapons::get_nonalternate_weapon);
|
||||||
|
replaceFunc(maps\mp\zombies\_zm_weapons::switch_from_alt_weapon, scripts\zm\replaced\_zm_weapons::switch_from_alt_weapon);
|
||||||
replaceFunc(maps\mp\zombies\_zm_weapons::give_fallback_weapon, scripts\zm\replaced\_zm_weapons::give_fallback_weapon);
|
replaceFunc(maps\mp\zombies\_zm_weapons::give_fallback_weapon, scripts\zm\replaced\_zm_weapons::give_fallback_weapon);
|
||||||
replaceFunc(maps\mp\zombies\_zm_magicbox::treasure_chest_init, scripts\zm\replaced\_zm_magicbox::treasure_chest_init);
|
replaceFunc(maps\mp\zombies\_zm_magicbox::treasure_chest_init, scripts\zm\replaced\_zm_magicbox::treasure_chest_init);
|
||||||
replaceFunc(maps\mp\zombies\_zm_magicbox::init_starting_chest_location, scripts\zm\replaced\_zm_magicbox::init_starting_chest_location);
|
replaceFunc(maps\mp\zombies\_zm_magicbox::init_starting_chest_location, scripts\zm\replaced\_zm_magicbox::init_starting_chest_location);
|
||||||
|
@ -971,6 +971,98 @@ createballisticknifewatcher_zm(name, weapon)
|
|||||||
watcher.headicon = 0;
|
watcher.headicon = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_player_weapondata(player, weapon)
|
||||||
|
{
|
||||||
|
weapondata = [];
|
||||||
|
|
||||||
|
if (!isdefined(weapon))
|
||||||
|
weapondata["name"] = get_nonalternate_weapon(player getcurrentweapon());
|
||||||
|
else
|
||||||
|
weapondata["name"] = weapon;
|
||||||
|
|
||||||
|
weapondata["dw_name"] = weapondualwieldweaponname(weapondata["name"]);
|
||||||
|
weapondata["alt_name"] = weaponaltweaponname(weapondata["name"]);
|
||||||
|
|
||||||
|
if (weapondata["name"] != "none")
|
||||||
|
{
|
||||||
|
weapondata["clip"] = player getweaponammoclip(weapondata["name"]);
|
||||||
|
weapondata["stock"] = player getweaponammostock(weapondata["name"]);
|
||||||
|
weapondata["fuel"] = player getweaponammofuel(weapondata["name"]);
|
||||||
|
weapondata["heat"] = player isweaponoverheating(1, weapondata["name"]);
|
||||||
|
weapondata["overheat"] = player isweaponoverheating(0, weapondata["name"]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
weapondata["clip"] = 0;
|
||||||
|
weapondata["stock"] = 0;
|
||||||
|
weapondata["fuel"] = 0;
|
||||||
|
weapondata["heat"] = 0;
|
||||||
|
weapondata["overheat"] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (weapondata["dw_name"] != "none")
|
||||||
|
weapondata["lh_clip"] = player getweaponammoclip(weapondata["dw_name"]);
|
||||||
|
else
|
||||||
|
weapondata["lh_clip"] = 0;
|
||||||
|
|
||||||
|
if (weapondata["alt_name"] != "none")
|
||||||
|
{
|
||||||
|
weapondata["alt_clip"] = player getweaponammoclip(weapondata["alt_name"]);
|
||||||
|
weapondata["alt_stock"] = player getweaponammostock(weapondata["alt_name"]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
weapondata["alt_clip"] = 0;
|
||||||
|
weapondata["alt_stock"] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return weapondata;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_nonalternate_weapon(altweapon)
|
||||||
|
{
|
||||||
|
if (is_alt_weapon(altweapon))
|
||||||
|
{
|
||||||
|
alt = weaponaltweaponname(altweapon);
|
||||||
|
|
||||||
|
if (alt == "none")
|
||||||
|
{
|
||||||
|
primaryweapons = self getweaponslistprimaries();
|
||||||
|
alt = primaryweapons[0];
|
||||||
|
|
||||||
|
foreach (weapon in primaryweapons)
|
||||||
|
{
|
||||||
|
if (weaponaltweaponname(weapon) == altweapon)
|
||||||
|
{
|
||||||
|
alt = weapon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return alt;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (issubstr(altweapon, "metalstorm"))
|
||||||
|
{
|
||||||
|
alt = "metalstorm_mms_zm";
|
||||||
|
|
||||||
|
if (issubstr(altweapon, "upgraded"))
|
||||||
|
{
|
||||||
|
alt = "metalstorm_mms_upgraded_zm";
|
||||||
|
}
|
||||||
|
|
||||||
|
return alt;
|
||||||
|
}
|
||||||
|
|
||||||
|
return altweapon;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_from_alt_weapon(current_weapon)
|
||||||
|
{
|
||||||
|
return get_nonalternate_weapon(current_weapon);
|
||||||
|
}
|
||||||
|
|
||||||
give_fallback_weapon()
|
give_fallback_weapon()
|
||||||
{
|
{
|
||||||
self switchtoweapon("held_" + self get_player_melee_weapon());
|
self switchtoweapon("held_" + self get_player_melee_weapon());
|
||||||
|
@ -1696,7 +1696,7 @@ game_module_player_damage_callback(einflictor, eattacker, idamage, idflags, smea
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sweapon = get_real_nonalternate_weapon(sweapon);
|
sweapon = get_nonalternate_weapon(sweapon);
|
||||||
|
|
||||||
if (!is_true(self._being_shellshocked))
|
if (!is_true(self._being_shellshocked))
|
||||||
{
|
{
|
||||||
@ -1925,25 +1925,6 @@ remove_player_damage_info()
|
|||||||
self.last_griefed_by = undefined;
|
self.last_griefed_by = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
get_real_nonalternate_weapon(sweapon)
|
|
||||||
{
|
|
||||||
sweapon = get_nonalternate_weapon(sweapon);
|
|
||||||
|
|
||||||
if (issubstr(sweapon, "metalstorm"))
|
|
||||||
{
|
|
||||||
if (issubstr(sweapon, "upgraded"))
|
|
||||||
{
|
|
||||||
sweapon = "metalstorm_mms_upgraded_zm";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sweapon = "metalstorm_mms_zm";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return sweapon;
|
|
||||||
}
|
|
||||||
|
|
||||||
grief_laststand_weapon_save(einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration)
|
grief_laststand_weapon_save(einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration)
|
||||||
{
|
{
|
||||||
self.grief_savedweapon_weapons = self getweaponslist();
|
self.grief_savedweapon_weapons = self getweaponslist();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user