From 5f314bc4178c6eeefb9f1ec076e18d1006db26b2 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Mon, 24 Apr 2023 04:05:47 -0700 Subject: [PATCH] Die Rise: fix elevator zombie kill --- scripts/zm/replaced/zm_highrise_classic.gsc | 2 +- scripts/zm/replaced/zm_highrise_elevators.gsc | 23 ++++++++++++++++--- .../zm/zm_highrise/zm_highrise_reimagined.gsc | 10 -------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/scripts/zm/replaced/zm_highrise_classic.gsc b/scripts/zm/replaced/zm_highrise_classic.gsc index 2fa75c8e..40ae3cbb 100644 --- a/scripts/zm/replaced/zm_highrise_classic.gsc +++ b/scripts/zm/replaced/zm_highrise_classic.gsc @@ -61,7 +61,7 @@ main() flag_wait( "start_zombie_round_logic" ); level thread maps\mp\zm_highrise_elevators::random_elevator_perks(); level thread maps\mp\zm_highrise_elevators::faller_location_logic(); - level.custom_faller_entrance_logic = maps\mp\zm_highrise_elevators::watch_for_elevator_during_faller_spawn; + level.custom_faller_entrance_logic = scripts\zm\replaced\zm_highrise_elevators::watch_for_elevator_during_faller_spawn; setdvar( "zombiemode_path_minz_bias", 13 ); level.check_valid_poi = ::check_valid_poi; level thread maps\mp\zm_highrise_elevators::shouldsuppressgibs(); diff --git a/scripts/zm/replaced/zm_highrise_elevators.gsc b/scripts/zm/replaced/zm_highrise_elevators.gsc index 13e716af..e759716f 100644 --- a/scripts/zm/replaced/zm_highrise_elevators.gsc +++ b/scripts/zm/replaced/zm_highrise_elevators.gsc @@ -434,16 +434,33 @@ watch_for_elevator_during_faller_spawn() self endon( "risen" ); self endon( "spawn_anim" ); + flag_wait( "power_on" ); + + elevator_bodies = []; + foreach ( elevator in level.elevators ) + { + elevator_bodies[elevator_bodies.size] = elevator.body; + } + + elevator_body = get_closest_2d( self.zombie_faller_location.origin, elevator_bodies ); + while ( true ) { should_gib = 0; - foreach ( elevator in level.elevators ) + if ( is_true( elevator_body.is_moving ) ) { - if ( is_true( elevator.body.is_moving ) && self istouching( elevator.body ) ) + if ( self istouching( elevator_body ) ) + { should_gib = 1; - else if ( !is_true( elevator.body.is_moving ) && distancesquared( elevator.body getcentroid(), self getcentroid() ) <= 9216 ) + } + } + else + { + if ( is_true( self.zombie_faller_location.is_blocked ) ) + { should_gib = 1; + } } if ( should_gib ) diff --git a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc index 9b5989e7..900fb863 100644 --- a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc +++ b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc @@ -60,7 +60,6 @@ init() slipgun_change_ammo(); - level thread custom_faller_entrance_logic(); level thread elevator_call(); level thread escape_pod_call(); } @@ -164,15 +163,6 @@ onbuyweapon_slipgun( player ) level notify( "slipgun_bought", player ); } -custom_faller_entrance_logic() -{ - flag_wait( "initial_blackscreen_passed" ); - - wait 1; - - level.custom_faller_entrance_logic = scripts\zm\replaced\zm_highrise_elevators::watch_for_elevator_during_faller_spawn; -} - elevator_call() { trigs = getentarray( "elevator_key_console_trigger", "targetname" );