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

init_each_perk()
{
    self.perk_data = [];
    self.perk_data["health"] = maps\mp\alien\_perkfunctions::init_perk_health();
    self.perk_data["damagemod"] = maps\mp\alien\_perkfunctions::init_perk_bullet_damage();
    self.perk_data["medic"] = maps\mp\alien\_perkfunctions::init_perk_medic();
    self.perk_data["rigger"] = maps\mp\alien\_perkfunctions::init_perk_rigger();
    self.perk_data["pistol"] = maps\mp\alien\_perkfunctions::init_perk_pistol();
    self.perk_data["none"] = maps\mp\alien\_perkfunctions::init_perk_none();
}

perk_getmeleescalar()
{
    return self.perk_data["health"].melee_scalar;
}

perk_getmaxhealth()
{
    return self.perk_data["health"].max_health;
}

perk_getbulletdamagescalar()
{
    return self.perk_data["damagemod"].bullet_damage_scalar;
}

perk_getrevivetimescalar()
{
    return self.perk_data["medic"].revive_time_scalar;
}

perk_getgasdamagescalar()
{
    return self.perk_data["medic"].gas_damage_scalar;
}

perk_getmovespeedscalar()
{
    return self.perk_data["medic"].move_speed_scalar;
}

perk_getrevivedamagescalar()
{
    return self.perk_data["medic"].revive_damage_scalar;
}

perk_getdrillhealthscalar()
{
    return self.perk_data["rigger"].drill_health_scalar;
}

perk_getdrilltimescalar()
{
    return self.perk_data["rigger"].drill_time_scalar;
}

perk_gettrapcostscalar()
{
    return self.perk_data["rigger"].trap_cost_scalar;
}

perk_gettrapdamagescalar()
{
    return self.perk_data["rigger"].trap_damage_scalar;
}

perk_gettrapdurationscalar()
{
    return self.perk_data["rigger"].trap_duration_scalar;
}

perk_getcurrencyscaleperhive()
{
    return self.perk_data["rigger"].currency_scale_per_hive;
}

perk_getexplosivedamagescalar()
{
    return self.perk_data["rigger"].explosive_damage_scalar;
}

perk_getrepairdamagescalar()
{
    return self.perk_data["rigger"].repair_damage_scalar;
}

perk_getpistolregen()
{
    return self.perk_data["pistol"].pistol_regen;
}

perk_getpistoloverkill()
{
    return self.perk_data["pistol"].pistol_overkill;
}

has_perk( var_0, var_1 )
{
    var_2 = maps\mp\alien\_persistence::get_selected_perk_0();
    var_3 = maps\mp\alien\_persistence::get_perk_0_level();
    var_4 = maps\mp\alien\_persistence::get_selected_perk_1();
    var_5 = maps\mp\alien\_persistence::get_perk_1_level();
    var_6 = "perk_none";

    if ( maps\mp\alien\_persistence::is_upgrade_enabled( "multi_class" ) )
        var_6 = maps\mp\alien\_persistence::get_selected_perk_0_secondary();

    if ( !isdefined( var_1 ) )
        return var_0 == var_2 || var_0 == var_4 || var_0 == var_6;
    else
    {
        var_7 = var_0 == var_2 && common_scripts\utility::array_contains( var_1, var_3 );
        var_8 = var_0 == var_4 && common_scripts\utility::array_contains( var_1, var_5 );
        var_9 = var_0 == var_6 && common_scripts\utility::array_contains( var_1, var_3 );
        return var_7 || var_8 || var_9;
    }
}

is_valid_perk( var_0 )
{
    var_1 = getarraykeys( level.alien_perks["perk_0"] );

    if ( common_scripts\utility::array_contains( var_1, var_0 ) )
        return 1;

    var_2 = getarraykeys( level.alien_perks["perk_1"] );
    return common_scripts\utility::array_contains( var_2, var_0 );
}
