From aba3b7874b35719900cb336d9cb22706f47e28b4 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Sun, 24 Dec 2023 11:16:02 -0800 Subject: [PATCH] Zombies: increase damage taken to make a crawler --- README.md | 1 + scripts/zm/replaced/_zm_spawner.gsc | 66 +++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/README.md b/README.md index 0e52defc..17230b8d 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ * Health capped at 100,000 * Decreased damage from 60 to 50 * Changed height to 60 (normally either 48 or 72) +* Increased damage taken to make a crawler from 10% of current health to 25% of current health * Amount of zombies scales linearly with the amount of players * Zombies that are deleted due to being too far away always respawn * Attracted towards points of interest immediately diff --git a/scripts/zm/replaced/_zm_spawner.gsc b/scripts/zm/replaced/_zm_spawner.gsc index b7d7f9e7..f70a993c 100644 --- a/scripts/zm/replaced/_zm_spawner.gsc +++ b/scripts/zm/replaced/_zm_spawner.gsc @@ -308,6 +308,72 @@ zombie_gib_on_damage() } } +zombie_should_gib( amount, attacker, type ) +{ + if ( !is_mature() ) + return false; + + if ( !isdefined( type ) ) + return false; + + if ( isdefined( self.is_on_fire ) && self.is_on_fire ) + return false; + + if ( isdefined( self.no_gib ) && self.no_gib == 1 ) + return false; + + switch ( type ) + { + case "MOD_UNKNOWN": + case "MOD_TRIGGER_HURT": + case "MOD_TELEFRAG": + case "MOD_SUICIDE": + case "MOD_FALLING": + case "MOD_CRUSH": + case "MOD_BURNED": + return false; + + case "MOD_MELEE": + return false; + } + + if ( type == "MOD_PISTOL_BULLET" || type == "MOD_RIFLE_BULLET" ) + { + if ( !isdefined( attacker ) || !isplayer( attacker ) ) + return false; + + weapon = attacker getcurrentweapon(); + + if ( weapon == "none" || weapon == level.start_weapon ) + return false; + + if ( weaponisgasweapon( self.weapon ) ) + return false; + } + else if ( type == "MOD_PROJECTILE" ) + { + if ( isdefined( attacker ) && isplayer( attacker ) ) + { + weapon = attacker getcurrentweapon(); + + if ( weapon == "slipgun_zm" || weapon == "slipgun_upgraded_zm" ) + return false; + } + } + + prev_health = amount + self.health; + + if ( prev_health <= 0 ) + prev_health = 1; + + damage_percent = amount / prev_health * 100; + + if ( damage_percent < 25 ) + return false; + + return true; +} + bleedout_watcher() { self endon("death");