From 8cb212c89fc45daff1f5964676d9bb575e8c9758 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Tue, 28 Mar 2023 20:39:47 -0700 Subject: [PATCH] Staffs: kill on any round when upgraded --- README.md | 1 + scripts/zm/replaced/_zm_weap_staff_fire.gsc | 49 +++++++++++++++ .../zm/replaced/_zm_weap_staff_lightning.gsc | 62 +++++++++++++++++++ scripts/zm/zm_tomb/zm_tomb_reimagined.gsc | 4 ++ 4 files changed, 116 insertions(+) create mode 100644 scripts/zm/replaced/_zm_weap_staff_fire.gsc create mode 100644 scripts/zm/replaced/_zm_weap_staff_lightning.gsc diff --git a/README.md b/README.md index 58169d17..14c54e83 100644 --- a/README.md +++ b/README.md @@ -232,6 +232,7 @@ * Can collect souls in The Crazy Place after upgrading to fill 5% of max ammo per soul * Get full ammo when initially picked up after upgrading (normally missing one clip) * Max ammo no longer fills clip ammo +* Upgraded: kill on any round ## Wallbuys * Purchasing ammo refills clip ammo diff --git a/scripts/zm/replaced/_zm_weap_staff_fire.gsc b/scripts/zm/replaced/_zm_weap_staff_fire.gsc new file mode 100644 index 00000000..9ff433cf --- /dev/null +++ b/scripts/zm/replaced/_zm_weap_staff_fire.gsc @@ -0,0 +1,49 @@ +#include common_scripts\utility; +#include maps\mp\_utility; +#include maps\mp\zombies\_zm_utility; +#include maps\mp\zombies\_zm_net; +#include maps\mp\zombies\_zm_spawner; +#include maps\mp\zombies\_zm_craftables; +#include maps\mp\zombies\_zm_equipment; +#include maps\mp\zm_tomb_teleporter; +#include maps\mp\zm_tomb_vo; +#include maps\mp\zombies\_zm_ai_basic; +#include maps\mp\animscripts\zm_shared; +#include maps\mp\zombies\_zm_unitrigger; +#include maps\mp\zombies\_zm_zonemgr; +#include maps\mp\zm_tomb_chamber; +#include maps\mp\zombies\_zm_challenges; +#include maps\mp\zm_tomb_challenges; +#include maps\mp\zm_tomb_tank; +#include maps\mp\zm_tomb_craftables; +#include maps\mp\zm_tomb_utility; +#include maps\mp\zombies\_zm_weap_staff_fire; + +flame_damage_fx( damageweapon, e_attacker, pct_damage = 1.0 ) +{ + was_on_fire = is_true( self.is_on_fire ); + n_initial_dmg = get_impact_damage( damageweapon ) * pct_damage; + is_upgraded = damageweapon == "staff_fire_upgraded_zm" || damageweapon == "staff_fire_upgraded2_zm" || damageweapon == "staff_fire_upgraded3_zm"; + + if ( is_upgraded && pct_damage > 0.5 ) + { + self do_damage_network_safe( e_attacker, self.health, damageweapon, "MOD_BURNED" ); + + self thread zombie_gib_guts(); + + return; + } + + self endon( "death" ); + + if ( !is_upgraded && !was_on_fire ) + { + self.is_on_fire = 1; + self thread zombie_set_and_restore_flame_state(); + wait 0.5; + self thread flame_damage_over_time( e_attacker, damageweapon, pct_damage ); + } + + if ( n_initial_dmg > 0 ) + self do_damage_network_safe( e_attacker, n_initial_dmg, damageweapon, "MOD_BURNED" ); +} \ No newline at end of file diff --git a/scripts/zm/replaced/_zm_weap_staff_lightning.gsc b/scripts/zm/replaced/_zm_weap_staff_lightning.gsc new file mode 100644 index 00000000..184230a1 --- /dev/null +++ b/scripts/zm/replaced/_zm_weap_staff_lightning.gsc @@ -0,0 +1,62 @@ +#include common_scripts\utility; +#include maps\mp\_utility; +#include maps\mp\zombies\_zm_utility; +#include maps\mp\zombies\_zm_net; +#include maps\mp\zm_tomb_utility; +#include maps\mp\zombies\_zm_spawner; +#include maps\mp\zombies\_zm_audio; +#include maps\mp\zombies\_zm_powerups; +#include maps\mp\zombies\_zm_score; +#include maps\mp\animscripts\shared; +#include maps\mp\zombies\_zm_weap_staff_lightning; + +staff_lightning_ball_damage_over_time( e_source, e_target, e_attacker ) +{ + e_attacker endon( "disconnect" ); + e_target setclientfield( "lightning_impact_fx", 1 ); + e_target thread maps\mp\zombies\_zm_audio::do_zombies_playvocals( "electrocute", e_target.animname ); + n_range_sq = e_source.n_range * e_source.n_range; + e_target.is_being_zapped = 1; + e_target setclientfield( "lightning_arc_fx", 1 ); + wait 0.5; + + if ( isdefined( e_source ) ) + { + if ( !isdefined( e_source.n_damage_per_sec ) ) + e_source.n_damage_per_sec = get_lightning_ball_damage_per_sec( e_attacker.chargeshotlevel ); + + n_damage_per_pulse = e_source.n_damage_per_sec * 1.0; + } + + while ( isdefined( e_source ) && isalive( e_target ) ) + { + e_target thread stun_zombie(); + wait 1.0; + + if ( !isdefined( e_source ) || !isalive( e_target ) ) + break; + + n_dist_sq = distancesquared( e_source.origin, e_target.origin ); + + if ( n_dist_sq > n_range_sq ) + break; + + if ( isalive( e_target ) && isdefined( e_source ) ) + { + e_target thread zombie_shock_eyes(); + e_target thread staff_lightning_kill_zombie( e_attacker, e_source.str_weapon ); + break; + } + } + + if ( isdefined( e_target ) ) + { + e_target.is_being_zapped = 0; + e_target setclientfield( "lightning_arc_fx", 0 ); + } +} + +get_lightning_ball_damage_per_sec( n_charge ) +{ + return 2500; +} \ No newline at end of file diff --git a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc index 2211bf8a..f7b0bf13 100644 --- a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc +++ b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc @@ -17,6 +17,8 @@ #include scripts\zm\replaced\_zm_powerup_zombie_blood; #include scripts\zm\replaced\_zm_riotshield_tomb; #include scripts\zm\replaced\_zm_weap_riotshield_tomb; +#include scripts\zm\replaced\_zm_weap_staff_fire; +#include scripts\zm\replaced\_zm_weap_staff_lightning; main() { @@ -45,6 +47,8 @@ main() replaceFunc(maps\mp\zombies\_zm_riotshield_tomb::trackriotshield, scripts\zm\replaced\_zm_riotshield_tomb::trackriotshield); replaceFunc(maps\mp\zombies\_zm_weap_riotshield_tomb::init, scripts\zm\replaced\_zm_weap_riotshield_tomb::init); replaceFunc(maps\mp\zombies\_zm_weap_riotshield_tomb::player_damage_shield, scripts\zm\replaced\_zm_weap_riotshield_tomb::player_damage_shield); + replaceFunc(maps\mp\zombies\_zm_weap_staff_fire::flame_damage_fx, scripts\zm\replaced\_zm_weap_staff_fire::flame_damage_fx); + replaceFunc(maps\mp\zombies\_zm_weap_staff_lightning::staff_lightning_ball_damage_over_time, scripts\zm\replaced\_zm_weap_staff_lightning::staff_lightning_ball_damage_over_time); } init()