// Handles mounting of armor sprites as character sprites.
// Worthless Bums 2012.


// Mounts the current armor sprite to a squad member sprite.
function mountArmorToCharacter (%armor, %characterIndex)
{//echo("mountArmorToCharacter()");
	$playerSquad[%characterIndex].armor = %armor;
	switch ($playerSquad[%characterIndex].characterClass)
	{
		case 0:	// Leader.
			$playerSquad[%characterIndex].imagemap = "LeaderImageMap";
			
		case 1:	// Scout.
			$playerSquad[%characterIndex].imagemap = "ScoutImageMap";
			
		case 2:	// Grenadier.
			$playerSquad[%characterIndex].imagemap = "GrenadierImageMap";
			
		case 3:	// Support.
			$playerSquad[%characterIndex].imagemap = "SupportImageMap";
			
		case 4:	// Engineer.
			$playerSquad[%characterIndex].imagemap = "EngineerImageMap";
	}
	updateSquadInfoGui();
	setSquadMemberFacing($playerSquad[$activeCharacter].facing, $playerSquad[$activeCharacter]);
}
// Gives the squad member a randomzied armor based on the specified dungeon level.
function giveRandomArmor (%squadMember, %dungeonLevel)
{//echo("giveRandomArmor()");
	%armorCode = createRandomArmor(%squadMember, %dungeonLevel);
	%armor = createNewArmor(%armorCode);
	mountArmorToCharacter(%armor, %squadMember);
}