:: secInit [nobr]

/* base vars */
<<set $authority = 0>>
<<set $security = 30>>
<<set $secRestPoint = 30>>
<<set $crime = 30>>
<<set $crimeCap = 100>>
<<set $readiness = 1>>
<<set $recon = 0>>
<<set $maxUnits = 6>>
<<set $activeUnits = 0>>
<<set $attackType = "none">>
<<set $attackThisWeek = 0>>
<<set $lastAttackWeeks = 0>>
<<set $hasFoughtOnce = 0>>
<<set $hasFoughtMajorBattleOnce = 0>>
<<set $majorBattle = 0>>
<<set $PCvictoryStreak = 0>>
<<set $PCvictories = 0>>
<<set $PClossStreak = 0>>
<<set $PClosses = 0>>
<<set $oldFlux = 0>>
<<set $wasToggledBefore = 0>>
<<set $showBattleStatistics = 0>>
<<set $forceBattle = 0>>
<<set $forceMajorBattle = 0>>
<<set $foughtThisWeek = 0>>
<<set $battlesEnabled = 1>>
<<set $majorBattlesEnabled = 1>>
<<set $majorBattleGameOver = 1>>
<<set $rebellionsEnabled = 0>>
<<set $forceRebellion = 0>>
<<set $rebellionGameOver = 1>>

/* edicts */
<<set $edictsUpkeep = 0>>
<<set $edictsAuthUpkeep = 0>>
<<set $alternativeRents = 0>>
<<set $enslavementRights = 0>>
<<set $securityExemption = 0>>
<<set $sellData = 0>>
<<set $propCampaignBoost = 0>>
<<set $slaveWatch = 0>>
<<set $subsidyChurch = 0>>
<<set $limitImmigration = 0>>
<<set $openBorders = 0>>
<<set $limitSubhumans = 0>>
<<set $slavesOfficers = 0>>
<<set $martialSchool = 0>>
<<set $discountMercenaries = 0>>
<<set $militiaFounded = 0>>
<<set $recruitVolunteers = 0>>
<<set $militaryService = 0>>
<<set $militarizedSociety = 0>>
<<set $militaryExemption = 0>>
<<set $lowerRquirements = 0>>
<<set $noSubhumansInArmy = 0>>
<<set $pregExemption = 0>>
<<set $eliteOfficers = 0>>
<<set $liveTargets = 0>>
<<set $legionTradition = 0>>
<<set $eagleWarriors = 0>>
<<set $ronin = 0>>
<<set $sunTzu = 0>>
<<set $weaponsLaw = 3>>

/* buildings */
<<set $upgradeUpkeep = 40>>
<<set $secHQ = 0>>
<<set $secHQUpkeep = $facilityCost * 5>>
<<set $secBarracks = 0>>
<<set $secBarracksUpkeep = $facilityCost * 5>>
<<set $secBarracksUpgrades ={
	size: 0,
	luxury: 0,
	training: 0}>>
<<set $secHelots = 0>>
<<set $reqHelots = 20>>
<<set $secUpgrades = {
	nanoCams: 0,
	cyberBots: 0,
	eyeScan: 0,
	cryptoAnalyzer: 0,
	coldstorage: 0}>>
<<set $crimeUpgrades = {
	autoTrial: 0,
	autoArchive: 0,
	worldProfiler: 0,
	advForensic: 0}>>
<<set $intelUpgrades = {
	sensors: 0,
	radar: 0,
	signalIntercept: 0}>>
<<set $readinessUpgrades = {
	earlyWarn: 0,
	rapidPlatforms: 0,
	pathways: 0,
	rapidVehicles: 0}>>
<<set $propHub = 0>>
<<set $propHubUpkeep = $facilityCost * 5>>
<<set $propCampaign = 0>>
<<set $propFocus = "none">>
<<set $miniTruth = 0>>
<<set $fakeNews = 0>>
<<set $controlLeaks = 0>>
<<set $secretService = 0>>
<<set $blackOps = 0>>
<<set $marketInfiltration = 0>>
<<set $riotCenter = 0>>
<<set $riotUpgrades = {
	freeMedia: 0,
	rapidUnit: 0,
	rapidUnitSpeed: 0}>>
<<set $fort = {
	reactor: 0,
	waterway: 0,
	assistant:0}>>
<<set $sentUnitCooldown = 0>>
<<set $advancedRiotEquip = 0>>
<<set $brainImplant = -1>>
<<set $brainImplantProject = 0>>

/* events */
<<set $smilingManProgress = 0>>
<<set $investedFunds = 0>>
<<set $relationshipLM = 0>>
<<set $captureRoute = 0>>
<<set $collaborationRoute = 0>>
<<set $hostileRoute = 0>>
<<set $smilingManWeek = 0>>
<<set $globalCrisisWeeks = 0>>
<<set $smilingManFate = 4>>

/* rebellions */
<<set $tension = 0>>
<<set $slaveProgress = 0>>
<<set $citizenProgress = 0>>
<<set $slaveRebellionEventFires = 0>>
<<set $citizenRebellionEventFires = 0>>
<<set $slaveRebellion = 0>>
<<set $citizenRebellion = 0>>
<<set $rebellingUnits = []>>
<<set $notInvolved = 0>>
<<set $irregulars = 0>>
<<set $engageRule = 0>>
<<set $rebellingMilitia = 0>>
<<set $rebellingSlaves = 0>>
<<set $rebellingMercs = 0>>
<<set $repairTime = 3>>
<<set $arcRepairTime = 0>>
<<set $rebelDefeatAftermath = 0>>
<<set $garrison = {
	penthouse: 0,
	reactor: 0,
	assistant: 0,
	waterway: 0,
	reactorTime: 0,
	assistantTime: 0,
	waterwayTime: 0 }>>
<<set $rebellionsCount = 0>>
<<set $PCrebWon = 0>>
<<set $PCrebLoss = 0>>


/* armed forces stats */
<<set $targetUnit = 0>>
<<set $targetIndex = 0>>
<<set $secBotsCost = 500>>
<<set $secBotsUpgradeCost = 250>>
<<set $equipUpgradeCost = 250>>
<<set $maxTroops = 30>>
<<set $militiaTotalManpower = 0>>
<<set $militiaFreeManpower = 0>>
<<set $militiaEmployedManpower = 0>>
<<set $militiaTotalCasualties = 0>>
<<set $slavesOfficers = 0>>
<<set $slavesEmployedManpower = 0>>
<<set $slavesTotalCasualties = 0>>
<<set $mercTotalManpower = 0>>
<<set $mercEmployedManpower = 0>>
<<set $mercTotalCasualties = 0>>
<<set $soldierUpkeep = 10>>
<<set $createdSlavesUnits = 0>>
<<set $createdMilitiaUnits = 0>>
<<set $createdMercUnits = 0>>
<<if $wasToggledBefore == 0>>
	<<if $mercenaries == 1>>
		<<set $mercFreeManpower = random(5,20)>>
	<<elseif $mercenaries > 1>>
		<<set $mercFreeManpower = random(10,30)>>
	<</if>>
<<else>>
	<<set $mercFreeManpower = 0>>
<</if>>


/* battle relevant variables */
<<set $totalKills = 0>>
<<set $battlesCount = 0>>
<<set $majorBattlesCount = 0>>
<<set $chosenTactic = "none">>
<<set $leadingTroops = "none">>
<<set $attackTroops = 0>>
<<set $attackEquip = 0>>
<<set $deployableUnits = 0>>
<<set $deployedUnits = 0>>
<<set $deployingBots = 0>>
<<set $deployingMilitia = 0>>
<<set $deployingSlaves = 0>>
<<set $deployingMercs = 0>>
<<set $battleTerrain = "none">>
<<set $maxTurns = 10>>
<<set $battleResult = 4>>			/* sets $battleResult value outside accepted range (-3,3) to avoid evaluation problems */
<<set $losses = 0>>
<<set $enemyLosses = 0>>
<<set $battleTurns = 0>>
<<set $bribeCost = 0>>
<<set $tacticsSuccessful = 0>>
<<set $leaderWounded = 0>>
<<set $woundType = 0>>				/* 0=no wound, 1=mute, 2=blind, 3=amputee, 4<=health */
<<set $gainedCombat = 0>>
<<set $gainedWarfare = 0>>
<<set $PCWounded = 0>>
<<set $PCWoundCooldown = 0>>
<<set $expectedEquip = 0>>
<<set $estimatedMen = 0>>
<<set $SFIntervention = 0>>
<<set $carriableSoldiers = 0>>

/* statistics */
<<set $baseBribePerAttacker = 5>>

<<set $equipMod = 0.15>>
<<set $secBotsBaseAttack = 7>>
<<set $secBotsBaseDefense = 3>>
<<set $secBotsMorale = 200>>
<<set $secBotsBaseHp = 3>>
<<set $militiaBaseAttack = 7>>
<<set $militiaBaseDefense = 5>>
<<set $militiaBaseMorale = 140>>
<<set $militiaBaseHp = 3>>
<<set $slaveBaseAttack = 9>>
<<set $slaveBaseDefense = 3>>
<<set $slaveBaseMorale = 110>>
<<set $slaveBaseHp = 3>>
<<set $mercBaseAttack = 8>>
<<set $mercBaseDefense = 4>>
<<set $mercBaseMorale = 125>>
<<set $mercBaseHp = 4>>
<<set $SFBaseAttack = 8>>
<<set $SFBaseDefense = 4>>
<<set $SFBaseMorale = 140>>
<<set $SFBaseHp = 4>>

<<set $raBaseAttack = 7>>
<<set $raBaseDefense = 2>>
<<set $raBaseMorale = 100>>
<<set $raBaseHp = 2>>
<<set $fcBaseAttack = 6>>
<<set $fcBaseDefense = 4>>
<<set $fcBaseMorale = 130>>
<<set $fcBaseHp = 3>>
<<set $owBaseAttack = 8>>
<<set $owBaseDefense = 4>>
<<set $owBaseMorale = 110>>
<<set $owBaseHp = 2>>
<<set $ffBaseAttack = 9>>
<<set $ffBaseDefense = 2>>
<<set $ffBaseMorale = 160>>
<<set $ffBaseHp = 2>>


/* Units */
<<if def $secBots>>
	<<set $secBots.active = 0>>
	<<set $secBots.isDeployed = 0>>
	<<set $secBots.troops = 0>>
	<<set $secBots.maxTroops = 0>>
	<<set $secBots.equip = 0>>
<<else>>
	<<set $secBots = {
	platoonName: "security drones",
	active: 0,
	isDeployed: 0,
	troops: 0,
	maxTroops: 0,
	equip: 0} >>
<</if>>

<<set $militiaUnits = []>>
<<set $slaveUnits = []>>
<<set $mercUnits = []>>

/* SFanon additons */
<<set $SFSupportLevel = 0>>
<<set $SFSupportUpkeep = 0>>
<<set $secUpgrades.coldstorage = 0>>