1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-11 15:48:05 -05:00

Deadshot: double headshot damage done properly

This commit is contained in:
Jbleezy
2021-12-20 19:58:45 -08:00
parent 0e9e3aafb0
commit 6d604c7465
3 changed files with 105 additions and 3 deletions

View File

@ -13,6 +13,7 @@
main()
{
replaceFunc(maps/mp/zombies/_zm::check_quickrevive_for_hotjoin, scripts/zm/replaced/_zm::check_quickrevive_for_hotjoin);
replaceFunc(maps/mp/zombies/_zm::actor_damage_override, scripts/zm/replaced/_zm::actor_damage_override);
replaceFunc(maps/mp/zombies/_zm::end_game, scripts/zm/replaced/_zm::end_game);
replaceFunc(maps/mp/zombies/_zm_playerhealth::playerhealthregen, scripts/zm/replaced/_zm_playerhealth::playerhealthregen);
replaceFunc(maps/mp/zombies/_zm_utility::track_players_intersection_tracker, scripts/zm/replaced/_zm_utility::track_players_intersection_tracker);
@ -3381,13 +3382,11 @@ give_additional_perks()
{
self SetPerk("specialty_stalker");
self Setperk( "specialty_sprintrecovery" );
self.pers_upgrades_awarded["multikill_headshots"] = 1; // double headshot damage
}
else
{
self UnsetPerk("specialty_stalker");
self Unsetperk( "specialty_sprintrecovery" );
self.pers_upgrades_awarded["multikill_headshots"] = 0;
}
if (self HasPerk("specialty_longersprint"))

View File

@ -57,6 +57,110 @@ wait_for_all_players_to_connect( max_wait )
}
}
actor_damage_override( inflictor, attacker, damage, flags, meansofdeath, weapon, vpoint, vdir, shitloc, psoffsettime, boneindex )
{
if ( !isDefined( self ) || !isDefined( attacker ) )
{
return damage;
}
if ( weapon == "tazer_knuckles_zm" || weapon == "jetgun_zm" )
{
self.knuckles_extinguish_flames = 1;
}
else if ( weapon != "none" )
{
self.knuckles_extinguish_flames = undefined;
}
if ( isDefined( attacker.animname ) && attacker.animname == "quad_zombie" )
{
if ( isDefined( self.animname ) && self.animname == "quad_zombie" )
{
return 0;
}
}
if ( !isplayer( attacker ) && isDefined( self.non_attacker_func ) )
{
if ( is_true( self.non_attack_func_takes_attacker ) )
{
return self [[ self.non_attacker_func ]]( damage, weapon, attacker );
}
else
{
return self [[ self.non_attacker_func ]]( damage, weapon );
}
}
if ( !isplayer( attacker ) && !isplayer( self ) )
{
return damage;
}
if ( !isDefined( damage ) || !isDefined( meansofdeath ) )
{
return damage;
}
if ( meansofdeath == "" )
{
return damage;
}
old_damage = damage;
final_damage = damage;
if ( isDefined( self.actor_damage_func ) )
{
final_damage = [[ self.actor_damage_func ]]( inflictor, attacker, damage, flags, meansofdeath, weapon, vpoint, vdir, shitloc, psoffsettime, boneindex );
}
if ( attacker.classname == "script_vehicle" && isDefined( attacker.owner ) )
{
attacker = attacker.owner;
}
if ( is_true( self.in_water ) )
{
if ( int( final_damage ) >= self.health )
{
self.water_damage = 1;
}
}
attacker thread maps/mp/gametypes_zm/_weapons::checkhit( weapon );
if(attacker HasPerk("specialty_deadshot") && is_headshot(weapon, shitloc, meansofdeath) && WeaponClass(weapon) != "spread" && WeaponClass(weapon) != "pistol spread")
{
final_damage *= 2;
}
if ( attacker maps/mp/zombies/_zm_pers_upgrades_functions::pers_mulit_kill_headshot_active() && is_headshot( weapon, shitloc, meansofdeath ) )
{
final_damage *= 2;
}
if ( is_true( level.headshots_only ) && isDefined( attacker ) && isplayer( attacker ) )
{
if ( meansofdeath == "MOD_MELEE" && shitloc == "head" || meansofdeath == "MOD_MELEE" && shitloc == "helmet" )
{
return int( final_damage );
}
if ( is_explosive_damage( meansofdeath ) )
{
return int( final_damage );
}
else if ( !is_headshot( weapon, shitloc, meansofdeath ) )
{
return 0;
}
}
return int( final_damage );
}
end_game()
{
level waittill( "end_game" );