1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-10 07:08:06 -05:00

Make all progress bars update client side

This commit is contained in:
Jbleezy
2023-05-03 01:41:30 -07:00
parent 7ecefb8f77
commit a92f027b07
3 changed files with 70 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include scripts\zm\replaced\_zm_weapons;
#include scripts\zm\replaced\_zm_magicbox;
#include scripts\zm\replaced\_zm_perks;
#include scripts\zm\replaced\_zm_buildables;
#include scripts\zm\replaced\_zm_power;
#include scripts\zm\replaced\_zm_powerups;
#include scripts\zm\replaced\_zm_pers_upgrades;
@ -104,6 +105,7 @@ main()
replaceFunc(maps\mp\zombies\_zm_perks::check_player_has_perk, scripts\zm\replaced\_zm_perks::check_player_has_perk);
replaceFunc(maps\mp\zombies\_zm_perks::perk_pause, scripts\zm\replaced\_zm_perks::perk_pause);
replaceFunc(maps\mp\zombies\_zm_perks::perk_unpause, scripts\zm\replaced\_zm_perks::perk_unpause);
replaceFunc(maps\mp\zombies\_zm_buildables::player_progress_bar_update, scripts\zm\replaced\_zm_buildables::player_progress_bar_update);
replaceFunc(maps\mp\zombies\_zm_power::standard_powered_items, scripts\zm\replaced\_zm_power::standard_powered_items);
replaceFunc(maps\mp\zombies\_zm_powerups::powerup_drop, scripts\zm\replaced\_zm_powerups::powerup_drop);
replaceFunc(maps\mp\zombies\_zm_powerups::get_next_powerup, scripts\zm\replaced\_zm_powerups::get_next_powerup);

View File

@ -144,4 +144,71 @@ special_round_end()
clean_up_special_round();
flag_clear( "sq_tpo_special_round_active" );
}
promote_to_corpse_model( str_model )
{
v_spawn_point = groundtrace( self.origin + vectorscale( ( 0, 0, 1 ), 10.0 ), self.origin + vectorscale( ( 0, 0, -1 ), 300.0 ), 0, undefined )["position"];
self.corpse_model = spawn( "script_model", v_spawn_point );
self.corpse_model.angles = self.angles;
self.corpse_model setmodel( str_model );
self.corpse_model.targetname = "sq_tpo_corpse_model";
self _pose_corpse();
self.corpse_model.unitrigger = setup_unitrigger( &"ZM_BURIED_SQ_SCH", ::unitrigger_think );
}
unitrigger_think()
{
self endon( "kill_trigger" );
self thread unitrigger_killed();
b_trigger_used = 0;
while ( !b_trigger_used )
{
self waittill( "trigger", player );
b_progress_bar_done = 0;
n_frame_count = 0;
while ( player usebuttonpressed() && !b_progress_bar_done )
{
if ( !isdefined( self.progress_bar ) )
{
self.progress_bar = player createprimaryprogressbar();
self.progress_bar updatebar( 0.01, 1 / 1.5 );
self.progress_bar_text = player createprimaryprogressbartext();
self.progress_bar_text settext( &"ZM_BURIED_SQ_SEARCHING" );
self thread _kill_progress_bar();
}
n_progress_amount = n_frame_count / 30.0;
n_frame_count++;
if ( n_progress_amount == 1 )
b_progress_bar_done = 1;
wait 0.05;
}
self _delete_progress_bar();
if ( b_progress_bar_done )
b_trigger_used = 1;
}
if ( b_progress_bar_done )
{
self.stub.hint_string = "";
self sethintstring( self.stub.hint_string );
if ( item_is_on_corpse() )
{
iprintlnbold( &"ZM_BURIED_SQ_FND" );
player give_player_sq_tpo_switch();
}
else
iprintlnbold( &"ZM_BURIED_SQ_NFND" );
self thread maps\mp\zombies\_zm_unitrigger::unregister_unitrigger( self.stub );
}
}

View File

@ -44,6 +44,7 @@ main()
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::init, scripts\zm\replaced\zm_buried_sq_tpo::init);
replaceFunc(maps\mp\zm_buried_sq_tpo::promote_to_corpse_model, scripts\zm\replaced\zm_buried_sq_tpo::promote_to_corpse_model);
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\zm_buried_distance_tracking::delete_zombie_noone_looking, scripts\zm\replaced\zm_buried_distance_tracking::delete_zombie_noone_looking);