From 3f209683c1c90bce6d705bed55d2062dcb0dc302 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Sat, 1 Apr 2023 20:46:24 -0700 Subject: [PATCH] One Inch Punch: reset melee weapon if bled out in Giant Robot --- README.md | 1 + .../zm/replaced/_zm_weap_one_inch_punch.gsc | 63 +++++++++++++++++++ scripts/zm/zm_tomb/zm_tomb_reimagined.gsc | 2 + 3 files changed, 66 insertions(+) create mode 100644 scripts/zm/replaced/_zm_weap_one_inch_punch.gsc diff --git a/README.md b/README.md index b006e8b7..c79ff68c 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,7 @@ ### One Inch Punch * Upgraded: elemental punch changes based on which staff the player currently has +* Fixed an issue where a player's melee weapon wouldn't reset if the player bled out in the Giant Robots ### Ray Gun * Unupgraded: increased impact damage from 1000 to 1500 (same as max splash damage) diff --git a/scripts/zm/replaced/_zm_weap_one_inch_punch.gsc b/scripts/zm/replaced/_zm_weap_one_inch_punch.gsc new file mode 100644 index 00000000..1b068412 --- /dev/null +++ b/scripts/zm/replaced/_zm_weap_one_inch_punch.gsc @@ -0,0 +1,63 @@ +#include maps\mp\_utility; +#include common_scripts\utility; +#include maps\mp\zombies\_zm_utility; +#include maps\mp\zombies\_zm_net; +#include maps\mp\zombies\_zm_audio; +#include maps\mp\zombies\_zm_spawner; +#include maps\mp\zombies\_zm_weap_staff_fire; +#include maps\mp\zombies\_zm_weap_staff_water; +#include maps\mp\zombies\_zm_score; +#include maps\mp\zombies\_zm_weap_staff_lightning; +#include maps\mp\animscripts\zm_shared; +#include maps\mp\zombies\_zm_weap_one_inch_punch; + +monitor_melee_swipe() +{ + self endon( "disconnect" ); + self notify( "stop_monitor_melee_swipe" ); + self endon( "stop_monitor_melee_swipe" ); + self endon( "bled_out" ); + self endon( "gr_head_forced_bleed_out" ); + + while ( true ) + { + while ( !self ismeleeing() ) + wait 0.05; + + if ( self getcurrentweapon() == level.riotshield_name ) + { + wait 0.1; + continue; + } + + range_mod = 1; + self setclientfield( "oneinchpunch_impact", 1 ); + wait_network_frame(); + self setclientfield( "oneinchpunch_impact", 0 ); + v_punch_effect_fwd = anglestoforward( self getplayerangles() ); + v_punch_yaw = get2dyaw( ( 0, 0, 0 ), v_punch_effect_fwd ); + + if ( isdefined( self.b_punch_upgraded ) && self.b_punch_upgraded && isdefined( self.str_punch_element ) && self.str_punch_element == "air" ) + range_mod *= 2; + + a_zombies = getaispeciesarray( level.zombie_team, "all" ); + a_zombies = get_array_of_closest( self.origin, a_zombies, undefined, undefined, 100 ); + + foreach ( zombie in a_zombies ) + { + if ( self is_player_facing( zombie, v_punch_yaw ) && distancesquared( self.origin, zombie.origin ) <= 4096 * range_mod ) + { + self thread zombie_punch_damage( zombie, 1 ); + continue; + } + + if ( self is_player_facing( zombie, v_punch_yaw ) ) + self thread zombie_punch_damage( zombie, 0.5 ); + } + + while ( self ismeleeing() ) + wait 0.05; + + wait 0.05; + } +} \ 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 b2dc74a8..49872399 100644 --- a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc +++ b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc @@ -25,6 +25,7 @@ #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_one_inch_punch; #include scripts\zm\replaced\_zm_weap_staff_air; #include scripts\zm\replaced\_zm_weap_staff_fire; #include scripts\zm\replaced\_zm_weap_staff_lightning; @@ -66,6 +67,7 @@ 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_one_inch_punch::monitor_melee_swipe, scripts\zm\replaced\_zm_weap_one_inch_punch::monitor_melee_swipe); replaceFunc(maps\mp\zombies\_zm_weap_staff_air::whirlwind_kill_zombies, scripts\zm\replaced\_zm_weap_staff_air::whirlwind_kill_zombies); 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_fire::get_impact_damage, scripts\zm\replaced\_zm_weap_staff_fire::get_impact_damage);