From 34b860a60e05fd6532d7b4d02edad06e847b5a26 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Sun, 2 Apr 2023 02:36:12 -0700 Subject: [PATCH] Buried: remove fall damage from fountain teleporter --- README.md | 1 + scripts/zm/replaced/zm_buried_fountain.gsc | 62 +++++++++++++++++++ scripts/zm/zm_buried/zm_buried_reimagined.gsc | 2 + 3 files changed, 65 insertions(+) create mode 100644 scripts/zm/replaced/zm_buried_fountain.gsc diff --git a/README.md b/README.md index dbc11644..62bc4ebd 100644 --- a/README.md +++ b/README.md @@ -554,6 +554,7 @@ * Ghosts no longer spawn a free perk powerup if any player gets damaged by the ghosts * Fountain portal automatically active * Navcard table automatically crafted +* Players no longer take fall damage after using the fountain teleporter * Players can no longer get into the corner next to Juggernog * Removed buildable table hint icons * Added buildable table hint strings on buildable purchase diff --git a/scripts/zm/replaced/zm_buried_fountain.gsc b/scripts/zm/replaced/zm_buried_fountain.gsc new file mode 100644 index 00000000..e512ecb3 --- /dev/null +++ b/scripts/zm/replaced/zm_buried_fountain.gsc @@ -0,0 +1,62 @@ +#include maps\mp\_utility; +#include common_scripts\utility; +#include maps\mp\zombies\_zm_utility; +#include maps\mp\zm_buried_classic; +#include maps\mp\zombies\_zm_ai_ghost; +#include maps\mp\zombies\_zm_stats; +#include maps\mp\zm_buried_fountain; + +transport_player_to_start_zone() +{ + self endon( "death_or_disconnect" ); + fountain_debug_print( "transport player!" ); + + if ( !isdefined( level._fountain_transporter ) ) + { + level._fountain_transporter = spawnstruct(); + level._fountain_transporter.index = 0; + level._fountain_transporter.end_points = getstructarray( "fountain_transport_end_location", "targetname" ); + } + + self playsoundtoplayer( "zmb_buried_teleport", self ); + self play_teleport_fx(); + self flash_screen_white(); + wait_network_frame(); + + if ( level._fountain_transporter.index >= level._fountain_transporter.end_points.size ) + level._fountain_transporter.index = 0; + + tries = 0; + + while ( positionwouldtelefrag( level._fountain_transporter.end_points[level._fountain_transporter.index].origin ) ) + { + tries++; + + if ( tries >= 4 ) + { + tries = 0; + wait 0.05; + } + + level._fountain_transporter.index++; + + if ( level._fountain_transporter.index >= level._fountain_transporter.end_points.size ) + level._fountain_transporter.index = 0; + } + + self setorigin( level._fountain_transporter.end_points[level._fountain_transporter.index].origin ); + self setplayerangles( level._fountain_transporter.end_points[level._fountain_transporter.index].angles ); + self setvelocity( ( 0, 0, 0 ) ); + level._fountain_transporter.index++; + wait_network_frame(); + self play_teleport_fx(); + self thread flash_screen_fade_out(); + self maps\mp\zm_buried_classic::buried_set_start_area_lighting(); + self thread maps\mp\zombies\_zm_ai_ghost::behave_after_fountain_transport( self ); + self maps\mp\zombies\_zm_stats::increment_client_stat( "buried_fountain_transporter_used", 0 ); + self maps\mp\zombies\_zm_stats::increment_player_stat( "buried_fountain_transporter_used" ); + self notify( "player_used_fountain_teleporter" ); + wait_network_frame(); + wait_network_frame(); + self.is_in_fountain_transport_trigger = 0; +} \ No newline at end of file diff --git a/scripts/zm/zm_buried/zm_buried_reimagined.gsc b/scripts/zm/zm_buried/zm_buried_reimagined.gsc index 0ed8b717..30b7c3c1 100644 --- a/scripts/zm/zm_buried/zm_buried_reimagined.gsc +++ b/scripts/zm/zm_buried/zm_buried_reimagined.gsc @@ -4,6 +4,7 @@ #include scripts\zm\replaced\zm_buried_gamemodes; #include scripts\zm\replaced\zm_buried_ffotd; +#include scripts\zm\replaced\zm_buried_fountain; #include scripts\zm\replaced\_zm_buildables_pooled; #include scripts\zm\replaced\_zm_equip_subwoofer; #include scripts\zm\replaced\_zm_equip_springpad; @@ -20,6 +21,7 @@ main() replaceFunc(maps\mp\zm_buried_gamemodes::init, scripts\zm\replaced\zm_buried_gamemodes::init); replaceFunc(maps\mp\zm_buried_gamemodes::buildbuildable, scripts\zm\replaced\zm_buried_gamemodes::buildbuildable); replaceFunc(maps\mp\zm_buried_ffotd::spawned_life_triggers, scripts\zm\replaced\zm_buried_ffotd::spawned_life_triggers); + replaceFunc(maps\mp\zm_buried_fountain::transport_player_to_start_zone, scripts\zm\replaced\zm_buried_fountain::transport_player_to_start_zone); replaceFunc(maps\mp\zombies\_zm_buildables_pooled::add_buildable_to_pool, scripts\zm\replaced\_zm_buildables_pooled::add_buildable_to_pool); replaceFunc(maps\mp\zombies\_zm_buildables_pooled::randomize_pooled_buildables, scripts\zm\replaced\_zm_buildables_pooled::randomize_pooled_buildables); replaceFunc(maps\mp\zombies\_zm_equip_subwoofer::startsubwooferdecay, scripts\zm\replaced\_zm_equip_subwoofer::startsubwooferdecay);