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

Buried: ghosts no longer spawn and go after players not in the Mansion during a ghost round

This commit is contained in:
Jbleezy
2023-05-02 13:59:42 -07:00
parent eb916d078b
commit f62e0b0645
3 changed files with 81 additions and 0 deletions

View File

@ -14,6 +14,85 @@
#include maps\mp\zombies\_zm_powerups;
#include maps\mp\zombies\_zm_ai_basic;
ghost_zone_spawning_think()
{
level endon( "intermission" );
if ( isdefined( level.intermission ) && level.intermission )
return;
if ( !isdefined( level.female_ghost_spawner ) )
{
return;
}
while ( true )
{
if ( level.zombie_ghost_count >= level.zombie_ai_limit_ghost )
{
wait 0.1;
continue;
}
valid_player_count = 0;
valid_players = [];
while ( valid_player_count < 1 )
{
players = getplayers();
valid_player_count = 0;
foreach ( player in players )
{
if ( is_player_valid( player ) && !is_player_fully_claimed( player ) )
{
if ( isdefined( player.is_in_ghost_zone ) && player.is_in_ghost_zone )
{
valid_player_count++;
valid_players[valid_players.size] = player;
}
}
}
wait 0.1;
}
valid_players = array_randomize( valid_players );
spawn_point = get_best_spawn_point( valid_players[0] );
if ( !isdefined( spawn_point ) )
{
wait 0.1;
continue;
}
ghost_ai = undefined;
if ( isdefined( level.female_ghost_spawner ) )
ghost_ai = spawn_zombie( level.female_ghost_spawner, level.female_ghost_spawner.targetname, spawn_point );
else
{
return;
}
if ( isdefined( ghost_ai ) )
{
ghost_ai setclientfield( "ghost_fx", 3 );
ghost_ai.spawn_point = spawn_point;
ghost_ai.is_ghost = 1;
ghost_ai.is_spawned_in_ghost_zone = 1;
ghost_ai.find_target = 1;
level.zombie_ghost_count++;
}
else
{
return;
}
wait 0.1;
}
}
should_last_ghost_drop_powerup()
{
if ( flag( "time_bomb_restore_active" ) )