diff --git a/README.md b/README.md index 7e04264b..fa6f8fec 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,6 @@ * Double headshot damage * Move faster while aiming * Decreased sprint recovery time -* Zombie heads always gib when killed ### Mule Kick * Added additional weapon indicator diff --git a/scripts/zm/main/_zm_reimagined.gsc b/scripts/zm/main/_zm_reimagined.gsc index 029319e4..ed034ad0 100644 --- a/scripts/zm/main/_zm_reimagined.gsc +++ b/scripts/zm/main/_zm_reimagined.gsc @@ -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")) diff --git a/scripts/zm/replaced/_zm.gsc b/scripts/zm/replaced/_zm.gsc index 9d9ab31d..a04272c3 100644 --- a/scripts/zm/replaced/_zm.gsc +++ b/scripts/zm/replaced/_zm.gsc @@ -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" );