// Tracks player kills.
// Worthless Bums 2012.


// Called whenever the active player kills a monster.
function updateKillRecord (%characterIndex, %monsterName, %monsterLevel)
{//echo("updateKillRecord()");//echo("%monsterName =" SPC %monsterName);//echo("%monsterLevel =" SPC %monsterLevel);
	if ($generateTutorialLevel)
	{
		if ($tutorialSection == 5)
		{
			tutorialMessage6();
		}
		if ($tutorialSection == 4)
		{
			tutorialMessage5();
		}
	}
	// Update character's kill record.
	$playerSquad[%characterIndex].kills++;
	
	// Update character's experience.
	updateExperience(%monsterName, %monsterLevel);
	
	// Update Hostile Control.
	%deckHostileControl = 20 * (1 / $maxMonsters);											// This calculates hostile control for the entire deck.
	switch$ ($overworldLocation)
	{
		case "Command Deck":
			$ship.commandDeckHostileControl -= %deckHostileControl;
			// Floor hostile control!
			if ($ship.commandDeckHostileControl < 0)
			{
				$ship.commandDeckHostileControl = 0;
			}
			
		case "Engineering Deck":
			$ship.engineeringDeckHostileControl -= %deckHostileControl;
			// Floor hostile control!
			if ($ship.engineeringDeckHostileControl < 0)
			{
				$ship.engineeringDeckHostileControl = 0;
			}
			
		case "Medical Deck":
			$ship.medicalDeckHostileControl -= %deckHostileControl;
			// Floor hostile control!
			if ($ship.medicalDeckHostileControl < 0)
			{
				$ship.medicalDeckHostileControl = 0;
			}
			
		case "Armory Deck":
			$ship.armoryDeckHostileControl -= %deckHostileControl;
			// Floor hostile control!
			if ($ship.armoryDeckHostileControl < 0)
			{
				$ship.armoryDeckHostileControl = 0;
			}
			
		case "Bridge Deck":
			$ship.bridgeDeckHostileControl -= %deckHostileControl;
			// Floor hostile control!
			if ($ship.bridgeDeckHostileControl < 0)
			{
				$ship.bridgeDeckHostileControl = 0;
			}
	}
	
	// Update Deck Stats.
	updateDeckStats();
}