diff --git a/scripts/zm/replaced/zm_highrise_classic.gsc b/scripts/zm/replaced/zm_highrise_classic.gsc index b087fe26..3ab8531b 100644 --- a/scripts/zm/replaced/zm_highrise_classic.gsc +++ b/scripts/zm/replaced/zm_highrise_classic.gsc @@ -3,6 +3,203 @@ #include maps\mp\zombies\_zm_utility; #include maps\mp\zm_highrise_classic; +main() +{ + level.buildables_built["pap"] = 1; + level.custom_pap_move_in = ::highrise_pap_move_in; + level.custom_pap_move_out = ::highrise_pap_move_out; + flag_init( "perks_ready" ); + maps\mp\gametypes_zm\_zm_gametype::setup_standard_objects( "rooftop" ); + maps\mp\zombies\_zm_game_module::set_current_game_module( level.game_module_standard_index ); + level thread maps\mp\zombies\_zm_buildables::think_buildables(); + level.calc_closest_player_using_paths = 1; + level.validate_enemy_path_length = ::highrise_validate_enemy_path_length; + level thread maps\mp\zm_highrise_classic::init_escape_pod(); + level thread maps\mp\zm_highrise_elevators::init_elevators(); + temp_clips = getentarray( "elevator_delete", "targetname" ); + + if ( isdefined( temp_clips ) && temp_clips.size > 0 ) + array_thread( temp_clips, ::self_delete ); + + elev_bldg3b = getent( "elevator_bldg3b_body", "targetname" ); + elev_bldg3b.origin += vectorscale( ( 0, 0, 1 ), 8.0 ); + level thread maps\mp\zm_highrise_elevators::init_elevator( "1b" ); + level thread maps\mp\zm_highrise_elevators::init_elevator( "1c", 1 ); + level thread maps\mp\zm_highrise_elevators::init_elevator( "1d" ); + + if ( randomint( 100 ) > 50 ) + { + level thread maps\mp\zm_highrise_elevators::init_elevator( "3", 1, -1264 ); + level thread maps\mp\zm_highrise_elevators::init_elevator( "3b", 2 ); + } + else + { + level thread maps\mp\zm_highrise_elevators::init_elevator( "3", 2 ); + level thread maps\mp\zm_highrise_elevators::init_elevator( "3b", 1, -1264 ); + } + + level thread maps\mp\zm_highrise_elevators::init_elevator( "3c", 3 ); + level thread maps\mp\zm_highrise_elevators::init_elevator( "3d", 1 ); + flag_wait( "initial_blackscreen_passed" ); + level thread escape_pod(); + level._chugabug_reject_corpse_override_func = ::highrise_chugabud_reject_corpse_func; + level._chugabud_reject_node_override_func = ::highrise_chugabud_reject_node_func; + level._chugabud_post_respawn_override_func = ::highrise_chugabud_post_respawn_func; + level.insta_kill_triggers = getentarray( "instant_death", "targetname" ); + array_thread( level.insta_kill_triggers, ::squashed_death_init, 0 ); + e_trigger = getent( "instant_death_escape_pod_shaft", "targetname" ); + + if ( isdefined( e_trigger ) ) + { + e_trigger thread squashed_death_init( 1 ); + e_trigger thread escape_pod_death_trigger_think(); + level.insta_kill_triggers[level.insta_kill_triggers.size] = e_trigger; + } + + exploder( 9 ); + exploder( 10 ); + 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; + setdvar( "zombiemode_path_minz_bias", 13 ); + level.check_valid_poi = ::check_valid_poi; + level thread maps\mp\zm_highrise_elevators::shouldsuppressgibs(); +} + +squashed_death_init( kill_if_falling ) +{ + while ( true ) + { + self waittill( "trigger", who ); + + if ( !( isdefined( who.insta_killed ) && who.insta_killed ) ) + { + if ( isplayer( who ) ) + { + who thread elevator_black_screen_squash_check(); + who thread insta_kill_player( 1, kill_if_falling ); + } + else if ( isai( who ) ) + { + if ( is_true( who.in_the_ceiling ) ) + continue; + + playfx( level._effect["zomb_gib"], who.origin ); + + if ( isdefined( who.is_leaper ) && who.is_leaper ) + { + who maps\mp\zombies\_zm_ai_leaper::leaper_cleanup(); + who dodamage( who.health + 100, who.origin ); + } + else + { + who delete(); + } + + who.insta_killed = 1; + } + } + } +} + +insta_kill_player( perks_can_respawn_player, kill_if_falling ) +{ + self endon( "disconnect" ); + if ( isDefined( perks_can_respawn_player ) && perks_can_respawn_player == 0 ) + { + if ( self hasperk( "specialty_quickrevive" ) ) + { + self unsetperk( "specialty_quickrevive" ); + } + if ( self hasperk( "specialty_finalstand" ) ) + { + self unsetperk( "specialty_finalstand" ); + } + } + self maps\mp\zombies\_zm_buildables::player_return_piece_to_original_spawn(); + if ( isDefined( self.insta_killed ) && self.insta_killed ) + { + return; + } + if ( isDefined( self.ignore_insta_kill ) ) + { + self.disable_chugabud_corpse = 1; + return; + } + if ( self hasperk( "specialty_finalstand" ) ) + { + self.ignore_insta_kill = 1; + self.disable_chugabud_corpse = 1; + self dodamage( self.health + 1000, ( 0, 0, 1 ) ); + return; + } + if ( !isDefined( kill_if_falling ) || kill_if_falling == 0 ) + { + if ( !self isonground() ) + { + return; + } + } + if ( is_player_killable( self ) ) + { + self.insta_killed = 1; + in_last_stand = 0; + self notify( "chugabud_effects_cleanup" ); + if ( self maps\mp\zombies\_zm_laststand::player_is_in_laststand() ) + { + in_last_stand = 1; + } + self thread blood_splat(); + if ( getnumconnectedplayers() == 1 ) + { + if ( isDefined( self.solo_lives_given ) && self.solo_lives_given < 3 ) + { + self.waiting_to_revive = 1; + points = getstruct( "zone_green_start", "script_noteworthy" ); + spawn_points = getstructarray( points.target, "targetname" ); + point = spawn_points[ 0 ]; + if ( in_last_stand == 0 ) + { + self dodamage( self.health + 1000, ( 0, 0, 1 ) ); + } + wait 0.5; + self freezecontrols( 1 ); + wait 0.25; + self setorigin( point.origin + vectorScale( ( 0, 0, 1 ), 20 ) ); + self.angles = point.angles; + if ( in_last_stand ) + { + flag_set( "instant_revive" ); + self.stopflashingbadlytime = getTime() + 1000; + wait_network_frame(); + flag_clear( "instant_revive" ); + } + else + { + self thread maps\mp\zombies\_zm_laststand::auto_revive( self ); + self.waiting_to_revive = 0; + self.solo_respawn = 0; + self.lives--; + } + self freezecontrols( 0 ); + self.insta_killed = 0; + } + else + { + self dodamage( self.health + 1000, ( 0, 0, 1 ) ); + } + } + else + { + self dodamage( self.health + 1000, ( 0, 0, 1 ) ); + wait_network_frame(); + self.bleedout_time = 0; + } + self.insta_killed = 0; + } +} + escape_pod() { escape_pod = getent( "elevator_bldg1a_body", "targetname" ); @@ -184,101 +381,4 @@ escape_pod_get_all_alive_players_inside() } return players_in_escape_pod; -} - -insta_kill_player( perks_can_respawn_player, kill_if_falling ) -{ - self endon( "disconnect" ); - if ( isDefined( perks_can_respawn_player ) && perks_can_respawn_player == 0 ) - { - if ( self hasperk( "specialty_quickrevive" ) ) - { - self unsetperk( "specialty_quickrevive" ); - } - if ( self hasperk( "specialty_finalstand" ) ) - { - self unsetperk( "specialty_finalstand" ); - } - } - self maps\mp\zombies\_zm_buildables::player_return_piece_to_original_spawn(); - if ( isDefined( self.insta_killed ) && self.insta_killed ) - { - return; - } - if ( isDefined( self.ignore_insta_kill ) ) - { - self.disable_chugabud_corpse = 1; - return; - } - if ( self hasperk( "specialty_finalstand" ) ) - { - self.ignore_insta_kill = 1; - self.disable_chugabud_corpse = 1; - self dodamage( self.health + 1000, ( 0, 0, 1 ) ); - return; - } - if ( !isDefined( kill_if_falling ) || kill_if_falling == 0 ) - { - if ( !self isonground() ) - { - return; - } - } - if ( is_player_killable( self ) ) - { - self.insta_killed = 1; - in_last_stand = 0; - self notify( "chugabud_effects_cleanup" ); - if ( self maps\mp\zombies\_zm_laststand::player_is_in_laststand() ) - { - in_last_stand = 1; - } - self thread blood_splat(); - if ( getnumconnectedplayers() == 1 ) - { - if ( isDefined( self.solo_lives_given ) && self.solo_lives_given < 3 ) - { - self.waiting_to_revive = 1; - points = getstruct( "zone_green_start", "script_noteworthy" ); - spawn_points = getstructarray( points.target, "targetname" ); - point = spawn_points[ 0 ]; - if ( in_last_stand == 0 ) - { - self dodamage( self.health + 1000, ( 0, 0, 1 ) ); - } - wait 0.5; - self freezecontrols( 1 ); - wait 0.25; - self setorigin( point.origin + vectorScale( ( 0, 0, 1 ), 20 ) ); - self.angles = point.angles; - if ( in_last_stand ) - { - flag_set( "instant_revive" ); - self.stopflashingbadlytime = getTime() + 1000; - wait_network_frame(); - flag_clear( "instant_revive" ); - } - else - { - self thread maps\mp\zombies\_zm_laststand::auto_revive( self ); - self.waiting_to_revive = 0; - self.solo_respawn = 0; - self.lives--; - } - self freezecontrols( 0 ); - self.insta_killed = 0; - } - else - { - self dodamage( self.health + 1000, ( 0, 0, 1 ) ); - } - } - else - { - self dodamage( self.health + 1000, ( 0, 0, 1 ) ); - wait_network_frame(); - self.bleedout_time = 0; - } - self.insta_killed = 0; - } } \ No newline at end of file diff --git a/scripts/zm/replaced/zm_highrise_gamemodes.gsc b/scripts/zm/replaced/zm_highrise_gamemodes.gsc index 64c24de7..1af962f9 100644 --- a/scripts/zm/replaced/zm_highrise_gamemodes.gsc +++ b/scripts/zm/replaced/zm_highrise_gamemodes.gsc @@ -9,5 +9,5 @@ init() { add_map_gamemode( "zclassic", scripts\zm\replaced\zm_highrise::zclassic_preinit, undefined, undefined ); - add_map_location_gamemode( "zclassic", "rooftop", maps\mp\zm_highrise_classic::precache, maps\mp\zm_highrise_classic::main ); + add_map_location_gamemode( "zclassic", "rooftop", maps\mp\zm_highrise_classic::precache, scripts\zm\replaced\zm_highrise_classic::main ); } \ No newline at end of file diff --git a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc index 9d25e357..52072408 100644 --- a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc +++ b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc @@ -30,8 +30,6 @@ main() replaceFunc(maps\mp\zm_highrise_sq_pts::init_2, scripts\zm\replaced\zm_highrise_sq_pts::init_2); replaceFunc(maps\mp\zm_highrise_sq_pts::pts_should_player_create_trigs, scripts\zm\replaced\zm_highrise_sq_pts::pts_should_player_create_trigs); replaceFunc(maps\mp\zm_highrise_gamemodes::init, scripts\zm\replaced\zm_highrise_gamemodes::init); - replaceFunc(maps\mp\zm_highrise_classic::escape_pod, scripts\zm\replaced\zm_highrise_classic::escape_pod); - replaceFunc(maps\mp\zm_highrise_classic::insta_kill_player, scripts\zm\replaced\zm_highrise_classic::insta_kill_player); replaceFunc(maps\mp\zm_highrise_buildables::init_buildables, scripts\zm\replaced\zm_highrise_buildables::init_buildables); replaceFunc(maps\mp\zm_highrise_buildables::include_buildables, scripts\zm\replaced\zm_highrise_buildables::include_buildables); replaceFunc(maps\mp\zm_highrise_elevators::init_elevator_perks, scripts\zm\replaced\zm_highrise_elevators::init_elevator_perks);