:: secExpOptions [nobr]

<<set $showEncyclopedia = 1, $encyclopedia = "Security Expansion", $nextButton = "Back to Options", $nextLink = "Options">>

__Battles__:
<<if $terrain != "oceanic">>
	<br><<if $battlesEnabled == 0>>
		Battles are @@.red;DISABLED@@.
		<<link "Enable battles" "secExpOptions">>
			<<set $battlesEnabled = 1>>
		<</link>>
	<<else>>
		Battles are @@.cyan;ENABLED@@.
	<<link "Disable battles" "secExpOptions">>
			<<set $battlesEnabled = 0>>
		<</link>>
	<</if>>
	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Enable/disable battles.//
	<<if $battlesEnabled == 1>>
		<br>
		<<if $majorBattlesEnabled == 0>>
			Major battles are @@.red;DISABLED@@.
			<<link "Enable major battles" "secExpOptions">>
				<<set $majorBattlesEnabled = 1>>
				<<set $battlesEnabled = 1>>
			<</link>>
		<<else>>
			Major battles are @@.cyan;ENABLED@@.
		<<link "Disable major battles" "secExpOptions">>
				<<set $majorBattlesEnabled = 0>>
			<</link>>
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Enable/disable late game large scale battles.//
		<br>
		<<if $majorBattleGameOver == 0>>
			Major battles can cause gameover is @@.red;FALSE@@.
			<<link "Activate game loss in case of major battle defeat" "secExpOptions">>
				<<set $majorBattleGameOver = 1>>
			<</link>>
		<<else>>
			Major battles can cause gameover is @@.cyan;TRUE@@.
		<<link "Deactivate game loss in case of major battle defeat" "secExpOptions">>
				<<set $majorBattleGameOver = 0>>
			<</link>>
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;//By default a total defeat in a major battle will cause a gameover.//
		<br>
		<<if $forceBattle == 0>>
			Battle guaranteed this week is @@.red;FALSE@@.
			<<link "Force engagement every week" "secExpOptions">>
				<<set $forceBattle = 1>>
			<</link>>

		<<else>>
			Battle guaranteed this week is @@.cyan;TRUE@@.
		<<link "Do not force engagement every week" "secExpOptions">>
				<<set $forceBattle = 0>>
				<<set $forceMajorBattle = 0>>
			<</link>>
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will force battles to happen every week.//
		<br>
		<<if $forceMajorBattle == 0>>
			Major battle guaranteed this week is @@.red;FALSE@@.
			<<link "Force major engagement every week" "secExpOptions">>
				<<set $forceMajorBattle = 1>>
				<<set $forceBattle = 1>>
			<</link>>
		<<else>>
			Major battle guaranteed this week is @@.cyan;TRUE@@.
			<<link "Do not force major engagement every week" "secExpOptions">>
				<<set $forceMajorBattle = 0>>
			<</link>>
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will force major battles to happen every week. //
	<</if>>
<<else>>
	<br>Oceanic arcologies are not by default subject to external attacks. You can however allow them to happen anyway. If you choose to do so please keep in mind that descriptions and mechanics are not intended for naval combat but land combat.
	<br>
	<<if $battlesEnabled == 0>>
		Battles are @@.red;DISABLED@@.
		<<link "Enable battles" "secExpOptions">>
			<<set $battlesEnabled = 1>>
		<</link>>
	<<else>>
		Battles are @@.cyan;ENABLED@@.
	<<link "Disable battles" "secExpOptions">>
			<<set $battlesEnabled = 0>>
		<</link>>
	<</if>>
	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Enable/disable battles.//
	<<if $battlesEnabled == 1>>
		<br>
		<<if $majorBattlesEnabled == 0>>
			Major battles are @@.red;DISABLED@@.
			<<link "Enable major battles" "secExpOptions">>
				<<set $majorBattlesEnabled = 1>>
				<<set $battlesEnabled = 1>>
			<</link>>
		<<else>>
			Major battles are @@.cyan;ENABLED@@.
		<<link "Disable major battles" "secExpOptions">>
				<<set $majorBattlesEnabled = 0>>
			<</link>>
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Enable/disable late game large scale battles.//
		<br>
		<<if $majorBattleGameOver == 0>>
			Major battles can cause gameover is @@.red;FALSE@@.
			<<link "Activate game loss in case of major battle defeat" "secExpOptions">>
				<<set $majorBattleGameOver = 1>>
			<</link>>
		<<else>>
			Major battles can cause gameover is @@.cyan;TRUE@@.
		<<link "Deactivate game loss in case of major battle defeat" "secExpOptions">>
				<<set $majorBattleGameOver = 0>>
			<</link>>
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;//By default a total defeat in a major battle will cause a gameover.//
		<br>
		<<if $forceBattle == 0>>
			Battle guaranteed this week is @@.red;FALSE@@.
			<<link "Force engagement every week" "secExpOptions">>
				<<set $forceBattle = 1>>
			<</link>>

		<<else>>
			Battle guaranteed this week is @@.cyan;TRUE@@.
		<<link "Do not force engagement every week" "secExpOptions">>
				<<set $forceBattle = 0>>
			<</link>>
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will force battles to happen every week.//
		<br>
		<<if $forceMajorBattle == 0>>
			Major battle guaranteed this week is @@.red;FALSE@@.
			<<link "Force major engagement every week" "secExpOptions">>
				<<set $forceMajorBattle = 1>>
				<<set $forceBattle = 1>>
			<</link>>
		<<else>>
			Major battle guaranteed this week is @@.cyan;TRUE@@.
			<<link "Do not force major engagement every week" "secExpOptions">>
				<<set $forceMajorBattle = 0>>
			<</link>>
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will force major battles to happen every week. //
	<</if>>
<</if>>
<br>
<br>
__Rebellions__:
	<br>
	<<if $rebellionsEnabled == 0>>
		Rebellions are @@.red;DISABLED@@.
		<<link "Enable rebellions" "secExpOptions">>
			<<set $rebellionsEnabled = 1>>
		<</link>>
	<<else>>
		Rebellions are @@.cyan;ENABLED@@.
	<<link "Disable rebellions" "secExpOptions">>
			<<set $rebellionsEnabled = 0>>
		<</link>>
	<</if>>
	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Enable/disable rebellions.//
	<br>
	<<if $rebellionsEnabled == 1>>
		<<if $rebellionGameOver == 0>>
			Rebellions can cause gameover is @@.red;FALSE@@.
			<<link "Activate game loss in case of rebellions succeeding" "secExpOptions">>
				<<set $rebellionGameOver = 1>>
			<</link>>
		<<elseif $rebellionGameOver == 1>>
			Rebellions can cause gameover is @@.cyan;TRUE@@.
			<<link "Deactivate game loss in case of rebellions succeeding" "secExpOptions">>
				<<set $rebellionGameOver = 0>>
			<</link>>
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Determines whether a total defeat in a rebellion will cause a gameover.//
		<br>
		<<if $forceRebellion == 0>>
			Rebellions guaranteed this week is @@.red;FALSE@@.
			<<link "Force engagement every week" "secExpOptions">>
				<<set $forceRebellion = 1>>
			<</link>>
		<<else>>
			Rebellions guaranteed this week is @@.cyan;TRUE@@.
		<<link "Do not force engagement every week" "secExpOptions">>
				<<set $forceRebellion = 0>>
			<</link>>
		<</if>>
		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will force rebellions to happen every week. Rebellions will take precedence over battles.//
	<</if>>

<<if $showBattleStatistics == 0 &&($battlesEnabled == 1 || $rebellionsEnabled == 1)>>
	<br>
	<br>
	Detailed battle statistics are @@.red;HIDDEN@@.
	<<link "Enable detailed battle statistics" "secExpOptions">>
		<<set $showBattleStatistics = 1>>
	<</link>>
	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will show detailed statistics and battle turns.//
	<br><br>
<<elseif ($battlesEnabled == 1 || $rebellionsEnabled == 1)>>
	<br>
	<br>
	Detailed battle statistics are @@.cyan;SHOWN@@.
	<<link "Disable detailed battle statistics" "secExpOptions">>
		<<set $showBattleStatistics = 0>>
	<</link>>
	<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will show detailed statistics and battle turns.//
<</if>>

<<if $allowPrestigeFromBattles == 0 && $battlesEnabled == 1>>
	<br>
	<br>
	Battles can give prestige to slaves is @@.red;DISABLED@@.
	<<link "enable prestige from battles for slaves" "secExpOptions">>
		<<set $allowPrestigeFromBattles = 1>>
	<</link>>
	<br>&nbsp;&nbsp;&nbsp;&nbsp;//If enabled, slaves will gain a rank of prestige for every 10 victories scored under their command.//
	<br><br>
<<elseif $battlesEnabled == 1>>
	<br>
	<br>
	Battles can give prestige to slaves is @@.cyan;ENABLED@@.
	<<link "Disable prestige from battles for slaves" "secExpOptions">>
		<<set $allowPrestigeFromBattles = 0>>
	<</link>>
	<br>&nbsp;&nbsp;&nbsp;&nbsp;//If enabled, slaves will gain a rank of prestige for every 10 victories scored under their command.//
<</if>>

<br>
<br>

__Battles/Rebellions Difficulty__:
<br>Difficulty is set to:<span id="difficulty">
<<if $difficulty == 0.5>>
	@@.green;Very easy@@
<<elseif $difficulty == 0.75>>
	@@.limegreen;Easy@@
<<elseif $difficulty == 1>>
	@@.yellow;Normal@@
<<elseif $difficulty == 1.25>>
	@@.red;Hard@@
<<else>>
	@@.darkred;Very hard@@
<</if>>
</span>
<br>
<<link "Very easy">>
	<<set $difficulty = 0.5>>
	<<replace "#difficulty">>
		@@.green;Very easy@@
	<</replace>>
<</link>> | <<link "Easy">>
	<<set $difficulty = 0.75>>
	<<replace "#difficulty">>
		@@.limegreen;Easy@@
	<</replace>>
<</link>> | <<link "Normal">>
	<<set $difficulty = 1>>
	<<replace "#difficulty">>
		@@.yellow;Normal@@
	<</replace>>
<</link>> | <<link "Hard">>
	<<set $difficulty = 1.25>>
	<<replace "#difficulty">>
		@@.red;Hard@@
	<</replace>>
<</link>> | <<link "Very hard">>
	<<set $difficulty = 1.5>>
	<<replace "#difficulty">>
		@@.darkred;Very hard@@
	<</replace>>
<</link>>
<br>
<br>
__Battles frequency__:
<br>Battle frequency is set to:<span id="battleFrequency">
<<if $battleFrequency == 0.5>>
	@@.green;Very infrequent@@
<<elseif $battleFrequency == 0.75>>
	@@.limegreen;Infrequent@@
<<elseif $battleFrequency == 1>>
	@@.yellow;Normal@@
<<elseif $battleFrequency == 1.25>>
	@@.red;Frequent@@
<<else>>
	@@.darkred;Very frequent@@
<</if>>
</span>
<br>
<<link "Very infrequent">>
	<<set $battleFrequency = 0.5>>
	<<replace "#battleFrequency">>
		@@.green;Very infrequent@@
	<</replace>>
<</link>> | <<link "Infrequent">>
	<<set $battleFrequency = 0.75>>
	<<replace "#battleFrequency">>
		@@.limegreen;Infrequent@@
	<</replace>>
<</link>> | <<link "Normal">>
	<<set $battleFrequency = 1>>
	<<replace "#battleFrequency">>
		@@.yellow;Normal@@
	<</replace>>
<</link>> | <<link "Frequent">>
	<<set $battleFrequency = 1.25>>
	<<replace "#battleFrequency">>
		@@.red;Frequent@@
	<</replace>>
<</link>> | <<link "Very frequent">>
	<<set $battleFrequency = 1.5>>
	<<replace "#battleFrequency">>
		@@.darkred;Very frequent@@
	<</replace>>
<</link>>
<br>
<br>
__Major battle multiplier__:
<br>Major battle multiplier is set to:<span id="majorBattleMult">
<<if $majorBattleMult == 0.5>>
	@@.green;Very low@@
<<elseif $majorBattleMult == 0.75>>
	@@.limegreen;Low@@
<<elseif $majorBattleMult == 1>>
	@@.yellow;Normal@@
<<elseif $majorBattleMult == 1.25>>
	@@.red;high@@
<<else>>
	@@.darkred;Very high@@
<</if>>
</span>
<br>
<<link "Very low">>
	<<set $majorBattleMult = 0.5>>
	<<replace "#majorBattleMult">>
		@@.green;Very low@@
	<</replace>>
<</link>> | <<link "Low">>
	<<set $majorBattleMult = 0.75>>
	<<replace "#majorBattleMult">>
		@@.limegreen;Low@@
	<</replace>>
<</link>> | <<link "Normal">>
	<<set $majorBattleMult = 1>>
	<<replace "#majorBattleMult">>
		@@.yellow;Normal@@
	<</replace>>
<</link>> | <<link "High">>
	<<set $majorBattleMult = 1.25>>
	<<replace "#majorBattleMult">>
		@@.red;High@@
	<</replace>>
<</link>> | <<link "Very high">>
	<<set $majorBattleMult = 1.5>>
	<<replace "#majorBattleMult">>
		@@.darkred;Very high@@
	<</replace>>
<</link>>
<br>
<br>
__Rebellions buildup speed__:
<br>Rebellion speed is set to:<span id="rebellionSpeed">
<<if $rebellionSpeed == 0.5>>
	@@.green;Very slow@@
<<elseif $rebellionSpeed == 0.75>>
	@@.limegreen;Slow@@
<<elseif $rebellionSpeed == 1>>
	@@.yellow;Normal@@
<<elseif $rebellionSpeed == 1.25>>
	@@.red;Fast@@
<<else>>
	@@.darkred;Very fast@@
<</if>>
</span>
<br>
<<link "Very slow">>
	<<set $rebellionSpeed = 0.5>>
	<<replace "#rebellionSpeed">>
		@@.green;Very slow@@
	<</replace>>
<</link>> | <<link "Slow">>
	<<set $rebellionSpeed = 0.75>>
	<<replace "#rebellionSpeed">>
		@@.limegreen;Slow@@
	<</replace>>
<</link>> | <<link "Normal">>
	<<set $rebellionSpeed = 1>>
	<<replace "#rebellionSpeed">>
		@@.yellow;Normal@@
	<</replace>>
<</link>> | <<link "Fast">>
	<<set $rebellionSpeed = 1.25>>
	<<replace "#rebellionSpeed">>
		@@.red;Fast@@
	<</replace>>
<</link>> | <<link "Very fast">>
	<<set $rebellionSpeed = 1.5>>
	<<replace "#rebellionSpeed">>
		@@.darkred;Very fast@@
	<</replace>>
<</link>>


<br>
<br>

__Debug/cheats:__
<<silently>><<= MenialPopCap()>><</silently>>
<br>
<<link "Set loyalty high" "secExpOptions">>
	<<for _i = 0; _i < $militiaUnits.length; _i++>>
		<<set $militiaUnits[_i].loyalty = random(80,100)>>
	<</for>>

	<<for _i = 0; _i < $slaveUnits.length; _i++>>
		<<set $slaveUnits[_i].loyalty = random(80,100)>>
	<</for>>

	<<for _i = 0; _i < $mercUnits.length; _i++>>
		<<set $mercUnits[_i].loyalty = random(80,100)>>
	<</for>>
<</link>> | <<link "Set loyalty average" "secExpOptions">>
	<<for _i = 0; _i < $militiaUnits.length; _i++>>
		<<set $militiaUnits[_i].loyalty = random(40,60)>>
	<</for>>

	<<for _i = 0; _i < $slaveUnits.length; _i++>>
		<<set $slaveUnits[_i].loyalty = random(40,60)>>
	<</for>>

	<<for _i = 0; _i < $mercUnits.length; _i++>>
		<<set $mercUnits[_i].loyalty = random(40,60)>>
	<</for>>
<</link>> | <<link "Set loyalty low" "secExpOptions">>
	<<for _i = 0; _i < $militiaUnits.length; _i++>>
		<<set $militiaUnits[_i].loyalty = random(20)>>
	<</for>>

	<<for _i = 0; _i < $slaveUnits.length; _i++>>
		<<set $slaveUnits[_i].loyalty = random(20)>>
	<</for>>

	<<for _i = 0; _i < $mercUnits.length; _i++>>
		<<set $mercUnits[_i].loyalty = random(20)>>
	<</for>>
<</link>> | <<link "Randomize loyalty" "secExpOptions">>
	<<for _i = 0; _i < $militiaUnits.length; _i++>>
		<<set $militiaUnits[_i].loyalty = random(100)>>
	<</for>>

	<<for _i = 0; _i < $slaveUnits.length; _i++>>
		<<set $slaveUnits[_i].loyalty = random(100)>>
	<</for>>

	<<for _i = 0; _i < $mercUnits.length; _i++>>
		<<set $mercUnits[_i].loyalty = random(100)>>
	<</for>>
<</link>>
<br><<link "Give Authority" "secExpOptions">>
	<<set $authority = Math.clamp($authority + 1000, 0, 20000)>>
<</link>> | <<link "Remove Authority" "secExpOptions">>
	<<set $authority = Math.clamp($authority - 1000, 0, 20000)>>
<</link>>
<br><<link "Raise security" "secExpOptions">>
	<<set $security = Math.clamp($security + 5, 0, 100)>>
<</link>> | <<link "Lower security" "secExpOptions">>
	<<set $security = Math.clamp($security - 5, 0, 100)>>
<</link>>
<br><<link "Raise crime" "secExpOptions">>
	<<set $crime = Math.clamp($crime + 5, 0, 100)>>
<</link>> | <<link "Lower crime" "secExpOptions">>
	<<set $crime = Math.clamp($crime - 5, 0, 100)>>
<</link>>
<br><<link "Give menial slaves" "secExpOptions">>
	<<set $helots = Math.clamp($helots + 30, 0, $PopCap)>>
<</link>> | <<link "Remove menial slaves" "secExpOptions">>
	<<set $helots = Math.clamp($helots - 30, 0, $PopCap)>>
<</link>>
<br><<link "Give militia manpower" "secExpOptions">>
	<<set $militiaFreeManpower += 30>>
	<<recalcManpower>>
<</link>> | <<link "Remove militia manpower" "secExpOptions">>
	<<set $militiaFreeManpower = Math.clamp($militiaFreeManpower - 30, 0, $militiaFreeManpower)>>
	<<recalcManpower>>
<</link>>
<br><<link "Give mercs manpower" "secExpOptions">>
	<<set $mercFreeManpower += 30>>
	<<recalcManpower>>
<</link>> | <<link "Remove mercs manpower" "secExpOptions">>
	<<set $mercFreeManpower = Math.clamp($mercFreeManpower - 30, 0, $mercFreeManpower)>>
	<<recalcManpower>>
<</link>>
<br><<link "Add citizens" "secExpOptions">>
	<<set $ACitizens = Math.clamp($ACitizens + 200, 0, $ACitizenLimit)>>
<</link>> | <<link "Remove citizens" "secExpOptions">>
	<<set $ACitizens = Math.clamp($ACitizens - 200, 0, $ACitizenLimit)>>
<</link>>
<br><<link "Add slaves" "secExpOptions">>
	<<set $ASlaves = Math.clamp($ASlaves + 200, 0, $ASlaveLimit)>>
<</link>> | <<link "Remove slaves" "secExpOptions">>
	<<set $ASlaves = Math.clamp($ASlaves - 200, 0, $ASlaveLimit)>>
<</link>>
<br><<link "Raise prosperity" "secExpOptions">>
	<<set $arcologies[0].prosperity = Math.clamp($arcologies[0].prosperity + 10, 0, 1000)>>
<</link>> | <<link "Lower prosperity" "secExpOptions">>
	<<set $arcologies[0].prosperity = Math.clamp($arcologies[0].prosperity - 10, 0, 1000)>>
<</link>>
