// IW6 GSC SOURCE
// Generated by https://github.com/xensik/gsc-tool

init_hives()
{
    if ( !common_scripts\utility::flag_exist( "hives_cleared" ) )
        common_scripts\utility::flag_init( "hives_cleared" );

    if ( !common_scripts\utility::flag_exist( "blocker_hive_destroyed" ) )
        common_scripts\utility::flag_init( "blocker_hive_destroyed" );

    init_hive_locs();
}

regular_hive( var_0 )
{
    for (;;)
    {
        var_1 = select_hives( 0 );
        level thread maps\mp\alien\_spawnlogic::encounter_cycle_spawn( "drill_planted", "door_planted" );

        foreach ( var_3 in var_1 )
            var_3 thread regular_hive_listener( get_hive_score_component_list_func( var_0 ) );

        var_5 = level common_scripts\utility::waittill_any_return( "regular_hive_destroyed", "regular_door_destroyed" );

        if ( var_5 == "regular_hive_destroyed" )
        {
            maps\mp\alien\_spawn_director::end_cycle();
            level thread maps\mp\alien\_spawnlogic::remaining_alien_management();
            return;
        }
    }
}

regular_hive_listener( var_0 )
{
    level endon( "game_ended" );
    self notify( "stop_listening" );
    self endon( "stop_listening" );

    if ( isdefined( level.drill ) && !isdefined( level.drill_carrier ) && !maps\mp\alien\_utility::is_true( level.automatic_drill ) )
        level waittill( "drill_pickedup", var_1 );

    var_2 = "waypoint_alien_destroy";
    var_3 = get_hive_waypoint_dist( self, 1300 );

    if ( maps\mp\alien\_utility::is_door() || isdefined( level.hive_icon_override ) && self [[ level.hive_icon_override ]]() )
    {
        var_3 = 1000;
        var_2 = "waypoint_alien_door";
    }

    thread set_hive_icon( var_2, var_3 );
    var_4 = maps\mp\alien\_drill::wait_for_drill_plant();
    level.current_hive_name = self.target;

    if ( !maps\mp\alien\_utility::is_true( level.automatic_drill ) )
        thread maps\mp\alien\_drill::drill_plant_bbprint( var_4 );

    if ( level.cycle_count == 1 )
        level maps\mp\_utility::delaythread( 1, maps\mp\alien\_music_and_dialog::playvoforwavestart );

    if ( maps\mp\alien\_utility::is_door() )
    {
        level notify( "door_planted" );
        level notify( "start_spawn_event", self.target );

        if ( maps\mp\alien\_utility::is_true( level.current_cycle_started_by_timeout ) )
            level.cycle_count--;
    }

    if ( !maps\mp\alien\_utility::is_door() )
        maps\mp\_utility::delaythread( 2, maps\mp\alien\_challenge::spawn_challenge );

    level.drill_carrier = undefined;
    thread maps\mp\alien\_drill::drilling( self.origin, var_4 );
    disable_other_strongholds();
    maps\mp\alien\_gamescore::reset_encounter_performance();
    level notify( "force_cycle_start" );
    common_scripts\utility::flag_wait( "drill_detonated" );
    hive_play_death_animations();
    maps\mp\alien\_challenge::end_current_challenge();
    maps\mp\alien\_challenge::remove_all_challenge_cases();
    level.stronghold_hive_locs = common_scripts\utility::array_remove( level.stronghold_hive_locs, self );
    self notify( "hive_dying" );
    thread maps\mp\alien\_drill::drill_detonate();

    if ( isdefined( self.scene_trig ) )
        self.scene_trig notify( "trigger", level.players[0] );

    level.current_hive_name = level.current_hive_name + "_post";

    if ( maps\mp\alien\_utility::is_door() )
    {
        give_door_score();
        level notify( "regular_door_destroyed" );
    }
    else
    {
        level.num_hive_destroyed++;
        give_players_rewards( 0, var_0 );
        level notify( "regular_hive_destroyed" );
    }

    self notify( "stop_listening" );
}

blocker_hive_explode_sequence( var_0, var_1 )
{
    var_0 delete();

    if ( isdefined( level.hive_heli ) )
    {
        level.hive_heli notify( "new_flight_path" );
        level.hive_heli notify( "blocker_hive_destroyed" );
    }

    common_scripts\utility::flag_set( "blocker_hive_destroyed" );
    var_1 hive_play_death_animations();
    var_1 delete_removables();
    var_1 maps\mp\alien\_drill::remove_spawner();
    var_1 maps\mp\alien\_drill::fx_ents_playfx();
    var_1 show_dead_hive_model();
    var_1 destroy_hive_icon();
    var_1 thread blocker_kill_sequence();
    var_1 thread maps\mp\alien\_drill::do_radius_damage();
    level thread maps\mp\alien\_music_and_dialog::playvoforblockerhive();
    level thread maps\mp\alien\_spawnlogic::remaining_alien_management();
    level.current_blocker_hive = undefined;
    level.blocker_hive_active = undefined;
    level.stronghold_hive_locs = common_scripts\utility::array_remove( level.stronghold_hive_locs, var_1 );
    level.current_hive_name = level.current_hive_name + "_post";
    level.num_hive_destroyed++;

    if ( maps\mp\alien\_utility::isplayingsolo() && !issplitscreen() )
        maps\mp\alien\_laststand::give_laststand( level.players[0], 1 );

    if ( isdefined( var_1.drill_teleport_structs ) && !maps\mp\alien\_utility::is_true( level.automatic_drill ) )
        level thread maps\mp\alien\_drill::teleport_drill( var_1.drill_teleport_structs[randomint( var_1.drill_teleport_structs.size )].origin );

    if ( isdefined( var_1.scene_trig ) )
        var_1.scene_trig notify( "trigger", level.players[0] );

    maps\mp\alien\_achievement::update_blocker_hive_achievements( var_1.target );
    level maps\mp\alien\_challenge_function::hide_barrier_hive_intel();
    common_scripts\utility::flag_clear( "blocker_hive_destroyed" );
    var_1 notify( "hive_dying" );
    var_1 notify( "stop_listening" );
}

blocker_kill_sequence()
{
    playfx( level._effect["stronghold_explode_large"], self.origin );
    thread sfx_destroy_hive();

    foreach ( var_1 in self.scriptables )
    {
        var_1 thread hive_explode( 1 );
        common_scripts\utility::waitframe();
    }
}

create_attackable_ent( var_0 )
{
    var_1 = spawn( "script_model", var_0.origin );
    var_1 setmodel( "mp_ext_alien_hive03_collision" );
    var_1 hide();
    var_1.hive_target = var_0.target;

    if ( get_blocker_hive_index() == 1 )
    {
        var_1.health = 100000;
        var_1.maxhealth = 100000;
    }
    else
    {
        var_1.health = 150000;
        var_1.maxhealth = 150000;
    }

    if ( maps\mp\alien\_utility::isplayingsolo() )
    {
        var_1.health = int( 0.66 * var_1.health );
        var_1.maxhealth = int( 0.66 * var_1.maxhealth );
    }

    if ( isdefined( level.create_attackable_ent_override_func ) )
        var_1 = [[ level.create_attackable_ent_override_func ]]( var_1 );

    return var_1;
}

hive_explode( var_0 )
{
    if ( !isdefined( var_0 ) )
        var_0 = 2;

    for ( var_1 = 0; var_1 < var_0; var_1++ )
    {
        wait( randomfloatrange( 0.5, 1 ) );
        var_2 = 8;
        var_3 = var_2 - randomintrange( 0, var_2 * 2 );
        var_4 = var_2 - randomintrange( 0, var_2 * 2 );
        var_5 = anglestoforward( self.angles );
        var_6 = anglestoup( self.angles );
        playfx( level._effect["alien_hive_explode"], self.origin + ( var_3, var_4, 0 ), var_5, var_6 );
    }
}

sfx_destroy_hive()
{
    wait 0.1;
    self playsound( "alien_hive_destroyed" );
}

monitor_attackable_ent_damage( var_0 )
{
    level endon( "blocker_hive_destroyed" );
    level endon( "game_ended" );
    level._effect["Fire_Cloud_Blocker_Hive"] = loadfx( "vfx/gameplay/alien/vfx_alien_gas_fire" );
    var_1 = 0.75 * self.maxhealth;
    var_2 = 0.5 * self.maxhealth;
    var_3 = 0.25 * self.maxhealth;
    var_4 = 0;
    var_5 = 0;
    var_6 = 0;

    for (;;)
    {
        self waittill( "damage", var_7, var_8, var_9, var_10, var_11, var_12, var_13, var_14, var_15, var_16 );

        if ( isdefined( var_16 ) && var_16 == "alienmortar_strike_mp" )
        {
            var_7 = int( var_7 / 3 );
            self.health = self.health + var_7;
        }

        if ( isdefined( var_16 ) && var_16 == "iw6_alienpanzerfaust3_mp" )
            self dodamage( var_7, self.origin, var_8, var_8, "MOD_PROJECTILE_SPLASH" );

        if ( isdefined( var_8 ) && isalive( var_8 ) && isplayer( var_8 ) )
        {
            if ( !isdefined( var_8.hive_damage ) )
                var_8.hive_damage = 0;

            var_8.hive_damage = var_8.hive_damage + var_7;

            if ( var_8.hive_damage > 400 )
            {
                var_8.hive_damage = 0;
                var_8.threatbias = var_8.threatbias + 100;
                var_8 thread cool_down_threat( 10 );
            }
        }

        if ( !( isdefined( var_11 ) && var_11 == "MOD_UNKNOWN" ) && !( isdefined( self.is_burning ) && self.is_burning ) )
        {
            if ( isdefined( var_8.has_incendiary_ammo ) && var_8.has_incendiary_ammo || isdefined( var_16 ) && ( var_16 == "iw6_alienmk324_mp" || var_16 == "iw6_alienminigun4_mp" || var_16 == "iw6_alienmk323_mp" ) )
                thread blocker_hive_burn( var_8 );
        }

        if ( isdefined( var_8.owner ) && isalive( var_8.owner ) && isplayer( var_8.owner ) )
            var_8 = var_8.owner;

        if ( isdefined( var_8 ) && isalive( var_8 ) && isplayer( var_8 ) )
            var_8 thread maps\mp\gametypes\_damagefeedback::updatedamagefeedback( "standard" );

        if ( !var_4 && self.health < var_1 )
        {
            thread warn_all_players( 0.1, 0.4 );
            var_4 = 1;
        }

        if ( !var_5 && self.health < var_2 )
        {
            thread warn_all_players( 0.1, 0.4 );
            var_0 hive_play_first_pain_animations();

            if ( isdefined( level.hive_heli ) )
                level.hive_heli maps\mp\alien\_music_and_dialog::play_pilot_vo( "so_alien_plt_hivehalfdead" );

            var_5 = 1;
        }

        if ( !var_6 && self.health < var_3 )
        {
            var_0 hive_play_second_pain_animations();

            if ( isdefined( level.hive_heli ) )
                level.hive_heli maps\mp\alien\_music_and_dialog::play_pilot_vo( "so_alien_plt_hivealmostdead" );

            var_6 = 1;
        }
    }
}

blocker_hive_burn( var_0 )
{
    self endon( "death" );
    self.is_burning = 1;
    var_1 = 3;
    var_2 = 1200;
    var_2 = var_2 * level.alien_health_per_player_scalar[level.players.size];
    var_3 = 0;
    var_4 = 6;
    var_5 = var_1 / var_4;
    var_6 = var_2 / var_4;
    var_7 = self.origin + vectornormalize( anglestoforward( self.angles ) ) * 60 - ( 0, 0, 20 );
    self.gasfire = spawnfx( level._effect["Fire_Cloud_Blocker_Hive"], var_7 );
    triggerfx( self.gasfire );
    thread kill_hive_burning_on_death();

    for ( var_8 = 0; var_8 < var_4; var_8++ )
    {
        wait( var_5 );
        self dodamage( var_6, self.origin, var_0, var_0, "MOD_UNKNOWN" );
    }

    self.is_burning = 0;
    self.gasfire delete();
}

kill_hive_burning_on_death()
{
    self notify( "kill_hive_burning_on_death" );
    self endon( "kill_hive_burning_on_death" );
    self waittill( "death" );

    if ( isdefined( self.gasfire ) )
        self.gasfire delete();
}

cool_down_threat( var_0 )
{
    level endon( "blocker_hive_destroyed" );
    level endon( "game_ended" );
    self endon( "death" );
    thread reset_threat_on_death();
    thread reset_threat_on_blocker_destroyed();
    wait( var_0 );
    self.threatbias = int( max( 0, self.threatbias - 100 ) );
}

reset_threat_on_death()
{
    self notify( "monitor_threat_on_death" );
    self endon( "monitor_threat_on_death" );
    self waittill( "death" );
    self.threatbias = 0;
}

reset_threat_on_blocker_destroyed()
{
    self notify( "monitor_threat_on_blocker_destroyed" );
    self endon( "monitor_threat_on_blocker_destroyed" );
    level waittill( "blocker_hive_destroyed" );
    self.threatbias = 0;
}

give_door_score()
{
    var_0 = get_door_score_component_list();
    maps\mp\alien\_gamescore::calculate_encounter_scores( level.players, var_0 );
}

get_door_score_component_list()
{
    if ( is_progression_door( self ) )
        return [ "progression_door" ];
    else
        return [ "side_area" ];
}

is_progression_door( var_0 )
{
    if ( !isdefined( level.progression_doors ) || !isdefined( var_0.target ) )
        return 0;

    return common_scripts\utility::array_contains( level.progression_doors, var_0.target );
}

give_players_rewards( var_0, var_1 )
{
    calculate_and_show_hive_scores( var_1 );

    foreach ( var_3 in level.players )
    {
        var_3 maps\mp\alien\_persistence::eog_player_update_stat( "hivesdestroyed", 1 );
        var_3 thread wait_to_give_rewards();

        if ( var_0 )
            var_3 maps\mp\alien\_persistence::try_award_bonus_pool_token();
    }
}

calculate_and_show_hive_scores( var_0 )
{
    var_1 = [[ var_0 ]]();
    maps\mp\alien\_gamescore::calculate_and_show_encounter_scores( level.players, var_1 );
}

get_blocker_hive_score_component_name_list()
{
    if ( maps\mp\alien\_utility::isplayingsolo() )
        return [ "personal_blocker" ];
    else
        return [ "team_blocker", "personal_blocker" ];
}

get_regular_hive_score_component_name_list()
{
    if ( maps\mp\alien\_utility::isplayingsolo() )
        return [ "drill", "personal", "challenge" ];
    else
        return [ "drill", "team", "personal", "challenge" ];
}

wait_to_give_rewards()
{
    self endon( "disconnect" );
    level endon( "game_ended" );
    var_0 = 4.0;
    wait( var_0 );
    var_1 = int( self.encounter_score_earned );
    maps\mp\alien\_persistence::give_player_xp( var_1 );
    maps\mp\alien\_persistence::give_player_currency( self.encounter_cash_earned, undefined, undefined, 1 );
}

disable_other_strongholds()
{
    foreach ( var_1 in level.stronghold_hive_locs )
    {
        if ( self != var_1 )
        {
            if ( isdefined( var_1.icon ) )
                var_1.icon destroy();

            var_1 makeunusable();
            var_1 sethintstring( "" );
            var_1 notify( "stop_listening" );
        }
    }
}

set_hive_icon( var_0, var_1, var_2, var_3 )
{
    level endon( "game_ended" );
    self endon( "stop_listening" );

    if ( !isdefined( var_1 ) )
        var_1 = 1000;

    if ( isdefined( level.drill_icon_draw_dist_override ) )
        var_1 = level.drill_icon_draw_dist_override;

    if ( !isdefined( var_2 ) )
        var_2 = 14;

    if ( !isdefined( var_3 ) )
        var_3 = 14;

    var_4 = 0;

    while ( !var_4 )
    {
        var_4 = 0;

        foreach ( var_6 in level.players )
        {
            if ( isalive( var_6 ) && distance( var_6.origin, self.origin ) <= var_1 )
                var_4 = 1;
        }

        wait 0.05;
    }

    destroy_hive_icon();
    self.icon = newhudelem();
    self.icon setshader( var_0, var_2, var_3 );
    self.icon.alpha = 0;
    self.icon.color = ( 1, 1, 1 );
    self.icon setwaypoint( 1, 1 );
    self.icon.x = self.origin[0];
    self.icon.y = self.origin[1];
    self.icon.z = self.origin[2];

    if ( !isdefined( var_1 ) )
    {
        self.icon.alpha = 0.5;
        return;
    }

    self.icon endon( "death" );

    while ( isdefined( self.icon ) )
    {
        var_4 = 0;

        foreach ( var_6 in level.players )
        {
            if ( isalive( var_6 ) && distance( var_6.origin, self.origin ) <= var_1 )
                var_4 = 1;
        }

        if ( var_4 )
            icon_fade_in( self.icon );
        else
            icon_fade_out( self.icon );

        wait 0.05;
    }
}

icon_fade_in( var_0 )
{
    if ( var_0.alpha != 0 )
        return;

    var_0 fadeovertime( 1 );
    var_0.alpha = 0.5;
    wait 1;
}

icon_fade_out( var_0 )
{
    if ( var_0.alpha == 0 )
        return;

    var_0 fadeovertime( 1 );
    var_0.alpha = 0;
    wait 1;
}

destroy_hive_icon()
{
    if ( isdefined( self.icon ) )
        self.icon destroy();
}

hive_pain_monitor()
{
    self endon( "death" );
    self endon( "stop_listening" );
    maps\mp\alien\_drill::get_drill_entity() endon( "offline" );

    if ( !isdefined( self.scriptables ) )
        return;

    var_0 = 0.5 * self.total_depth;
    var_1 = 0.25 * self.total_depth;
    var_2 = self.depth;

    if ( var_2 > var_0 )
    {
        wait( self.depth - var_0 );
        hive_play_first_pain_animations();
        var_2 = var_0;
    }

    if ( var_2 > var_1 )
    {
        wait( var_2 - var_1 );
        hive_play_second_pain_animations();
    }
}

get_hive_score_component_list_func( var_0 )
{
    if ( isdefined( var_0 ) )
        return var_0;

    return ::get_regular_hive_score_component_name_list;
}

hive_play_first_pain_animations()
{
    var_0 = 3;
    thread play_hive_scriptable_animations( undefined, undefined, var_0, 1 );
}

hive_play_second_pain_animations()
{
    var_0 = 0.4;
    thread play_hive_scriptable_animations( "start_near_death", var_0, "loop_near_death", 1 );
}

hive_play_drill_planted_animations( var_0 )
{
    var_1 = 0.2;

    if ( isdefined( var_0 ) )
        var_1 = var_0;

    thread play_hive_scriptable_animations( "start_pain", var_1, "loop_pain1", 1 );
}

hive_play_death_animations()
{
    var_0 = 1.5;
    thread play_hive_scriptable_animations( "death", var_0, "remove", 1 );
}

play_hive_scriptable_animations( var_0, var_1, var_2, var_3 )
{
    var_4 = 0.15;
    var_5 = 0.25;

    if ( !isdefined( self.scriptables ) )
        return;

    foreach ( var_7 in self.scriptables )
    {
        var_7 thread play_hive_anim( var_0, var_1, var_2 );

        if ( var_3 )
            wait( randomfloatrange( var_4, var_5 ) );
    }
}

play_hive_anim( var_0, var_1, var_2 )
{
    if ( isdefined( var_0 ) )
        self setscriptablepartstate( 0, var_0 );

    if ( isdefined( var_1 ) )
        wait( var_1 );

    if ( isdefined( var_2 ) )
        self setscriptablepartstate( 0, var_2 );
}

dependent_hives_removed()
{
    if ( !isdefined( self.target ) || !isdefined( level.hive_dependencies ) || !isdefined( level.hive_dependencies[self.target] ) )
        return 1;

    var_0 = level.hive_dependencies[self.target];

    foreach ( var_2 in level.stronghold_hive_locs )
    {
        if ( isdefined( var_2.target ) )
        {
            if ( common_scripts\utility::array_contains( var_0, var_2.target ) )
                return 0;
        }
    }

    return 1;
}

select_hives( var_0 )
{
    var_1 = [];
    var_2 = maps\mp\alien\_utility::get_current_area_name();

    foreach ( var_4 in level.stronghold_hive_locs )
    {
        var_5 = var_4 is_blocker_hive();

        if ( var_0 && !var_5 )
            continue;

        if ( !var_0 && var_5 )
            continue;

        if ( !( var_4.area_name == var_2 ) && !var_4 maps\mp\alien\_utility::is_door() )
            continue;

        if ( !var_4 dependent_hives_removed() )
            continue;

        var_1[var_1.size] = var_4;
    }

    return var_1;
}

remove_unused_hives( var_0 )
{
    foreach ( var_2 in var_0 )
    {
        var_3 = getent( var_2, "target" );
        var_3 notify( "stop_listening" );
        var_3 thread play_hive_scriptable_animations( "remove", undefined, undefined, 0 );
        var_3 thread delete_removables();
        var_3 destroy_hive_icon();

        foreach ( var_5 in var_3.fx_ents )
            var_5 delete();

        if ( isdefined( var_3.dead_hive_model ) )
            var_3 show_dead_hive_model();

        var_3 delete();
    }
}

delete_removables()
{
    foreach ( var_1 in self.removeables )
    {
        if ( isdefined( var_1 ) )
            var_1 delete();
    }
}

show_dead_hive_model()
{
    foreach ( var_1 in self.dead_hive_model )
        var_1 show();
}

is_blocker_hive()
{
    if ( !isdefined( level.blocker_hives ) || !isdefined( self.target ) )
        return 0;

    foreach ( var_1 in level.blocker_hives )
    {
        if ( var_1 == self.target )
            return 1;
    }

    return 0;
}

warn_all_players( var_0, var_1 )
{
    level endon( "game_ended" );
    wait( var_0 );

    foreach ( var_3 in level.players )
        var_3 thread warn_player( var_1 );
}

warn_player( var_0 )
{
    earthquake( var_0, 3, self.origin, 300 );
    self playlocalsound( "pre_quake_mtl_groan" );
    self playrumbleonentity( "heavygun_fire" );
}

init_hive_locs()
{
    level.stronghold_hive_locs = [];
    level.current_hive_name = "before_first_hive";
    var_0 = getentarray( "stronghold_bomb_loc", "targetname" );
    var_1 = getentarray( "stronghold_door_loc", "targetname" );

    if ( isdefined( var_1 ) && var_1.size > 0 )
        var_0 = common_scripts\utility::array_combine( var_0, var_1 );

    foreach ( var_3 in var_0 )
    {
        if ( isdefined( var_3.target ) )
        {
            var_4 = getentarray( var_3.target, "targetname" );
            var_3.scriptables = getscriptablearray( var_3.target, "targetname" );

            foreach ( var_6 in var_3.scriptables )
                var_6.is_hive = 1;

            var_8 = [];
            var_9 = [];

            foreach ( var_11 in var_4 )
            {
                if ( isdefined( var_11.script_noteworthy ) && var_11.script_noteworthy == "fx_ent" )
                {
                    var_9[var_9.size] = var_11;
                    continue;
                }

                if ( isdefined( var_11.script_noteworthy ) && issubstr( var_11.script_noteworthy, "waypointdist" ) )
                {
                    var_12 = strtok( var_11.script_noteworthy, " " );

                    if ( isdefined( var_12 ) && var_12.size && var_12[0] == "waypointdist" )
                        var_3.waypoint_dist = int( var_12[1] );

                    continue;
                }

                var_8[var_8.size] = var_11;
            }

            if ( isdefined( level.scene_trigs ) )
            {
                foreach ( var_15 in level.scene_trigs )
                {
                    if ( isdefined( var_15.script_noteworthy ) && var_15.script_noteworthy == var_3.target )
                    {
                        var_3.scene_trig = var_15;
                        break;
                    }
                }
            }

            var_17 = var_3.target + "_drill_teleport_loc";
            var_3.drill_teleport_structs = common_scripts\utility::getstructarray( var_17, "targetname" );
            var_3.removeables = var_8;
            var_3.fx_ents = var_9;

            if ( var_3.target == level.last_hive )
                var_3.last_hive = 1;

            var_18 = var_3.target + "_dead";
            var_3.dead_hive_model = getentarray( var_18, "targetname" );

            if ( isdefined( var_3.dead_hive_model ) )
            {
                foreach ( var_20 in var_3.dead_hive_model )
                    var_20 hide();
            }

            if ( var_3 is_blocker_hive() )
            {
                var_3 thread init_blocker_hive_animation_state();
                var_3 makeunusable();
                var_3 sethintstring( "" );
            }
        }

        if ( !common_scripts\utility::array_contains( level.removed_hives, var_3.target ) )
        {
            var_3.area_name = var_3 maps\mp\alien\_utility::get_in_world_area();
            level.stronghold_hive_locs[level.stronghold_hive_locs.size] = var_3;
        }
    }
}

init_blocker_hive_animation_state()
{
    level endon( "game_ended" );
    self endon( "death" );

    if ( !isdefined( self.scriptables ) )
        return;

    wait 5;

    foreach ( var_1 in self.scriptables )
    {
        wait( randomfloatrange( 0.15, 0.25 ) );
        var_1 setscriptablepartstate( 0, "loop_pain1" );
    }
}

get_hive_waypoint_dist( var_0, var_1 )
{
    if ( isdefined( var_0.waypoint_dist ) )
        return var_0.waypoint_dist;

    if ( isdefined( level.waypoint_dist_override ) )
        return level.waypoint_dist_override;

    return var_1;
}

get_blocker_hive_index()
{
    var_0 = level.cycle_end_area_list[0];
    var_1 = level.cycle_end_area_list[1];

    if ( level.cycle_count == var_0 - 1 || level.cycle_count == var_0 )
        return 1;
    else
        return 2;
}

skip_hive()
{

}

beat_regular_hive()
{

}

beat_blocker_hive()
{

}
