diff --git a/README.md b/README.md index c8eec9ba..516e3188 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,9 @@ * Increased trigger radius * Decreased upgraded ammo cost from 4500 to 2500 +## Mystery Box +* Decreased weapon pickup time from 12 seconds to 9 seconds + ## 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 4af56dc3..819cc781 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -7,6 +7,7 @@ #include scripts/zm/replaced/_zm_playerhealth; #include scripts/zm/replaced/_zm_utility; #include scripts/zm/replaced/_zm_weapons; +#include scripts/zm/replaced/_zm_magicbox; #include scripts/zm/replaced/_zm_powerups; #include scripts/zm/replaced/_zm_equipment; #include scripts/zm/replaced/_zm_ai_basic; @@ -21,6 +22,8 @@ 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_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); replaceFunc(maps/mp/zombies/_zm_equipment::placed_equipment_think, scripts/zm/replaced/_zm_equipment::placed_equipment_think); replaceFunc(maps/mp/zombies/_zm_ai_basic::inert_wakeup, scripts/zm/replaced/_zm_ai_basic::inert_wakeup); @@ -146,6 +149,7 @@ post_all_players_spawned() maps/mp/zombies/_zm::register_player_damage_callback( ::player_damage_override ); level.near_miss = 2; // makes screecher not run away first time on solo + level.magicbox_timeout = 9; level.equipment_etrap_needs_power = 0; level.equipment_turret_needs_power = 0; level.equipment_subwoofer_needs_power = 0; diff --git a/scripts/zm/replaced/_zm_magicbox.gsc b/scripts/zm/replaced/_zm_magicbox.gsc new file mode 100644 index 00000000..f63bfcd6 --- /dev/null +++ b/scripts/zm/replaced/_zm_magicbox.gsc @@ -0,0 +1,23 @@ +#include maps\mp\_utility; +#include common_scripts\utility; +#include maps\mp\zombies\_zm_utility; + +treasure_chest_timeout() +{ + self endon( "user_grabbed_weapon" ); + self.zbarrier endon( "box_hacked_respin" ); + self.zbarrier endon( "box_hacked_rerespin" ); + wait level.magicbox_timeout; + self notify( "trigger", level ); +} + +timer_til_despawn( v_float ) +{ + self endon( "kill_weapon_movement" ); + self moveto( self.origin - ( v_float * 0.85 ), level.magicbox_timeout, level.magicbox_timeout * 0.5 ); + wait level.magicbox_timeout; + if ( isDefined( self ) ) + { + self delete(); + } +} \ 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 new file mode 100644 index 00000000..1fc24210 --- /dev/null +++ b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc @@ -0,0 +1,20 @@ +#include maps\mp\_utility; +#include common_scripts\utility; +#include maps\mp\zombies\_zm_utility; + +init() +{ + level.custom_magic_box_timer_til_despawn = ::custom_magic_box_timer_til_despawn; +} + +custom_magic_box_timer_til_despawn( magic_box ) +{ + self endon( "kill_weapon_movement" ); + v_float = anglesToForward( magic_box.angles - vectorScale( ( 0, 1, 0 ), 90 ) ) * 40; + self moveto( self.origin - ( v_float * 0.25 ), level.magicbox_timeout, level.magicbox_timeout * 0.5 ); + wait level.magicbox_timeout; + if ( isDefined( self ) ) + { + self delete(); + } +} \ No newline at end of file