:: seeUnit [nobr]

<<if $attackThisWeek == 1>>
	<<set $nextButton = "Back", $nextLink = "attackOption", $returnTo = "secBarracks">>
<<else>>
	<<set $nextButton = "Back", $nextLink = "secBarracks", $returnTo = "secBarracks">>
<</if>>

<<if $targetUnit == "secBots">>
	<<secBotsDescription>>
	<br><br>
	<<if $secBots.maxTroops < 80>>
		<<link "Improve the digital control matrix">>|
			<<set $secBots.maxTroops += 10>>
			<<set $cash -= 5000>>
			<<goto "seeUnit">>
		<</link>>
		Invest in the development of more refined controls for your drones to increase the maximum number of drones in the unit.
		<br>//Costs 5000 per upgrade and each will increase the max by 10//
	<<else>>
		There's little left to improve in the matrix. Your control systems are at top capacity and won't be able to handle bigger drone units.
	<</if>>
	<br>
	<<if $secBots.equip < 3>>
		<<link "Improve drone weaponry and armor">>
			<<set $secBots.equip += 1>>
			<<set $cash -= (($secBotsUpgradeCost * $secBots.maxTroops) + 1000)>>
			<<goto "seeUnit">>
		<</link>>
		Invest in better equipment for your drones to increase their battle effectiveness.
		<br>//Costs <<print (($secBotsUpgradeCost * $secBots.maxTroops) + 1000)>> and will increase attack and defense value of the unit by 15% for every upgrade.//
	<<else>>
		Your drones are equipped with top tier weaponry and armor.
	<</if>>
	<<if $showBattleStatistics == 1>>
		<br>
		<br>Security drones base attack: $secBotsBaseAttack (<<print ($secBotsBaseAttack + $secBotsBaseAttack * $secBots.equip * 0.15)>>)
		<br>Security drones base defense: $secBotsBaseDefense (<<print ($secBotsBaseDefense + $secBotsBaseDefense * $secBots.equip * 0.15)>>)
		<br>Equipment bonus: + <<print $secBots.equip * 15>>%
		<br>Security drones base morale: $secBotsMorale
		<br>Security drones base hp: $secBotsBaseHp
	<</if>>	
<<elseif $targetUnit == "militiaUnits">>
	<<militiaUnitsDescription $militiaUnits[$targetIndex]>>
	<br><br>
	Rename unit <<textbox "$militiaUnits[$targetIndex].platoonName" $militiaUnits[$targetIndex].platoonName "seeUnit">>
	<br>
	<br>
	<<if $militiaUnits[$targetIndex].maxTroops < 50>>
		<<link "Intensive officers training">>
			<<set $militiaUnits[$targetIndex].maxTroops += 10>>
			<<set $cash -= 5000>>
			<<goto "seeUnit">>
		<</link>>
		Invest in the training of your officers to increase the maximum number of soldiers in the unit.
		<br>//Costs 5000 per upgrade and each will increase the max by 10//
	<<else>>
		Your officers rached their peak. Further training will have little impact on the number of troops they can effectively lead.
	<</if>>
	<br>
	<<if $militiaUnits[$targetIndex].equip < 3>>
		<<link "Improve weaponry and equipment">>
			<<set $militiaUnits[$targetIndex].equip += 1>>
			<<set $cash -= ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 1000>>
			<<goto "seeUnit">>
		<</link>>
		Invest in better equipment for your soldiers to increase their battle effectiveness.
		<br>//Costs <<print ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 1000>> and will increase attack and defense value of the unit by 15% for every upgrade.//
	<<else>>
		The unit is equipped with state of the art weaponry and equipment.
	<</if>>
	<br>
	<<if $militiaUnits[$targetIndex].medics == 0>>
		<<link "Attach trained medics to the unit">>
			<<set $militiaUnits[$targetIndex].medics = 1>>
			<<set $cash -= $equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 1000>>
			<<goto "seeUnit">>
		<</link>>
		Attach a small squad of trained medics to the unit.
		<br>//Costs <<print ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 1000>> and will decrease the number of casualties suffered during battle.//
	<<else>>
		The unit has a medic detachment following it into battle, decreasing the number of casualties the unit suffers.
	<</if>>
	<<if $securityForceActive == 1>>
		<<if $militiaUnits[$targetIndex].SF == 0>>
			<<link "Attach Security Force advisors">>
				<<set $militiaUnits[$targetIndex].SF = 1>>
				<<set $cash -= ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 5000>>
				<<goto "seeUnit">>
			<</link>>
			Attach $securityForceName advisors to the unit.
			<br>//Costs <<print ($equipUpgradeCost * $militiaUnits[$targetIndex].maxTroops) + 5000>> and will slightly increase the base stats of the unit.//
		<<else>>
			The unit has a medic detachment following it into battle, decreasing the number of casualties the unit suffers.
		<</if>>
	<</if>>
	<<if $showBattleStatistics == 1>>
		<br>
		<br>Militia base attack: $militiaBaseAttack (<<print ($militiaBaseAttack + $militiaBaseAttack * $militiaUnits[$targetIndex].equip * 0.15)>>)
		<br>Militia base defense: $militiaBaseDefense (<<print ($militiaBaseDefense + $militiaBaseDefense * $militiaUnits[$targetIndex].equip * 0.15)>>)
		<br>Equipment bonus: + <<print $militiaUnits[$targetIndex].equip * 15>>%
		<br>Militia base morale: $militiaBaseMorale (<<print ($militiaBaseMorale + $militiaBaseMorale * $secBarracksUpgrades.luxury * 0.05)>>)
		<br>Barracks bonus: + <<print $secBarracksUpgrades.luxury * 5>>%
		<br>Militia base hp: $militiaBaseHp
	<</if>>
<<elseif $targetUnit == "slaveUnits">>
	<<slaveUnitsDescription $slaveUnits[$targetIndex]>>
	<br><br>
	Rename unit <<textbox "$slaveUnits[$targetIndex].platoonName" $slaveUnits[$targetIndex].platoonName "seeUnit">>
	<br>
	<br>
	<<if $slaveUnits[$targetIndex].maxTroops < 50>>
		<<link "Intensive officers training">>
			<<set $slaveUnits[$targetIndex].maxTroops += 10>>
			<<set $cash -= 5000>>
			<<goto "seeUnit">>
		<</link>>
		Invest in the training of your officers to increase the maximum number of soldiers in the unit.
		<br>//Costs 5000 per upgrade and each will increase the max by 10//
	<<else>>
		Your officers rached their peak. Further training will have little impact on the number of troops they can effectively lead.
	<</if>>
	<br>
	<<if $slaveUnits[$targetIndex].equip < 3>>
		<<link "Improve weaponry and equipment">>
			<<set $slaveUnits[$targetIndex].equip += 1>>
			<<set $cash -= ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 1000>>
			<<goto "seeUnit">>
		<</link>>
		Invest in better equipment for your soldiers to increase their battle effectiveness.
		<br>//Costs <<print ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 1000>> and will increase attack and defense value of the unit by 15% for every upgrade.//
	<<else>>
		The unit is equipped with state of the art weaponry and equipment.
	<</if>>
	<br>
	<<if $slaveUnits[$targetIndex].medics == 0>>
		<<link "Attach trained medics to the unit">>
			<<set $slaveUnits[$targetIndex].medics = 1>>
			<<set $cash -= $equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 1000>>
			<<goto "seeUnit">>
		<</link>>
		Attach a small squad of trained medics to the unit.
		<br>//Costs <<print ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 1000>> and will decrease the number of casualties suffered during battle.//
	<<else>>
		The unit has a medic detachment following it into battle, decreasing the number of casualties the unit suffers.
	<</if>>
	<<if $securityForceActive == 1>>
		<<if $slaveUnits[$targetIndex].SF == 0>>
			<<link "Attach Security Force advisors">>
				<<set $slaveUnits[$targetIndex].SF = 1>>
				<<set $cash -= ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 5000>>
				<<goto "seeUnit">>
			<</link>>
			Attach $securityForceName advisors to the unit.
			<br>//Costs <<print ($equipUpgradeCost * $slaveUnits[$targetIndex].maxTroops) + 5000>> and will slightly increase the base stats of the unit.//
		<<else>>
			The unit has a medic detachment following it into battle, decreasing the number of casualties the unit suffers.
		<</if>>
	<</if>>
	<<if $showBattleStatistics == 1>>
		<br>
		<br>Slaves base attack: $slaveBaseAttack (<<print ($slaveBaseAttack + $slaveBaseAttack * $slaveUnits[$targetIndex].equip * 0.15)>>)
		<br>Slaves base defense: $slaveBaseDefense (<<print ($slaveBaseDefense + $slaveBaseDefense * $slaveUnits[$targetIndex].equip * 0.15)>>)
		<br>Equipment bonus: + <<print $slaveUnits[$targetIndex].equip * 15>>%
		<br>Slaves base morale: $slaveBaseMorale (<<print ($slaveBaseMorale + $slaveBaseMorale * $secBarracksUpgrades.luxury * 0.05)>>)
		<br>Barracks bonus: + <<print $secBarracksUpgrades.luxury * 5>>%
		<br>Slaves base hp: $slaveBaseHp
	<</if>>
<<elseif $targetUnit == "mercUnits">>
	<<mercUnitsDescription $mercUnits[$targetIndex]>>
	<br><br>
	Rename unit <<textbox "$mercUnits[$targetIndex].platoonName" $mercUnits[$targetIndex].platoonName "seeUnit">>
	<br>
	<br>
	<<if $mercUnits[$targetIndex].maxTroops < 50>>
		<<link "Intensive officers training">>
			<<set $mercUnits[$targetIndex].maxTroops += 10>>
			<<set $cash -= 5000>>
			<<goto "seeUnit">>
		<</link>>
		Invest in the training of your officers to increase the maximum number of soldiers in the unit.
		<br>//Costs 5000 per upgrade and each will increase the max by 10//
	<<else>>
		Your officers rached their peak. Further training will have little impact on the number of troops they can effectively lead.
	<</if>>
	<br>
	<<if $mercUnits[$targetIndex].equip < 3>>
		<<link "Improve weaponry and equipment">>
			<<set $mercUnits[$targetIndex].equip += 1>>
			<<set $cash -= ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 1000>>
			<<goto "seeUnit">>
		<</link>>
		Invest in better equipment for your soldiers to increase their battle effectiveness.
		<br>//Costs <<print ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 1000>> and will increase attack and defense value of the unit by 15% for every upgrade.//
	<<else>>
		The unit is equipped with state of the art weaponry and equipment.
	<</if>>
	<br>
	<<if $mercUnits[$targetIndex].medics == 0>>
		<<link "Attach trained medics to the unit">>
			<<set $mercUnits[$targetIndex].medics = 1>>
			<<set $cash -= ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 5000>>
			<<goto "seeUnit">>
		<</link>>
		Attach a small squad of trained medics to the unit.
		<br>//Costs <<print ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 5000>> and will decrease the number of casualties suffered during battle.//
	<<else>>
		The unit has a medic detachment following it into battle, decreasing the number of casualties the unit suffers.
	<</if>>
	<<if $securityForceActive == 1>>
		<<if $mercUnits[$targetIndex].SF == 0>>
			<<link "Attach Security Force advisors">>
				<<set $mercUnits[$targetIndex].SF = 1>>
				<<set $cash -= ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 5000>>
				<<goto "seeUnit">>
			<</link>>
			Attach $securityForceName advisors to the unit.
			<br>//Costs <<print ($equipUpgradeCost * $mercUnits[$targetIndex].maxTroops) + 5000>> and will slightly increase the base stats of the unit.//
		<<else>>
			The unit has a medic detachment following it into battle, decreasing the number of casualties the unit suffers.
		<</if>>
	<</if>>
	<<if $showBattleStatistics == 1>>
		<br>
		<br>Mercenaries base attack: $mercBaseAttack (<<print ($mercBaseAttack + $mercBaseAttack * $mercUnits[$targetIndex].equip * 0.15)>>)
		<br>Mercenaries base defense: $mercBaseDefense (<<print ($mercBaseDefense + $mercBaseDefense * $mercUnits[$targetIndex].equip * 0.15)>>)
		<br>Equipment bonus: + <<print $mercUnits[$targetIndex].equip * 15>>%
		<br>Mercenaries base morale: $mercBaseMorale (<<print ($mercBaseMorale + $mercBaseMorale * $secBarracksUpgrades.luxury * 0.05)>>)
		<br>Barracks bonus: + <<print $secBarracksUpgrades.luxury * 5>>%
		<br>Mercenaries base hp: $mercBaseHp
	<</if>>
<</if>>