// Stat and Skill Handler.
// Worthless Bums 2012.


// STATS
// Adds a point to Power stat.
function addPowerPoint ()
{//echo("addPowerPoint()");
	// Check for stat points.
	if ($playerSquad[$activeCharacter].statPoints > 0)
	{
		// Decrement stat points.
		$playerSquad[$activeCharacter].statPoints--;
		// Compose Info Text.
		%infoText = //"Talent Points: " 	@	$playerSquad[$activeCharacter].talentPoints		NL
					"Stat Points: "		@	$playerSquad[$activeCharacter].statPoints		NL
					"Skill Points: "	@	$playerSquad[$activeCharacter].skillPoints;
		// Set Information Text.
		setCharacterPromotionInfo(%infoText);
	}
	else
	{
		return;
	}
	
	// Increment and display.
	$playerSquad[$activeCharacter].power++;
	characterPowerStat.setText("Power..............." 		  @		$playerSquad[$activeCharacter].power);
	
	// Add 1% chance to resist slowing and immobolizing effects.
	// Nothing here yet!
	
	// Update display.
	updateInventoryTabInformation();
	updateSquadMemberFloatingText();
}

// Adds a point to Speed stat.
function addSpeedPoint ()
{//echo("addSpeedPoint()");
	// Check for stat points.
	if ($playerSquad[$activeCharacter].statPoints > 0)
	{
		// Decrement stat points.
		$playerSquad[$activeCharacter].statPoints--;
		// Compose Info Text.
		%infoText = //"Talent Points: " 	@	$playerSquad[$activeCharacter].talentPoints		NL
					"Stat Points: "		@	$playerSquad[$activeCharacter].statPoints		NL
					"Skill Points: "		@	$playerSquad[$activeCharacter].skillPoints;
		// Set Information Text.
		setCharacterPromotionInfo(%infoText);
	}
	else
	{
		return;
	}
	
	// Increment and display.
	$playerSquad[$activeCharacter].speed++;
	$playerSquad[$activeCharacter].evasion += 2;
	characterSpeedStat.setText("Speed..............." @ $playerSquad[$activeCharacter].speed);
	
	// Add 0.25 Action Points.
	if ($playerSquad[$activeCharacter].speed > 0	&&
		$playerSquad[$activeCharacter].speed % 4 == 0)
	{
		// Increment max and current action points!
		$playerSquad[$activeCharacter].sight++;
		$playerSquad[$activeCharacter].maxActionPoints++;
		$playerSquad[$activeCharacter].currentActionPoints++;
		// Update display.
		updateInventoryTabInformation();
	}
	updateSquadMemberFloatingText();
}

// Adds a point to Endurance stat.
function addEndurancePoint ()
{//echo("addEndurancePoint()");
	// Check for stat points.
	if ($playerSquad[$activeCharacter].statPoints > 0)
	{
		// Decrement stat points.
		$playerSquad[$activeCharacter].statPoints--;
		// Compose Info Text.
		%infoText = //"Talent Points: " 	@	$playerSquad[$activeCharacter].talentPoints		NL
					"Stat Points: "		@	$playerSquad[$activeCharacter].statPoints		NL
					"Skill Points: "		@	$playerSquad[$activeCharacter].skillPoints;
		// Set Information Text.
		setCharacterPromotionInfo(%infoText);
	}
	else
	{
		return;
	}
	
	// Increment and display.
	$playerSquad[$activeCharacter].endurance++;
	characterEnduranceStat.setText("Strength........." @ $playerSquad[$activeCharacter].endurance);
	
	// Add health.
	$playerSquad[$activeCharacter].currentHealth += 2;
	$playerSquad[$activeCharacter].maxHealth += 2;
	
	// Update health.
	updateInventoryTabInformation();
	updateSquadMemberFloatingText();
}


// SKILLS //
// Adds a point to Bash skill.
function addBashPoint ()
{//echo("addBashPoint()");
	// Check for skill points.
	if ($playerSquad[$activeCharacter].skillPoints > 0)
	{
		// Decrement skill points.
		$playerSquad[$activeCharacter].skillPoints--;
		// Compose Info Text.
		%infoText = //"Talent Points: " 	@	$playerSquad[$activeCharacter].talentPoints		NL
					"Stat Points: "		@	$playerSquad[$activeCharacter].statPoints		NL
					"Skill Points: "		@	$playerSquad[$activeCharacter].skillPoints;
		// Set Information Text.
		setCharacterPromotionInfo(%infoText);
	}
	else
	{
		return;
	}
	
	// Increment and display.
	$playerSquad[$activeCharacter].bash++;
	characterBashSkill.setText("Smasher.........." @ $playerSquad[$activeCharacter].bash);
	
	// Add +1 melee damage and +1% chance to bash obstacles.
	// Nothing here yet!
	updateSquadMemberFloatingText();
}

// Adds a point to Demolitions skill.
function addDemolitionsPoint ()
{//echo("addDemolitionsPoint()");
	// Check for skill points.
	if ($playerSquad[$activeCharacter].skillPoints > 0)
	{
		// Decrement skill points.
		$playerSquad[$activeCharacter].skillPoints--;
		// Compose Info Text.
		%infoText = //"Talent Points: " 	@	$playerSquad[$activeCharacter].talentPoints		NL
					"Stat Points: "		@	$playerSquad[$activeCharacter].statPoints		NL
					"Skill Points: "	@	$playerSquad[$activeCharacter].skillPoints;
		// Set Information Text.
		setCharacterPromotionInfo(%infoText);
	}
	else
	{
		return;
	}
	
	// Increment and display.
	$playerSquad[$activeCharacter].demolitions++;
	characterDemolitionsSkill.setText("Bomb Tech......" @ $playerSquad[$activeCharacter].demolitions);
	
	// Add +1% aoe damage and +1% protection against aoe damage.
	// Nothing here yet!
	updateSquadMemberFloatingText();
}

// Adds a point to Arms skill.
function addArmsPoint ()
{//echo("addArmsPoint()");
	// Check for skill points.
	if ($playerSquad[$activeCharacter].skillPoints > 0)
	{
		// Decrement skill points.
		$playerSquad[$activeCharacter].skillPoints--;
		// Compose Info Text.
		%infoText = //"Talent Points: " 	@	$playerSquad[$activeCharacter].talentPoints		NL
					"Stat Points: "		@	$playerSquad[$activeCharacter].statPoints		NL
					"Skill Points: "	@	$playerSquad[$activeCharacter].skillPoints;
		// Set Information Text.
		setCharacterPromotionInfo(%infoText);
	}
	else
	{
		return;
	}
	
	// Increment and display.
	$playerSquad[$activeCharacter].arms++;
	characterArmsSkill.setText("Precision........." @ $playerSquad[$activeCharacter].arms);
	
	// Add +1 to firearm damage and +1% accuracy.
	// Nothing here yet!
	updateSquadMemberFloatingText();
}