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

Time Bomb changes

This commit is contained in:
Jbleezy
2023-04-02 19:29:49 -07:00
parent ad744dfb14
commit ce52bc5ee4
2 changed files with 164 additions and 0 deletions

View File

@ -184,6 +184,8 @@
* Increased max amount that can be placed from 12 to 20 * Increased max amount that can be placed from 12 to 20
### Time Bomb ### Time Bomb
* No longer sends players back in time
* Kills all zombies
* Can have with Monkey Bombs * Can have with Monkey Bombs
### One Inch Punch ### One Inch Punch

View File

@ -70,4 +70,166 @@ player_give_time_bomb()
self thread time_bomb_inventory_slot_think(); self thread time_bomb_inventory_slot_think();
self thread destroy_time_bomb_save_if_user_bleeds_out_or_disconnects(); self thread destroy_time_bomb_save_if_user_bleeds_out_or_disconnects();
self thread sndwatchforweapswitch(); self thread sndwatchforweapswitch();
}
show_time_bomb_hints()
{
self endon( "death_or_disconnect" );
self endon( "player_lost_time_bomb" );
if ( !isdefined( self.time_bomb_hints_shown ) )
self.time_bomb_hints_shown = 0;
if ( !self.time_bomb_hints_shown )
{
self.time_bomb_hints_shown = 1;
wait 0.5;
self show_time_bomb_notification( &"ZOMBIE_TIMEBOMB_PICKUP" );
self thread _watch_for_player_switch_to_time_bomb();
wait 3.5;
self clean_up_time_bomb_notifications();
}
}
time_bomb_think()
{
self notify( "_time_bomb_kill_thread" );
self endon( "_time_bomb_kill_thread" );
self endon( "death" );
self endon( "disconnect" );
self endon( "player_lost_time_bomb" );
while ( true )
{
self waittill( "grenade_fire", e_grenade, str_grenade_name );
if ( str_grenade_name == "time_bomb_zm" )
{
if ( isdefined( str_grenade_name ) && str_grenade_name == "time_bomb_zm" )
{
e_grenade thread setup_time_bomb_detonation_model();
time_bomb_saves_data(0);
e_grenade time_bomb_model_init();
self thread swap_weapon_to_detonator( e_grenade );
self thread time_bomb_thrown_vo();
}
}
}
}
swap_weapon_to_detonator( e_grenade )
{
self endon( "death_or_disconnect" );
self endon( "player_lost_time_bomb" );
b_switch_to_weapon = 0;
if ( isdefined( e_grenade ) )
{
b_switch_to_weapon = 1;
wait 0.5;
}
self takeweapon( "time_bomb_zm" );
self giveweapon( "time_bomb_detonator_zm" );
self setweaponammoclip( "time_bomb_detonator_zm", 0 );
self setweaponammostock( "time_bomb_detonator_zm", 0 );
self setactionslot( 2, "weapon", "time_bomb_detonator_zm" );
if ( b_switch_to_weapon )
self switchtoweapon( "time_bomb_detonator_zm" );
self giveweapon( "time_bomb_zm" );
}
detonator_think()
{
self notify( "_detonator_think_done" );
self endon( "_detonator_think_done" );
self endon( "death" );
self endon( "disconnect" );
self endon( "player_lost_time_bomb" );
debug_time_bomb_print( "player picked up detonator" );
while ( true )
{
self waittill( "detonate" );
debug_time_bomb_print( "detonate detected! " );
if ( time_bomb_save_exists() && flag( "time_bomb_detonation_enabled" ) )
{
level.time_bomb_save_data.player_used = self;
level.time_bomb_save_data.time_bomb_model thread detonate_time_bomb();
self notify( "player_activates_timebomb" );
self thread time_bomb_detonation_vo();
}
}
}
detonate_time_bomb()
{
if ( isdefined( level.time_bomb_save_data.time_bomb_model ) && isdefined( level.time_bomb_save_data.time_bomb_model.origin ) )
playsoundatposition( "zmb_timebomb_3d_timer_end", level.time_bomb_save_data.time_bomb_model.origin );
if ( time_bomb_save_exists() )
time_bomb_detonation();
else
delete_time_bomb_model();
}
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();
time_bomb_clears_player_data();
flag_clear( "spawn_zombies" );
wait 4;
_time_bomb_kill_all_active_enemies();
flag_set( "spawn_zombies" );
delete_time_bomb_model();
_time_bomb_hide_overlay();
level setclientfield( "time_bomb_lua_override", 0 );
}
_time_bomb_kill_all_active_enemies()
{
for ( zombies = time_bomb_get_enemy_array(); zombies.size > 0; zombies = time_bomb_get_enemy_array() )
{
for ( i = 0; i < zombies.size; i++ )
{
timebomb_wait_for_hostmigration();
if ( isdefined( zombies[i] ) )
zombies[i] thread _kill_time_bomb_enemy();
}
}
}
_kill_time_bomb_enemy()
{
self dodamage( self.health + 100, self.origin, level.time_bomb_save_data.player_used, level.time_bomb_save_data.player_used, self.origin );
self ghost();
playfx( level._effect["time_bomb_kills_enemy"], self.origin );
if ( isdefined( self ) && isdefined( self.anchor ) )
self.anchor delete();
wait_network_frame();
if ( isdefined( self ) )
{
if ( isdefined( self.script_mover ) )
self.script_mover delete();
self delete();
}
} }