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

init()
{
    var_0 = spawnstruct();
    var_0.weaponinfo = "deployable_vest_marker_mp";
    var_0.modelbase = "afr_mortar_ammo_01";
    var_0.hintstring = &"KILLSTREAKS_HINTS_DEPLOYABLE_JUICEBOX_PICKUP";
    var_0.capturingstring = &"KILLSTREAKS_DEPLOYABLE_JUICEBOX_TAKING";
    var_0.event = "deployable_juicebox_taken";
    var_0.streakname = "deployable_juicebox";
    var_0.splashname = "used_deployable_juicebox";
    var_0.shadername = "compass_objpoint_deploy_juiced_friendly";
    var_0.headiconoffset = 25;
    var_0.lifespan = 90.0;
    var_0.usexp = 50;
    var_0.xppopup = "destroyed_vest";
    var_0.vodestroyed = "ballistic_vest_destroyed";
    var_0.deployedsfx = "mp_vest_deployed_ui";
    var_0.onusesfx = "ammo_crate_use";
    var_0.onusecallback = ::onusedeployable;
    var_0.canusecallback = ::canusedeployable;
    var_0.usetime = 500;
    var_0.maxhealth = 300;
    var_0.damagefeedback = "deployable_bag";
    var_0.deathweaponinfo = "deployable_ammo_mp";
    var_0.deathvfx = loadfx( "vfx/gameplay/mp/killstreaks/vfx_ballistic_vest_death" );
    var_0.allowmeleedamage = 1;
    var_0.allowgrenadedamage = 0;
    var_0.maxuses = 4;
    level.boxsettings["deployable_juicebox"] = var_0;
    level.killstreakfuncs["deployable_juicebox"] = ::tryusedeployablejuiced;
    level.deployable_box["deployable_juicebox"] = [];
}

tryusedeployablejuiced( var_0, var_1 )
{
    var_2 = maps\mp\killstreaks\_deployablebox::begindeployableviamarker( var_0, "deployable_juicebox" );

    if ( !isdefined( var_2 ) || !var_2 )
        return 0;

    if ( !maps\mp\_utility::is_aliens() )
        maps\mp\_matchdata::logkillstreakevent( "deployable_juicebox", self.origin );

    return 1;
}

onusedeployable( var_0 )
{
    if ( maps\mp\_utility::is_aliens() )
        thread maps\mp\perks\_perkfunctions::setjuiced( level.deployablebox_juicebox_rank[var_0.upgrade_rank] );
    else
        thread maps\mp\perks\_perkfunctions::setjuiced( 15 );
}

canusedeployable( var_0 )
{
    if ( maps\mp\_utility::is_aliens() && isdefined( var_0 ) && var_0.owner == self && !isdefined( var_0.air_dropped ) )
        return 0;

    return !maps\mp\_utility::isjuggernaut() && !maps\mp\perks\_perkfunctions::hasjuiced();
}
