diff --git a/README.md b/README.md index 119a5448..f4be28d7 100644 --- a/README.md +++ b/README.md @@ -560,7 +560,7 @@ ### Buried * Power automatically on * Noose and Guillotine parts automatically picked up -* Removed Turbine, keys, booze, and candy +* Removed Turbine, key, booze, and candy * Drawing weapons no longer gives points * Arthur barricades are buyable debris * Arthur can be purchased to feed him candy and make him run around and kill zombies for 30 seconds @@ -571,11 +571,13 @@ * Removed buildable table hint icons * Added buildable table hint strings on buildable purchase * Quest: all 5 signs must be meleed for wisp to spawn -* Quest: no longer need to activate the Time Bomb to be able to spawn the 2nd wisp -* Quest: no longer need to activate the lever in the Mansion before activating the bells -* Quest: bells can be activated in any order * Quest: changed number of targets that need to be hit to 20 multiplied by the amount of player * Quest: completion button always activatable after completing the quest +* Quest (Maxis): no longer need to activate the Time Bomb to be able to spawn the 2nd wisp +* Quest (Maxis): no longer need to activate the lever in the Mansion before activating the bells +* Quest (Maxis): bells can be activated in any order +* Quest (Richtofen): can enter round infinity without having all players next to the Guillotine +* Quest (Richtofen): Maze levers can be activated in an order #### Borough * Tunnels and bank area disabled diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index 0fd9f89e..5d2ac8f2 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -2820,9 +2820,13 @@ onuseplantobject_mtower( player ) self maps\mp\zombies\_zm_buildables::buildablestub_finish_build( player ); player playsound( "zmb_buildable_complete" ); - slot = self.buildablestruct.buildable_slot; - piece = player player_get_buildable_piece( slot ); - player player_destroy_piece( piece ); + players = get_players(); + foreach (other_player in players) + { + slot = self.buildablestruct.buildable_slot; + piece = other_player player_get_buildable_piece( slot ); + other_player player_destroy_piece( piece ); + } level thread unregister_tower_unitriggers(); } @@ -2839,9 +2843,13 @@ onuseplantobject_rtower( player ) self maps\mp\zombies\_zm_buildables::buildablestub_finish_build( player ); player playsound( "zmb_buildable_complete" ); - slot = self.buildablestruct.buildable_slot; - piece = player player_get_buildable_piece( slot ); - player player_destroy_piece( piece ); + players = get_players(); + foreach (other_player in players) + { + slot = self.buildablestruct.buildable_slot; + piece = other_player player_get_buildable_piece( slot ); + other_player player_destroy_piece( piece ); + } level thread unregister_tower_unitriggers(); } diff --git a/scripts/zm/replaced/_zm_weap_time_bomb.gsc b/scripts/zm/replaced/_zm_weap_time_bomb.gsc index 3f0c3761..babfa0b4 100644 --- a/scripts/zm/replaced/_zm_weap_time_bomb.gsc +++ b/scripts/zm/replaced/_zm_weap_time_bomb.gsc @@ -181,9 +181,6 @@ time_bomb_detonation() { level setclientfield( "time_bomb_lua_override", 1 ); - if ( isdefined( level._time_bomb.functionality_override ) && level._time_bomb.functionality_override ) - return; - playsoundatposition( "zmb_timebomb_timechange_2d", ( 0, 0, 0 ) ); _time_bomb_show_overlay(); time_bomb_clears_global_data(); @@ -197,7 +194,22 @@ time_bomb_detonation() flag_set( "spawn_zombies" ); delete_time_bomb_model(); _time_bomb_hide_overlay(); + level thread set_time_bomb_restore_active(); level setclientfield( "time_bomb_lua_override", 0 ); + + if ( isdefined( level._time_bomb.functionality_override ) && level._time_bomb.functionality_override ) + return; + + level notify( "time_bomb_detonation_complete" ); +} + +set_time_bomb_restore_active() +{ + flag_set( "time_bomb_restore_active" ); + + wait 0.05; + + flag_clear( "time_bomb_restore_active" ); } _time_bomb_kill_all_active_enemies() diff --git a/scripts/zm/replaced/zm_buried_sq_ip.gsc b/scripts/zm/replaced/zm_buried_sq_ip.gsc index 96a22742..8f443d06 100644 --- a/scripts/zm/replaced/zm_buried_sq_ip.gsc +++ b/scripts/zm/replaced/zm_buried_sq_ip.gsc @@ -108,4 +108,36 @@ sq_bp_button_pressed( str_tag, trig ) trig.triggered = 1; sq_bp_light_on( str_tag, "green" ); level notify( "sq_bp_correct_button" ); +} + +sq_ml_puzzle_logic() +{ + a_levers = getentarray( "sq_ml_lever", "targetname" ); + level.sq_ml_curr_lever = 0; + a_levers = array_randomize( a_levers ); + + for ( i = 0; i < a_levers.size; i++ ) + a_levers[i].n_lever_order = i; + + while ( true ) + { + level.sq_ml_curr_lever = 0; + sq_ml_puzzle_wait_for_levers(); + n_correct = 0; + + foreach ( m_lever in a_levers ) + { + playfxontag( level._effect["sq_spark"], m_lever, "tag_origin" ); + n_correct++; + m_lever playsound( "zmb_sq_maze_correct_spark" ); + } + + if ( n_correct == a_levers.size ) + flag_set( "sq_ip_puzzle_complete" ); + + level waittill( "zm_buried_maze_changed" ); + + level notify( "sq_ml_reset_levers" ); + wait 1; + } } \ No newline at end of file diff --git a/scripts/zm/replaced/zm_buried_sq_tpo.gsc b/scripts/zm/replaced/zm_buried_sq_tpo.gsc index fa8b60ec..b5170999 100644 --- a/scripts/zm/replaced/zm_buried_sq_tpo.gsc +++ b/scripts/zm/replaced/zm_buried_sq_tpo.gsc @@ -12,6 +12,36 @@ #include maps\mp\zm_buried_buildables; #include maps\mp\zm_buried_sq_tpo; +init() +{ + declare_sidequest_stage( "sq", "tpo", ::init_stage, ::stage_logic, ::exit_stage ); + flag_init( "sq_tpo_time_bomb_in_valid_location" ); + flag_init( "sq_tpo_players_in_position_for_time_warp" ); + flag_init( "sq_tpo_special_round_active" ); + flag_init( "sq_tpo_found_item" ); + flag_init( "sq_tpo_generator_powered" ); + flag_init( "sq_wisp_saved_with_time_bomb" ); + flag_init( "sq_tpo_stage_started" ); + maps\mp\zombies\_zm_weap_time_bomb::time_bomb_add_custom_func_global_save( ::time_bomb_saves_wisp_state ); + maps\mp\zombies\_zm_weap_time_bomb::time_bomb_add_custom_func_global_restore( ::time_bomb_restores_wisp_state ); + + level._effect["sq_tpo_time_bomb_fx"] = loadfx( "maps/zombie_buried/fx_buried_ghost_drain" ); + level.sq_tpo = spawnstruct(); + level thread setup_buildable_switch(); +} + +stage_logic() +{ + flag_set( "sq_tpo_stage_started" ); + + if ( flag( "sq_is_ric_tower_built" ) ) + stage_logic_richtofen(); + else + stage_logic_maxis(); + + stage_completed( "sq", level._cur_stage_name ); +} + stage_logic_maxis() { flag_clear( "sq_wisp_success" ); @@ -29,4 +59,89 @@ stage_logic_maxis() } level._cur_stage_name = "tpo"; +} + +stage_logic_richtofen() +{ + level endon( "sq_tpo_generator_powered" ); + + e_time_bomb_volume = getent( "sq_tpo_timebomb_volume", "targetname" ); + + do + { + flag_clear( "sq_tpo_time_bomb_in_valid_location" ); + + b_time_bomb_in_valid_location = 0; + while (1) + { + if ( isdefined( level.time_bomb_save_data ) && isdefined( level.time_bomb_save_data.time_bomb_model ) ) + { + b_time_bomb_in_valid_location = level.time_bomb_save_data.time_bomb_model istouching( e_time_bomb_volume ); + level.time_bomb_save_data.time_bomb_model.sq_location_valid = b_time_bomb_in_valid_location; + } + + if ( b_time_bomb_in_valid_location ) + { + break; + } + + level waittill( "new_time_bomb_set" ); + } + + playfxontag( level._effect["sq_tpo_time_bomb_fx"], level.time_bomb_save_data.time_bomb_model, "tag_origin" ); + flag_set( "sq_tpo_time_bomb_in_valid_location" ); + flag_set( "sq_tpo_players_in_position_for_time_warp" ); + wait_for_time_bomb_to_be_detonated_or_thrown_again(); + level notify( "sq_tpo_stop_checking_time_bomb_volume" ); + + if ( flag( "time_bomb_restore_active" ) ) + { + if ( flag( "sq_tpo_players_in_position_for_time_warp" ) ) + { + special_round_start(); + level notify( "sq_tpo_special_round_started" ); + start_item_hunt_with_timeout( 60 ); + special_round_end(); + level notify( "sq_tpo_special_round_ended" ); + } + } + + wait_network_frame(); + } + while ( !flag( "sq_tpo_generator_powered" ) ); +} + +special_round_start() +{ + flag_set( "sq_tpo_special_round_active" ); + level.sq_tpo.times_searched = 0; + flag_clear( "time_bomb_detonation_enabled" ); + level thread sndsidequestnoirmusic(); + make_super_zombies( 1 ); + a_players = get_players(); + + foreach ( player in a_players ) + vsmgr_activate( "visionset", "cheat_bw", player ); + + level setclientfield( "sq_tpo_special_round_active", 1 ); +} + +special_round_end() +{ + level setclientfield( "sq_tpo_special_round_active", 0 ); + level notify( "sndEndNoirMusic" ); + make_super_zombies( 0 ); + level._time_bomb.functionality_override = 0; + flag_set( "time_bomb_detonation_enabled" ); + scripts\zm\replaced\_zm_weap_time_bomb::time_bomb_detonation(); + + a_players = get_players(); + foreach ( player in a_players ) + { + vsmgr_deactivate( "visionset", "cheat_bw", player ); + player notify( "search_done" ); + } + + clean_up_special_round(); + flag_clear( "sq_tpo_special_round_active" ); } \ 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 157c2364..daabeaa5 100644 --- a/scripts/zm/zm_buried/zm_buried_reimagined.gsc +++ b/scripts/zm/zm_buried/zm_buried_reimagined.gsc @@ -36,7 +36,7 @@ main() replaceFunc(maps\mp\zm_buried_sq_bt::stage_vo_watch_gallows, scripts\zm\replaced\zm_buried_sq_bt::stage_vo_watch_gallows); replaceFunc(maps\mp\zm_buried_sq_bt::stage_vo_watch_guillotine, scripts\zm\replaced\zm_buried_sq_bt::stage_vo_watch_guillotine); replaceFunc(maps\mp\zm_buried_sq_ts::ts_sign_damage_watch, scripts\zm\replaced\zm_buried_sq_ts::ts_sign_damage_watch); - replaceFunc(maps\mp\zm_buried_sq_tpo::stage_logic_maxis, scripts\zm\replaced\zm_buried_sq_tpo::stage_logic_maxis); + replaceFunc(maps\mp\zm_buried_sq_tpo::init, scripts\zm\replaced\zm_buried_sq_tpo::init); replaceFunc(maps\mp\zm_buried_sq_ip::init, scripts\zm\replaced\zm_buried_sq_ip::init); replaceFunc(maps\mp\zm_buried_sq_ows::ows_targets_start, scripts\zm\replaced\zm_buried_sq_ows::ows_targets_start); replaceFunc(maps\mp\zombies\_zm_ai_sloth::sloth_init_start_funcs, scripts\zm\replaced\_zm_ai_sloth::sloth_init_start_funcs);