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

callback_playerlaststandalien( var_0, var_1, var_2, var_3, var_4, var_5, var_6, var_7, var_8, var_9 )
{
    blackbox_laststand( var_1, var_2 );

    if ( maps\mp\alien\_utility::is_chaos_mode() )
        maps\mp\alien\_chaos_laststand::chaos_playerlaststand( var_0, var_1, var_2, var_3, var_4, var_5, var_6, var_9 );
    else
        regularextinction_playerlaststand( var_0, var_1, var_2, var_3, var_4, var_5, var_6, var_9 );
}

regularextinction_playerlaststand( var_0, var_1, var_2, var_3, var_4, var_5, var_6, var_7 )
{
    var_8 = gameshouldend( self );

    if ( var_8 )
        level thread maps\mp\gametypes\aliens::alienendgame( "axis", maps\mp\alien\_hud::get_end_game_string_index( "kia" ) );

    if ( self.inlaststand )
        forcebleedout( var_7 );
    else
        dropintolaststand( var_0, var_1, var_2, var_3, var_4, var_5, var_6, var_7, var_8 );
}

forcebleedout( var_0 )
{
    if ( maps\mp\alien\_utility::isplayingsolo() )
        self setorigin( var_0.origin );

    self.bleedoutspawnentityoverride = var_0;
    self notify( "force_bleed_out" );
}

dropintolaststand( var_0, var_1, var_2, var_3, var_4, var_5, var_6, var_7, var_8 )
{
    self endon( "disconnect" );
    level endon( "game_ended" );
    self notify( "last_stand" );
    enter_gamemodespecificaction();
    enter_laststand();

    if ( maydolaststandalien( self, var_8, var_7 ) )
    {
        var_9 = waitinlaststand( var_7, var_8 );

        if ( !var_9 )
            waitinspecator( var_7, var_8 );
    }
    else
        waitinspecator( var_7, var_8 );

    self notify( "revive" );
    exit_laststand();
    exit_gamemodespecificaction();
}

enter_laststand()
{
    self.inlaststand = 1;
    self.laststand = 1;
    self.ignoreme = 1;
    self.health = 1;
    common_scripts\utility::_disableusability();
}

exit_laststand()
{
    self laststandrevive();
    self setstance( "stand" );
    self.inlaststand = 0;
    self.laststand = undefined;
    self.ignoreme = 0;
    self.health = maps\mp\gametypes\aliens::gethealthcap();
    common_scripts\utility::_enableusability();
}

enter_gamemodespecificaction_getcurrentweapon( var_0 )
{
    var_1 = self getcurrentweapon();

    if ( var_1 == "none" )
        return self.copy_fullweaponlist[0];

    foreach ( var_3 in var_0 )
    {
        if ( var_1 == var_3 )
            return self.copy_fullweaponlist[0];
    }

    return var_1;
}

enter_gamemodespecificaction()
{
    level thread maps\mp\alien\_music_and_dialog::playvofordowned( self );
    maps\mp\alien\_gamescore::update_team_encounter_performance( maps\mp\alien\_gamescore::get_team_score_component_name(), "num_players_enter_laststand" );
    var_0 = [ "alienbomb_mp", "killstreak_remote_uav_mp", "mortar_detonator_mp", "switchblade_laptop_mp", "aliendeployable_crate_marker_mp", "iw6_alienminigun_mp", "iw6_alienminigun1_mp", "iw6_alienminigun2_mp", "iw6_alienminigun3_mp", "iw6_alienminigun4_mp", "iw6_alienmk32_mp", "iw6_alienmk321_mp", "iw6_alienmk322_mp", "iw6_alienmk323_mp", "iw6_alienmk324_mp", "alienflare_mp", "aliensemtex_mp", "alienclaymore_mp", "alientrophy_mp", "alienbetty_mp", "alienthrowingknife_mp", "iw6_alienmaaws_mp", "alienmortar_shell_mp", "iw6_aliendlc21_mp", "iw6_aliendlc22_mp", "iw6_aliendlc31_mp", "iw6_aliendlc32_mp", "iw6_aliendlc33_mp", "iw6_aliendlc43_mp", "aliencortex_mp" ];
    maps\mp\alien\_utility::store_weapons_status( var_0 );
    self.lastweapon = enter_gamemodespecificaction_getcurrentweapon( var_0 );
    self.bleedoutspawnentityoverride = undefined;
    self.laststand_pistol = self getweaponslistprimaries()[0];
    self.being_revived = 0;
    thread only_use_weapon();
    maps\mp\alien\_persistence::take_player_currency( 500, 1 );
    maps\mp\alien\_persistence::eog_player_update_stat( "downs", 1 );
    maps\mp\alien\_alien_matchdata::inc_downed_counts();
    maps\mp\alien\_challenge::update_challenge( "no_laststand" );
    self setclientomnvar( "ui_alien_player_in_laststand", 1 );
}

exit_gamemodespecificaction()
{
    thread maps\mp\alien\_music_and_dialog::ext_last_stand_sfx();
    self.haveinvulnerabilityavailable = 1;
    self.damageshieldexpiretime = gettime() + 3000;
    self visionsetnakedforplayer( "", 0 );
    maps\mp\alien\_utility::restore_client_fog( 0 );
    maps\mp\alien\_progression::restore_all_perks();
    self setweaponammostock( self.laststand_pistol, self.laststand_ammo );
    self setweaponammoclip( self.laststand_pistol, self.laststand_clip_ammo );
    var_0 = [ "alienflare_mp", "aliensemtex_mp", "alienclaymore_mp", "alientrophy_mp", "alienbetty_mp", "alienthrowingknife_mp", "alienmortar_shell_mp", "iw6_aliendlc21_mp", "iw6_aliendlc22_mp", "iw6_aliendlc31_mp", "iw6_aliendlc32_mp", "iw6_aliendlc43_mp", "iw6_aliendlc33_mp" ];
    maps\mp\alien\_utility::restore_weapons_status( var_0 );
    self setclientomnvar( "ui_alien_player_in_laststand", 0 );
    self.laststand_ammo = undefined;
    self.bleedoutspawnentityoverride = undefined;
    maps\mp\alien\_alien_matchdata::inc_revived_counts();
    self setspawnweapon( self.lastweapon );
    maps\mp\alien\_death::set_kill_trigger_event_processed( self, 0 );

    if ( maps\mp\alien\_utility::is_chaos_mode() )
        maps\mp\alien\_chaos_laststand::chaos_exit_gamemodespecificaction( self );
}

waitinlaststand( var_0, var_1 )
{
    self endon( "disconnect" );
    self endon( "revive" );
    level endon( "game_ended" );

    if ( !var_1 )
    {
        visionfadetoblack( 35 );
        thread playdeathsoundinlaststand( 35 );

        if ( maps\mp\alien\_utility::isplayingsolo() )
        {
            take_laststand( self, 1 );
            self setclientomnvar( "ui_laststand_end_milliseconds", gettime() + 5000 );
            register_laststand_ammo();
        }
        else
            self setclientomnvar( "ui_laststand_end_milliseconds", gettime() + 35000 );
    }

    if ( maps\mp\alien\_utility::isplayingsolo() )
        return wait_for_self_revive( var_0, var_1 );
    else
        return wait_to_be_revived( self, self.origin, undefined, undefined, 1, 5000, ( 0.33, 0.75, 0.24 ), 35, 0, var_1 );
}

waitinspecator( var_0, var_1 )
{
    self endon( "disconnect" );
    level endon( "game_ended" );
    self notify( "death" );
    register_laststand_ammo();
    common_scripts\utility::waitframe();
    level.alienbbdata["times_died"]++;
    maps\mp\alien\_persistence::eog_player_update_stat( "deaths", 1 );

    if ( isdefined( self.bleedoutspawnentityoverride ) )
    {
        var_0 = self.bleedoutspawnentityoverride;
        self.bleedoutspawnentityoverride = undefined;
    }

    if ( is_killed_by_kill_trigger( var_0 ) )
    {
        var_2 = common_scripts\utility::drop_to_ground( var_0.origin, 32, -64 );
        var_3 = var_0.angles;
    }
    else
    {
        maps\mp\alien\_gamescore::update_team_encounter_performance( maps\mp\alien\_gamescore::get_team_score_component_name(), "num_players_bleed_out" );
        maps\mp\alien\_alien_matchdata::inc_bleedout_counts();
        var_2 = self.origin;
        var_3 = self.angles;
    }

    maps\mp\alien\_challenge::update_challenge( "no_bleedout" );
    self setclientomnvar( "ui_laststand_end_milliseconds", 0 );
    var_4 = wait_to_be_revived( self, var_2, "prop_dogtags_friend_iw6", "mp_dogtag_spin", 0, 6000, ( 1, 0, 0 ), undefined, 1, var_1 );
    maps\mp\_utility::updatesessionstate( "playing" );
    self.forcespawnorigin = var_2;
    self.forcespawnangles = var_3;

    if ( isdefined( self.forceteleportorigin ) )
        self.forcespawnorigin = self.forceteleportorigin;

    if ( isdefined( self.forceteleportangles ) )
        self.forcespawnangles = self.forceteleportangles;

    maps\mp\gametypes\_playerlogic::spawnplayer( 1 );
}

wait_for_self_revive( var_0, var_1 )
{
    if ( var_1 )
    {
        level waittill( "forever" );
        self setclientomnvar( "ui_laststand_end_milliseconds", 0 );
        return 0;
    }

    if ( is_killed_by_kill_trigger( var_0 ) )
        self setorigin( var_0.origin );
    else
        wait 5;

    self setclientomnvar( "ui_laststand_end_milliseconds", 0 );
    return 1;
}

wait_to_be_revived( var_0, var_1, var_2, var_3, var_4, var_5, var_6, var_7, var_8, var_9, var_10 )
{
    register_laststand_ammo();
    var_11 = makereviveentity( var_0, var_1, var_2, var_3, var_4 );
    var_11 thread cleanupreviveent( var_0 );

    if ( maps\mp\alien\_utility::is_true( var_10 ) )
        common_scripts\utility::_disableweapon();

    if ( var_8 )
        thread enter_spectate( var_0, var_1, var_11 );

    if ( var_9 )
    {
        level waittill( "forever" );
        return 0;
    }
    else
    {
        var_12 = var_11;

        if ( var_8 )
            var_12 = makereviveiconentity( var_0, var_11 );

        var_12 maps\mp\alien\_hud::makereviveicon( var_0, var_6, var_7 );
        var_0.reviveent = var_11;
        var_0.reviveiconent = var_12;
        var_11 thread laststandwaittilllifereceived( var_0, var_5 );

        if ( isdefined( var_7 ) )
            var_13 = var_11 waittill_any_ents_or_timeout_return( var_7, var_11, "revive_success", var_0, "force_bleed_out", var_0, "revive_success" );
        else if ( !isdefined( var_7 ) && maps\mp\alien\_utility::is_true( var_10 ) )
            var_13 = var_11 waittill_any_ents_return( var_11, "revive_success", var_0, "force_bleed_out", var_0, "revive_success" );
        else
            var_13 = var_11 common_scripts\utility::waittill_any_return( "revive_success" );

        if ( var_13 == "timeout" && is_being_revived( var_0 ) )
            var_13 = var_11 common_scripts\utility::waittill_any_return( "revive_success", "revive_fail" );

        if ( var_13 == "revive_success" )
        {
            if ( maps\mp\alien\_utility::is_true( var_10 ) )
                common_scripts\utility::_enableweapon();

            return 1;
        }
        else
            return 0;
    }
}

laststandwaittilllifereceived( var_0, var_1 )
{
    self endon( "death" );
    level endon( "game_ended" );

    for (;;)
    {
        self makeusable();
        self waittill( "trigger", var_2 );
        self makeunusable();

        if ( !isplayer( var_2 ) || !var_2 isonground() )
            continue;

        var_3 = var_2 maps\mp\alien\_perk_utility::perk_getrevivetimescalar();

        if ( var_0 maps\mp\alien\_persistence::is_upgrade_enabled( "faster_revive_upgrade" ) )
            var_3 = var_3 * 1.2;

        var_4 = int( var_1 / var_3 );
        var_5 = get_revive_result( var_0, var_2, self.origin, var_4 );

        if ( var_5 )
        {
            record_revive_success( var_2, var_0 );
            break;
        }
        else
        {
            self notify( "revive_fail" );
            continue;
        }
    }

    var_0 setclientomnvar( "ui_laststand_end_milliseconds", 0 );
    self notify( "revive_success" );
}

medic_revive( var_0, var_1 )
{
    instant_revive( var_1 );
    record_revive_success( var_0, var_1 );
}

record_revive_success( var_0, var_1 )
{
    level thread maps\mp\alien\_music_and_dialog::playvoforrevived( var_0 );
    var_0 maps\mp\alien\_persistence::set_player_revives();
    var_0 maps\mp\alien\_persistence::eog_player_update_stat( "revives", 1 );
    var_1 thread maps\mp\gametypes\_hud_message::playercardsplashnotify( "revived", var_0 );
}

makereviveentity( var_0, var_1, var_2, var_3, var_4 )
{
    var_5 = ( 0, 0, 20 );
    var_1 = common_scripts\utility::drop_to_ground( var_1 + var_5, 32, -64 );
    var_6 = spawn( "script_model", var_1 );
    var_6 setcursorhint( "HINT_NOICON" );
    var_6 sethintstring( &"PLATFORM_REVIVE" );
    var_6.owner = var_0;
    var_6.inuse = 0;
    var_6.targetname = "revive_trigger";

    if ( isdefined( var_2 ) )
        var_6 setmodel( var_2 );

    if ( isdefined( var_3 ) )
        var_6 scriptmodelplayanim( var_3 );

    if ( var_4 )
        var_6 linkto( var_0, "tag_origin", var_5, ( 0, 0, 0 ) );

    return var_6;
}

makereviveiconentity( var_0, var_1 )
{
    var_2 = ( 0, 0, 30 );
    var_3 = spawn( "script_model", var_1.origin + var_2 );
    var_3 thread cleanupreviveent( var_0 );
    return var_3;
}

maydolaststandalien( var_0, var_1, var_2 )
{
    if ( maps\mp\alien\_utility::isplayingsolo() )
        return solo_maydolaststand( var_1, var_2 );
    else
        return coop_maydolaststand( var_2 );
}

solo_maydolaststand( var_0, var_1 )
{
    if ( var_0 && is_killed_by_kill_trigger( var_1 ) )
        return 0;

    return 1;
}

coop_maydolaststand( var_0 )
{
    if ( is_killed_by_kill_trigger( var_0 ) )
        return 0;

    return 1;
}

only_use_weapon( var_0 )
{
    if ( isdefined( self.iscarrying ) && self.iscarrying )
        wait 0.5;

    var_1 = self getweaponslistprimaries()[0];
    var_2 = [ "alienflare_mp", "aliensemtex_mp", "alienclaymore_mp", "alientrophy_mp", "alienbetty_mp", "iw6_aliendlc43_mp", "alienthrowingknife_mp", "alienmortar_shell_mp", "iw6_aliendlc21_mp", "iw6_aliendlc22_mp", "iw6_aliendlc31_mp", "iw6_aliendlc32_mp", "iw6_aliendlc33_mp" ];
    var_3 = can_use_pistol_during_last_stand( self );

    if ( var_3 )
        var_2[var_2.size] = var_1;

    _takeweaponsexceptlist( var_2 );

    if ( var_3 )
    {
        var_4 = self getammocount( var_1 );
        var_5 = weaponclipsize( var_1 );

        if ( var_4 < var_5 )
            self setweaponammoclip( var_1, var_5 );

        self switchtoweapon( var_1 );
    }
}

can_use_pistol_during_last_stand( var_0 )
{
    if ( maps\mp\alien\_utility::is_chaos_mode() && var_0 get_last_stand_count() == 0 )
        return 0;

    return 1;
}

cleanupreviveent( var_0 )
{
    self endon( "death" );
    var_0 common_scripts\utility::waittill_any( "death", "disconnect", "revive" );
    self delete();
}

player_init_laststand()
{
    if ( maps\mp\alien\_utility::is_chaos_mode() )
        maps\mp\alien\_chaos_laststand::chaos_player_init_laststand();
    else
        regularextinction_player_init_laststand();
}

regularextinction_player_init_laststand()
{
    if ( maps\mp\alien\_utility::isplayingsolo() && !issplitscreen() )
    {
        set_last_stand_count( self, 1 );
        thread init_selfrevive_icon( 1 );
    }
}

init_selfrevive_icon( var_0 )
{
    self endon( "death" );
    self endon( "disconnect" );
    level endon( "game_ended" );
    wait 5.0;
    var_1 = get_last_stand_count();
    self setclientomnvar( "ui_alien_selfrevive", var_1 );
}

give_laststand( var_0, var_1 )
{
    if ( !isdefined( var_1 ) )
        var_1 = 1;

    var_2 = var_0 get_last_stand_count() + var_1;
    set_last_stand_count( var_0, var_2 );
}

take_laststand( var_0, var_1 )
{
    if ( !isdefined( var_1 ) )
        var_1 = 1;

    var_2 = var_0 get_last_stand_count() - var_1;
    set_last_stand_count( var_0, max( var_2, 0 ) );
}

gameshouldend( var_0 )
{
    if ( maps\mp\alien\_utility::isplayingsolo() )
        return solo_gameshouldend( var_0 );
    else
        return coop_gameshouldend( var_0 );
}

solo_gameshouldend( var_0 )
{
    if ( var_0.inlaststand )
        return 0;

    return var_0 get_last_stand_count() == 0;
}

coop_gameshouldend( var_0 )
{
    return everyone_else_all_in_laststand( var_0 );
}

everyone_else_all_in_laststand( var_0 )
{
    foreach ( var_2 in level.players )
    {
        if ( var_2 == var_0 )
            continue;

        if ( !player_in_laststand( var_2 ) )
            return 0;
    }

    return 1;
}

get_revive_result( var_0, var_1, var_2, var_3 )
{
    var_1.iscapturingcrate = 1;
    var_4 = createuseent( var_2 );
    var_4 thread cleanupreviveent( var_0 );
    var_5 = revive_use_hold_think( var_0, var_1, var_4, var_3 );
    var_1.iscapturingcrate = 0;
    return var_5;
}

createuseent( var_0 )
{
    var_1 = spawn( "script_origin", var_0 );
    var_1.curprogress = 0;
    var_1.usetime = 0;
    var_1.userate = 8000;
    var_1.inuse = 0;
    return var_1;
}

playdeathsoundinlaststand( var_0 )
{
    self endon( "disconnect" );
    self endon( "revive" );
    level endon( "game_ended" );
    maps\mp\_utility::playdeathsound();
    wait( var_0 / 3 );
    maps\mp\_utility::playdeathsound();
    wait( var_0 / 3 );
    maps\mp\_utility::playdeathsound();
}

visionfadetoblack( var_0 )
{
    var_1 = 2.4;
    self visionsetnakedforplayer( "black_bw", var_0 * var_1 );
    maps\mp\alien\_utility::restore_client_fog( 0 );
}

enter_spectate( var_0, var_1, var_2 )
{
    var_0 endon( "disconnect" );
    level endon( "game_ended" );
    enter_camera_zoomout();
    camera_zoomout( var_0, var_1, var_2 );
    exit_camera_zoomout();
}

camera_zoomout( var_0, var_1, var_2 )
{
    var_2 endon( "revive_success" );
    var_3 = ( 0, 0, 30 );
    var_4 = ( 0, 0, 100 );
    var_5 = ( 0, 0, 400 );
    var_6 = 2.0;
    var_7 = 0.6;
    var_8 = 0.6;
    var_9 = var_1 + var_3;
    var_10 = bullettrace( var_9, var_9 + var_4, 0, var_0 );
    var_11 = var_10["position"];
    var_10 = bullettrace( var_11, var_11 + var_5, 0, var_0 );
    var_12 = var_10["position"];
    var_13 = spawn( "script_model", var_11 );
    var_13 setmodel( "tag_origin" );
    var_13.angles = vectortoangles( ( 0, 0, -1 ) );
    var_13 thread cleanupreviveent( var_0 );
    var_0 cameralinkto( var_13, "tag_origin" );
    var_13 moveto( var_12, var_6, var_7, var_8 );
    var_13 waittill( "movedone" );
    var_13 delete();
    var_0 maps\mp\gametypes\_playerlogic::respawn_asspectator();
}

enter_camera_zoomout()
{
    self playerhide();
    self freezecontrols( 1 );
    self visionsetnakedforplayer( "cheat_bw", 0 );
    maps\mp\alien\_utility::restore_client_fog( 0 );
}

exit_camera_zoomout()
{
    self cameraunlink();
    self freezecontrols( 0 );
}

revive_use_hold_think( var_0, var_1, var_2, var_3 )
{
    enter_revive_use_hold_think( var_0, var_1, var_2, var_3 );
    thread wait_for_exit_revive_use_hold_think( var_0, var_1, var_2 );
    var_4 = 0;
    var_5 = 0;

    while ( should_revive_continue( var_1 ) )
    {
        if ( var_4 >= var_3 )
        {
            var_5 = 1;
            break;
        }

        var_0 setclientomnvar( "ui_securing_progress", var_4 / var_3 );
        var_1 setclientomnvar( "ui_securing_progress", var_4 / var_3 );
        var_4 = var_4 + 50;
        common_scripts\utility::waitframe();
    }

    var_2 notify( "use_hold_think_complete" );
    var_2 waittill( "exit_use_hold_think_complete" );
    return var_5;
}

enter_revive_use_hold_think( var_0, var_1, var_2, var_3 )
{
    var_0 setclientomnvar( "ui_securing", 4 );
    var_1 setclientomnvar( "ui_securing", 3 );
    var_0.being_revived = 1;
    var_1 playerlinkto( var_2 );
    var_1 playerlinkedoffsetenable();
    var_1 maps\mp\alien\_utility::disable_weapon_timeout( var_3 + 0.05, "revive_weapon_management" );
    var_1.isreviving = 1;
}

wait_for_exit_revive_use_hold_think( var_0, var_1, var_2 )
{
    common_scripts\utility::waittill_any_ents( var_2, "use_hold_think_complete", var_0, "disconnect", var_0, "revive_success", var_0, "force_bleed_out" );

    if ( maps\mp\_utility::isreallyalive( var_0 ) )
    {
        var_0.being_revived = 0;
        var_0 setclientomnvar( "ui_securing", 0 );
    }

    var_1 unlink();
    var_1 maps\mp\alien\_utility::enable_weapon_wrapper( "revive_weapon_management" );
    var_1 setclientomnvar( "ui_securing", 0 );
    var_1.isreviving = 0;
    var_2 notify( "exit_use_hold_think_complete" );
}

should_revive_continue( var_0 )
{
    return !level.gameended && maps\mp\_utility::isreallyalive( var_0 ) && var_0 usebuttonpressed() && !var_0.inlaststand;
}

register_laststand_ammo()
{
    self.laststand_ammo = self getweaponammostock( self.laststand_pistol );
    self.laststand_clip_ammo = self getweaponammoclip( self.laststand_pistol );
}

_takeweaponsexceptlist( var_0 )
{
    var_1 = self getweaponslistall();

    foreach ( var_3 in var_1 )
    {
        if ( common_scripts\utility::array_contains( var_0, var_3 ) )
            continue;
        else
            self takeweapon( var_3 );
    }
}

blackbox_laststand( var_0, var_1 )
{
    level.alienbbdata["times_downed"]++;
    var_2 = isagent( var_0 );

    if ( var_2 )
    {
        var_3 = ( gettime() - var_0.birthtime ) / 1000;
        var_4 = "unknown agent";

        if ( isdefined( var_0.agent_type ) )
        {
            var_4 = var_0.agent_type;

            if ( isdefined( var_0.alien_type ) )
                var_4 = var_0.alien_type;
        }
    }
    else
    {
        var_3 = 0;

        if ( isplayer( var_0 ) )
            var_4 = "player";
        else
            var_4 = "nonagent";
    }

    var_5 = 0.0;
    var_6 = 0.0;
    var_7 = 0.0;

    if ( isdefined( var_0 ) && isagent( var_0 ) )
    {
        var_5 = var_0.origin[0];
        var_6 = var_0.origin[1];
        var_7 = var_0.origin[2];
    }

    var_8 = "";

    if ( isdefined( self.name ) )
        var_8 = self.name;

    var_9 = -1;

    if ( isdefined( level.current_cycle_num ) )
        var_9 = level.current_cycle_num;

    var_10 = "unknown";

    if ( isdefined( level.current_hive_name ) )
        var_10 = level.current_hive_name;

    bbprint( "alienplayerlaststand", "cyclenum %i hivename %s attackerisagent %i attackeragenttype %s attackeralivetime %f attackerx %f attackery %f attackerz %f victimx %f victimy %f victimz %f victimname %s damage %i", var_9, var_10, var_2, var_4, var_3, var_5, var_6, var_7, self.origin[0], self.origin[1], self.origin[2], var_8, var_1 );
}

waittill_any_ents_or_timeout_return( var_0, var_1, var_2, var_3, var_4, var_5, var_6, var_7, var_8, var_9, var_10, var_11, var_12, var_13, var_14 )
{
    self endon( "death" );
    var_15 = spawnstruct();
    var_1 childthread common_scripts\utility::waittill_string( var_2, var_15 );

    if ( isdefined( var_3 ) && isdefined( var_4 ) )
        var_3 childthread common_scripts\utility::waittill_string( var_4, var_15 );

    if ( isdefined( var_5 ) && isdefined( var_6 ) )
        var_5 childthread common_scripts\utility::waittill_string( var_6, var_15 );

    if ( isdefined( var_7 ) && isdefined( var_8 ) )
        var_7 childthread common_scripts\utility::waittill_string( var_8, var_15 );

    if ( isdefined( var_9 ) && isdefined( var_10 ) )
        var_9 childthread common_scripts\utility::waittill_string( var_10, var_15 );

    if ( isdefined( var_11 ) && isdefined( var_12 ) )
        var_11 childthread common_scripts\utility::waittill_string( var_12, var_15 );

    if ( isdefined( var_13 ) && isdefined( var_14 ) )
        var_13 childthread common_scripts\utility::waittill_string( var_14, var_15 );

    var_15 childthread common_scripts\utility::_timeout( var_0 );
    var_15 waittill( "returned", var_16 );
    var_15 notify( "die" );
    return var_16;
}

waittill_any_ents_return( var_0, var_1, var_2, var_3, var_4, var_5, var_6, var_7, var_8, var_9, var_10, var_11, var_12, var_13 )
{
    self endon( "death" );
    var_14 = spawnstruct();
    var_0 childthread common_scripts\utility::waittill_string( var_1, var_14 );

    if ( isdefined( var_2 ) && isdefined( var_3 ) )
        var_2 childthread common_scripts\utility::waittill_string( var_3, var_14 );

    if ( isdefined( var_4 ) && isdefined( var_5 ) )
        var_4 childthread common_scripts\utility::waittill_string( var_5, var_14 );

    if ( isdefined( var_6 ) && isdefined( var_7 ) )
        var_6 childthread common_scripts\utility::waittill_string( var_7, var_14 );

    if ( isdefined( var_8 ) && isdefined( var_9 ) )
        var_8 childthread common_scripts\utility::waittill_string( var_9, var_14 );

    if ( isdefined( var_10 ) && isdefined( var_11 ) )
        var_10 childthread common_scripts\utility::waittill_string( var_11, var_14 );

    if ( isdefined( var_12 ) && isdefined( var_13 ) )
        var_12 childthread common_scripts\utility::waittill_string( var_13, var_14 );

    var_14 waittill( "returned", var_15 );
    var_14 notify( "die" );
    return var_15;
}

is_killed_by_kill_trigger( var_0 )
{
    return isdefined( var_0 );
}

set_last_stand_count( var_0, var_1 )
{
    var_1 = int( var_1 );
    var_0 setcoopplayerdata( "alienSession", "last_stand_count", var_1 );
    var_0 setclientomnvar( "ui_alien_selfrevive", var_1 );
}

get_last_stand_count()
{
    return self getcoopplayerdata( "alienSession", "last_stand_count" );
}

is_being_revived( var_0 )
{
    return var_0.being_revived;
}

player_in_laststand( var_0 )
{
    return var_0.inlaststand;
}

instant_revive( var_0 )
{
    var_0 notify( "revive_success" );
}
