// This script contains functionality to allow bots to choose secondary weapons based on skill level

this.Name = "SecondaryWeapon";
this.Parent = "Limbo";

this.Initialize = function()
{
        this.Bot.SkillTable = {};
};

this.GetPriority = function()
{
	this.Bot.GetSkills(this.Bot.SkillTable);
	team = this.Bot.GetTeam();
	class = this.Bot.GetClass();
	wpn = null;

	if ( class == CLASS.SOLDIER &&  this.Bot.SkillTable[SKILL.HEAVY_WEAPONS] > 3 )
	{
		if ( team == TEAM.ALLIES )
		{
			wpn = WEAPON.THOMPSON;
		}
		else if ( team == TEAM.AXIS )
		{
			wpn = WEAPON.MP40;
		}
	}
	else if ( class == CLASS.COVERTOPS )
	{
		if ( this.Bot.SkillTable[SKILL.LIGHT_WEAPONS] > 3 )
		{
			if ( team == TEAM.ALLIES )
			{
				wpn = WEAPON.COLT_AKIMBO_SILENCED;
			}
			else if ( team == TEAM.AXIS )
			{
				wpn = WEAPON.LUGER_AKIMBO_SILENCED;
			}
		}
	}
	else if ( this.Bot.SkillTable[SKILL.LIGHT_WEAPONS] > 3 )
	{
		if ( team == TEAM.ALLIES )
		{
			wpn = WEAPON.COLT_AKIMBO;
		}
		else if ( team == TEAM.AXIS )
		{
			wpn = WEAPON.LUGER_AKIMBO;
		}
	}

	if ( wpn )
	{
		this.Bot.ChangeSecondaryWeapon(wpn);
	}

	block(0);
};
