From f4a911a7939d5af484cc3dc7c61ea26b087cd89b Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Sun, 2 Jan 2022 16:36:45 -0800 Subject: [PATCH] Mystery Box: moves to new location instantly --- README.md | 1 + scripts/zm/_zm_reimagined.gsc | 1 + scripts/zm/replaced/_zm_magicbox.gsc | 45 ++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/README.md b/README.md index 24891a11..25d19657 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ ## Mystery Box * Decreased weapon pickup time from 12 seconds to 9 seconds +* Moves to new location instantly ## Perks * No longer deactivated if the perk machine is powered off diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index 1849dfb1..e7cfd00f 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -22,6 +22,7 @@ main() replaceFunc(maps/mp/zombies/_zm_utility::is_headshot, scripts/zm/replaced/_zm_utility::is_headshot); replaceFunc(maps/mp/zombies/_zm_weapons::get_upgraded_ammo_cost, scripts/zm/replaced/_zm_weapons::get_upgraded_ammo_cost); replaceFunc(maps/mp/zombies/_zm_weapons::makegrenadedudanddestroy, scripts/zm/replaced/_zm_weapons::makegrenadedudanddestroy); + replaceFunc(maps/mp/zombies/_zm_magicbox::treasure_chest_move, scripts/zm/replaced/_zm_magicbox::treasure_chest_move); replaceFunc(maps/mp/zombies/_zm_magicbox::treasure_chest_timeout, scripts/zm/replaced/_zm_magicbox::treasure_chest_timeout); replaceFunc(maps/mp/zombies/_zm_magicbox::timer_til_despawn, scripts/zm/replaced/_zm_magicbox::timer_til_despawn); replaceFunc(maps/mp/zombies/_zm_powerups::nuke_powerup, scripts/zm/replaced/_zm_powerups::nuke_powerup); diff --git a/scripts/zm/replaced/_zm_magicbox.gsc b/scripts/zm/replaced/_zm_magicbox.gsc index f63bfcd6..a59fa90e 100644 --- a/scripts/zm/replaced/_zm_magicbox.gsc +++ b/scripts/zm/replaced/_zm_magicbox.gsc @@ -2,6 +2,51 @@ #include common_scripts\utility; #include maps\mp\zombies\_zm_utility; +treasure_chest_move( player_vox ) +{ + level waittill( "weapon_fly_away_start" ); + players = get_players(); + array_thread( players, maps/mp/zombies/_zm_magicbox::play_crazi_sound ); + if ( isDefined( player_vox ) ) + { + player_vox delay_thread( randomintrange( 2, 7 ), maps/mp/zombies/_zm_audio::create_and_play_dialog, "general", "box_move" ); + } + level waittill( "weapon_fly_away_end" ); + if ( isDefined( self.zbarrier ) ) + { + self maps/mp/zombies/_zm_magicbox::hide_chest( 1 ); + } + wait 0.1; + if ( level.zombie_vars[ "zombie_powerup_fire_sale_on" ] == 1 && self [[ level._zombiemode_check_firesale_loc_valid_func ]]() ) + { + current_sale_time = level.zombie_vars[ "zombie_powerup_fire_sale_time" ]; + wait_network_frame(); + self thread maps/mp/zombies/_zm_magicbox::fire_sale_fix(); + level.zombie_vars[ "zombie_powerup_fire_sale_time" ] = current_sale_time; + while ( level.zombie_vars[ "zombie_powerup_fire_sale_time" ] > 0 ) + { + wait 0.1; + } + } + level.verify_chest = 0; + if ( isDefined( level._zombiemode_custom_box_move_logic ) ) + { + [[ level._zombiemode_custom_box_move_logic ]](); + } + else + { + maps/mp/zombies/_zm_magicbox::default_box_move_logic(); + } + if ( isDefined( level.chests[ level.chest_index ].box_hacks[ "summon_box" ] ) ) + { + level.chests[ level.chest_index ] [[ level.chests[ level.chest_index ].box_hacks[ "summon_box" ] ]]( 0 ); + } + playfx( level._effect[ "poltergeist" ], level.chests[ level.chest_index ].zbarrier.origin ); + level.chests[ level.chest_index ] maps/mp/zombies/_zm_magicbox::show_chest(); + flag_clear( "moving_chest_now" ); + self.zbarrier.chest_moving = 0; +} + treasure_chest_timeout() { self endon( "user_grabbed_weapon" );