From f947a93f6614fcec85c4260cb68ed67c41beb15f Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Sun, 5 Mar 2023 15:53:33 -0800 Subject: [PATCH] Origins: fix ascend from darkness quest step --- scripts/zm/replaced/zm_tomb_craftables.gsc | 28 --------- .../zm/replaced/zm_tomb_ee_main_step_2.gsc | 63 ++++++++++++++----- scripts/zm/zm_tomb/zm_tomb_reimagined.gsc | 2 +- 3 files changed, 50 insertions(+), 43 deletions(-) diff --git a/scripts/zm/replaced/zm_tomb_craftables.gsc b/scripts/zm/replaced/zm_tomb_craftables.gsc index f42565f5..133a4f51 100644 --- a/scripts/zm/replaced/zm_tomb_craftables.gsc +++ b/scripts/zm/replaced/zm_tomb_craftables.gsc @@ -13,34 +13,6 @@ #include maps\mp\zombies\_zm_equipment; #include maps\mp\zm_tomb_craftables; -is_unclaimed_staff_weapon( str_weapon ) -{ - if ( !maps\mp\zombies\_zm_equipment::is_limited_equipment( str_weapon ) ) - { - return true; - } - - s_elemental_staff = get_staff_info_from_weapon_name( str_weapon, 0 ); - players = get_players(); - - foreach ( player in players ) - { - if ( isdefined( player ) && player has_weapon_or_upgrade( s_elemental_staff.weapname ) ) - { - return false; - } - } - - e_upgraded_staff = maps\mp\zm_tomb_craftables::get_staff_info_from_weapon_name( str_weapon ); - - if (is_true(e_upgraded_staff.ee_in_use)) - { - return false; - } - - return true; -} - quadrotor_control_thread() { self endon( "bled_out" ); diff --git a/scripts/zm/replaced/zm_tomb_ee_main_step_2.gsc b/scripts/zm/replaced/zm_tomb_ee_main_step_2.gsc index ce5be947..60c961e1 100644 --- a/scripts/zm/replaced/zm_tomb_ee_main_step_2.gsc +++ b/scripts/zm/replaced/zm_tomb_ee_main_step_2.gsc @@ -63,35 +63,70 @@ robot_head_trigger_think() str_weap_staffs = array("staff_air_upgraded_zm", "staff_lightning_upgraded_zm", "staff_fire_upgraded_zm", "staff_water_upgraded_zm"); - e_upgraded_staffs = []; - for (i = 0; i < str_weap_staffs.size; i++) - { - e_upgraded_staffs[i] = maps\mp\zm_tomb_craftables::get_staff_info_from_weapon_name( str_weap_staffs[i] ); - } - - staff_placed = 0; - - while ( !staff_placed ) + while ( true ) { self waittill( "trigger", player ); + if (is_true(self.stub.staff_placed)) + { + continue; + } + for (i = 0; i < str_weap_staffs.size; i++) { if ( player hasweapon( str_weap_staffs[i] ) ) { - staff_placed = 1; - e_upgraded_staffs[i].ee_in_use = 1; + self.stub.staff_placed = 1; + + e_upgraded_staff = maps\mp\zm_tomb_craftables::get_staff_info_from_weapon_name( str_weap_staffs[i] ); + + for (j = 0; j < level.a_elemental_staffs_upgraded.size; j++) + { + if (level.a_elemental_staffs_upgraded[j].weapname == str_weap_staffs[i]) + { + level.a_elemental_staffs_upgraded[j].ee_in_use = 1; + + } + } + player takeweapon( str_weap_staffs[i] ); maps\mp\zm_tomb_craftables::clear_player_staff( str_weap_staffs[i] ); level.n_ee_robot_staffs_planted++; if ( level.n_ee_robot_staffs_planted == 4 ) + { flag_set( "ee_all_staffs_placed" ); + } - e_upgraded_staffs[i] thread place_staff( self.stub.m_plinth ); - - break; + e_upgraded_staff thread place_staff( self.stub.m_plinth ); } } } +} + +remove_plinth() +{ + playfx( level._effect["teleport_1p"], self.m_plinth.origin ); + playsoundatposition( "zmb_footprintbox_disappear", self.m_plinth.origin ); + wait 3; + + if ( isdefined( self.m_plinth.m_staff ) ) + { + self.m_plinth.m_staff unlink(); + self.m_plinth.m_staff.origin = self.m_plinth.v_old_origin; + self.m_plinth.m_staff.angles = self.m_plinth.v_old_angles; + + for (i = 0; i < level.a_elemental_staffs_upgraded.size; i++) + { + if (level.a_elemental_staffs_upgraded[i].weapname == self.m_plinth.e_staff.upgrade.weapname) + { + level.a_elemental_staffs_upgraded[i].ee_in_use = undefined; + } + } + } + + self.m_sign delete(); + self.m_plinth delete(); + self.m_coll delete(); + unregister_unitrigger( self ); } \ 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 index 34dacae3..cfc89bb0 100644 --- a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc +++ b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc @@ -22,8 +22,8 @@ main() replaceFunc(maps\mp\zm_tomb_quest_fire::fire_puzzle_1_run, scripts\zm\replaced\zm_tomb_quest_fire::fire_puzzle_1_run); replaceFunc(maps\mp\zm_tomb_quest_ice::ice_puzzle_1_run, scripts\zm\replaced\zm_tomb_quest_ice::ice_puzzle_1_run); replaceFunc(maps\mp\zm_tomb_ee_main_step_2::create_robot_head_trigger, scripts\zm\replaced\zm_tomb_ee_main_step_2::create_robot_head_trigger); + replaceFunc(maps\mp\zm_tomb_ee_main_step_2::remove_plinth, scripts\zm\replaced\zm_tomb_ee_main_step_2::remove_plinth); replaceFunc(maps\mp\zm_tomb_ee_main_step_3::fire_link_cooldown, scripts\zm\replaced\zm_tomb_ee_main_step_3::fire_link_cooldown); - replaceFunc(maps\mp\zm_tomb_craftables::is_unclaimed_staff_weapon, scripts\zm\replaced\zm_tomb_craftables::is_unclaimed_staff_weapon); replaceFunc(maps\mp\zm_tomb_craftables::quadrotor_control_thread, scripts\zm\replaced\zm_tomb_craftables::quadrotor_control_thread); replaceFunc(maps\mp\zm_tomb_challenges::challenges_init, scripts\zm\replaced\zm_tomb_challenges::challenges_init); replaceFunc(maps\mp\zm_tomb_dig::increment_player_perk_purchase_limit, scripts\zm\replaced\zm_tomb_dig::increment_player_perk_purchase_limit);