diff --git a/README.md b/README.md index e7c2248a..58169d17 100644 --- a/README.md +++ b/README.md @@ -503,7 +503,7 @@ * Upgraded Tower Trap stays upgraded until the end of the round * Plane parts are shared in coop * Plane parts must be all acquired to craft -* Plane fuel automatically picked up +* Plane no longer has to be refueled after first use * Key no longer shows on HUD * Players no longer respawn in the Acid Trap * Zombies spawn in the Docks zone when in the Docks Gates zone diff --git a/scripts/zm/replaced/zm_alcatraz_craftables.gsc b/scripts/zm/replaced/zm_alcatraz_craftables.gsc index 5142e569..2a2ccebd 100644 --- a/scripts/zm/replaced/zm_alcatraz_craftables.gsc +++ b/scripts/zm/replaced/zm_alcatraz_craftables.gsc @@ -10,6 +10,24 @@ #include maps\mp\zm_alcatraz_travel; #include maps\mp\zm_alcatraz_craftables; +init_craftables() +{ + precachestring( &"ZM_PRISON_KEY_DOOR" ); + level.craftable_piece_count = 10; + register_clientfields(); + add_zombie_craftable( "alcatraz_shield_zm", &"ZM_PRISON_CRAFT_RIOT", undefined, &"ZOMBIE_BOUGHT_RIOT", undefined, 1 ); + add_zombie_craftable_vox_category( "alcatraz_shield_zm", "build_zs" ); + make_zombie_craftable_open( "alcatraz_shield_zm", "t6_wpn_zmb_shield_dlc2_dmg0_world", vectorscale( ( 0, -1, 0 ), 90.0 ), ( 0, 0, level.riotshield_placement_zoffset ) ); + add_zombie_craftable( "packasplat", &"ZM_PRISON_CRAFT_PACKASPLAT", undefined, undefined, ::onfullycrafted_packasplat, 1 ); + add_zombie_craftable_vox_category( "packasplat", "build_bsm" ); + make_zombie_craftable_open( "packasplat", "p6_anim_zm_al_packasplat", vectorscale( ( 0, -1, 0 ), 90.0 ) ); + level.craftable_piece_swap_allowed = 0; + add_zombie_craftable( "quest_key1" ); + add_zombie_craftable( "plane", &"ZM_PRISON_CRAFT_PLANE", &"ZM_PRISON_CRAFTING_PLANE", undefined, ::onfullycrafted_plane, 1 ); + add_zombie_craftable( "refuelable_plane", &"ZM_PRISON_REFUEL_PLANE", &"ZM_PRISON_REFUELING_PLANE", undefined, ::onfullycrafted_refueled, 1 ); + in_game_checklist_setup(); +} + include_craftables() { level.zombie_include_craftables["open_table"].custom_craftablestub_update_prompt = ::prison_open_craftablestub_update_prompt; @@ -44,19 +62,16 @@ include_craftables() plane_steering = generate_zombie_craftable_piece( craftable_name, "steering", "veh_t6_dlc_zombie_part_control", 32, 15, 0, undefined, ::onpickup_plane, ::ondrop_plane, ::oncrafted_plane, undefined, "tag_control_mechanism", undefined, 4 ); plane_rigging = generate_zombie_craftable_piece( craftable_name, "rigging", "veh_t6_dlc_zombie_part_rigging", 32, 15, 0, undefined, ::onpickup_plane, ::ondrop_plane, ::oncrafted_plane, undefined, "tag_origin", undefined, 5 ); - if ( level.is_forever_solo_game ) - { - plane_cloth.is_shared = 1; - plane_fueltanks.is_shared = 1; - plane_engine.is_shared = 1; - plane_steering.is_shared = 1; - plane_rigging.is_shared = 1; - plane_cloth.client_field_state = undefined; - plane_fueltanks.client_field_state = undefined; - plane_engine.client_field_state = undefined; - plane_steering.client_field_state = undefined; - plane_rigging.client_field_state = undefined; - } + plane_cloth.is_shared = 1; + plane_fueltanks.is_shared = 1; + plane_engine.is_shared = 1; + plane_steering.is_shared = 1; + plane_rigging.is_shared = 1; + plane_cloth.client_field_state = undefined; + plane_fueltanks.client_field_state = undefined; + plane_engine.client_field_state = undefined; + plane_steering.client_field_state = undefined; + plane_rigging.client_field_state = undefined; plane_cloth.pickup_alias = "sidequest_sheets"; plane_fueltanks.pickup_alias = "sidequest_oxygen"; @@ -80,19 +95,16 @@ include_craftables() refuelable_plane_gas4 = generate_zombie_craftable_piece( craftable_name, "fuel4", "accessories_gas_canister_1", 32, 15, 0, undefined, ::onpickup_fuel, ::ondrop_fuel, ::oncrafted_fuel, undefined, undefined, undefined, 9 ); refuelable_plane_gas5 = generate_zombie_craftable_piece( craftable_name, "fuel5", "accessories_gas_canister_1", 32, 15, 0, undefined, ::onpickup_fuel, ::ondrop_fuel, ::oncrafted_fuel, undefined, undefined, undefined, 10 ); - if ( level.is_forever_solo_game ) - { - refuelable_plane_gas1.is_shared = 1; - refuelable_plane_gas2.is_shared = 1; - refuelable_plane_gas3.is_shared = 1; - refuelable_plane_gas4.is_shared = 1; - refuelable_plane_gas5.is_shared = 1; - refuelable_plane_gas1.client_field_state = undefined; - refuelable_plane_gas2.client_field_state = undefined; - refuelable_plane_gas3.client_field_state = undefined; - refuelable_plane_gas4.client_field_state = undefined; - refuelable_plane_gas5.client_field_state = undefined; - } + refuelable_plane_gas1.is_shared = 1; + refuelable_plane_gas2.is_shared = 1; + refuelable_plane_gas3.is_shared = 1; + refuelable_plane_gas4.is_shared = 1; + refuelable_plane_gas5.is_shared = 1; + refuelable_plane_gas1.client_field_state = undefined; + refuelable_plane_gas2.client_field_state = undefined; + refuelable_plane_gas3.client_field_state = undefined; + refuelable_plane_gas4.client_field_state = undefined; + refuelable_plane_gas5.client_field_state = undefined; refuelable_plane = spawnstruct(); refuelable_plane.name = craftable_name; diff --git a/scripts/zm/replaced/zm_alcatraz_sq.gsc b/scripts/zm/replaced/zm_alcatraz_sq.gsc new file mode 100644 index 00000000..583cbb20 --- /dev/null +++ b/scripts/zm/replaced/zm_alcatraz_sq.gsc @@ -0,0 +1,173 @@ +#include common_scripts\utility; +#include maps\mp\_utility; +#include maps\_utility; +#include maps\_vehicle; +#include maps\mp\zombies\_zm_afterlife; +#include maps\mp\zombies\_zm_utility; +#include maps\mp\zombies\_zm_craftables; +#include maps\mp\zombies\_zm_sidequests; +#include maps\mp\zm_alcatraz_utility; +#include maps\mp\gametypes_zm\_hud_util; +#include maps\mp\gametypes_zm\_hud; +#include maps\mp\zm_prison_sq_final; +#include maps\mp\zm_alcatraz_sq_vo; +#include maps\mp\zombies\_zm_equipment; +#include maps\mp\zombies\_zm_unitrigger; +#include maps\mp\zm_alcatraz_sq_nixie; +#include maps\mp\zombies\_zm_audio; +#include maps\mp\zombies\_zm_ai_brutus; +#include maps\mp\animscripts\shared; +#include maps\mp\zombies\_zm_ai_basic; +#include maps\mp\zombies\_zm_laststand; +#include maps\mp\zombies\_zm_clone; +#include maps\mp\zm_alcatraz_sq; + +track_quest_status_thread() +{ + while ( true ) + { + while ( level.characters_in_nml.size == 0 ) + wait 1; + + while ( level.characters_in_nml.size > 0 ) + wait 1; + + if ( flag( "plane_trip_to_nml_successful" ) ) + { + bestow_quest_rewards(); + flag_clear( "plane_trip_to_nml_successful" ); + } + + level notify( "bridge_empty" ); + + level waittill( "start_of_round" ); + + if ( level.n_quest_iteration_count == 2 ) + vo_play_four_part_conversation( level.four_part_convos["alcatraz_return_alt" + randomintrange( 0, 2 )] ); + + prep_for_new_quest(); + t_plane_fly = getent( "plane_fly_trigger", "targetname" ); + t_plane_fly sethintstring( &"ZM_PRISON_PLANE_BEGIN_TAKEOFF" ); + t_plane_fly trigger_on(); + } +} + +prep_for_new_quest() +{ + for ( i = 1; i < 4; i++ ) + { + str_trigger_targetname = "trigger_electric_chair_" + i; + t_electric_chair = getent( str_trigger_targetname, "targetname" ); + t_electric_chair sethintstring( &"ZM_PRISON_ELECTRIC_CHAIR_ACTIVATE" ); + t_electric_chair trigger_on(); + } + + for ( i = 1; i < 5; i++ ) + { + m_electric_chair = getent( "electric_chair_" + i, "targetname" ); + m_electric_chair notify( "bridge_empty" ); + } + + m_plane_craftable = getent( "plane_craftable", "targetname" ); + m_plane_craftable show(); + playfxontag( level._effect["fx_alcatraz_plane_apear"], m_plane_craftable, "tag_origin" ); + veh_plane_flyable = getent( "plane_flyable", "targetname" ); + veh_plane_flyable attachpath( getvehiclenode( "zombie_plane_underground", "targetname" ) ); + vo_play_four_part_conversation( level.four_part_convos["alcatraz_return_quest_reset"] ); + flag_clear( "plane_is_away" ); +} + +plane_flight_thread() +{ + while ( true ) + { + m_plane_about_to_crash = getent( "plane_about_to_crash", "targetname" ); + m_plane_craftable = getent( "plane_craftable", "targetname" ); + t_plane_fly = getent( "plane_fly_trigger", "targetname" ); + veh_plane_flyable = getent( "plane_flyable", "targetname" ); + m_plane_about_to_crash ghost(); + flag_wait( "plane_boarded" ); + level clientnotify( "sndPB" ); + + if ( !( isdefined( level.music_override ) && level.music_override ) ) + t_plane_fly playloopsound( "mus_event_plane_countdown_loop", 0.25 ); + + for ( i = 10; i > 0; i-- ) + { + veh_plane_flyable playsound( "zmb_plane_countdown_tick" ); + wait 1; + } + + t_plane_fly stoploopsound( 2 ); + exploder( 10000 ); + veh_plane_flyable attachpath( getvehiclenode( "zombie_plane_flight_path", "targetname" ) ); + veh_plane_flyable startpath(); + flag_set( "plane_departed" ); + t_plane_fly trigger_off(); + m_plane_craftable ghost(); + veh_plane_flyable setvisibletoall(); + level setclientfield( "fog_stage", 1 ); + playfxontag( level._effect["fx_alcatraz_plane_trail"], veh_plane_flyable, "tag_origin" ); + wait 2; + playfxontag( level._effect["fx_alcatraz_plane_trail_fast"], veh_plane_flyable, "tag_origin" ); + wait 3; + exploder( 10001 ); + wait 4; + playfxontag( level._effect["fx_alcatraz_flight_lightning"], veh_plane_flyable, "tag_origin" ); + level setclientfield( "scripted_lightning_flash", 1 ); + wait 1; + flag_set( "plane_approach_bridge" ); + stop_exploder( 10001 ); + level setclientfield( "fog_stage", 2 ); + veh_plane_flyable attachpath( getvehiclenode( "zombie_plane_bridge_approach", "targetname" ) ); + veh_plane_flyable startpath(); + wait 6; + playfxontag( level._effect["fx_alcatraz_flight_lightning"], veh_plane_flyable, "tag_origin" ); + level setclientfield( "scripted_lightning_flash", 1 ); + + veh_plane_flyable waittill( "reached_end_node" ); + + flag_set( "plane_zapped" ); + level setclientfield( "fog_stage", 3 ); + veh_plane_flyable setinvisibletoall(); + n_crash_duration = 2.25; + nd_plane_about_to_crash_1 = getstruct( "plane_about_to_crash_point_1", "targetname" ); + m_plane_about_to_crash.origin = nd_plane_about_to_crash_1.origin; + nd_plane_about_to_crash_2 = getstruct( "plane_about_to_crash_point_2", "targetname" ); + m_plane_about_to_crash moveto( nd_plane_about_to_crash_2.origin, n_crash_duration ); + m_plane_about_to_crash thread spin_while_falling(); + stop_exploder( 10000 ); + + m_plane_about_to_crash waittill( "movedone" ); + + flag_set( "plane_crashed" ); + wait 2; + level setclientfield( "scripted_lightning_flash", 1 ); + m_plane_about_to_crash.origin += vectorscale( ( 0, 0, -1 ), 2048.0 ); + wait 4; + veh_plane_flyable setvisibletoall(); + veh_plane_flyable play_fx( "fx_alcatraz_plane_fire_trail", veh_plane_flyable.origin, veh_plane_flyable.angles, "reached_end_node", 1, "tag_origin", undefined ); + veh_plane_flyable attachpath( getvehiclenode( "zombie_plane_bridge_flyby", "targetname" ) ); + veh_plane_flyable startpath(); + veh_plane_flyable thread sndpc(); + + veh_plane_flyable waittill( "reached_end_node" ); + + veh_plane_flyable setinvisibletoall(); + wait 20; + + if ( !level.final_flight_activated ) + { + if ( isdefined( level.brutus_on_the_bridge_custom_func ) ) + level thread [[ level.brutus_on_the_bridge_custom_func ]](); + else + level thread brutus_on_the_bridge(); + } + + flag_clear( "plane_boarded" ); + flag_clear( "plane_departed" ); + flag_clear( "plane_approach_bridge" ); + flag_clear( "plane_zapped" ); + flag_clear( "plane_crashed" ); + } +} \ No newline at end of file diff --git a/scripts/zm/zm_prison/zm_prison_reimagined.gsc b/scripts/zm/zm_prison/zm_prison_reimagined.gsc index 33328646..10828d30 100644 --- a/scripts/zm/zm_prison/zm_prison_reimagined.gsc +++ b/scripts/zm/zm_prison/zm_prison_reimagined.gsc @@ -9,6 +9,7 @@ #include scripts\zm\replaced\zm_alcatraz_craftables; #include scripts\zm\replaced\zm_alcatraz_gamemodes; #include scripts\zm\replaced\zm_alcatraz_utility; +#include scripts\zm\replaced\zm_alcatraz_sq; #include scripts\zm\replaced\zm_alcatraz_weap_quest; #include scripts\zm\replaced\_zm_afterlife; #include scripts\zm\replaced\_zm_ai_brutus; @@ -21,9 +22,12 @@ main() { replaceFunc(maps\mp\zm_alcatraz_classic::give_afterlife, scripts\zm\replaced\zm_alcatraz_classic::give_afterlife); + replaceFunc(maps\mp\zm_alcatraz_craftables::init_craftables, scripts\zm\replaced\zm_alcatraz_craftables::init_craftables); replaceFunc(maps\mp\zm_alcatraz_craftables::include_craftables, scripts\zm\replaced\zm_alcatraz_craftables::include_craftables); replaceFunc(maps\mp\zm_alcatraz_gamemodes::init, scripts\zm\replaced\zm_alcatraz_gamemodes::init); replaceFunc(maps\mp\zm_alcatraz_utility::blundergat_upgrade_station, scripts\zm\replaced\zm_alcatraz_utility::blundergat_upgrade_station); + replaceFunc(maps\mp\zm_alcatraz_sq::track_quest_status_thread, scripts\zm\replaced\zm_alcatraz_sq::track_quest_status_thread); + replaceFunc(maps\mp\zm_alcatraz_sq::plane_flight_thread, scripts\zm\replaced\zm_alcatraz_sq::plane_flight_thread); replaceFunc(maps\mp\zm_alcatraz_weap_quest::grief_soul_catcher_state_manager, scripts\zm\replaced\zm_alcatraz_weap_quest::grief_soul_catcher_state_manager); replaceFunc(maps\mp\zombies\_zm_afterlife::afterlife_add, scripts\zm\replaced\_zm_afterlife::afterlife_add); replaceFunc(maps\mp\zombies\_zm_ai_brutus::init, scripts\zm\replaced\_zm_ai_brutus::init); @@ -61,10 +65,6 @@ init() tower_trap_changes(); - plane_set_need_all_pieces(); - plane_set_pieces_shared(); - - level thread plane_auto_refuel(); level thread updatecraftables(); level thread grief_brutus_spawn_after_time(); } @@ -294,54 +294,6 @@ tower_upgrade_trigger_think() } } -plane_set_need_all_pieces() -{ - if(!(is_classic() && level.scr_zm_map_start_location == "prison")) - { - return; - } - - level.zombie_craftablestubs["plane"].need_all_pieces = 1; - level.zombie_craftablestubs["refuelable_plane"].need_all_pieces = 1; -} - -plane_set_pieces_shared() -{ - if(!(is_classic() && level.scr_zm_map_start_location == "prison")) - { - return; - } - - foreach(stub in level.zombie_include_craftables) - { - if(stub.name == "plane" || stub.name == "refuelable_plane") - { - foreach(piece in stub.a_piecestubs) - { - piece.is_shared = 1; - piece.client_field_state = undefined; - } - } - } -} - -plane_auto_refuel() -{ - if(!(is_classic() && level.scr_zm_map_start_location == "prison")) - { - return; - } - - for ( ;; ) - { - flag_wait( "spawn_fuel_tanks" ); - - wait 0.05; - - scripts\zm\_zm_reimagined::buildcraftable( "refuelable_plane" ); - } -} - updatecraftables() { flag_wait( "start_zombie_round_logic" );