From d9e00923e936763bcb95b844a7d13b1df657df63 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Wed, 19 Jan 2022 23:54:48 -0800 Subject: [PATCH] Remove headless zombies --- README.md | 1 + scripts/zm/_zm_reimagined.gsc | 3 +- scripts/zm/replaced/_zm_spawner.gsc | 70 +++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 66205e11..6eb499a4 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ ## Zombies * Health capped at 100,000 * Removed walkers in high rounds +* Removed headless zombies * Neck counts as headshot ### Screechers diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index 72d3b239..7b903169 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -17,8 +17,8 @@ #include scripts/zm/replaced/_zm_pers_upgrades; #include scripts/zm/replaced/_zm_traps; #include scripts/zm/replaced/_zm_equipment; -#include scripts/zm/replaced/_zm_ai_basic; #include scripts/zm/replaced/_zm_spawner; +#include scripts/zm/replaced/_zm_ai_basic; main() { @@ -54,6 +54,7 @@ main() replaceFunc(maps/mp/zombies/_zm_traps::player_elec_damage, scripts/zm/replaced/_zm_traps::player_elec_damage); replaceFunc(maps/mp/zombies/_zm_equipment::show_equipment_hint, scripts/zm/replaced/_zm_equipment::show_equipment_hint); replaceFunc(maps/mp/zombies/_zm_equipment::placed_equipment_think, scripts/zm/replaced/_zm_equipment::placed_equipment_think); + replaceFunc(maps/mp/zombies/_zm_spawner::head_should_gib, scripts/zm/replaced/_zm_spawner::head_should_gib); replaceFunc(maps/mp/zombies/_zm_ai_basic::inert_wakeup, scripts/zm/replaced/_zm_ai_basic::inert_wakeup); } diff --git a/scripts/zm/replaced/_zm_spawner.gsc b/scripts/zm/replaced/_zm_spawner.gsc index c428338f..0586495d 100644 --- a/scripts/zm/replaced/_zm_spawner.gsc +++ b/scripts/zm/replaced/_zm_spawner.gsc @@ -1,6 +1,7 @@ #include maps\mp\_utility; #include common_scripts\utility; #include maps\mp\zombies\_zm_utility; +#include maps/mp/zombies/_zm_spawner; zombie_damage( mod, hit_location, hit_origin, player, amount, team ) { @@ -151,4 +152,73 @@ zombie_damage( mod, hit_location, hit_origin, player, amount, team ) } self thread maps/mp/zombies/_zm_powerups::check_for_instakill( player, mod, hit_location ); +} + +head_should_gib( attacker, type, point ) +{ + if ( !is_mature() ) + { + return 0; + } + + if ( self.head_gibbed ) + { + return 0; + } + + if ( !isDefined( attacker ) || !isplayer( attacker ) ) + { + return 0; + } + + weapon = attacker getcurrentweapon(); + + if ( type != "MOD_RIFLE_BULLET" && type != "MOD_PISTOL_BULLET" ) + { + if ( type == "MOD_GRENADE" || type == "MOD_GRENADE_SPLASH" ) + { + if ( ( distance( point, self gettagorigin( "j_head" ) ) > 55 ) || ( self.health > 0 ) ) + { + return 0; + } + else + { + return 1; + } + } + else if ( type == "MOD_PROJECTILE" ) + { + if ( ( distance( point, self gettagorigin( "j_head" ) ) > 10 ) || ( self.health > 0 ) ) + { + return 0; + } + else + { + return 1; + } + } + else if ( weaponclass( weapon ) != "spread" ) + { + return 0; + } + } + + if ( !self maps/mp/animscripts/zm_utility::damagelocationisany( "head", "helmet", "neck" ) ) + { + return 0; + } + + if ( weapon == "none" || weapon == level.start_weapon || weaponisgasweapon( self.weapon ) ) + { + return 0; + } + + self zombie_hat_gib( attacker, type ); + + if ( self.health > 0 ) + { + return 0; + } + + return 1; } \ No newline at end of file