From 4752ee62fda16637473395ee1bd06c4dabd7b419 Mon Sep 17 00:00:00 2001
From: Blank_Alt <12406-Blank_Alt@users.noreply.gitgud.io>
Date: Mon, 16 Aug 2021 18:47:01 +0000
Subject: [PATCH] Sec exp edict jsification conflict report compression [tested
 and ready to be merged]

---
 src/005-passages/eventsPassages.js        |   12 +-
 src/005-passages/managePassages.js        |    8 +
 src/Mods/SecExp/edicts.tw                 |  664 ----------
 src/Mods/SecExp/events/attackReport.js    | 1051 ---------------
 src/Mods/SecExp/events/conflictHandler.js |    2 +-
 src/Mods/SecExp/events/conflictReport.js  | 1468 +++++++++++++++++++++
 src/Mods/SecExp/events/rebellionReport.js |  683 ----------
 src/Mods/SecExp/js/edicts.js              |  971 ++++++++++++++
 8 files changed, 2453 insertions(+), 2406 deletions(-)
 delete mode 100644 src/Mods/SecExp/edicts.tw
 delete mode 100644 src/Mods/SecExp/events/attackReport.js
 create mode 100644 src/Mods/SecExp/events/conflictReport.js
 delete mode 100644 src/Mods/SecExp/events/rebellionReport.js
 create mode 100644 src/Mods/SecExp/js/edicts.js

diff --git a/src/005-passages/eventsPassages.js b/src/005-passages/eventsPassages.js
index 6bc374dc415..70acfbf7389 100644
--- a/src/005-passages/eventsPassages.js
+++ b/src/005-passages/eventsPassages.js
@@ -6,14 +6,12 @@ new App.DomPassage("Nonrandom Event",
 	}
 );
 
-new App.DomPassage("attackReport",
+new App.DomPassage("conflictReport",
 	() => {
-		return App.Events.attackReport();
-	}
-);
-new App.DomPassage("rebellionReport",
-	() => {
-		return App.Events.rebellionReport();
+		V.nextButton = "Continue";
+		V.nextLink = "Scheduled Event";
+		V.encyclopedia = "Battles";
+		return App.Events.conflictReport();
 	}
 );
 new App.DomPassage("conflictHandler",
diff --git a/src/005-passages/managePassages.js b/src/005-passages/managePassages.js
index 4b1f337a91d..fc46819fda7 100644
--- a/src/005-passages/managePassages.js
+++ b/src/005-passages/managePassages.js
@@ -203,3 +203,11 @@ new App.DomPassage("editSF",
 		return App.UI.editSF();
 	}
 );
+
+new App.DomPassage("edicts",
+	() => {
+		V.nextButton = "Back";
+		V.nextLink = "Main";
+		return App.SecExp.edicts();
+	}, ["jump-to-safe", "jump-from-safe"]
+);
diff --git a/src/Mods/SecExp/edicts.tw b/src/Mods/SecExp/edicts.tw
deleted file mode 100644
index 41fcdf1a6da..00000000000
--- a/src/Mods/SecExp/edicts.tw
+++ /dev/null
@@ -1,664 +0,0 @@
-:: edicts [nobr jump-to-safe jump-from-safe]
-
-<<set $nextButton = "Back", $nextLink = "Main">>
-
-//Passing any edict will cost <<print cashFormat(5000)>> and some authority. More edicts will become available as the arcology develops.//
-<<run App.UI.tabBar.handlePreSelectedTab($tabChoice.edicts)>>
-<br>
-<button class="tab-links" onclick="App.UI.tabBar.openTab(event, 'Society')" id="tab Society">Society</button>
-<<if $SecExp.battles.victories + $SecExp.battles.losses > 0 || $SecExp.rebellions.victories + $SecExp.rebellions.losses > 0 || $mercenaries > 0>>
-	<button class="tab-links" onclick="App.UI.tabBar.openTab(event, 'Military')" id="tab Military">Military</button>
-<</if>>
-<<set $SecExp.core.authority = Math.clamp($SecExp.core.authority, 0, 20000)>>
-
-<div id="Society" class="tab-content">
-	<div class="content">
-	<<if $SecExp.edicts.alternativeRents == 1>>
-		<br>''Alternative rent payment:'' you are allowing citizens to pay for their rents in menial slaves rather than cash.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.alternativeRents = 0]]</span>
-	<<else>>
-		<br>''Alternative rent payment:'' allow citizens to pay for their rents in menial slaves rather than cash, if so they wish.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.alternativeRents = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will decrease rents, but will supply a small amount of menial slaves each week.//
-	<</if>>
-
-	<<if $SecExp.edicts.enslavementRights == 1>>
-		<br>''Enslavement rights:'' you are the only authority able to declare a person enslaved or not.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.enslavementRights = 0]]</span>
-	<<else>>
-		<br>''Enslavement rights:'' the arcology owner will be the only authority able to declare a person enslaved or not.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.enslavementRights = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will provide cash each week. The higher the flux of citizens to slaves the higher the income. Will cost a small amount of authority each week.//
-	<</if>>
-
-	<<if $SecExp.buildings.secHub>>
-		<<set _secUpgrades = $SecExp.buildings.secHub.upgrades>>
-		<<if $SecExp.edicts.sellData === 1>>
-			<br>''Private Data marketization:'' you are selling private citizens' data to the best bidder.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.sellData = 0]]</span>
-		<<elseif $SecExp.edicts.sellData === 0 && Object.values(_secUpgrades.security).reduce((a, b) => a + b) > 0 || Object.values(_secUpgrades.crime).reduce((a, b) => a + b) > 0 || Object.values(_secUpgrades.intel).reduce((a, b) => a + b) > 0>>
-			<br>''Private Data marketization:'' allow the selling of private citizens' data.
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.sellData = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will generate income dependent on the amount of upgrades installed in the security HQ, but will cost a small amount of authority each week.//
-		<</if>>
-	<</if>>
-	<<if $SecExp.buildings.propHub>>
-		<<if $SecExp.edicts.propCampaignBoost == 1>>
-			<br>''Obligatory educational material:'' you are forcing residents to read curated educational material about the arcology.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.propCampaignBoost = 0]]</span>
-		<<else>>
-			<br>''Obligatory educational material:'' force residents to read curated educational material about the arcology.
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.propCampaignBoost = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase the effectiveness of propaganda campaigns, but will incur upkeep costs.//
-		<</if>>
-	<</if>>
-	<<if $SecExp.buildings.transportHub>>
-		<<if $SecExp.edicts.tradeLegalAid == 1>>
-			<br>''Legal aid for new businesses:'' New businesses can rely on your help for legal expenses and issues.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.tradeLegalAid = 0]]</span>
-		<<else>>
-			<br>''Legal aid for new businesses:'' Support new businesses in the arcology by helping them cover legal costs and issues.
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.tradeLegalAid = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase trade, but will incur upkeep costs.//
-		<</if>>
-		<<if $SecExp.edicts.taxTrade == 1>>
-			<br>''Trade tariffs:'' all goods transitioning in your arcology have to pay a transition fee.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.taxTrade = 0]]</span>
-		<<else>>
-			<br>''Trade tariffs:'' all goods transitioning in your arcology will have to pay a transition fee.
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.taxTrade = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will provide income based on trade level, but will negatively affect trade.//
-		<</if>>
-	<</if>>
-
-	<<if $arcologies[0].FSPaternalist != "unset">>
-		<<if $SecExp.edicts.slaveWatch == 1>>
-			<br>''@@.lime;Slave mistreatment watch:@@'' slaves are able access a special security service in case of mistreatment.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.slaveWatch = 0]]</span>
-		<<else>>
-			<br>''@@.lime;Slave mistreatment watch:@@'' slaves will be able access a special security service in case of mistreatment.
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.slaveWatch = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will help advance paternalism, but will incur upkeep costs.//
-		<</if>>
-	<</if>>
-
-	<<if $arcologies[0].FSChattelReligionist >= 40>>
-		<<if $SecExp.edicts.subsidyChurch == 1>>
-			<br>''@@.lime;Religious activities subsidy:@@'' you are providing economic support to religious activities following the official dogma.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.subsidyChurch = 0]]</span>
-		<<else>>
-			<br>''@@.lime;Religious activities subsidy:@@'' will provide economic support to religious activities following the official dogma.
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.subsidyChurch = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will provide authority each week, but will incur upkeep costs.//
-		<</if>>
-	<</if>>
-
-	<br><br>__Immigration:__
-	<<if $SecExp.edicts.limitImmigration == 1>>
-		<br>''Immigration limits:'' you put strict limits to the amount of people the arcology can accept each week.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.limitImmigration = 0]]</span>
-	<<else>>
-		<br>''Immigration limits:'' institute limits to the amount of people the arcology will accept each week.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.openBorders = 0, $SecExp.edicts.limitImmigration = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will lower the amount of people immigrating into the arcology and enhance security.//
-	<</if>>
-
-	<<if $SecExp.edicts.openBorders == 1>>
-		<br>''Open borders:'' you have lowered considerably the requirements to become citizens.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.openBorders = 0]]</span>
-	<<else>>
-		<br>''Open borders:'' considerably lower requirements to become citizens.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.openBorders = 1, $SecExp.edicts.limitImmigration = 0, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase immigration to the arcology, but will increase crime.//
-	<</if>>
-
-	<br><br>__Weapons:__
-	<<if $SecExp.edicts.weaponsLaw == 0>>
-		<br>''Forbid weapons inside the arcology:'' residents are forbidden to buy, sell and keep weaponry while within the arcology.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.weaponsLaw = 3]]</span>
-	<<elseif $SecExp.edicts.weaponsLaw == 2>>
-		<br>''Heavy weaponry forbidden:'' residents are allowed to buy, sell and keep weapons within the arcology as long as they are non-heavy, non-explosive.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.weaponsLaw = 3]]</span>
-	<<elseif $SecExp.edicts.weaponsLaw == 1>>
-		<br>''Heavily restricted weaponry:'' residents are allowed to buy, sell and keep weapons within the arcology as long as they are non-automatic, non-high caliber.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.weaponsLaw = 3]]</span>
-	<<else>>
-		<br>''All weapons allowed:'' residents are allowed to buy, sell and keep all kind of weapons in the arcology.
-	<</if>>
-
-	<<if $SecExp.edicts.weaponsLaw == 3>>
-		<br>''Heavy weaponry forbidden:'' set the range of weapons allowed within the arcology to non-heavy, non-explosive.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.weaponsLaw = 2, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slightly increase prosperity, but will cost a small amount of authority each week and will leave rebellions decently armed.//
-	<<elseif $SecExp.edicts.weaponsLaw == 2>>
-		<br>''All weapons allowed:'' allow residents of the arcology to buy, sell and keep weaponry of any kind within the arcology.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.weaponsLaw = 3, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slightly increase prosperity and provide a small weekly amount of reputation, but rebellions will be very well armed.//
-		<br>''Heavily restricted weaponry:'' set the range of weapons allowed within the arcology to non-automatic, non-high caliber.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.weaponsLaw = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will cost some authority each week, but rebellions will be poorly armed.//
-	<<elseif $SecExp.edicts.weaponsLaw == 1>>
-		<br>''Heavy weaponry forbidden:'' set the range of weapons allowed within the arcology to non-heavy, non-explosive.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.weaponsLaw = 2, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slightly increase prosperity, but will cost a small amount of authority each week and will leave rebellions decently armed.//
-		<br>''Forbid weapons inside the arcology:'' forbid residents to buy, sell and keep weaponry while within the arcology.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.weaponsLaw = 0, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will cost a moderate amount of authority each week, but rebellions will be very poorly armed.//
-	<<elseif $SecExp.edicts.weaponsLaw == 0>>
-		<br>''Heavily restricted weaponry:'' set the range of weapons allowed within the arcology to non-automatic, non-high caliber.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.weaponsLaw = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will cost some authority each week, but rebellions will be poorly armed.//
-	<</if>>
-
-	<<if $FSAnnounced>>
-		<br><br>__Future Societies:__
-		<<if $SecExp.edicts.defense.legionTradition === 1>>
-			<br>''@@.lime;Legionaries traditions:@@'' you are funding specialized training for your recruits following the Roman tradition of professional armies.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.legionTradition = 0]]</span>
-		<</if>>
-		<<if $SecExp.edicts.defense.imperialTradition === 1>>
-			<br>''@@.lime;Neo-Imperial traditions:@@'' you are funding specialized training for your recruits to inculcate them into a professional Imperial army, led by highly trained and hand-picked $mercenariesTitle.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.imperialTradition = 0]]</span>
-		<</if>>
-		<<if $SecExp.edicts.defense.pharaonTradition === 1>>
-			<br>''@@.lime;Pharaonic traditions:@@'' you are funding specialized training for your recruits to turn them into an army worthy of a pharaon.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.pharaonTradition = 0]]</span>
-		<</if>>
-		<<if $SecExp.edicts.defense.militia >= 1>>
-			<<if $arcologies[0].FSRomanRevivalist >= 40>>
-				<<if $SecExp.edicts.defense.legionTradition === 0>>
-					<br>''@@.lime;Legionaries traditions:@@'' Fund specialized training for your recruits to turn them into the professional of Roman tradition.
-					<<if $SecExp.core.authority >= 1000>>
-						<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.legionTradition = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-					<<else>>
-						<br>//Not enough Authority.//
-					<</if>>
-					<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase defense, morale and hp of militia units, but will incur upkeep costs.//
-				<</if>>
-			<</if>>
-			<<if $arcologies[0].FSEgyptianRevivalist >= 40>>
-				<<if $SecExp.edicts.defense.pharaonTradition === 0>>
-					<br>''@@.lime;Pharaonic traditions:@@'' Fund specialized training for your recruits to turn them into an army worthy of a pharaoh.
-					<<if $SecExp.core.authority >= 1000>>
-						<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.pharaonTradition = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-					<<else>>
-						<br>//Not enough Authority.//
-					<</if>>
-					<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase attack, defense and morale of militia units, but will incur upkeep costs.//
-				<</if>>
-			<</if>>
-			<<if $arcologies[0].FSNeoImperialist >= 40>>
-				<<if $SecExp.edicts.defense.imperialTradition === 0>>
-					<br>''@@.lime;Neo-Imperial traditions:@@'' Fund specialized training for your recruits to turn them into a professional Imperial army, led by your handpicked Imperial Knights.
-					<<if $SecExp.core.authority >= 1000>>
-						<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.imperialTradition = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-					<<else>>
-						<br>//Not enough Authority.//
-					<</if>>
-					<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will moderately increase defense, hp, and morale of your militia units and increase attack, defense and morale of your mercenaries, but will incur upkeep costs.//
-				<</if>>
-			<</if>>
-		<</if>>
-
-		<<if $SecExp.edicts.defense.eagleWarriors === 1>>
-			<br>''@@.lime;Eagle warriors traditions:@@'' you are funding specialized training for your mercenaries following the Aztec tradition of elite warriors.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.eagleWarriors = 0]]</span>
-		<</if>>
-
-		<<if $SecExp.edicts.defense.ronin === 1>>
-			<br>''@@.lime;Ronin traditions:@@'' you are funding specialized training for your mercenaries following the Japanese tradition of elite errant samurai.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.ronin = 0]]</span>
-		<</if>>
-		<<if $mercenaries > 0>>
-			<<if $arcologies[0].FSAztecRevivalist >= 40>>
-				<<if $SecExp.edicts.defense.eagleWarriors === 0>>
-					<br>''@@.lime;Eagle warriors traditions:@@'' Fund specialized training for your mercenaries to turn them into the elite units of Aztec tradition.
-					<<if $SecExp.core.authority >= 1000>>
-						<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.eagleWarriors = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-					<<else>>
-						<br>//Not enough Authority.//
-					<</if>>
-					<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will give a high increase in attack and morale, but will lower defense of mercenary units and will incur upkeep costs.//
-				<</if>>
-			<</if>>
-			<<if $arcologies[0].FSEdoRevivalist >= 40>>
-				<<if $SecExp.edicts.defense.ronin === 0>>
-					<br>''@@.lime;Ronin traditions:@@'' Fund specialized training for your mercenaries to turn them into the errant samurai of Japanese tradition.
-					<<if $SecExp.core.authority >= 1000>>
-						<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.ronin = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-					<<else>>
-						<br>//Not enough Authority.//
-					<</if>>
-					<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase attack, defense and morale of mercenary units, but will incur upkeep costs.//
-				<</if>>
-			<</if>>
-		<</if>>
-
-		<<if $SecExp.edicts.defense.mamluks === 1>>
-			<br>''@@.lime;Mamluks traditions:@@'' you are funding specialized training for your slaves following the Arabian tradition of mamluks slave soldiers.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.mamluks = 0]]</span>
-		<</if>>
-
-		<<if $SecExp.edicts.defense.sunTzu === 1>>
-			<br>''@@.lime;Sun Tzu Teachings:@@'' you are funding specialized training for your units and officers to follow the teachings of the "Art of War".
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.sunTzu = 0]]</span>
-		<</if>>
-		<<if $arcologies[0].FSArabianRevivalist >= 40>>
-			<<if $SecExp.edicts.defense.mamluks === 0>>
-				<br>''@@.lime;Mamluks traditions:@@'' Fund specialized training for your slaves to turn them into the mamluks slave soldiers of Arabian tradition.
-				<<if $SecExp.core.authority >= 1000>>
-					<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.mamluks = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-				<<else>>
-					<br>//Not enough Authority.//
-				<</if>>
-				<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase attack, morale and hp of slave units, but will incur upkeep costs.//
-			<</if>>
-		<</if>>
-		<<if $arcologies[0].FSChineseRevivalist >= 40>>
-			<<if $SecExp.edicts.defense.sunTzu === 0>>
-				<br>''@@.lime;Sun Tzu Teachings:@@'' Fund specialized training for your units and officers to conform your army to the teachings of the "Art of War".
-				<<if $SecExp.core.authority >= 1000>>
-					<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.sunTzu = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-				<<else>>
-					<br>//Not enough Authority.//
-				<</if>>
-				<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slightly increase attack, defense and morale of all units, but will incur upkeep costs.//
-			<</if>>
-		<</if>>
-	<</if>>
-	</div>
-</div>
-
-<div id="Military" class="tab-content">
-	<div class="content">
-	<<if $SecExp.edicts.defense.soldierWages === 0>>
-		<br>''Low wages for soldiers:'' wages for soldiers are set to a low level compared to market standards.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.soldierWages = 1]]</span>
-	<<elseif $SecExp.edicts.defense.soldierWages === 1>>
-		<br>''Average wages for soldiers:'' wages for soldiers are set to the market standards.
-	<<else>>
-		<br>''High wages for soldiers:'' wages for soldiers are set to a high level compared to market standards.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.soldierWages = 1]]</span>
-	<</if>>
-
-	<<if $SecExp.edicts.defense.soldierWages === 0>>
-		<br>''Average wages for soldiers:'' will set the wages paid to the soldiers of the arcology to an average amount.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.soldierWages += 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will raise all units upkeep and push loyalty to average levels.//
-	<<elseif $SecExp.edicts.defense.soldierWages === 1>>
-		<br>''Low wages for soldiers:'' will set the wages paid to the soldiers of the arcology to a low amount.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.soldierWages -= 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will lower all units upkeep and push loyalty to low levels.//
-		<br>''High wages for soldiers:'' will set the wages paid to the soldiers of the arcology to a high amount.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.soldierWages += 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will raise all units upkeep and push loyalty to high levels.//
-	<<else>>
-		<br>''Average wages for soldiers:'' will set the wages paid to the soldiers of the arcology to an average amount.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.soldierWages -= 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will lower all units upkeep and push loyalty to average levels.//
-	<</if>>
-
-	<<if $SecExp.edicts.defense.slavesOfficers === 1>>
-		<br>''Slave Officers:'' your trusted slaves are allowed to lead the defense forces of the arcology.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.slavesOfficers = 0]]</span>
-	<<else>>
-		<br>''Slave Officers:'' allow your trusted slaves to lead the defense forces of the arcology.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.slavesOfficers = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will allow your bodyguard and Head Girl to lead troops into battle, but will cost a small amount of authority each week.//
-	<</if>>
-
-	<<if $mercenaries > 0>>
-		<<if $SecExp.edicts.defense.discountMercenaries === 1>>
-			<br>''Mercenary subsidy:'' mercenaries willing to immigrate in your arcology will be offered a discount on rent.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.discountMercenaries = 0]]</span>
-		<<else>>
-			<br>''Mercenary subsidy:'' mercenaries willing to immigrate in your arcology will be offered a discount on rent.
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.discountMercenaries = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slightly lower rent, but will increase the amount of available mercenaries.//
-		<</if>>
-	<</if>>
-
-	<<if $SecExp.edicts.defense.militia === 0>>
-		<br>''Found the militia:'' lay the groundwork for the formation of the arcology's citizens' army.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.militia = 2, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will allow for the recruitment and training of citizens.//
-	<<else>>
-		<<if $SecExp.edicts.defense.militia === 1>>
-			<br>''Volunteers' militia:'' only volunteers will be accepted in the militia.
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.militia = 2, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will replenish militia manpower slowly and will cap at <<= num(App.SecExp.militiaCap(2)*100)>>% of the total citizens population.//
-		<</if>>
-
-		<<if $SecExp.edicts.defense.militia === 3>>
-			<br>''Conscription:'' every citizen is required to train in the militia and serve the arcology for a limited amount of time.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.militia = 2]]</span>
-		<<else>>
-			<br>''Conscription:'' every citizen is required to train in the militia and serve the arcology if the need arises.
-			<<if $SecExp.core.authority >= 4000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.militia = 3, cashX(-5000, "edicts"), $SecExp.core.authority -= 4000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will replenish militia manpower moderately fast and will cap at <<= num(App.SecExp.militiaCap(3)*100)>>% of the total citizens population, but has a high authority cost//
-		<</if>>
-		<<if $SecExp.edicts.defense.militia === 4>>
-			<br>''Obligatory military service:'' every citizen is required to register and serve under the militia.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.militia = 2]]</span>
-		<<else>>
-			<br>''Obligatory military service:'' every citizen is required to register and serve under the militia.
-			<<if $SecExp.core.authority >= 6000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.militia = 4, cashX(-5000, "edicts"), $SecExp.core.authority -= 6000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will quickly replenish militia manpower and will cap at <<= num(App.SecExp.militiaCap(4)*100)>>% of the total citizens population, but has a very high authority cost//
-		<</if>>
-		<<if $SecExp.edicts.defense.militia === 5>>
-			<br>''Militarized Society:'' every adult citizen is required to train and actively participate in the military of the arcology.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.militia = 2]]</span>
-		<<else>>
-			<br>''Militarized Society:'' every adult citizen is required to train and participate in the defense of the arcology.
-			<<if $SecExp.core.authority >= 8000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.militia = 5, cashX(-5000, "edicts"), $SecExp.core.authority -= 8000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will very quickly replenish militia manpower and will cap at <<= num(App.SecExp.militiaCap(5)*100)>>% of the total citizens population, but has an extremely high authority cost//
-		<</if>>
-
-
-		<<if $SecExp.edicts.defense.militaryExemption === 1>>
-				<br>''Military exemption:'' you allow citizens to avoid military duty by paying a weekly fee.
-				<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.militaryExemption = 0]]</span>
-		<</if>>
-		<<if $SecExp.edicts.defense.militia >= 3>>
-			<<if $SecExp.edicts.defense.militaryExemption === 0>>
-				<br>''Military exemption:'' allow citizens to avoid military duty by paying a weekly fee.
-				<<if $SecExp.core.authority >= 1000>>
-					<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.militaryExemption = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-				<<else>>
-					<br>//Not enough Authority.//
-				<</if>>
-				<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slow down the replenishment of manpower, but will supply cash each week. More profitable with stricter recruitment laws.//
-			<</if>>
-		<</if>>
-
-
-		<<if $SecExp.edicts.defense.lowerRequirements == 1>>
-			<br>''@@.lime;Revised minimum requirements:@@'' you allow citizens outside the normally accepted range to join the militia.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.lowerRequirements = 0]]</span>
-		<</if>>
-		<<if $arcologies[0].FSHedonisticDecadence >= 40>>
-			<<if $SecExp.edicts.defense.lowerRequirements == 0>>
-				<br>''@@.lime;Revised minimum requirements:@@'' will allow citizens outside the normally accepted range to join the militia.
-				<<if $SecExp.core.authority >= 1000>>
-					<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.lowerRequirements = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-				<<else>>
-					<br>//Not enough Authority.//
-				<</if>>
-				<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slightly lower defense and hp of militia units, but will increase the manpower replenishment rate.//
-			<</if>>
-		<</if>>
-
-		<<if $SecExp.edicts.defense.noSubhumansInArmy == 1>>
-			<br>''@@.lime;No subhumans in the militia:@@'' it is forbidden for subhumans to join the militia.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.noSubhumansInArmy = 0]]</span>
-		<</if>>
-		<<if $arcologies[0].FSSubjugationist >= 40>>
-			<<if $SecExp.edicts.defense.noSubhumansInArmy == 0>>
-				<br>''@@.lime;No subhumans in the militia:@@'' prevent subhumans from joining the militia.
-				<<if $SecExp.core.authority >= 1000>>
-					<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.noSubhumansInArmy = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-				<<else>>
-					<br>//Not enough Authority.//
-				<</if>>
-				<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will help advance racial Subjugation, but will slow down slightly manpower replenishment.//
-			<</if>>
-		<</if>>
-
-		<<if $SecExp.edicts.defense.pregExemption == 1>>
-			<br>''@@.lime;Military exemption for pregnancies:@@'' pregnant citizens are allowed, and encouraged, to avoid military service.
-			<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.pregExemption = 0]]</span>
-		<</if>>
-		<<if $arcologies[0].FSRepopulationFocus >= 40 && $SecExp.edicts.defense.militia >= 3>>
-			<<if $SecExp.edicts.defense.pregExemption == 0>>
-				<br>''@@.lime;Military exemption for pregnancies:@@'' pregnant citizens will be allowed, and encouraged, to avoid military service.
-				<<if $SecExp.core.authority >= 1000>>
-					<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.pregExemption = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-				<<else>>
-					<br>//Not enough Authority.//
-				<</if>>
-				<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will help advance repopulation focus, but will slow down slightly manpower replenishment.//
-			<</if>>
-		<</if>>
-	<</if>>
-
-	<<if $SecExp.edicts.defense.privilege.militiaSoldier === 1>>
-		<br>''Special militia privileges:'' citizens joining the militia are exempt from rent payment.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.privilege.militiaSoldier = 0]]</span>
-	<</if>>
-	<<if $SecExp.edicts.defense.privilege.militiaSoldier === 0 && $SecExp.edicts.defense.militia >= 1>>
-		<br>''Special militia privileges'' will allow citizens joining the militia to avoid paying rent.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.privilege.militiaSoldier = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase the loyalty of militia units, but will decrease rents.//
-	<</if>>
-
-	<<if $SecExp.edicts.defense.privilege.slaveSoldier === 1>>
-		<br>''Special slaves privileges:'' Slaves into the army are allowed to have material possessions.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.privilege.slaveSoldier = 0]]</span>
-	<</if>>
-	<<if $SecExp.edicts.defense.privilege.slaveSoldier === 0>>
-		<br>''Special slaves privileges'' will allow slaves drafted into the army to be able to have material possessions.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.privilege.slaveSoldier = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase the loyalty of slave units, but will cost authority each week.//
-	<</if>>
-
-	<<if $SecExp.edicts.defense.privilege.mercSoldier === 1>>
-		<br>''Special mercenary privileges:'' Mercenaries under contract can claim part of the loot gained from battles.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.privilege.mercSoldier = 0]]</span>
-	<</if>>
-	<<if $SecExp.edicts.defense.privilege.mercSoldier === 0 && $mercenaries > 0>>
-		<br>''Special mercenary privileges'' will allow mercenaries under contract to claim part of the loot gained from battles.
-		<<if $SecExp.core.authority >= 1000>>
-			<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.privilege.mercSoldier = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-		<<else>>
-			<br>//Not enough Authority.//
-		<</if>>
-		<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will increase the loyalty of mercenary units, but will reduce cash and menial slaves gained from battles.//
-	<</if>>
-
-	<<if $SecExp.edicts.defense.martialSchool === 1>>
-		<br>''@@.lime;Slave martial schools:@@'' specialized schools are training slaves in martial arts and bodyguarding.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.martialSchool = 0]]</span>
-	<</if>>
-	<<if $arcologies[0].FSPhysicalIdealist >= 40>>
-		<<if $SecExp.edicts.defense.martialSchool === 0>>
-			<br>''@@.lime;Slave martial schools:@@'' specialized schools will be set up to train slaves in martial arts and bodyguarding.
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.martialSchool = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will slightly increase morale of slave units, but will incur upkeep costs.//
-		<</if>>
-	<</if>>
-
-	<<if $SecExp.edicts.defense.eliteOfficers === 1>>
-		<br>''@@.lime;Elite officers:@@'' officers are exclusively recruited from the elite of society.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.eliteOfficers = 0]]</span>
-	<</if>>
-	<<if $arcologies[0].FSRestart >= 40>>
-		<<if $SecExp.edicts.defense.eliteOfficers === 0>>
-			<br>''@@.lime;Elite officers:@@'' officers will be exclusively recruited from the elite of society.
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.eliteOfficers = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will help advance eugenics and provide a small morale boost to militia units, but will give a small morale malus to slave units.//
-		<</if>>
-	<</if>>
-
-	<<if $SecExp.edicts.defense.liveTargets === 1>>
-		<br>''@@.lime;Live targets drills:@@'' disobedient slaves are used as live targets at shooting ranges.
-		<span class ='yellow'>[[Repeal|edicts][$SecExp.edicts.defense.liveTargets = 0]]</span>
-	<</if>>
-	<<if $arcologies[0].FSDegradationist >= 40>>
-		<<if $SecExp.edicts.defense.liveTargets === 0>>
-			<br>''@@.lime;Live targets drills:@@'' disobedient slaves will be used as live targets at shooting ranges.
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.defense.liveTargets = 1, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will help advance degradationism and provide a small amount of exp to units, but will make the slave population slowly decline.//
-		<</if>>
-	<</if>>
-
-	<<if $SF.Toggle && $SF.Active >= 1>>
-		<br><br>__Special Force:__
-		<<set _capSF = capFirstChar($SF.Lower || "the special force")>>
-		<<if $SecExp.edicts.SFSupportLevel > 0>>
-			<<if $SecExp.edicts.SFSupportLevel === 1>>
-				<br>''Equipment provision:'' _capSF is providing the security HQ with advanced equipment, boosting its efficiency.
-			<<elseif $SecExp.edicts.SFSupportLevel === 2>>
-				<br>''Personnel training:'' _capSF is currently providing advanced equipment and training to security HQ personnel.
-			<<elseif $SecExp.edicts.SFSupportLevel === 3>>
-				<br>''Troops detachment:'' _capSF has currently transferred troops to the security department HQ in addition to providing advanced equipment and training to security HQ personnel.
-			<<elseif $SecExp.edicts.SFSupportLevel === 4>>
-				<br>''Full support:'' _capSF is currently providing its full support to the security department, while transferring troops to the security department HQ in addition to providing advanced equipment and training to security HQ personnel.
-			<<elseif $SecExp.edicts.SFSupportLevel === 5>>
-				<br>''Network assistance:'' _capSF is currently assisting with a local install of its custom network full support and has transferred troops to the security department HQ in addition to providing advanced equipment and training to security HQ personnel.
-			<</if>>
-			<span class='yellow'>[[Repeal|edicts][$SecExp.edicts.SFSupportLevel--]]</span>
-		<</if>>
-		<<if $SecExp.edicts.SFSupportLevel < 5>>
-			<<if $SecExp.edicts.SFSupportLevel === 0 && App.SecExp.Check.reqMenials() > 5>>
-				<br>''Equipment provision:'' _capSF will provide the security HQ with advanced equipment.
-				<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will lower the amount of personnel necessary to man the security HQ by 5, but will incur upkeep costs.//
-			<<elseif $SecExp.edicts.SFSupportLevel === 1 && $SF.Squad.Firebase >= 4 && App.SecExp.Check.reqMenials() > 5>>
-				<br>''Personnel training:'' _capSF will provide the security HQ personnel with advanced training.
-				<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs.//
-			<<elseif $SecExp.edicts.SFSupportLevel === 2 && $SF.Squad.Firebase >= 6 && App.SecExp.Check.reqMenials() > 5>>
-				<br>''Troops detachment:'' _capSF will provide troops to the security department.
-				<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs.//
-			<<elseif $SecExp.edicts.SFSupportLevel === 3 && $SF.Squad.Firebase >= 6 && App.SecExp.Check.reqMenials() > 5>>
-				<br>''Full Support:'' _capSF will give the security department its full support.
-				<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs.//
-			<<elseif $SecExp.edicts.SFSupportLevel === 4 && $SF.Squad.Firebase === 10 && App.SecExp.Check.reqMenials() > 5>>
-				<br>''Network assistance:'' _capSF will assist the security department with installing a local version of their custom network.
-				<br>&nbsp;&nbsp;&nbsp;&nbsp;//Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs.//
-			<</if>>
-			<<if $SecExp.core.authority >= 1000>>
-				<span class='green'>[[Implement|edicts][$SecExp.edicts.SFSupportLevel++, cashX(-5000, "edicts"), $SecExp.core.authority -= 1000]]</span>
-			<<else>>
-				<br>//Not enough Authority.//
-			<</if>>
-		<</if>>
-	<</if>>
-	</div>
-</div>
diff --git a/src/Mods/SecExp/events/attackReport.js b/src/Mods/SecExp/events/attackReport.js
deleted file mode 100644
index 74ca53f5bc8..00000000000
--- a/src/Mods/SecExp/events/attackReport.js
+++ /dev/null
@@ -1,1051 +0,0 @@
-App.Events.attackReport = function() {
-	V.nextButton = "Continue";
-	V.nextLink = "Scheduled Event";
-	V.encyclopedia = "Battles";
-	const casualtiesReport = function(type, loss, squad=null) {
-		const isSpecial = squad && App.SecExp.unit.list().slice(1).includes(type);
-		let r = [];
-		if (loss <= 0) {
-			r.push(`No`);
-		} else if (loss <= (isSpecial ? (squad.troops * 0.2) : 10)) {
-			r.push(`Light`);
-		} else if (loss <= (isSpecial ? (squad.troops * 0.4) : 30)) {
-			r.push(`Moderate`);
-		} else if (loss <= (isSpecial ? (squad.troops * 0.6) : 60)) {
-			r.push(`Heavy`);
-		} else {
-			r.push(`Catastrophic`);
-		}
-		r.push(`casualties suffered.`);
-		if (App.SecExp.unit.list().includes(type)) {
-			if (squad.troops <= 0) {
-				squad.active = 0;
-				r.push(`Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit.`);
-				if (type === "bots") {
-					r.push(`It will take quite the investment to rebuild them.`);
-				} else {
-					r.push(`The remnants will be sent home honored as veterans or reorganized in a new unit.`);
-				}
-			} else if (squad.troops <= 10) {
-				r.push(`The unit has very few operatives left, it risks complete annihilation if deployed again.`);
-			}
-		}
-		return r.join(" ");
-	};
-	function loopThroughUnits(units, type) {
-		for (const unit of units) {
-			if (App.SecExp.unit.isDeployed(unit)) {
-				if (V.SecExp.war.losses > 0) {
-					loss = lossesList.pluck();
-					loss = Math.clamp(loss, 0, unit.troops);
-				}
-
-				const r = [`${type !== "bots" ? `${unit.platoonName}` : `Security drones`}: ${casualtiesReport(type, loss, unit)}`];
-				if (type !== "bots") {
-					unit.battlesFought++;
-					if (loss > 0) {
-						const med = Math.round(Math.clamp(loss * unit.medics * 0.25, 1, loss));
-						if (unit.medics === 1) {
-							r.push(`Some men were saved by their medics.`);
-						}
-						unit.troops -= Math.trunc(Math.clamp(loss - med, 0, unit.maxTroops));
-						V.SecExp.units[type].dead += Math.trunc(loss - med);
-					}
-					if (unit.training < 100 && random(1, 100) > 60) {
-						r.push(`Experience has increased.`);
-						unit.training += random(5, 15) + (majorBattle ? 1 : 0) * random(5, 15);
-					}
-				} else if (type === "bots" && loss > 0) {
-					unit.troops -= loss;
-				}
-				App.Events.addNode(node, r, "div");
-			}
-		}
-	}
-
-	const node = new DocumentFragment();
-	let r = [];
-
-	V.SecExp.war.attacker.losses = Math.trunc(V.SecExp.war.attacker.losses);
-	if (V.SecExp.war.attacker.losses > V.SecExp.war.attacker.troops) {
-		V.SecExp.war.attacker.losses = V.SecExp.war.attacker.troops;
-	}
-	V.SecExp.core.totalKills += V.SecExp.war.attacker.losses;
-	V.SecExp.war.losses = Math.trunc(V.SecExp.war.losses);
-	let loot = 0;
-	let loss = 0;
-	let captives;
-	const lossesList = [];
-
-	// result
-	const majorBattle = V.SecExp.war.type.includes("Major");
-	const majorBattleMod = !majorBattle ? 1 : 2;
-	if (majorBattle) {
-		V.SecExp.battles.major++;
-	}
-	if (V.SecExp.war.result === 3) {
-		App.UI.DOM.makeElement("h1", `Victory!`, "strong");
-		V.SecExp.battles.lossStreak = 0;
-		V.SecExp.battles.victoryStreak += 1;
-		V.SecExp.battles.victories++;
-	} else if (V.SecExp.war.result === -3) {
-		App.UI.DOM.makeElement("h1", `Defeat!`, "strong");
-		V.SecExp.battles.lossStreak += 1;
-		V.SecExp.battles.victoryStreak = 0;
-		V.SecExp.battles.losses++;
-	} else if (V.SecExp.war.result === 2) {
-		App.UI.DOM.makeElement("h1", `Partial victory!`, "strong");
-		V.SecExp.battles.victories++;
-	} else if (V.SecExp.war.result === -2) {
-		App.UI.DOM.makeElement("h1", `Partial defeat!`, "strong");
-		V.SecExp.battles.losses++;
-	} else if (V.SecExp.war.result === -1) {
-		App.UI.DOM.makeElement("h1", `We surrendered`, "strong");
-		V.SecExp.battles.losses++;
-	} else if (V.SecExp.war.result === 0) {
-		App.UI.DOM.makeElement("h1", `Failed bribery!`, "strong");
-		V.SecExp.battles.losses++;
-	} else if (V.SecExp.war.result === 1) {
-		App.UI.DOM.makeElement("h1", `Successful bribery!`, "strong");
-		V.SecExp.battles.victories++;
-	}
-	let end = (V.SecExp.battles.victoryStreak >= 2 || V.SecExp.battles.lossStreak >= 2) ? `,` : `.`;
-
-	r.push(`Today, ${asDateString(V.week, random(0, 7))}, our arcology was attacked by`);
-	if (V.SecExp.war.attacker.type === "raiders") {
-		r.push(`a band of wild raiders,`);
-	} else if (V.SecExp.war.attacker.type === "free city") {
-		r.push(`a contingent of mercenaries hired by a competing free city,`);
-	} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-		r.push(`a group of freedom fighters bent on the destruction of the institution of slavery,`);
-	} else if (V.SecExp.war.attacker.type === "old world") {
-		r.push(`an old world nation boasting a misplaced sense of superiority,`);
-	}
-
-	r.push(`${num(Math.trunc(V.SecExp.war.attacker.troops))} men strong.`);
-	if (V.SecExp.war.result !== 1 && V.SecExp.war.result !== 0 && V.SecExp.war.result !== -1) {
-		r.push(`Our defense forces, ${num(Math.trunc(App.SecExp.battle.troopCount()))} strong, clashed with them`);
-		if (V.SecExp.war.terrain === "urban") {
-			r.push(`in the streets of`);
-			if (V.SecExp.war.terrain === "urban") {
-				r.push(`the old world city surrounding the arcology,`);
-			} else {
-				r.push(`of the free city,`);
-			}
-		} else if (V.SecExp.war.terrain === "rural") {
-			r.push(`in the rural land surrounding the free city,`);
-		} else if (V.SecExp.war.terrain === "hills") {
-			r.push(`on the hills around the free city,`);
-		} else if (V.SecExp.war.terrain === "coast") {
-			r.push(`along the coast just outside the free city,`);
-		} else if (V.SecExp.war.terrain === "outskirts") {
-			r.push(`just against the walls of the arcology,`);
-		} else if (V.SecExp.war.terrain === "mountains") {
-			r.push(`in the mountains overlooking the arcology,`);
-		} else if (V.SecExp.war.terrain === "wasteland") {
-			r.push(`in the wastelands outside the free city territory,`);
-		} else if (V.SecExp.war.terrain === "international waters") {
-			r.push(`in the water surrounding the free city,`);
-		} else if (["a sunken ship", "an underwater cave"].includes(V.SecExp.war.terrain)) {
-			r.push(`in <strong>${V.SecExp.war.terrain}</strong> near the free city`);
-		}
-		if (V.SecExp.war.attacker.losses !== V.SecExp.war.attacker.troops) {
-			r.push(`inflicting ${V.SecExp.war.attacker.losses} casualties, while sustaining`);
-			if (V.SecExp.war.losses > 1) {
-				r.push(`${num(Math.trunc(V.SecExp.war.losses))} casualties`);
-			} else if (V.SecExp.war.losses > 0) {
-				r.push(`a casualty`);
-			} else {
-				r.push(`zero`);
-			}
-			r.push(`themselves.`);
-		} else {
-			r.push(`completely annihilating their troops, while sustaining`);
-			if (V.SecExp.war.losses > 1) {
-				r.push(`${num(Math.trunc(V.SecExp.war.losses))} casualties.`);
-			} else if (V.SecExp.war.losses > 0) {
-				r.push(`a casualty.`);
-			} else {
-				r.push(`zero casualties.`);
-			}
-		}
-	}
-	if (V.SecExp.war.result === 3) {
-		if (V.SecExp.war.turns <= 5) {
-			r.push(`The fight was quick and one sided, our men easily stopped the`);
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`disorganized horde's futile attempt at raiding your arcology${end}`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`mercenaries dead in their tracks${end}`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`freedom fighters dead in their tracks${end}`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`old world soldiers dead in their tracks${end}`);
-			}
-		} else if (V.SecExp.war.turns <= 7) {
-			r.push(`The fight was hard, but in the end our men stopped the`);
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`disorganized horde attempt at raiding your arcology${end}`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`slavers attempt at weakening your arcology${end}`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`fighters attack${end}`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`soldiers of the old world${end}`);
-			}
-		} else {
-			r.push(`The fight was long and hard, but our men managed to stop the`);
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`horde raiding party${end}`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`free city mercenaries${end}`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`freedom fighters${end}`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`old world soldiers${end}`);
-			}
-		}
-		if (V.SecExp.battles.victoryStreak >= 2) {
-			r.push(`adding another victory to the growing list of our military's successes.`);
-		} else if (V.SecExp.battles.lossStreak >= 2) {
-			r.push(`finally putting an end to a series of unfortunate defeats.`);
-		}
-	} else if (V.SecExp.war.result === -3) {
-		if (V.SecExp.war.turns <= 5) {
-			r.push(`The fight was quick and one sided, our men were easily crushed by the`);
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`barbaric horde of raiders${end}`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`consumed mercenary veterans sent against us${end}`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`fanatical fury of the freedom fighters${end}`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`discipline of the old world armies${end}`);
-			}
-		} else if (V.SecExp.war.turns <= 7) {
-			r.push(`The fight was hard and in the end the`);
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`bandits proved too much to handle for our men${end}`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`slavers proved too much to handle for our men${end}`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`freedom fighters proved too much to handle for our men${end}`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`old world proved too much to handle for our men${end}`);
-			}
-		} else {
-			r.push(`The fight was long and hard, but despite their bravery the`);
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`horde proved too much for our men${end}`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`mercenary slavers proved too much for our men${end}`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`freedom fighters fury proved too much for our men${end}`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`old world troops proved too much for our men${end}`);
-			}
-		}
-		if (V.SecExp.battles.victoryStreak >= 2) {
-			r.push(`so interrupting a long series of military successes.`);
-		} else if (V.SecExp.battles.lossStreak >= 2) {
-			r.push(`confirming the long list of recent failures our armed forces collected.`);
-		}
-	} else if (V.SecExp.war.result === 2) {
-		r.push(`The fight was long and hard, but in the end our men managed to repel the`);
-		if (V.SecExp.war.attacker.type === "raiders") {
-			r.push(`raiders, though not without difficulty.`);
-		} else if (V.SecExp.war.attacker.type === "free city") {
-			r.push(`mercenaries, though not without difficulty.`);
-		} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-			r.push(`freedom fighters, though not without difficulty.`);
-		} else if (V.SecExp.war.attacker.type === "old world") {
-			r.push(`old world soldiers, though not without difficulty.`);
-		}
-	} else if (V.SecExp.war.result === -2) {
-		r.push(`The fight was long and hard. Our men in the end had to yield to the`);
-		if (V.SecExp.war.attacker.type === "raiders") {
-			r.push(`horde raiders, which was fortunately unable to capitalize on their victory.`);
-		} else if (V.SecExp.war.attacker.type === "free city") {
-			r.push(`slavers, which were fortunately unable to capitalize on their victory.`);
-		} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-			r.push(`freedom fighters, which were fortunately unable to capitalize on their victory.`);
-		} else if (V.SecExp.war.attacker.type === "old world") {
-			r.push(`old world soldiers, which were fortunately unable to capitalize on their victory.`);
-		}
-	} else if (V.SecExp.war.result === -1) {
-		r.push(`You gave your troops the order to surrender, obediently they stand down.`);
-	} else if (V.SecExp.war.result === 0) {
-		r.push(`You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls.`);
-	} else if (V.SecExp.war.result === 1) {
-		r.push(`You decided in favor of a financial approach rather than open hostilities. Your troops remain inside the arcology's walls.`);
-	}
-
-	App.Events.addParagraph(node, r);
-	r = [];
-	// calculates effects on the city
-	if (V.SecExp.war.result === 3) {
-		r.push(`Thanks to your victory, your <span class="green">reputation</span> and <span class="darkviolet">authority</span> increased. You were also able to capture`);
-		if (V.SecExp.war.attacker.type === "raiders") {
-			repX(4000 * majorBattleMod, "war");
-			V.SecExp.core.authority += 800 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "free city") {
-			repX(6000 * majorBattleMod, "war");
-			V.SecExp.core.authority += 1200 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-			repX(7500 * majorBattleMod, "war");
-			V.SecExp.core.authority += 1500 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "old world") {
-			repX(8000 * majorBattleMod, "war");
-			V.SecExp.core.authority += 1600 * majorBattleMod;
-		}
-		if (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses <= 50) {
-			r.push(`a small amount of attackers,`);
-			captives = (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.1 * random(1, 3);
-		} else if (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses <= 100) {
-			r.push(`an healthy group of attackers,`);
-			captives = (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.1 * random(1, 3);
-		} else if (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses <= 150) {
-			r.push(`a big group of attackers,`);
-			captives = (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.1 * random(1, 3);
-		} else if (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses <= 200) {
-			r.push(`a huge group of attackers,`);
-			captives = (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.1 * random(1, 3);
-		} else if (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses > 200) {
-			r.push(`a great amount of attackers,`);
-			captives = (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.1 * random(1, 3);
-		}
-		r.push(`and some of their equipment, which once sold produced`);
-		if (V.SecExp.war.attacker.equip === 0) {
-			r.push(`<span class="yellowgreen">a small amount of cash.</span>`);
-			loot += 1000 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.equip === 1) {
-			r.push(`<span class="yellowgreen">a moderate amount of cash.</span>`);
-			loot += 5000 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.equip === 2) {
-			r.push(`<span class="yellowgreen">a good amount of cash.</span>`);
-			loot += 10000 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.equip === 3) {
-			r.push(`<span class="yellowgreen">a great amount of cash.</span>`);
-			loot += 15000 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.equip === 4) {
-			r.push(`<span class="yellowgreen">wealth worthy of the mightiest warlord.</span>`);
-			loot += 20000 * majorBattleMod;
-		}
-		if (V.SecExp.edicts.defense.privilege.mercSoldier === 1 && App.SecExp.battle.deployedUnits('mercs') >= 1) {
-			r.push(`Part of the loot is distributed to your mercenaries.`);
-			captives = Math.trunc(captives * 0.6);
-			loot = Math.trunc(loot * 0.6);
-		}
-		cashX(loot, "war");
-		App.Events.addParagraph(node, r);
-		r = [];
-		r.push(`Damage to the infrastructure was <span class="yellow">virtually non-existent,</span> costing only pocket cash to bring the structure back to normal. The inhabitants as well reported little to no injuries, because of this the prosperity of the arcology did not suffer.`);
-		r.push(`${IncreasePCSkills('engineering', 0.1)}`);
-		cashX(forceNeg(1000 * majorBattleMod), "war");
-		if (V.SecExp.battles.victoryStreak >= 3) {
-			r.push(`It seems your victories over the constant threats directed your way is having <span class="green">a positive effect on the prosperity of the arcology,</span> due to the security your leadership affords.`);
-			V.arcologies[0].prosperity += 5 * majorBattleMod;
-		}
-	} else if (V.SecExp.war.result === -3) {
-		r.push(`Due to your defeat, your <span class="red">reputation</span> and <span class="red">authority</span> decreased. Obviously your troops were not able to capture anyone or anything.`);
-		if (V.SecExp.war.attacker.type === "raiders") {
-			repX(forceNeg(400 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 400 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "free city") {
-			repX(forceNeg(600 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 600 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-			repX(forceNeg(750 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 750 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "old world") {
-			repX(forceNeg(800 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 800 * majorBattleMod;
-		}
-		App.Events.addParagraph(node, r);
-		r = [];
-		r.push(`In the raiding following the battle <span class="red">the arcology sustained heavy damage,</span> which will cost quite the amount of cash to fix. Reports of <span class="red">citizens or slaves killed or missing</span> flood your office for a few days following the defeat.`);
-		r.push(`${IncreasePCSkills('engineering', 0.1)}`);
-		cashX(forceNeg(5000 * majorBattleMod), "war");
-		if (V.week <= 30) {
-			V.lowerClass -= random(100) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(150) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(5) * majorBattleMod;
-		} else if (V.week <= 60) {
-			V.lowerClass -= random(120) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(170) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(10) * majorBattleMod;
-		} else if (V.week <= 90) {
-			V.lowerClass -= random(140) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(190) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(15) * majorBattleMod;
-		} else if (V.week <= 120) {
-			V.lowerClass -= random(160) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(210) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(20) * majorBattleMod;
-		} else {
-			V.lowerClass -= random(180) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(230) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(25) * majorBattleMod;
-		}
-		if (V.SecExp.battles.lossStreak >= 3) {
-			r.push(`This only confirms the fears of many, <span class="red">your arcology is not safe</span> and it is clear their business will be better somewhere else.`);
-			V.arcologies[0].prosperity -= 5 * majorBattleMod;
-		}
-	} else if (V.SecExp.war.result === 2) {
-		r.push(`Thanks to your victory, your <span class="green">reputation</span> and <span class="darkviolet">authority</span> slightly increased. Our men were not able to capture any combatants, however some equipment was seized during the enemy's hasty retreat,`);
-		if (V.SecExp.war.attacker.type === "raiders") {
-			repX(1000 * majorBattleMod, "war");
-			V.SecExp.core.authority += 200 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "free city") {
-			repX(1500 * majorBattleMod, "war");
-			V.SecExp.core.authority += 300 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-			repX(2000 * majorBattleMod, "war");
-			V.SecExp.core.authority += 450 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "old world") {
-			repX(2100 * majorBattleMod, "war");
-			V.SecExp.core.authority += 500 * majorBattleMod;
-		}
-		r.push(`which once sold produced`);
-		if (V.SecExp.war.attacker.equip === 0) {
-			r.push(`<span class="yellowgreen">a bit of cash.</span>`);
-			loot += 500 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.equip === 1) {
-			r.push(`<span class="yellowgreen">a small amount of cash.</span>`);
-			loot += 2500 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.equip === 2) {
-			r.push(`<span class="yellowgreen">a moderate amount of cash.</span>`);
-			loot += 5000 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.equip === 3) {
-			r.push(`<span class="yellowgreen">a good amount of cash.</span>`);
-			loot += 7500 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.equip === 4) {
-			r.push(`<span class="yellowgreen">a great amount of cash.</span>`);
-			loot += 10000 * majorBattleMod;
-		}
-		if (V.SecExp.edicts.defense.privilege.mercSoldier === 1 && App.SecExp.battle.deployedUnits('mercs') >= 1) {
-			r.push(`Part of the loot is distributed to your mercenaries.`);
-			loot = Math.trunc(loot * 0.6);
-		}
-		cashX(loot, "war");
-		App.Events.addParagraph(node, r);
-		r = [];
-		r.push(`Damage to the city was <span class="red">limited,</span> it won't take much to rebuild. Very few citizens or slaves were involved in the fight and even fewer met their end, safeguarding the prosperity of the arcology.`);
-		r.push(`${IncreasePCSkills('engineering', 0.1)}`);
-		cashX(forceNeg(2000 * majorBattleMod), "war");
-		V.lowerClass -= random(10) * majorBattleMod;
-		App.SecExp.slavesDamaged(random(20) * majorBattleMod);
-	} else if (V.SecExp.war.result === -2) {
-		r.push(`It was a close defeat, but nonetheless your <span class="red">reputation</span> and <span class="red">authority</span> slightly decreased. Your troops were not able to capture anyone or anything.`);
-		if (V.SecExp.war.attacker.type === "raiders") {
-			repX(forceNeg(40 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 40 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "free city") {
-			repX(forceNeg(60 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 60 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-			repX(forceNeg(75 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 75 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "old world") {
-			repX(forceNeg(80 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 80 * majorBattleMod;
-		}
-		App.Events.addParagraph(node, r);
-		r = [];
-		r.push(`The enemy did not have the strength to raid the arcology for long, still <span class="red">the arcology sustained some damage,</span> which will cost a moderate amount of cash to fix. Some citizens and slaves found themselves on the wrong end of a gun and met their demise.`);
-		r.push(`Some business sustained heavy damage, slightly impacting the arcology's prosperity.`);
-		r.push(`${IncreasePCSkills('engineering', 0.1)}`);
-		cashX(forceNeg(3000 * majorBattleMod), "war");
-		if (V.week <= 30) {
-			V.lowerClass -= random(50) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(75) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(2) * majorBattleMod;
-		} else if (V.week <= 60) {
-			V.lowerClass -= random(60) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(85) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(5) * majorBattleMod;
-		} else if (V.week <= 90) {
-			V.lowerClass -= random(70) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(95) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(7) * majorBattleMod;
-		} else if (V.week <= 120) {
-			V.lowerClass -= random(80) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(105) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(10) * majorBattleMod;
-		} else {
-			V.lowerClass -= random(90) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(115) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(12) * majorBattleMod;
-		}
-	} else if (V.SecExp.war.result === -1) {
-		r.push(`Rather than waste the lives of your men you decided to surrender, hoping your enemy will cause less damage if you indulge them, this is however a big hit to your status. Your <span class="red">reputation</span> and <span class="red">authority</span> are significantly impacted.`);
-		if (V.SecExp.war.attacker.type === "raiders") {
-			repX(forceNeg(600 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 600 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "free city") {
-			repX(forceNeg(800 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 800 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-			repX(forceNeg(1000 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 1000 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "old world") {
-			repX(forceNeg(1200 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 1200 * majorBattleMod;
-		}
-		App.Events.addParagraph(node, r);
-		r = [];
-		r.push(`The surrender allows the arcology to survive <span class="red">mostly intact,</span> however reports of <span class="red">mass looting and killing of citizens</span> flood your office for a few days.`);
-		r.push(`${IncreasePCSkills('engineering', 0.1)}`);
-		cashX(forceNeg(1000 * majorBattleMod), "war");
-		if (V.week <= 30) {
-			V.lowerClass -= random(80) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(120) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(5) * majorBattleMod;
-		} else if (V.week <= 60) {
-			V.lowerClass -= random(100) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(140) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(10) * majorBattleMod;
-		} else if (V.week <= 90) {
-			V.lowerClass -= random(120) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(160) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(15) * majorBattleMod;
-		} else if (V.week <= 120) {
-			V.lowerClass -= random(140) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(180) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(20) * majorBattleMod;
-		} else {
-			V.lowerClass -= random(160) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(200) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(25) * majorBattleMod;
-		}
-	} else if (V.SecExp.war.result === 0) {
-		r.push(`Unfortunately your adversary did not accept your money.`);
-		if (V.SecExp.war.attacker.type === "freedom fighters") {
-			r.push(`Their ideological crusade would not allow such thing.`);
-		} else {
-			r.push(`They saw your attempt as nothing more than admission of weakness.`);
-		}
-		r.push(`There was no time to organize a defense and so the enemy walked into the arcology as it was his. Your reputation and authority suffer a hit.`);
-		if (V.SecExp.war.attacker.type === "raiders") {
-			repX(forceNeg(400 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 400 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "free city") {
-			repX(forceNeg(600 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 600 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-			repX(forceNeg(750 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 750 * majorBattleMod;
-		} else if (V.SecExp.war.attacker.type === "old world") {
-			repX(forceNeg(800 * majorBattleMod), "war");
-			V.SecExp.core.authority -= 800 * majorBattleMod;
-		}
-		V.SecExp.core.authority = Math.clamp(V.SecExp.core.authority, 0, 20000);
-		App.Events.addParagraph(node, r);
-		r = [];
-		r.push(`Fortunately the arcology survives <span class="yellow">mostly intact,</span> however reports of <span class="red">mass looting and killing of citizens</span> flood your office for a few days.`);
-		r.push(`${IncreasePCSkills('engineering', 0.1)}`);
-		cashX(-1000, "war");
-		if (V.week <= 30) {
-			V.lowerClass -= random(80) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(120) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(5) * majorBattleMod;
-		} else if (V.week <= 60) {
-			V.lowerClass -= random(100) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(140) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(10) * majorBattleMod;
-		} else if (V.week <= 90) {
-			V.lowerClass -= random(120) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(160) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(15) * majorBattleMod;
-		} else if (V.week <= 120) {
-			V.lowerClass -= random(140) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(180) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(20) * majorBattleMod;
-		} else {
-			V.lowerClass -= random(160) * majorBattleMod;
-			App.SecExp.slavesDamaged(random(200) * majorBattleMod);
-			V.arcologies[0].prosperity -= random(25) * majorBattleMod;
-		}
-		App.Events.addParagraph(node, r);
-		r = [];
-	} else if (V.SecExp.war.result === 1) {
-		r.push(`The attackers wisely take the money offered them to leave your territory without further issues. The strength of the Free Cities was never in their guns but in their dollars, and today's events are the perfect demonstration of such strength.`);
-		r.push(`Your <span class="green">reputation slightly increases.</span>`);
-		if (V.SecExp.war.attacker.type === "raiders") {
-			repX(500 * majorBattleMod, "war");
-		} else if (V.SecExp.war.attacker.type === "free city") {
-			repX(750 * majorBattleMod, "war");
-		} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-			repX(1000 * majorBattleMod, "war");
-		} else if (V.SecExp.war.attacker.type === "old world") {
-			repX(1250 * majorBattleMod, "war");
-		}
-		cashX(forceNeg(App.SecExp.battle.bribeCost()), "war");
-	}
-	if (!Number.isInteger(V.lowerClass)) {
-		if (isNaN(V.lowerClass)) {
-			r.push(App.UI.DOM.makeElement("div", `Error: lowerClass is NaN, please report this issue`, "red"));
-		} else if (V.lowerClass > 0) {
-			V.lowerClass = Math.trunc(V.lowerClass);
-		} else {
-			V.lowerClass = 0;
-		}
-	}
-	if (!Number.isInteger(V.NPCSlaves)) {
-		if (isNaN(V.NPCSlaves)) {
-			r.push(App.UI.DOM.makeElement("div", `Error: NPCSlaves is NaN, please report this issue`, "red"));
-		} else if (V.NPCSlaves > 0) {
-			V.NPCSlaves = Math.trunc(V.NPCSlaves);
-		} else {
-			V.NPCSlaves = 0;
-		}
-	}
-
-	App.Events.addParagraph(node, r);
-	r = [];
-	if (V.SecExp.war.result !== 1 && V.SecExp.war.result !== 0 && V.SecExp.war.result !== -1) {
-		App.Events.addParagraph(node, App.SecExp.commanderEffectiveness("report"));
-		r = [];
-
-		// tactics
-		if (V.SecExp.war.commander === "PC") {
-			r.push(`You`);
-		} else {
-			r.push(`Your commander`);
-		}
-		if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-			r.push(`chose to employ "bait and bleed" tactics or relying on quick attacks and harassment to tire and wound the enemy until their surrender.`);
-		} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-			r.push(`chose to employ "guerrilla" tactics or relying on stealth, terrain knowledge and subterfuge to undermine and ultimately destroy the enemy.`);
-		} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-			r.push(`chose to employ "choke points" tactics or the extensive use of fortified or highly defensive positions to slow down and eventually stop the enemy.`);
-		} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-			r.push(`chose to employ "interior lines" tactics or exploiting the defender's shorter front to quickly disengage and concentrate troops when and where needed.`);
-		} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-			r.push(`chose to employ "pincer maneuver" tactics or attempting to encircle the enemy by faking a collapsing center front.`);
-		} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-			r.push(`chose to employ "defense in depth" tactics or relying on mobility to disengage and exploit overextended enemy troops by attacking their freshly exposed flanks.`);
-		} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-			r.push(`chose to employ "blitzkrieg" tactics or shattering the enemy's front-line with a violent, concentrated armored assault.`);
-		} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-			r.push(`chose to employ "human wave" tactics or overwhelming the enemy's army with a massive infantry assault.`);
-		}
-		if (V.SecExp.war.terrain === "urban") {
-			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-				r.push(`The urban terrain synergized well with bait and bleed tactics, slowly chipping away at the enemy's forces from the safety of the narrow streets and empty buildings.`);
-			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-				r.push(`The urban terrain synergized well with guerrilla tactics, eroding your enemy's determination from the safety of the narrow streets and empty buildings.`);
-			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-				r.push(`The urban environment offers many opportunities to hunker down and stop the momentum of the enemy's assault while keeping your soldiers in relative safety.`);
-			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-				r.push(`While the urban environment offers many highly defensive position, it does restrict movement and with it the advantages of exploiting interior lines.`);
-			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-				r.push(`The urban terrain does not allow for wide maneuvers, the attempts of your forces to encircle the attackers are mostly unsuccessful.`);
-			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-				r.push(`While the urban environment offers many defensive positions, it limits mobility, limiting the advantages of using a defense in depth tactic.`);
-			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-				r.push(`The urban terrain is difficult to traverse, making your troops attempt at a lightning strike unsuccessful.`);
-			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-				r.push(`The urban terrain offers great advantages to the defender, your men find themselves in great disadvantage while mass assaulting the enemy's position.`);
-			}
-		} else if (V.SecExp.war.terrain === "rural") {
-			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-				r.push(`The open terrain of rural lands does not lend itself well to bait and bleed tactics, making it harder for your men to achieve tactical superiority.`);
-			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-				r.push(`The open terrain of rural lands does not offer many hiding spots, making it harder for your men to perform guerrilla actions effectively.`);
-			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-				r.push(`The open terrain of rural lands does not offer many natural choke points, making it hard for your troops to funnel the enemy towards highly defended positions.`);
-			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-				r.push(`The open terrain allows your men to easily exploit the superior mobility of the defender, making excellent use of interior lines to strike where it hurts.`);
-			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-				r.push(`The open terrain affords your men great mobility, allowing them to easily position themselves for envelopment.`);
-			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-				r.push(`The open terrain affords your men great mobility, allowing them to exploit overextended assaults and concentrate where and when it matters.`);
-			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-				r.push(`The open terrain affords your men great mobility, making it easier to accomplish concentrated lightning strikes.`);
-			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-				r.push(`The open terrain affords your men great mobility, making it easier to overwhelm the enemy with mass assaults.`);
-			}
-		} else if (V.SecExp.war.terrain === "hills") {
-			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-				r.push(`While the hills offer some protection, they also make it harder to maneuver; bait and bleed tactics will not be 100% effective here.`);
-			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-				r.push(`The hills offer protection to both your troops and your enemy's, making it harder for your men to accomplish guerrilla attacks effectively.`);
-			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-				r.push(`While not as defensible as mountains, hills offer numerous opportunities to funnel the enemy towards highly defensible choke points.`);
-			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-				r.push(`The limited mobility on hills hampers the capability of your troops to exploit the defender's greater mobility afforded by interior lines.`);
-			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-				r.push(`Limited mobility due to the hills is a double edged sword, affording your men a decent shot at encirclement.`);
-			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-				r.push(`The limited mobility on hills hampers the capability of your troops to use elastic defense tactics.`);
-			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-				r.push(`The limited mobility on hills hampers the capability of your troops to organize lightning strikes.`);
-			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-				r.push(`The defensibility of hills makes it harder to accomplish victory through mass assaults.`);
-			}
-		} else if (V.SecExp.war.terrain === "coast") {
-			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-				r.push(`On the coast there's little space and protection to effectively employ bait and bleed tactics.`);
-			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-				r.push(`On the coast there's little space and protection to effectively employ guerrilla tactics.`);
-			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-				r.push(`Amphibious attacks are difficult in the best of situations; the defender has a very easy time funneling the enemy towards their key defensive positions.`);
-			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-				r.push(`While in an amphibious landing mobility is not the defender's best weapon, exploiting interior lines still affords your troops some advantages.`);
-			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-				r.push(`Attempting to encircle a landing party is not the best course of action, but not the worst either.`);
-			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-				r.push(`In an amphibious assault it's very easy for the enemy to overextend, making defense in depth tactics quite effective.`);
-			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-				r.push(`The rough, restricted terrain does not lend itself well to lightning strikes, but the precarious position of the enemy still gives your mobile troops tactical superiority.`);
-			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-				r.push(`The rough, restricted terrain does not lend itself well to mass assaults, but the precarious position of the enemy still gives your troops tactical superiority.`);
-			}
-		} else if (V.SecExp.war.terrain === "outskirts") {
-			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-				r.push(`Fighting just beneath the walls of the arcology does not allow for the dynamic redeployment of troops bait and bleed tactics would require.`);
-			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-				r.push(`Fighting just beneath the walls of the arcology does not allow for the dynamic redeployment of troops guerrilla tactics would require.`);
-			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-				r.push(`The imposing structure of the arcology itself provides plenty of opportunities to create fortified choke points from which to shatter the enemy assault.`);
-			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-				r.push(`While the presence of the arcology near the battlefield is an advantage, it does limit maneuverability, lowering overall effectiveness of interior lines tactics.`);
-			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-				r.push(`While the presence of the arcology near the battlefield is an advantage, it does limit maneuverability, lowering the chances of making an effective encirclement.`);
-			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-				r.push(`Having the arcology near the battlefield means there are limited available maneuvers to your troops, who still needs to defend the structure, making defense in depth tactics not as effective.`);
-			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-				r.push(`While an assault may save the arcology from getting involved at all, having the imposing structure so near does limit maneuverability and so the impetus of the lightning strike.`);
-			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-				r.push(`While an attack may save the arcology from getting involved at all, having the imposing structure so near does limit maneuverability and so the impetus of the mass assault.`);
-			}
-		} else if (V.SecExp.war.terrain === "mountains") {
-			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-				r.push(`While the mountains offer great protection, they also limit maneuverability; bait and bleed tactics will not be quite as effective here.`);
-			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-				r.push(`The mountains offer many excellent hiding spots and defensive positions, making guerrilla tactics very effective.`);
-			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-				r.push(`The mountains offer plenty of opportunity to build strong defensive positions from which to shatter the enemy's assault.`);
-			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-				r.push(`While the rough terrain complicates maneuvers, the defensive advantages offered by the mountains offsets its negative impact.`);
-			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-				r.push(`The rough terrain complicates maneuvers; your men have a really hard time pulling off an effective encirclement in this environment.`);
-			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-				r.push(`While mobility is limited, defensive positions are plentiful; your men are not able to fully exploit overextended assaults, but are able to better resist them.`);
-			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-				r.push(`The rough terrain complicates maneuvers; your men have a really hard time pulling off an effective lightning strike in this environment.`);
-			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-				r.push(`The rough terrain complicates maneuvers; your men have a really hard time pulling off an effective mass assault in this environment.`);
-			}
-		} else if (V.SecExp.war.terrain === "wasteland") {
-			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-				r.push(`While the wastelands are mostly open terrain, there are enough hiding spots to make bait and bleed tactics work well enough.`);
-			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-				r.push(`While the wastelands are mostly open terrain, there are enough hiding spots to make guerrilla tactics work well enough.`);
-			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-				r.push(`The wastelands are mostly open terrain; your men have a difficult time setting up effective fortified positions.`);
-			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-				r.push(`The wastelands, while rough, are mostly open terrain, where your men can exploit to the maximum the superior mobility of the defender.`);
-			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-				r.push(`The wastelands, while rough, are mostly open terrain; your men can set up an effective encirclement here.`);
-			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-				r.push(`The wastelands, while rough, are mostly open terrain, allowing your men to liberally maneuver to exploit overextended enemies.`);
-			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-				r.push(`The wastelands, while rough, are mostly open terrain, where your men are able to mount effective lightning strikes.`);
-			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-				r.push(`The wastelands, while rough, are mostly open terrain, where your men are able to mount effective mass assaults.`);
-			}
-		} else if (V.SecExp.war.terrain === "international waters") {
-			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-				r.push(`The open terrain of international waters does not lend itself well to bait and bleed tactics, making it harder for your men to achieve tactical superiority.`);
-			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-				r.push(`The open terrain of international waters does not offer many hiding spots, making it harder for your men to perform guerrilla actions effectively.`);
-			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-				r.push(`The open terrain of international waters does not offer many natural choke points, making it hard for your troops to funnel the enemy towards highly defended positions.`);
-			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-				r.push(`The open terrain allows your men to easily exploit the superior mobility of the defender, making excellent use of interior lines to strike where it hurts.`);
-			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-				r.push(`The open terrain affords your men great mobility, allowing them to easily position themselves for envelopment.`);
-			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-				r.push(`The open terrain affords your men great mobility, allowing them to exploit overextended assaults and concentrate where and when it matters.`);
-			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-				r.push(`The open terrain affords your men great mobility, making it easier to accomplish concentrated lightning strikes.`);
-			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-				r.push(`The open terrain affords your men great mobility, making it easier to overwhelm the enemy with mass assaults.`);
-			}
-		} else if (V.SecExp.war.terrain === "an underwater cave") {
-			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-				r.push(`The tight terrain of an underwater cave does not lend itself well to bait and bleed tactics, making it harder for your men to achieve tactical superiority.`);
-			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-				r.push(`The tight terrain of an underwater cave does offers many hiding spots, making it easier for your men to perform guerrilla actions effectively.`);
-			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-				r.push(`The tight terrain of an underwater cave offers many natural choke points, making it easy for your troops to funnel the enemy towards highly defended positions.`);
-			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-				r.push(`The tight terrain makes it hard for your men to easily exploit the superior mobility of the defender.`);
-			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-				r.push(`The tight terrain hinders the mobility of your army, allowing them to easily position themselves for envelopment.`);
-			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-				r.push(`The tight terrain hinders the mobility of your army, allowing them to exploit overextended assaults and concentrate where and when it matters.`);
-			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-				r.push(`The tight terrain hinders the mobility of your army, making it easier to accomplish concentrated lightning strikes.`);
-			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-				r.push(`The tight terrain hinders the mobility of your army, making it easier to overwhelm the enemy with mass assaults.`);
-			}
-		} else if (V.SecExp.war.terrain === "a sunken ship") {
-			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-				r.push(`The tight terrain of a sunken ship lends itself well to bait and bleed tactics, making it easier for your men to achieve tactical superiority.`);
-			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-				r.push(`The tight terrain of a sunken ship offers many hiding spots, making it easy for your men to perform guerrilla actions effectively.`);
-			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-				r.push(`The tight terrain of a sunken ship offers many natural choke points, making it easy for your troops to funnel the enemy towards highly defended positions.`);
-			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-				r.push(`The tight terrain does not allow your men to easily exploit the superior mobility of the defender.`);
-			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-				r.push(`The open terrain hinders the mobility of your army, allowing them to easily position themselves for envelopment.`);
-			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-				r.push(`The open terrain affords your men great mobility, allowing them to exploit overextended assaults and concentrate where and when it matters.`);
-			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-				r.push(`The open terrain affords your men great mobility, making it easier to accomplish concentrated lightning strikes.`);
-			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-				r.push(`The open terrain affords your men great mobility, making it easier to overwhelm the enemy with mass assaults.`);
-			}
-		}
-
-		if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`Since the bands of raiders are used to be on high alert and on the move constantly, bait and bleed tactics are not effective against them.`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`The modern armies hired by Free Cities are decently mobile, which means quick hit and run attacks will be less successful, but their discipline and confidence still make them quite susceptible to this type of attack.`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`While old world armies are tough nuts to crack, their predictability makes them the perfect target for hit and run and harassment tactics.`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`Freedom fighters live every day as chasing and being chased by far superior forces, they are far more experienced than your troops in this type of warfare and much less susceptible to it.`);
-			}
-		} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`Since the bands of raiders are used to be on high alert and on the move constantly, guerrilla tactics are not effective against them.`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`The modern armies hired by Free Cities are highly mobile, which means quick hit and run attacks will be less successful, but their discipline and confidence still make them quite susceptible to this type of attack.`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`While old world armies are tough nuts to crack, their predictability makes them the perfect target for hit and run and harassment tactics.`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`Freedom fighters live every day as chasing and being chased by far superior forces, they are far more experienced than your troops in this type of warfare and much less susceptible to it.`);
-			}
-		} else if (V.SecExp.war.chosenTactic === "Choke Points") {
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`Raiders lack heavy weaponry or armor, so making use of fortified positions is an excellent way to dissipate the otherwise powerful momentum of their assault.`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`The high tech equipment Free Cities can afford to give their guns for hire means there's no defensive position strong enough to stop them, still the relatively low numbers means they will have to take a careful approach, slowing them down.`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`Old world armies have both the manpower and the equipment to conquer any defensive position, making use of strong fortifications will only bring you this far against them.`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`The lack of specialized weaponry means freedom fighters have a rather hard time overcoming tough defensive positions, unfortunately they have also a lot of experience in avoiding them.`);
-			}
-		} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`The highly mobile horde of raiders will not give much room for your troops to maneuver, lowering their tactical superiority.`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`While decently mobile, Free Cities forces are not in high enough numbers to risk maintaining prolonged contact, allowing your troops to quickly disengage and redeploy where it hurts.`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`Old world armies are not famous for the mobility, which makes them highly susceptible to any tactic that exploits maneuverability and speed.`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`While not the best equipped army, the experience and mobility typical of freedom fighters groups make them tough targets for an army that relies itself on mobility.`);
-			}
-		} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`While numerous, the undisciplined masses of raiders are easy prey for encirclements.`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`While decently mobile, the low number of Free Cities expedition forces make them good candidates for encirclements.`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`The discipline and numbers of old world armies make them quite difficult to encircle.`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`While not particularly mobile, freedom fighters are used to fight against overwhelming odds, diminishing the effectiveness of the encirclement.`);
-			}
-		} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`While their low discipline makes them prime candidates for an elastic defense type of strategy, their high numbers limit your troops maneuverability.`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`With their low numbers Free Cities mercenaries are quite susceptible to this type of tactic, despite their mobility.`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`With their low mobility old world armies are very susceptible to this type of strategy.`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`Low mobility and not particularly high numbers mean freedom fighters can be defeated by employing elastic defense tactics.`);
-			}
-		} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`With their low discipline and lack of heavy equipment, lightning strikes are very effective against raider hordes.`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`Having good equipment and discipline on their side, Free Cities expeditions are capable of responding to even strong lightning strikes.`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`While disciplined, old world armies low mobility makes them highly susceptible to lightning strikes.`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`While not well equipped, freedom fighters have plenty of experience fighting small, mobile attacks, making them difficult to defeat with lightning strikes.`);
-			}
-		} else if (V.SecExp.war.chosenTactic === "Human Wave") {
-			if (V.SecExp.war.attacker.type === "raiders") {
-				r.push(`The hordes of raiders are much more experienced than your soldiers in executing mass assaults and they also have a lot more bodies to throw in the grinder.`);
-			} else if (V.SecExp.war.attacker.type === "free city") {
-				r.push(`The good equipment and mobility of Free Cities mercenaries cannot save them from an organized mass assault.`);
-			} else if (V.SecExp.war.attacker.type === "old world") {
-				r.push(`Unfortunately the discipline and good equipment of old world armies allow them to respond well against a mass assault.`);
-			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
-				r.push(`The relative low numbers and not great equipment typical of freedom fighters make them susceptible to being overwhelmed by an organized mass assault.`);
-			}
-		}
-		r.push(`In the end`);
-		if (V.SecExp.war.commander === "PC") {
-			r.push(`you were`);
-		} else {
-			r.push(`your commander was`);
-		}
-		if (V.SecExp.war.tacticsSuccessful) {
-			r.push(`<span class="green">able to successfully employ ${V.SecExp.war.chosenTactic} tactics,</span> greatly enhancing`);
-		} else {
-			r.push(`<span class="red">not able to effectively employ ${V.SecExp.war.chosenTactic} tactics,</span> greatly affecting`);
-		}
-		r.push(`the efficiency of your army.`);
-		App.Events.addParagraph(node, r);
-		r = [];
-		node.append(unitsBattleReport());
-
-		if (
-			V.SF.Toggle && V.SF.Active >= 1 &&
-			(V.SF.Squad.Firebase >= 7 || V.SF.Squad.GunS >= 1 || V.SF.Squad.Satellite >= 5 || V.SF.Squad.GiantRobot >= 6 || V.SF.Squad.MissileSilo >= 1)
-		) {
-			// SF upgrades effects
-			App.Events.addParagraph(node, r);
-			r = [];
-			if (V.SF.Squad.Firebase >= 7) {
-				r.push(`The artillery pieces installed around ${V.SF.Lower}'s firebase provided vital fire support to the troops in the field.`);
-			}
-			if (V.SF.Squad.GunS >= 1) {
-				r.push(`The gunship gave our troops an undeniable advantage in recon capabilities, air superiority and fire support.`);
-			}
-			if (V.SF.Squad.Satellite >= 5 && V.SF.SatLaunched > 0) {
-				r.push(`The devastating power of ${V.SF.Lower}'s satellite was employed with great efficiency against the enemy.`);
-			}
-			if (V.SF.Squad.GiantRobot >= 6) {
-				r.push(`The giant robot of ${V.SF.Lower} proved to be a great boon to our troops, shielding many from the worst the enemy had to offer.`);
-			}
-			if (V.SF.Squad.MissileSilo >= 1) {
-				r.push(`The missile silo exterminated many enemy soldiers even before the battle would begin.`);
-			}
-		}
-	}// closes check for surrender and bribery
-
-	App.Events.addParagraph(node, r);
-	r = [];
-
-	let menialPrice = Math.trunc((V.slaveCostFactor * 1000) / 100) * 100;
-	menialPrice = Math.clamp(menialPrice, 500, 1500);
-
-	captives = Math.trunc(captives);
-	if (captives > 0) {
-		let candidates = 0;
-		r.push(`During the battle ${captives} attackers were captured.`);
-		if (random(1, 100) <= 25) {
-			candidates = Math.min(captives, random(1, 3));
-			r.push(`${capFirstChar(num(candidates, true))} of them have the potential to be sex slaves.`);
-		}
-
-		const sell = function() {
-			cashX((menialPrice * captives), "menialTransfer");
-			return `Captives sold`;
-		};
-
-		const keep = function() {
-			V.menials += (captives - candidates);
-			for (let i = 0; i < candidates; i++) {
-				const generateFemale = random(0, 99) < V.seeDicks;
-				let slave = GenerateNewSlave((generateFemale ? "XY" : "XX"), {minAge: 16, maxAge: 32, disableDisability: 1});
-				slave.weight = (generateFemale ? random(-20, 30) : random(0, 30));
-				slave.muscles = (generateFemale ? random(15, 80) : random(25, 80));
-				slave.waist = (generateFemale ? random(10, 80) : random(-20, 20));
-				slave.skill.combat = 1;
-				slave.origin = `$He is an enslaved ${V.SecExp.war.attacker.type} soldier captured during a battle.`;
-				newSlave(slave); // skip New Slave Intro
-			}
-			return `Captives primarily added as menial slaves.`;
-		};
-
-		App.Events.addResponses(node, [
-			new App.Events.Result(`sell them all immediately`, sell),
-			new App.Events.Result(`keep them as primarily menial slaves`, keep),
-		]);
-	}
-
-	// resets variables
-	V.SecExp.units.bots.isDeployed = 0;
-	for (const squad of App.SecExp.unit.humanSquads()) {
-		squad.isDeployed = 0;
-	}
-	App.Events.addParagraph(node, r);
-	return node;
-
-	function unitsBattleReport() {
-		const el = document.createElement("div");
-		if (V.SecExp.war.losses >= 0) {
-			if (V.SecExp.war.losses > 0) {
-				// if the losses are more than zero
-				// generates a list of randomized losses, from which each unit picks one at random
-				let losses = V.SecExp.war.losses;
-				const averageLosses = Math.trunc(losses / App.SecExp.battle.deployedUnits());
-				let assignedLosses;
-				for (let i = 0; i < App.SecExp.battle.deployedUnits(); i++) {
-					assignedLosses = Math.trunc(Math.clamp(averageLosses + random(-5, 5), 0, 100));
-					if (assignedLosses > losses) {
-						assignedLosses = losses;
-						losses = 0;
-					} else {
-						losses -= assignedLosses;
-					}
-					lossesList.push(assignedLosses);
-				}
-				if (losses > 0) {
-					lossesList[random(lossesList.length - 1)] += losses;
-				}
-				lossesList.shuffle();
-
-				// sanity check for losses
-				let count = 0;
-				for (let i = 0; i < lossesList.length; i++) {
-					if (!Number.isInteger(lossesList[i])) {
-						lossesList[i] = 0;
-					}
-					count += lossesList[i];
-				}
-				if (count < V.SecExp.war.losses) {
-					const rand = random(lossesList.length - 1);
-					lossesList[rand] += V.SecExp.war.losses - count;
-				} else if (count > V.SecExp.war.losses) {
-					const diff = count - V.SecExp.war.losses;
-					const rand = random(lossesList.length - 1);
-					lossesList[rand] = Math.clamp(lossesList[rand] - diff, 0, 100);
-				}
-			}
-
-			if (V.SF.Toggle && V.SF.Active >= 1 && V.SecExp.war.deploySF) {
-				if (V.SecExp.war.losses > 0) {
-					loss = lossesList.pluck();
-					loss = Math.clamp(loss, 0, V.SF.ArmySize);
-					V.SF.ArmySize -= loss;
-				}
-				App.UI.DOM.appendNewElement("div", el, `${num(V.SF.ArmySize)} soldiers from ${V.SF.Lower} joined the battle: casualtiesReport(type, loss)`);
-			}
-			for (const unitClass of App.SecExp.unit.list()) {
-				if (App.SecExp.battle.deployedUnits(unitClass) >= 1) {
-					if (unitClass !== 'bots') {
-						loopThroughUnits(V.SecExp.units[unitClass].squads, unitClass);
-					} else {
-						loopThroughUnits([V.SecExp.units.bots], unitClass);
-					}
-				}
-			}
-		} else {
-			App.UI.DOM.appendNewElement("div", el, `Error: losses are a negative number or NaN`, "red");
-		}// closes check for more than zero casualties
-
-		return el;
-	}
-};
diff --git a/src/Mods/SecExp/events/conflictHandler.js b/src/Mods/SecExp/events/conflictHandler.js
index 1a69bfaa256..a630d7fd314 100644
--- a/src/Mods/SecExp/events/conflictHandler.js
+++ b/src/Mods/SecExp/events/conflictHandler.js
@@ -544,7 +544,7 @@ App.Events.conflictHandler = function() {
 		V.gameover = `${isMajorBattle ? "major battle" : "Rebellion"} defeat`;
 		atEnd("Gameover");
 	} else {
-		atEnd(inBattle ? "attackReport" : "rebellionReport");
+		atEnd("conflictReport");
 	}
 	return node;
 };
diff --git a/src/Mods/SecExp/events/conflictReport.js b/src/Mods/SecExp/events/conflictReport.js
new file mode 100644
index 00000000000..70f4f6547db
--- /dev/null
+++ b/src/Mods/SecExp/events/conflictReport.js
@@ -0,0 +1,1468 @@
+App.Events.conflictReport = function() {
+	/**
+	 * @param {string} [type]
+	 * @param {number} [loss]
+	 * @param {Object} [squad=null]
+	 * @returns {string}
+	 */
+	 const casualtiesReport = function(type, loss, squad=null) {
+		const isSpecial = squad && App.SecExp.unit.list().slice(1).includes(type);
+		let r = [];
+		if (loss <= 0) {
+			r.push(`No`);
+		} else if (loss <= (isSpecial ? (squad.troops * 0.2) : 10)) {
+			r.push(`Light`);
+		} else if (loss <= (isSpecial ? (squad.troops * 0.4) : 30)) {
+			r.push(`Moderate`);
+		} else if (loss <= (isSpecial ? (squad.troops * 0.6) : 60)) {
+			r.push(`Heavy`);
+		} else {
+			r.push(`Catastrophic`);
+		}
+		r.push(`casualties suffered.`);
+		if (App.SecExp.unit.list().includes(type)) {
+			if (squad.troops <= 0) {
+				squad.active = 0;
+				r.push(`Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit.`);
+				if (type === "bots") {
+					r.push(`It will take quite the investment to rebuild them.`);
+				} else {
+					r.push(`The remnants will be sent home honored as veterans or reorganized in a new unit.`);
+				}
+			} else if (squad.troops <= 10) {
+				r.push(`The unit has very few operatives left, it risks complete annihilation if deployed again.`);
+			}
+		}
+		return r.join(" ");
+	};
+	let r = [];
+	const allKilled = V.SecExp.war.attacker.losses === V.SecExp.war.attacker.troops;
+	const result = V.SecExp.war.result;
+	const hasLosses = V.SecExp.war.losses > 0;
+
+	const inBattle = V.SecExp.war.type.includes("Attack");
+	const isMajorBattle = inBattle && V.SecExp.war.type.includes("Major");
+	const majorBattleMod = !isMajorBattle ? 1 : 2;
+
+	const inRebellion = V.SecExp.war.type.includes("Rebellion");
+	const slaveRebellion = V.SecExp.war.type.includes("Slave");
+	const type = inBattle ? "battles" : "rebellions";
+
+	// Battles
+	let loot = 0;
+	let captives;
+	const end = (V.SecExp.battles.victoryStreak >= 2 || V.SecExp.battles.lossStreak >= 2) ? `,` : `.`;
+	/**
+	 * Does the target become wounded?
+	 * @param {string} [target]
+	 * @returns {string}
+	 */
+	 const checkWoundStatus = function(target) {
+		let conditions;
+		let slave;
+		let woundChance = 0;
+		const r = [];
+		if (target === "PC") {
+			if (V.PC.career === "mercenary" || V.PC.career === "gang") {
+				woundChance -= 5;
+			} else if (V.PC.skill.warfare >= 75) {
+				woundChance -= 3;
+			}
+			if (V.personalArms >= 1) {
+				woundChance -= 5;
+			}
+			if (V.PC.balls >= 20) {
+				woundChance += random(5, 10);
+			} else if (V.PC.balls >= 9) {
+				woundChance += random(1, 5);
+			}
+			conditions = [
+				V.PC.physicalAge >= 60,
+				V.PC.belly > 5000,
+				V.PC.boobs >= 1000,
+				V.PC.butt >= 4,
+				V.PC.preg >= 30
+			];
+		} else {
+			if (target === "Concubine") {
+				slave = S.Concubine;
+			} else if (target === "Bodyguard") {
+				slave = S.Bodyguard;
+			}
+
+			if (!slave) {
+				return ``;
+			}
+
+			if (slave.skill.combat === 1) {
+				woundChance -= 2;
+			}
+			woundChance -= 0.25 * (getLimbCount(slave, 105));
+			if (slave.health.condition >= 50) {
+				woundChance -= 1;
+			}
+			conditions = [
+				slave.weight > 130,
+				slave.muscles < -30,
+				getBestVision(slave) === 0,
+				slave.heels === 1,
+				slave.boobs >= 1400,
+				slave.butt >= 6,
+				slave.belly >= 10000,
+				slave.dick >= 8,
+				slave.balls >= 8,
+				slave.intelligence + slave.intelligenceImplant < -95
+			];
+		}
+		for (const cond of conditions) {
+			if (cond) {
+				woundChance += (target === "PC" ? random(1, 5) : 1);
+			}
+		}
+		woundChance *= (target === "PC" ? random(1, 2) : random(2, 4));
+
+		if (random(1, 100) <= woundChance) {
+			if (target === "PC") {
+				healthDamage(V.PC, 60);
+				r.push(`A lucky shot managed to find its way to you, leaving a painful, but thankfully not lethal, wound.`);
+			} else {
+				const woundType = App.SecExp.inflictBattleWound(slave);
+				const {his, him} = getPronouns(slave);
+				if (target === "Concubine") {
+					r.push(`Your Concubine was unfortunately caught in the crossfire.`);
+				} else {
+					r.push(`During one of the assaults your Bodyguard was hit.`);
+				}
+				if (woundType === "voice") {
+					r.push(`A splinter pierced ${his} throat, severing ${his} vocal cords.`);
+				} else if (woundType === "eyes") {
+					r.push(`A splinter hit ${his} face, severely damaging ${his} eyes.`);
+				} else if (woundType === "legs") {
+					r.push(`An explosion near ${him} caused the loss of both of ${his} legs.`);
+				} else if (woundType === "arm") {
+					r.push(`An explosion near ${him} caused the loss of one of ${his} arms.`);
+				} else if (woundType === "flesh") {
+					r.push(`A stray shot severely wounded ${him}.`);
+				}
+			}
+		} else if (target === "PC") {
+			r.push(`Fortunately you managed to avoid injury.`);
+		}
+		return r.join(" ");
+	};
+
+	// Rebellions
+	let lostSlaves;
+	/**
+	 * @param {string} [target]
+	 * @param {number} [value]
+	 * @param {number} [cost=2000]
+	 */
+	const setRepairTime = function(target, value, cost=2000) {
+		V.SecExp.rebellions.repairTime[target] = 3 + random(1) - value;
+		cashX(-cost, "war");
+		return IncreasePCSkills('engineering', 0.1);
+	};
+
+	/**
+	 * @param {number} [lowerClass]
+	 * @param {number} [slaves]
+	 * @param {number} [prosperity]
+	 * @returns {void}
+	 */
+	const arcologyEffects = function(lowerClass, slaves, prosperity) {
+		V.lowerClass -= random(lowerClass);
+		App.SecExp.slavesDamaged(random(slaves));
+		V.arcologies[0].prosperity -= random(prosperity);
+	};
+	
+	/**
+	 * @param {FC.SecExp.PlayerHumanUnitType} [unit]
+	 * @param {number} [averageLosses]
+	 */
+	const rebellingUnitsFate = function(unit, averageLosses) {
+		let manpower = 0;
+		const node = new DocumentFragment();
+		const r = [];
+		const rebels = {ID: [], names: []};
+
+		const Dissolve = function() {
+			App.SecExp.unit.unitFree(unit).add(manpower);
+			for (const u of V.SecExp.units[unit].squads.filter(s => s.active === 1)) {
+				u.loyalty = Math.clamp(u.loyalty - random(10, 40), 0, 100);
+			}
+			return `Units dissolved.`;
+		};
+		const Purge = function() {
+			App.SecExp.unit.unitFree(unit).add(manpower * 0.5);
+			return `Dissidents purged and units dissolved.`;
+		};
+		const Execute = function() {
+			for (const u of V.SecExp.units[unit].squads.filter(s => s.active === 1)) {
+				u.loyalty = Math.clamp(u.loyalty + random(10, 40), 0, 100);
+			}
+			return `Units executed. Dissent will not be tolerated.`;
+		};
+
+		App.UI.DOM.appendNewElement("div", node);
+		for (const u of V.SecExp.units[unit].squads.filter(s => s.active === 1)) {
+			if (V.SecExp.war.rebellingID.contains(u.ID)) {
+				rebels.names.push(u.platoonName);
+				rebels.ID.push(u.ID);
+				manpower += Math.clamp(u.troops - random(averageLosses), 0, u.troops);
+			}
+		}
+
+		if (rebels.ID.length > 0) {
+			V.SecExp.units[unit].squads.deleteWith((u) => rebels.ID.contains(u.ID));
+			V.SecExp.battles.lastSelection.deleteWith((u) => rebels.ID.contains(u.ID));
+			if (unit === "slaves") {
+				r.push(`${toSentence(rebels.names)} decided in their blind arrogance to betray you.`);
+			} else if (unit === "militia") {
+				r.push(`${toSentence(rebels.names)} had the gall to betray you and join your enemies.`);
+			} else if (unit === "mercs") {
+				r.push(`${toSentence(rebels.names)} made the grave mistake of betraying you.`);
+			}
+			if (V.SecExp.war.result < 2) { // rebellion loss
+				r.push(`They participated in the looting following the battle, then vanished in the wastes.`);
+				cashX(forceNeg(1000 * rebels.ID.length), "war");
+			} else { // rebellion win
+				App.Events.addResponses(node, [
+					new App.Events.Result(
+						`Dissolve the units`,
+						Dissolve,
+						`Manpower will be refunded, but will negatively influence the loyalty of the other units`
+					),
+					new App.Events.Result(
+						`Purge the dissidents and dissolve the units`,
+						Purge,
+						`Will not influence the loyalty of the other units, but half the manpower will be refunded.`
+					),
+					new App.Events.Result(
+						`Execute them all`,
+						Execute,
+						`Will positively influence the loyalty of the other units, but manpower will not be refunded.`
+					),
+				]);
+			}
+			App.Events.addNode(node, r, "div");
+		}
+		return node;
+	};
+
+	V.SecExp.war.attacker.losses = Math.trunc(V.SecExp.war.attacker.losses);
+	if (V.SecExp.war.attacker.losses > V.SecExp.war.attacker.troops) {
+		V.SecExp.war.attacker.losses = V.SecExp.war.attacker.troops;
+	}
+	V.SecExp.core.totalKills += V.SecExp.war.attacker.losses;
+	V.SecExp.war.losses = Math.trunc(V.SecExp.war.losses);
+	if (isMajorBattle) {
+		V.SecExp.battles.major++;
+	}
+
+	const node = new DocumentFragment();
+	if (result === 3 || result === 2) {
+		App.UI.DOM.appendNewElement("h1", node, `${result === 2 ? 'Partial ' : ''}Victory!`, "strong");
+		V.SecExp[type].victories++;
+		if (inBattle && result === 3) {
+			V.SecExp.battles.lossStreak = 0;
+			V.SecExp.battles.victoryStreak++;
+		}
+	} else if (result === -3 || result === -2) {
+		App.UI.DOM.appendNewElement("h1", node, `${result === -2 ? 'Partial ' : ''}Defeat!`, "strong");
+		V.SecExp[type].losses++;
+		if (inBattle && result === -3) {
+			V.SecExp.battles.lossStreak++;
+			V.SecExp.battles.victoryStreak = 0;
+		}
+	} else if (result === -1) {
+		App.UI.DOM.appendNewElement("h1", node, `We surrendered`, "strong");
+		V.SecExp[type].losses++;
+	} else if (V.SecExp.war.result === 0) { // Battles only
+		App.UI.DOM.makeElement("h1", `Failed bribery!`, "strong");
+		V.SecExp.battles.losses++;
+	} else if (V.SecExp.war.result === 1) { // Battles only
+		App.UI.DOM.makeElement("h1", `Successful bribery!`, "strong");
+		V.SecExp.battles.victories++;
+	}
+	App.UI.DOM.appendNewElement("hr", node);
+
+	r.push(`Today, ${asDateString(V.week, random(0, 7))}, our arcology was`);
+	if (inBattle) {
+		r.push(`attacked by`);
+		if (V.SecExp.war.attacker.type === "raiders") {
+			r.push(`a band of wild raiders,`);
+		} else if (V.SecExp.war.attacker.type === "free city") {
+			r.push(`a contingent of mercenaries hired by a competing free city,`);
+		} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+			r.push(`a group of freedom fighters bent on the destruction of the institution of slavery,`);
+		} else if (V.SecExp.war.attacker.type === "old world") {
+			r.push(`an old world nation boasting a misplaced sense of superiority,`);
+		}
+		r.push(`${num(Math.trunc(V.SecExp.war.attacker.troops))} men strong.`);
+	} else {
+		r.push(`inflamed by the fires of rebellion. ${num(Math.trunc(V.SecExp.war.attacker.troops))} rebels from all over the structure dared rise up`);
+		if (slaveRebellion) {
+			r.push(`against their owners and conquer their freedom through blood.`);
+		} else {
+			r.push(`to dethrone their arcology owner.`);
+		}
+	}
+
+	if (V.SecExp.war.result !== 1 && V.SecExp.war.result !== 0 && V.SecExp.war.result !== -1) {
+		r.push(`Our defense forces, ${num(Math.trunc(App.SecExp.battle.troopCount()))} strong,`);
+		if (inBattle) {
+			r.push(`clashed with them`);
+			if (V.SecExp.war.terrain === "urban") {
+				r.push(`in the streets of the old world city surrounding the arcology,`);
+			} else if (V.SecExp.war.terrain === "rural") {
+				r.push(`in the rural land surrounding the free city,`);
+			} else if (V.SecExp.war.terrain === "hills") {
+				r.push(`on the hills around the free city,`);
+			} else if (V.SecExp.war.terrain === "coast") {
+				r.push(`along the coast just outside the free city,`);
+			} else if (V.SecExp.war.terrain === "outskirts") {
+				r.push(`just against the walls of the arcology,`);
+			} else if (V.SecExp.war.terrain === "mountains") {
+				r.push(`in the mountains overlooking the arcology,`);
+			} else if (V.SecExp.war.terrain === "wasteland") {
+				r.push(`in the wastelands outside the free city territory,`);
+			} else if (V.SecExp.war.terrain === "international waters") {
+				r.push(`in the water surrounding the free city,`);
+			} else if (["a sunken ship", "an underwater cave"].includes(V.SecExp.war.terrain)) {
+				r.push(`in <strong>${V.SecExp.war.terrain}</strong> near the free city`);
+			}
+		} else {
+			r.push(`fought with them street by street`);
+		}
+
+		if (allKilled) {
+			r.push(`completely annihilating their troops, while sustaining`);
+		} else {
+			r.push(`inflicting ${V.SecExp.war.attacker.losses} casualties, while sustaining`);
+		}
+		if (V.SecExp.war.losses > 1) {
+			r.push(`${num(Math.trunc(V.SecExp.war.losses))} casualties`);
+		} else if (V.SecExp.war.losses > 0) {
+			r.push(`a casualty`);
+		} else {
+			r.push(`zero casualties`);
+		}
+		r.push(`${allKilled ? '' : 'themselves'}.`);
+		if (inRebellion) {
+			App.SecExp.slavesDamaged(V.SecExp.war.attacker.losses);
+		}
+
+		if (V.SecExp.war.result === 3) {
+			if (V.SecExp.war.turns <= 5) {
+				r.push(`The fight was quick and one sided, our men easily stopped the`);
+				if (inBattle) {
+					if (V.SecExp.war.attacker.type === "raiders") {
+						r.push(`disorganized horde's futile attempt at raiding your arcology${end}`);
+					} else if (V.SecExp.war.attacker.type === "free city") {
+						r.push(`mercenaries dead in their tracks${end}`);
+					} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+						r.push(`freedom fighters dead in their tracks${end}`);
+					} else if (V.SecExp.war.attacker.type === "old world") {
+						r.push(`old world soldiers dead in their tracks${end}`);
+					}
+				} else {
+					r.push(`disorganized revolt in a few well aimed assaults.`);
+				}
+			} else if (V.SecExp.war.turns <= 7) {
+				r.push(`The fight was hard, but in the end our men stopped the`);
+				if (inBattle) {
+					if (V.SecExp.war.attacker.type === "raiders") {
+						r.push(`disorganized horde attempt at raiding your arcology${end}`);
+					} else if (V.SecExp.war.attacker.type === "free city") {
+						r.push(`slavers attempt at weakening your arcology${end}`);
+					} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+						r.push(`fighters attack${end}`);
+					} else if (V.SecExp.war.attacker.type === "old world") {
+						r.push(`soldiers of the old world${end}`);
+					}
+				} else {
+					r.push(`disorganized revolt with several well aimed assaults.`);
+				}
+			} else {
+				r.push(`The fight was long and hard, but our men managed to stop the`);
+				if (inBattle) {
+					if (V.SecExp.war.attacker.type === "raiders") {
+						r.push(`horde raiding party${end}`);
+					} else if (V.SecExp.war.attacker.type === "free city") {
+						r.push(`free city mercenaries${end}`);
+					} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+						r.push(`freedom fighters${end}`);
+					} else if (V.SecExp.war.attacker.type === "old world") {
+						r.push(`old world soldiers${end}`);
+					}
+				} else {
+					r.push(`revolt before it could accumulate momentum.`);
+				}
+			}
+			if (inBattle && V.SecExp.battles.victoryStreak >= 2) {
+				r.push(`adding another victory to the growing list of our military's successes.`);
+			} else if (inBattle && V.SecExp.battles.lossStreak >= 2) {
+				r.push(`finally putting an end to a series of unfortunate defeats.`);
+			}
+		} else if (V.SecExp.war.result === -3) {
+			if (V.SecExp.war.turns <= 5) {
+				r.push(`The fight was quick and one sided, our men were easily crushed by the`);
+				if (inBattle) {
+					if (V.SecExp.war.attacker.type === "raiders") {
+						r.push(`barbaric horde of raiders${end}`);
+					} else if (V.SecExp.war.attacker.type === "free city") {
+						r.push(`consumed mercenary veterans sent against us${end}`);
+					} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+						r.push(`fanatical fury of the freedom fighters${end}`);
+					} else if (V.SecExp.war.attacker.type === "old world") {
+						r.push(`discipline of the old world armies${end}`);
+					}
+				} else {
+					r.push(`furious charge of the rebels.`);
+				}
+			} else if (V.SecExp.war.turns <= 7) {
+				r.push(`The fight was hard and in the end the`);
+				if (inBattle) {
+					if (V.SecExp.war.attacker.type === "raiders") {
+						r.push(`bandits proved too much to handle for our men${end}`);
+					} else if (V.SecExp.war.attacker.type === "free city") {
+						r.push(`slavers proved too much to handle for our men${end}`);
+					} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+						r.push(`freedom fighters proved too much to handle for our men${end}`);
+					} else if (V.SecExp.war.attacker.type === "old world") {
+						r.push(`old world proved too much to handle for our men${end}`);
+					}
+				} else {
+					r.push(`rebels proved too much to handle for our men.`);
+				}
+			} else {
+				r.push(`The fight was long and hard, but despite their bravery the`);
+				if (inBattle) {
+					if (V.SecExp.war.attacker.type === "raiders") {
+						r.push(`horde proved too much for our men${end}`);
+					} else if (V.SecExp.war.attacker.type === "free city") {
+						r.push(`mercenary slavers proved too much for our men${end}`);
+					} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+						r.push(`freedom fighters fury proved too much for our men${end}`);
+					} else if (V.SecExp.war.attacker.type === "old world") {
+						r.push(`old world troops proved too much for our men${end}`);
+					}
+				} else {
+					r.push(`rebels proved too much for our men.`);
+				}
+			}
+			if (inBattle && V.SecExp.battles.victoryStreak >= 2) {
+				r.push(`so interrupting a long series of military successes.`);
+			} else if (inBattle && V.SecExp.battles.lossStreak >= 2) {
+				r.push(`confirming the long list of recent failures our armed forces collected.`);
+			}
+		} else if (V.SecExp.war.result === 2) {
+			r.push(`The fight was long and hard, but in the end our men managed to`);
+			if (inBattle) {
+				r.push(`repel the`);
+				if (V.SecExp.war.attacker.type === "raiders") {
+					r.push(`raiders, though not without difficulty.`);
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					r.push(`mercenaries, though not without difficulty.`);
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					r.push(`freedom fighters, though not without difficulty.`);
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					r.push(`old world soldiers, though not without difficulty.`);
+				}
+			} else {
+				r.push(`stop the revolt, though not without difficulty.`);
+			}
+		} else if (V.SecExp.war.result === -2) {
+			r.push(`The fight was long and hard. Our men in the end had to yield to the`);
+			if (inBattle) {
+				if (V.SecExp.war.attacker.type === "raiders") {
+					r.push(`horde of raiders, which was fortunately unable to capitalize on their victory.`);
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					r.push(`slavers, which were fortunately unable to capitalize on their victory.`);
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					r.push(`freedom fighters, which were fortunately unable to capitalize on their victory.`);
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					r.push(`old world soldiers, which were fortunately unable to capitalize on their victory.`);
+				}
+			} else {
+				r.push(`rebels, which were fortunately unable to capitalize on their victory.`);
+			}
+		}
+
+		if (inRebellion && V.SecExp.rebellions.sfArmor) {
+			r.push(`More units were able to survive thanks to wearing ${V.SF.Lower}'s combat armor suits.`);
+		}
+		App.Events.addParagraph(node, r);
+		r = [];
+
+		// Effects
+		if (result === 3 || result === 2) {
+			r.push(` Thanks to your victory, your `, App.UI.DOM.makeElement("span", `reputation`, "green"), ` and `, App.UI.DOM.makeElement("span", `authority`, "darkviolet"), `${result === 2 ? 'slightly' : ''} increased.`);
+			if (inRebellion) {
+				if (slaveRebellion) {
+					App.UI.DOM.appendNewElement("div", node, `Many of the rebelling slaves were recaptured and punished.`);
+				} else {
+					App.UI.DOM.appendNewElement("div", node, `Many of the rebelling citizens were captured and punished, many others enslaved.`);
+				}
+				App.UI.DOM.appendNewElement("div", node, `The instigators were executed one after another in a public trial that lasted for almost three days.`);
+				if (slaveRebellion) {
+					V.NPCSlaves -= random(10, 30);
+				} else {
+					V.lowerClass -= random(10, 30);
+				}
+				repX((result === 3 ? random(800, 1000) : random(600, 180)), "war");
+				V.SecExp.core.authority += (result === 3 ? random(800, 1000) : random(600, 800));
+			} else {
+				if (result === 3) {
+					r.push("You were also able to capture");
+					if (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses <= 50) {
+						r.push(`a small amount of attackers,`);
+						captives = (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.1 * random(1, 3);
+					} else if (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses <= 100) {
+						r.push(`an healthy group of attackers,`);
+						captives = (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.1 * random(1, 3);
+					} else if (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses <= 150) {
+						r.push(`a big group of attackers,`);
+						captives = (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.1 * random(1, 3);
+					} else if (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses <= 200) {
+						r.push(`a huge group of attackers,`);
+						captives = (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.1 * random(1, 3);
+					} else if (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses > 200) {
+						r.push(`a great amount of attackers,`);
+						captives = (V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.1 * random(1, 3);
+					}
+					r.push(`and some of their equipment,`);
+				} else {
+					App.UI.DOM.appendNewElement("div", node, " Our men were not able to capture any combatants, however some equipment was seized during the enemy's hasty retreat,");
+				}
+				if (V.SecExp.war.attacker.type === "raiders") {
+					repX((result === 3 ? 4000 : 1000) * majorBattleMod, "war");
+					V.SecExp.core.authority += (result === 3 ? 800 : 200) * majorBattleMod;
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					repX((result === 3 ? 6000 : 1500) * majorBattleMod, "war");
+					V.SecExp.core.authority += (result === 3 ? 1200 : 300) * majorBattleMod;
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					repX((result === 3 ? 7500 : 2000) * majorBattleMod, "war");
+					V.SecExp.core.authority += (result === 3 ? 1500 : 450) * majorBattleMod;
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					repX((result === 3 ? 8000 : 2100) * majorBattleMod, "war");
+					V.SecExp.core.authority += (result === 3 ? 1600 : 500) * majorBattleMod;
+				}
+				r.push(`which once sold produced`);
+				if (V.SecExp.war.attacker.equip === 0) {
+					r.push(`<span class="yellowgreen">a ${result === 3 ? 'small amount' : 'bit'} of cash.</span>`);
+					loot += (result === 3 ? 1000 : 500) * majorBattleMod;
+				} else if (V.SecExp.war.attacker.equip === 1) {
+					r.push(`<span class="yellowgreen">a ${result === 3 ? 'moderate' : 'small'} amount of cash.</span>`);
+					loot += (result === 3 ? 5000 : 2500) * majorBattleMod;
+				} else if (V.SecExp.war.attacker.equip === 2) {
+					r.push(`<span class="yellowgreen">a ${result === 3 ? 'good' : 'moderate'} amount of cash.</span>`);
+					loot += (result === 3 ? 10000 : 5000) * majorBattleMod;
+				} else if (V.SecExp.war.attacker.equip === 3) {
+					r.push(`<span class="yellowgreen">a ${result === 3 ? 'great' : 'good'} amount of cash.</span>`);
+					loot += (result === 3 ? 15000 : 7500) * majorBattleMod;
+				} else if (V.SecExp.war.attacker.equip === 4) {
+					r.push(`<span class="yellowgreen">${result === 3 ? 'wealth worthy of the mightiest warlord' : 'a great amount of cash'}.</span>`);
+					loot += (result === 3 ? 20000 : 10000) * majorBattleMod;
+				}
+				if (V.SecExp.edicts.defense.privilege.mercSoldier === 1 && App.SecExp.battle.deployedUnits('mercs') >= 1) {
+					r.push(`Part of the loot is distributed to your mercenaries.`);
+					if (result === 3) {
+						captives = Math.trunc(captives * 0.6);
+					}
+					loot = Math.trunc(loot * 0.6);
+				}
+				cashX(loot, "war");
+				App.Events.addParagraph(node, r);
+				r = [];
+				if (result === 3) {
+					r.push(`Damage to the city was <span class="red">limited,</span> it won't take much to rebuild. Very few citizens or slaves were involved in the fight and even fewer met their end, safeguarding the prosperity of the arcology.`);
+				} else {
+					r.push(`Damage to the infrastructure was <span class="yellow">virtually non-existent,</span> costing only pocket cash to bring the structure back to normal. The inhabitants as well reported little to no injuries, because of this the prosperity of the arcology did not suffer.`);
+				}
+				r.push(`${IncreasePCSkills('engineering', 0.1)}`);
+				cashX(forceNeg((result === 3 ? 1000 : 2000) * majorBattleMod), "war");
+				if (result === 3) {
+					if (V.SecExp.battles.victoryStreak >= 3) {
+						r.push(`It seems your victories over the constant threats directed your way is having <span class="green">a positive effect on the prosperity of the arcology,</span> due to the security your leadership affords.`);
+						V.arcologies[0].prosperity += 5 * majorBattleMod;
+					}
+				} else {
+					V.lowerClass -= random(10) * majorBattleMod;
+					App.SecExp.slavesDamaged(random(20) * majorBattleMod);
+				}
+				App.Events.addParagraph(node, r);
+				r = [];
+			}
+		} else if (result === -3 || result === -2) {
+			r.push(` Thanks to your defeat, your `, App.UI.DOM.makeElement("span", `reputation`, "red"), ` and `, App.UI.DOM.makeElement("span", `authority`, "red"), ` decreased.`);
+			if (inRebellion) {
+				if (slaveRebellion) {
+					App.UI.DOM.appendNewElement("div", node, `After the battle most of the rebelling slaves managed to escape, while others remained in the arcology for days looting and hunting their former masters. The arcology will bear the scars of this day for a long time.`);
+					V.lowerClass -= (result === -3 ? random(50, 100) : random(40, 80));
+					lostSlaves = Math.trunc((V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.8);
+					App.SecExp.slavesDamaged(lostSlaves);
+				} else {
+					App.UI.DOM.appendNewElement("div", node, `After the battle most of the rebelling citizens remained in the arcology for days looting and hunting their former arcology. We will bear the scars of this day for a long time.`);
+					V.lowerClass -= Math.trunc((V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.6);
+				}
+				repX((result === -3 ? random(-800, -1000) : random(-600, -800)), "war");
+				V.SecExp.core.authority -= (result === -3 ? random(800, 1000) : random(600, 800));
+			} else {
+				if (result === -3) {
+					App.UI.DOM.appendNewElement("div", node, " Obviously your troops were not able to capture anyone or anything.");
+
+					r = [];
+					r.push(`In the raiding following the battle <span class="red">the arcology sustained heavy damage,</span> which will cost quite the amount of cash to fix. Reports of <span class="red">citizens or slaves killed or missing</span> flood your office for a few days following the defeat.`);
+					if (V.SecExp.battles.lossStreak >= 3) {
+						r.push(`This only confirms the fears of many, <span class="red">your arcology is not safe</span> and it is clear their business will be better somewhere else.`);
+						V.arcologies[0].prosperity -= 5 * majorBattleMod;
+					}
+				} else {
+					r.push(`It was a close defeat, but nonetheless your <span class="red">reputation</span> and <span class="red">authority</span> slightly decreased.`);
+					r.push("Your troops were not able to capture anyone or anything.");
+					r = [];
+					r.push(`The enemy did not have the strength to raid the arcology for long, still <span class="red">the arcology sustained some damage,</span> which will cost a moderate amount of cash to fix. Some citizens and slaves found themselves on the wrong end of a gun and met their demise.`);
+					r.push(`Some business sustained heavy damage, slightly impacting the arcology's prosperity.`);
+				}
+				r.push(`${IncreasePCSkills('engineering', 0.1)}`);
+				App.Events.addParagraph(node, r);
+				r = [];
+				if (V.SecExp.war.attacker.type === "raiders") {
+					repX(forceNeg((result === -3 ? 400 : 40) * majorBattleMod), "war");
+					V.SecExp.core.authority -= (result === -3 ? 400 : 40) * majorBattleMod;
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					repX(forceNeg((result === -3 ? 600 : 60) * majorBattleMod), "war");
+					V.SecExp.core.authority -= (result === -3 ? 600 : 60) * majorBattleMod;
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					repX(forceNeg((result === -3 ? 750 : 75) * majorBattleMod), "war");
+					V.SecExp.core.authority -= (result === -3 ? 750 : 75) * majorBattleMod;
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					repX(forceNeg((result === -3 ? 800 : 80) * majorBattleMod), "war");
+					V.SecExp.core.authority -= (result === -3 ? 800 : 80) * majorBattleMod;
+				}
+				
+				cashX(forceNeg((result === -3 ? 5000 : 3000) * majorBattleMod), "war");
+				if (V.week <= 30) {
+					V.lowerClass -= random(result === -3 ? 100 : 50) * majorBattleMod;
+					App.SecExp.slavesDamaged(random(result === -3 ? 150 : 75) * majorBattleMod);
+					V.arcologies[0].prosperity -= random(result === -3 ? 5 : 2) * majorBattleMod;
+				} else if (V.week <= 60) {
+					V.lowerClass -= random(result === -3 ? 120 : 60) * majorBattleMod;
+					App.SecExp.slavesDamaged(random(result === -3 ? 170 : 85) * majorBattleMod);
+					V.arcologies[0].prosperity -= random(result === -3 ? 10 : 5) * majorBattleMod;
+				} else if (V.week <= 90) {
+					V.lowerClass -= random(result === -3 ? 140 : 70) * majorBattleMod;
+					App.SecExp.slavesDamaged(random(result === -3 ? 190 : 95) * majorBattleMod);
+					V.arcologies[0].prosperity -= random(result === -3 ? 15 : 7) * majorBattleMod;
+				} else if (V.week <= 120) {
+					V.lowerClass -= random(result === -3 ? 160 : 80) * majorBattleMod;
+					App.SecExp.slavesDamaged(random(result === -3 ? 210 : 105) * majorBattleMod);
+					V.arcologies[0].prosperity -= random(result === -3 ? 20 : 10) * majorBattleMod;
+				} else {
+					V.lowerClass -= random(result === -3 ? 180 : 90) * majorBattleMod;
+					App.SecExp.slavesDamaged(random(result === -3 ? 230 : 115) * majorBattleMod);
+					V.arcologies[0].prosperity -= random(result === -3 ? 25 : 12) * majorBattleMod;
+				}
+			}
+		}
+
+		if (inRebellion) {
+			V.SecExp.core.authority = Math.clamp(V.SecExp.core.authority, 0, 20000);
+			if (V.SecExp.war.engageRule === 0) {
+				r.push(`Since you ordered your troops to limit their weaponry to low caliber or nonlethal, the arcology reported only`);
+				r.push(`<span class="red">minor damage.</span>`);
+				r.push(`Most citizens and non involved slaves remained unharmed, though some casualties between the civilians were inevitable.`);
+				r.push(`A few businesses were looted and burned, but the damage was pretty limited.`);
+				r.push(setRepairTime("arc", 3, 1500));
+				if (V.week <= 30) {
+					arcologyEffects(40, 65, 2);
+				} else if (V.week <= 60) {
+					arcologyEffects(50, 75, 5);
+				} else if (V.week <= 90) {
+					arcologyEffects(60, 85, 7);
+				} else if (V.week <= 120) {
+					arcologyEffects(70, 95, 10);
+				} else {
+					arcologyEffects(80, 105, 12);
+				}
+			} else if (V.SecExp.war.engageRule === 1) {
+				r.push(`You ordered your troops to limit their weaponry to non-heavy, non-explosive, because of this the arcology reported`);
+				r.push(`<span class="red">moderate damage.</span>`);
+				r.push(`Most citizens and non involved slaves remained unharmed or only lightly wounded, but many others did not make it. Unfortunately casualties between the civilians were inevitable.`);
+				r.push(`A few businesses were looted and burned, but the damage was pretty limited.`);
+				r.push(setRepairTime("arc", 5, 2000));
+				if (V.week <= 30) {
+					arcologyEffects(60, 85, 4);
+				} else if (V.week <= 60) {
+					arcologyEffects(70, 95, 7);
+				} else if (V.week <= 90) {
+					arcologyEffects(80, 105, 9);
+				} else if (V.week <= 120) {
+					arcologyEffects(90, 115, 12);
+				} else {
+					arcologyEffects(100, 125, 14);
+				}
+			} else if (V.SecExp.war.engageRule === 2) {
+				r.push(`Since you did not apply any restriction on the weapons your forces should use, the arcology reported`);
+				r.push(`<span class="red">heavy damage.</span>`);
+				r.push(`Many citizens and uninvolved slaves are reported killed or missing. Casualties between the civilians were inevitable.`);
+				r.push(`Many businesses were damaged during the battle either by the fight itself, by fires which spread unchecked for hours or by looters.`);
+				r.push(setRepairTime("arc", 7, 3000));
+				if (V.week <= 30) {
+					arcologyEffects(100, 150, 5);
+				} else if (V.week <= 60) {
+					arcologyEffects(120, 170, 10);
+				} else if (V.week <= 90) {
+					arcologyEffects(140, 190, 15);
+				} else if (V.week <= 120) {
+					arcologyEffects(160, 210, 20);
+				} else {
+					arcologyEffects(180, 230, 25);
+				}
+			} else {
+				r.push(`Thanks to the advance riot control weaponry developed by your experts, the rebels were mostly subdued or killed with`);
+				r.push(`<span class="yellow">little to no collateral damage to the arcology</span> and its inhabitants.`);
+				r.push(`A few businesses were looted, but the damage was very limited.`);
+				r.push(setRepairTime("arc", 2, 1000));
+				if (V.week <= 30) {
+					arcologyEffects(20, 45, 2);
+				} else if (V.week <= 60) {
+					arcologyEffects(30, 55, 4);
+				} else if (V.week <= 90) {
+					arcologyEffects(40, 65, 6);
+				} else if (V.week <= 120) {
+					arcologyEffects(50, 75, 8);
+				} else {
+					arcologyEffects(60, 85, 10);
+				}
+			}
+			App.Events.addParagraph(node, r);
+			r = [];
+
+			if (!V.SecExp.war.reactorDefense) {
+				if (random(1, 100) <= (75 - ((V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.reactor : 0) * 25))) {
+					r.push(`Unfortunately during the fighting a group of slaves infiltrated the reactor complex and sabotaged it, causing massive power fluctuations and blackouts.`);
+					r.push(`<span class="red">time and money to repair the damage.</span>`);
+					r.push(setRepairTime("reactor", (V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.reactor : 0)));
+				} else {
+					r.push(`While the reactor was left defenseless without a garrison, there was no attempt at sabotage. Let's hope we'll always be this lucky.`);
+				}
+			} else {
+				r.push(`The garrison assigned to the reactor protected it from the multiple sabotage attempts carried out by the rebels.`);
+			}
+			App.UI.DOM.appendNewElement("div", node, r.join(" "));
+			r = [];
+
+			if (!V.SecExp.war.waterwayDefense) {
+				if (random(1, 100) <= (75 - ((V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.waterway : 0) * 25))) {
+					r.push(`Unfortunately during the fighting a group of slaves infiltrated the water management complex and sabotaged it, causing huge water leaks throughout the arcology and severely limiting the water supply.`);
+					r.push(`<span class="red">time and money to repair the damage.</span>`);
+					r.push(setRepairTime("waterway", (V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.waterway : 0)));
+				} else {
+					r.push(`While the water management complex was left defenseless without a garrison, there was no attempt at sabotage. Let's hope we'll always be this lucky.`);
+				}
+			} else {
+				r.push(`The garrison assigned to the water management complex protected it from the sabotage attempt of the rebels.`);
+			}
+			App.UI.DOM.appendNewElement("div", node, r.join(" "));
+			r = [];
+
+			if (!V.SecExp.war.assistantDefense) {
+				if (random(1, 100) <= (75 - ((V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.assistant : 0) * 25))) {
+					r.push(`Unfortunately during the fighting a group of slaves infiltrated the facility housing ${V.assistant.name}'s mainframe and sabotaged it. Without its AI, the arcology will be next to impossible to manage.`);
+					r.push(`<span class="red">time and money to repair the damage.</span>`);
+					r.push(setRepairTime("assistant", (V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.assistant : 0)));
+				} else {
+					r.push(`While the ${V.assistant.name}'s mainframe was left defenseless without a garrison, there was no attempt at sabotage. Let's hope we'll always be this lucky.`);
+				}
+			} else {
+				r.push(`The garrison assigned to the facility housing ${V.assistant.name}'s mainframe prevented any sabotage attempt.`);
+			}
+			App.UI.DOM.appendNewElement("div", node, r.join(" "));
+			r = [];
+
+			if (V.SecExp.war.penthouseDefense && V.BodyguardID !== 0) {
+				r.push(`The garrison assigned to the penthouse together with your loyal Bodyguard stopped all assaults against your penthouse with ease.`);
+			} else {
+				if (random(1, 100) <= 75) {
+					r.push(`During the fighting a group of slaves assaulted the penthouse.`);
+					if (S.Bodyguard) {
+						r.push(`Your Bodyguard, ${S.Bodyguard.slaveName}, stood strong against the furious attack.`);
+					} else if (V.SecExp.war.penthouseDefense) {
+						r.push(`The garrison stood strong against the furious attack.`);
+					} else {
+						r.push(`Isolated and alone, you stood strong against the furious attack.`);
+					}
+					["PC", "Concubine", "Bodyguard"].forEach(c => r.push(checkWoundStatus(c)));
+					r.push(`<span class="red">The damage to the structure will be</span> costly to repair.`);
+					r.push(IncreasePCSkills('engineering', 0.1));
+					cashX(-2000, "war");
+				} else {
+					if (!V.SecExp.war.penthouseDefense) {
+						r.push(`While the penthouse was left without a sizable garrison, there was no dangerous assault against it. Let's hope we'll always be this lucky.`);
+					} else {
+						r.push(`There was no sizable assault against the penthouse. Let's hope we'll always be this lucky.`);
+					}
+				}
+			}
+			App.UI.DOM.appendNewElement("div", node, r.join(" "));
+			r = [];
+		}
+		V.lowerClass = Math.max(V.lowerClass, 0);
+		V.NPCSlaves = Math.max(V.NPCSlaves, 0);
+
+		if (inBattle) { // tactics
+			App.Events.addParagraph(node, App.SecExp.commanderEffectiveness("report"));
+			r = [];
+
+			r.push(`${V.SecExp.war.commander === "PC" ? 'You' : 'Your commander'}`);
+			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+				r.push(`chose to employ "bait and bleed" tactics or relying on quick attacks and harassment to tire and wound the enemy until their surrender.`);
+			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+				r.push(`chose to employ "guerrilla" tactics or relying on stealth, terrain knowledge and subterfuge to undermine and ultimately destroy the enemy.`);
+			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+				r.push(`chose to employ "choke points" tactics or the extensive use of fortified or highly defensive positions to slow down and eventually stop the enemy.`);
+			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+				r.push(`chose to employ "interior lines" tactics or exploiting the defender's shorter front to quickly disengage and concentrate troops when and where needed.`);
+			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+				r.push(`chose to employ "pincer maneuver" tactics or attempting to encircle the enemy by faking a collapsing center front.`);
+			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+				r.push(`chose to employ "defense in depth" tactics or relying on mobility to disengage and exploit overextended enemy troops by attacking their freshly exposed flanks.`);
+			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+				r.push(`chose to employ "blitzkrieg" tactics or shattering the enemy's front-line with a violent, concentrated armored assault.`);
+			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+				r.push(`chose to employ "human wave" tactics or overwhelming the enemy's army with a massive infantry assault.`);
+			}
+			if (V.SecExp.war.terrain === "urban") {
+				if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+					r.push(`The urban terrain synergized well with bait and bleed tactics, slowly chipping away at the enemy's forces from the safety of the narrow streets and empty buildings.`);
+				} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+					r.push(`The urban terrain synergized well with guerrilla tactics, eroding your enemy's determination from the safety of the narrow streets and empty buildings.`);
+				} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+					r.push(`The urban environment offers many opportunities to hunker down and stop the momentum of the enemy's assault while keeping your soldiers in relative safety.`);
+				} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+					r.push(`While the urban environment offers many highly defensive position, it does restrict movement and with it the advantages of exploiting interior lines.`);
+				} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+					r.push(`The urban terrain does not allow for wide maneuvers, the attempts of your forces to encircle the attackers are mostly unsuccessful.`);
+				} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+					r.push(`While the urban environment offers many defensive positions, it limits mobility, limiting the advantages of using a defense in depth tactic.`);
+				} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+					r.push(`The urban terrain is difficult to traverse, making your troops attempt at a lightning strike unsuccessful.`);
+				} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+					r.push(`The urban terrain offers great advantages to the defender, your men find themselves in great disadvantage while mass assaulting the enemy's position.`);
+				}
+			} else if (V.SecExp.war.terrain === "rural") {
+				if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+					r.push(`The open terrain of rural lands does not lend itself well to bait and bleed tactics, making it harder for your men to achieve tactical superiority.`);
+				} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+					r.push(`The open terrain of rural lands does not offer many hiding spots, making it harder for your men to perform guerrilla actions effectively.`);
+				} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+					r.push(`The open terrain of rural lands does not offer many natural choke points, making it hard for your troops to funnel the enemy towards highly defended positions.`);
+				} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+					r.push(`The open terrain allows your men to easily exploit the superior mobility of the defender, making excellent use of interior lines to strike where it hurts.`);
+				} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+					r.push(`The open terrain affords your men great mobility, allowing them to easily position themselves for envelopment.`);
+				} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+					r.push(`The open terrain affords your men great mobility, allowing them to exploit overextended assaults and concentrate where and when it matters.`);
+				} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+					r.push(`The open terrain affords your men great mobility, making it easier to accomplish concentrated lightning strikes.`);
+				} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+					r.push(`The open terrain affords your men great mobility, making it easier to overwhelm the enemy with mass assaults.`);
+				}
+			} else if (V.SecExp.war.terrain === "hills") {
+				if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+					r.push(`While the hills offer some protection, they also make it harder to maneuver; bait and bleed tactics will not be 100% effective here.`);
+				} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+					r.push(`The hills offer protection to both your troops and your enemy's, making it harder for your men to accomplish guerrilla attacks effectively.`);
+				} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+					r.push(`While not as defensible as mountains, hills offer numerous opportunities to funnel the enemy towards highly defensible choke points.`);
+				} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+					r.push(`The limited mobility on hills hampers the capability of your troops to exploit the defender's greater mobility afforded by interior lines.`);
+				} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+					r.push(`Limited mobility due to the hills is a double edged sword, affording your men a decent shot at encirclement.`);
+				} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+					r.push(`The limited mobility on hills hampers the capability of your troops to use elastic defense tactics.`);
+				} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+					r.push(`The limited mobility on hills hampers the capability of your troops to organize lightning strikes.`);
+				} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+					r.push(`The defensibility of hills makes it harder to accomplish victory through mass assaults.`);
+				}
+			} else if (V.SecExp.war.terrain === "coast") {
+				if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+					r.push(`On the coast there's little space and protection to effectively employ bait and bleed tactics.`);
+				} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+					r.push(`On the coast there's little space and protection to effectively employ guerrilla tactics.`);
+				} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+					r.push(`Amphibious attacks are difficult in the best of situations; the defender has a very easy time funneling the enemy towards their key defensive positions.`);
+				} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+					r.push(`While in an amphibious landing mobility is not the defender's best weapon, exploiting interior lines still affords your troops some advantages.`);
+				} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+					r.push(`Attempting to encircle a landing party is not the best course of action, but not the worst either.`);
+				} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+					r.push(`In an amphibious assault it's very easy for the enemy to overextend, making defense in depth tactics quite effective.`);
+				} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+					r.push(`The rough, restricted terrain does not lend itself well to lightning strikes, but the precarious position of the enemy still gives your mobile troops tactical superiority.`);
+				} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+					r.push(`The rough, restricted terrain does not lend itself well to mass assaults, but the precarious position of the enemy still gives your troops tactical superiority.`);
+				}
+			} else if (V.SecExp.war.terrain === "outskirts") {
+				if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+					r.push(`Fighting just beneath the walls of the arcology does not allow for the dynamic redeployment of troops bait and bleed tactics would require.`);
+				} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+					r.push(`Fighting just beneath the walls of the arcology does not allow for the dynamic redeployment of troops guerrilla tactics would require.`);
+				} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+					r.push(`The imposing structure of the arcology itself provides plenty of opportunities to create fortified choke points from which to shatter the enemy assault.`);
+				} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+					r.push(`While the presence of the arcology near the battlefield is an advantage, it does limit maneuverability, lowering overall effectiveness of interior lines tactics.`);
+				} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+					r.push(`While the presence of the arcology near the battlefield is an advantage, it does limit maneuverability, lowering the chances of making an effective encirclement.`);
+				} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+					r.push(`Having the arcology near the battlefield means there are limited available maneuvers to your troops, who still needs to defend the structure, making defense in depth tactics not as effective.`);
+				} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+					r.push(`While an assault may save the arcology from getting involved at all, having the imposing structure so near does limit maneuverability and so the impetus of the lightning strike.`);
+				} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+					r.push(`While an attack may save the arcology from getting involved at all, having the imposing structure so near does limit maneuverability and so the impetus of the mass assault.`);
+				}
+			} else if (V.SecExp.war.terrain === "mountains") {
+				if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+					r.push(`While the mountains offer great protection, they also limit maneuverability; bait and bleed tactics will not be quite as effective here.`);
+				} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+					r.push(`The mountains offer many excellent hiding spots and defensive positions, making guerrilla tactics very effective.`);
+				} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+					r.push(`The mountains offer plenty of opportunity to build strong defensive positions from which to shatter the enemy's assault.`);
+				} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+					r.push(`While the rough terrain complicates maneuvers, the defensive advantages offered by the mountains offsets its negative impact.`);
+				} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+					r.push(`The rough terrain complicates maneuvers; your men have a really hard time pulling off an effective encirclement in this environment.`);
+				} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+					r.push(`While mobility is limited, defensive positions are plentiful; your men are not able to fully exploit overextended assaults, but are able to better resist them.`);
+				} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+					r.push(`The rough terrain complicates maneuvers; your men have a really hard time pulling off an effective lightning strike in this environment.`);
+				} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+					r.push(`The rough terrain complicates maneuvers; your men have a really hard time pulling off an effective mass assault in this environment.`);
+				}
+			} else if (V.SecExp.war.terrain === "wasteland") {
+				if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+					r.push(`While the wastelands are mostly open terrain, there are enough hiding spots to make bait and bleed tactics work well enough.`);
+				} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+					r.push(`While the wastelands are mostly open terrain, there are enough hiding spots to make guerrilla tactics work well enough.`);
+				} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+					r.push(`The wastelands are mostly open terrain; your men have a difficult time setting up effective fortified positions.`);
+				} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+					r.push(`The wastelands, while rough, are mostly open terrain, where your men can exploit to the maximum the superior mobility of the defender.`);
+				} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+					r.push(`The wastelands, while rough, are mostly open terrain; your men can set up an effective encirclement here.`);
+				} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+					r.push(`The wastelands, while rough, are mostly open terrain, allowing your men to liberally maneuver to exploit overextended enemies.`);
+				} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+					r.push(`The wastelands, while rough, are mostly open terrain, where your men are able to mount effective lightning strikes.`);
+				} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+					r.push(`The wastelands, while rough, are mostly open terrain, where your men are able to mount effective mass assaults.`);
+				}
+			} else if (V.SecExp.war.terrain === "international waters") {
+				if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+					r.push(`The open terrain of international waters does not lend itself well to bait and bleed tactics, making it harder for your men to achieve tactical superiority.`);
+				} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+					r.push(`The open terrain of international waters does not offer many hiding spots, making it harder for your men to perform guerrilla actions effectively.`);
+				} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+					r.push(`The open terrain of international waters does not offer many natural choke points, making it hard for your troops to funnel the enemy towards highly defended positions.`);
+				} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+					r.push(`The open terrain allows your men to easily exploit the superior mobility of the defender, making excellent use of interior lines to strike where it hurts.`);
+				} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+					r.push(`The open terrain affords your men great mobility, allowing them to easily position themselves for envelopment.`);
+				} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+					r.push(`The open terrain affords your men great mobility, allowing them to exploit overextended assaults and concentrate where and when it matters.`);
+				} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+					r.push(`The open terrain affords your men great mobility, making it easier to accomplish concentrated lightning strikes.`);
+				} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+					r.push(`The open terrain affords your men great mobility, making it easier to overwhelm the enemy with mass assaults.`);
+				}
+			} else if (V.SecExp.war.terrain === "an underwater cave") {
+				if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+					r.push(`The tight terrain of an underwater cave does not lend itself well to bait and bleed tactics, making it harder for your men to achieve tactical superiority.`);
+				} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+					r.push(`The tight terrain of an underwater cave does offers many hiding spots, making it easier for your men to perform guerrilla actions effectively.`);
+				} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+					r.push(`The tight terrain of an underwater cave offers many natural choke points, making it easy for your troops to funnel the enemy towards highly defended positions.`);
+				} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+					r.push(`The tight terrain makes it hard for your men to easily exploit the superior mobility of the defender.`);
+				} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+					r.push(`The tight terrain hinders the mobility of your army, allowing them to easily position themselves for envelopment.`);
+				} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+					r.push(`The tight terrain hinders the mobility of your army, allowing them to exploit overextended assaults and concentrate where and when it matters.`);
+				} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+					r.push(`The tight terrain hinders the mobility of your army, making it easier to accomplish concentrated lightning strikes.`);
+				} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+					r.push(`The tight terrain hinders the mobility of your army, making it easier to overwhelm the enemy with mass assaults.`);
+				}
+			} else if (V.SecExp.war.terrain === "a sunken ship") {
+				if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+					r.push(`The tight terrain of a sunken ship lends itself well to bait and bleed tactics, making it easier for your men to achieve tactical superiority.`);
+				} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+					r.push(`The tight terrain of a sunken ship offers many hiding spots, making it easy for your men to perform guerrilla actions effectively.`);
+				} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+					r.push(`The tight terrain of a sunken ship offers many natural choke points, making it easy for your troops to funnel the enemy towards highly defended positions.`);
+				} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+					r.push(`The tight terrain does not allow your men to easily exploit the superior mobility of the defender.`);
+				} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+					r.push(`The open terrain hinders the mobility of your army, allowing them to easily position themselves for envelopment.`);
+				} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+					r.push(`The open terrain affords your men great mobility, allowing them to exploit overextended assaults and concentrate where and when it matters.`);
+				} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+					r.push(`The open terrain affords your men great mobility, making it easier to accomplish concentrated lightning strikes.`);
+				} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+					r.push(`The open terrain affords your men great mobility, making it easier to overwhelm the enemy with mass assaults.`);
+				}
+			}
+
+			if (V.SecExp.war.chosenTactic === "Bait and Bleed") {
+				if (V.SecExp.war.attacker.type === "raiders") {
+					r.push(`Since the bands of raiders are used to be on high alert and on the move constantly, bait and bleed tactics are not effective against them.`);
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					r.push(`The modern armies hired by Free Cities are decently mobile, which means quick hit and run attacks will be less successful, but their discipline and confidence still make them quite susceptible to this type of attack.`);
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					r.push(`While old world armies are tough nuts to crack, their predictability makes them the perfect target for hit and run and harassment tactics.`);
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					r.push(`Freedom fighters live every day as chasing and being chased by far superior forces, they are far more experienced than your troops in this type of warfare and much less susceptible to it.`);
+				}
+			} else if (V.SecExp.war.chosenTactic === "Guerrilla") {
+				if (V.SecExp.war.attacker.type === "raiders") {
+					r.push(`Since the bands of raiders are used to be on high alert and on the move constantly, guerrilla tactics are not effective against them.`);
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					r.push(`The modern armies hired by Free Cities are highly mobile, which means quick hit and run attacks will be less successful, but their discipline and confidence still make them quite susceptible to this type of attack.`);
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					r.push(`While old world armies are tough nuts to crack, their predictability makes them the perfect target for hit and run and harassment tactics.`);
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					r.push(`Freedom fighters live every day as chasing and being chased by far superior forces, they are far more experienced than your troops in this type of warfare and much less susceptible to it.`);
+				}
+			} else if (V.SecExp.war.chosenTactic === "Choke Points") {
+				if (V.SecExp.war.attacker.type === "raiders") {
+					r.push(`Raiders lack heavy weaponry or armor, so making use of fortified positions is an excellent way to dissipate the otherwise powerful momentum of their assault.`);
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					r.push(`The high tech equipment Free Cities can afford to give their guns for hire means there's no defensive position strong enough to stop them, still the relatively low numbers means they will have to take a careful approach, slowing them down.`);
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					r.push(`Old world armies have both the manpower and the equipment to conquer any defensive position, making use of strong fortifications will only bring you this far against them.`);
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					r.push(`The lack of specialized weaponry means freedom fighters have a rather hard time overcoming tough defensive positions, unfortunately they have also a lot of experience in avoiding them.`);
+				}
+			} else if (V.SecExp.war.chosenTactic === "Interior Lines") {
+				if (V.SecExp.war.attacker.type === "raiders") {
+					r.push(`The highly mobile horde of raiders will not give much room for your troops to maneuver, lowering their tactical superiority.`);
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					r.push(`While decently mobile, Free Cities forces are not in high enough numbers to risk maintaining prolonged contact, allowing your troops to quickly disengage and redeploy where it hurts.`);
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					r.push(`Old world armies are not famous for the mobility, which makes them highly susceptible to any tactic that exploits maneuverability and speed.`);
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					r.push(`While not the best equipped army, the experience and mobility typical of freedom fighters groups make them tough targets for an army that relies itself on mobility.`);
+				}
+			} else if (V.SecExp.war.chosenTactic === "Pincer Maneuver") {
+				if (V.SecExp.war.attacker.type === "raiders") {
+					r.push(`While numerous, the undisciplined masses of raiders are easy prey for encirclements.`);
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					r.push(`While decently mobile, the low number of Free Cities expedition forces make them good candidates for encirclements.`);
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					r.push(`The discipline and numbers of old world armies make them quite difficult to encircle.`);
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					r.push(`While not particularly mobile, freedom fighters are used to fight against overwhelming odds, diminishing the effectiveness of the encirclement.`);
+				}
+			} else if (V.SecExp.war.chosenTactic === "Defense In Depth") {
+				if (V.SecExp.war.attacker.type === "raiders") {
+					r.push(`While their low discipline makes them prime candidates for an elastic defense type of strategy, their high numbers limit your troops maneuverability.`);
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					r.push(`With their low numbers Free Cities mercenaries are quite susceptible to this type of tactic, despite their mobility.`);
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					r.push(`With their low mobility old world armies are very susceptible to this type of strategy.`);
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					r.push(`Low mobility and not particularly high numbers mean freedom fighters can be defeated by employing elastic defense tactics.`);
+				}
+			} else if (V.SecExp.war.chosenTactic === "Blitzkrieg") {
+				if (V.SecExp.war.attacker.type === "raiders") {
+					r.push(`With their low discipline and lack of heavy equipment, lightning strikes are very effective against raider hordes.`);
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					r.push(`Having good equipment and discipline on their side, Free Cities expeditions are capable of responding to even strong lightning strikes.`);
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					r.push(`While disciplined, old world armies low mobility makes them highly susceptible to lightning strikes.`);
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					r.push(`While not well equipped, freedom fighters have plenty of experience fighting small, mobile attacks, making them difficult to defeat with lightning strikes.`);
+				}
+			} else if (V.SecExp.war.chosenTactic === "Human Wave") {
+				if (V.SecExp.war.attacker.type === "raiders") {
+					r.push(`The hordes of raiders are much more experienced than your soldiers in executing mass assaults and they also have a lot more bodies to throw in the grinder.`);
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					r.push(`The good equipment and mobility of Free Cities mercenaries cannot save them from an organized mass assault.`);
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					r.push(`Unfortunately the discipline and good equipment of old world armies allow them to respond well against a mass assault.`);
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					r.push(`The relative low numbers and not great equipment typical of freedom fighters make them susceptible to being overwhelmed by an organized mass assault.`);
+				}
+			}
+			r.push(`In the end`);
+			if (V.SecExp.war.commander === "PC") {
+				r.push(`you were`);
+			} else {
+				r.push(`your commander was`);
+			}
+			if (V.SecExp.war.tacticsSuccessful) {
+				r.push(`<span class="green">able to successfully employ ${V.SecExp.war.chosenTactic} tactics,</span> greatly enhancing`);
+			} else {
+				r.push(`<span class="red">not able to effectively employ ${V.SecExp.war.chosenTactic} tactics,</span> greatly affecting`);
+			}
+			r.push(`the efficiency of your army.`);
+			App.Events.addParagraph(node, r);
+			r = [];
+		}
+
+		let rand;
+		let count = 0;
+		let averageLosses = 0;
+		let loss = 0;
+		const lossesList = [];
+		if (hasLosses || V.SecExp.war.losses === 0) {
+			if (hasLosses) { // Generates a list of randomized losses, from which each unit picks one at random
+				averageLosses = Math.trunc(V.SecExp.war.losses / App.SecExp.battle.deployedUnits());
+				for (let i = 0; i < App.SecExp.battle.deployedUnits(); i++) {
+					let assignedLosses = Math.trunc(Math.clamp(averageLosses + random(-5, 5), 0, 100));
+					if (assignedLosses > V.SecExp.war.losses) {
+						assignedLosses = V.SecExp.war.losses;
+						V.SecExp.war.losses = 0;
+					} else {
+						V.SecExp.war.losses -= assignedLosses;
+					}
+					lossesList.push(assignedLosses);
+				}
+				if (V.SecExp.war.losses > 0) {
+					lossesList[random(lossesList.length - 1)] += V.SecExp.war.losses;
+				}
+				lossesList.shuffle();
+
+				// Sanity check for losses
+				for (let l of lossesList) {
+					if (!Number.isInteger(l)) {
+						l = 0;
+					}
+					count += l;
+				}
+				if (count < V.SecExp.war.losses) {
+					rand = random(lossesList.length - 1);
+					lossesList[rand] += V.SecExp.war.losses - count;
+				} else if (count > V.SecExp.war.losses) {
+					const diff = count - V.SecExp.war.losses;
+					rand = random(lossesList.length - 1);
+					lossesList[rand] = Math.clamp(lossesList[rand]-diff, 0, 100);
+				}
+			}
+		} else {
+			throw Error(`Losses are ${V.SecExp.war.losses}.`);
+		}
+
+		if (inRebellion && V.SecExp.war.irregulars > 0) {
+			if (hasLosses) {
+				loss = lossesList.pluck();
+				if (loss > V.ACitizens * 0.95) { // This is unlikely to happen, but might as well be safe
+					loss = Math.trunc(V.ACitizens * 0.95);
+				}
+			}
+			App.UI.DOM.appendNewElement("div", node, `The volunteering citizens were quickly organized into an irregular militia unit and deployed in the arcology: ${casualtiesReport('irregulars', loss)}`);
+			if (hasLosses) {
+				if (loss > V.lowerClass * 0.95) { // I suspect only lower class ever get to fight/die, but being safe
+					V.lowerClass = Math.trunc(V.lowerClass * 0.05);
+					loss -= Math.trunc(V.lowerClass * 0.95);
+					if (loss > V.middleClass * 0.95) {
+						V.middleClass = Math.trunc(V.middleClass * 0.05);
+						loss -= Math.trunc(V.middleClass *0.95);
+						if (loss > V.upperClass * 0.95) {
+							V.upperClass = Math.trunc(V.upperClass * 0.05);
+							loss -= Math.trunc(V.upperClass * 0.95);
+							if (loss > V.topClass * 0.95) {
+								V.topClass = Math.trunc(V.topClass * 0.05);
+							} else {
+								V.topClass -= loss;
+							}
+						} else {
+							V.upperClass -= loss;
+						}
+					} else {
+						V.middleClass -= loss;
+					}
+				} else {
+					V.lowerClass -= loss;
+				}
+			}
+		}
+		if (V.SF.Toggle && V.SF.Active >= 1 && (inRebellion || inBattle && V.SecExp.war.deploySF)) {
+			if (hasLosses) {
+				loss = lossesList.pluck();
+				loss = Math.clamp(loss, 0, V.SF.ArmySize);
+				V.SF.ArmySize -= loss;
+			}
+			App.UI.DOM.appendNewElement("div", node, `${capFirstChar(V.SF.Lower)}, ${num(V.SF.ArmySize)} strong, is called to arms: ${casualtiesReport('SF', loss)}`);
+		}
+		for (const type of App.SecExp.unit.list()) {
+			if (App.SecExp.battle.deployedUnits(type) >= 1) {
+				let units;
+				if (type !== 'bots') {
+					units = V.SecExp.units[type].squads;
+				} else {
+					units = [V.SecExp.units.bots];
+				}
+				for (const unit of units) {
+					if (App.SecExp.unit.isDeployed(unit)) {
+						let r = [];
+						if (hasLosses) {
+							loss = lossesList.pluck();
+							loss = Math.clamp(loss, 0, unit.troops);
+						}
+
+						if (inRebellion) {
+							if (type === "bots") {
+								r.push(`Security drones: ${casualtiesReport(type, loss, unit)}`);
+							} else {
+								r.push(`${unit.platoonName} participated in the battle. They remained loyal to you. ${casualtiesReport(type, loss, unit)}`);
+							}
+						} else {
+							r.push(`${type !== "bots" ? `${unit.platoonName}` : "Security drones"}: ${casualtiesReport(type, loss, unit)}`);
+						}
+						if (type !== "bots") {
+							unit.battlesFought++;
+							if (loss > 0) {
+								const med = Math.round(Math.clamp(loss * unit.medics * 0.25, 1, loss));
+								if (unit.medics === 1) {
+									r.push(`Some men were saved by their medics.`);
+								}
+								unit.troops -= Math.trunc(Math.clamp(loss - med, 0, unit.maxTroops));
+								V.SecExp.units[type].dead += Math.trunc(loss - med);
+							}
+							if (unit.training < 100 && random(1, 100) > 60) {
+								r.push(`Experience has increased.`);
+								unit.training += random(5, 15) + (isMajorBattle ? 1 : 0) * random(5, 15);
+							}
+						} else if (type === "bots" && loss > 0) {
+							unit.troops -= loss;
+						}
+						App.Events.addNode(node, r, "div");
+					}
+				}
+			}
+		}
+
+		if (inRebellion) {
+			for (const unit of App.SecExp.unit.list().slice(1)) {
+				App.UI.DOM.appendNewElement("p", node, rebellingUnitsFate(unit, averageLosses));
+			}
+		} else {
+			if (
+				V.SF.Toggle && V.SF.Active >= 1 &&
+				(V.SF.Squad.Firebase >= 7 || V.SF.Squad.GunS >= 1 || V.SF.Squad.Satellite >= 5 || V.SF.Squad.GiantRobot >= 6 || V.SF.Squad.MissileSilo >= 1)
+			) {
+				// SF upgrades effects
+				r = [];
+				if (V.SF.Squad.Firebase >= 7) {
+					r.push(`The artillery pieces installed around ${V.SF.Lower}'s firebase provided vital fire support to the troops in the field.`);
+				}
+				if (V.SF.Squad.GunS >= 1) {
+					r.push(`The gunship gave our troops an undeniable advantage in recon capabilities, air superiority and fire support.`);
+				}
+				if (V.SF.Squad.Satellite >= 5 && V.SF.SatLaunched > 0) {
+					r.push(`The devastating power of ${V.SF.Lower}'s satellite was employed with great efficiency against the enemy.`);
+				}
+				if (V.SF.Squad.GiantRobot >= 6) {
+					r.push(`The giant robot of ${V.SF.Lower} proved to be a great boon to our troops, shielding many from the worst the enemy had to offer.`);
+				}
+				if (V.SF.Squad.MissileSilo >= 1) {
+					r.push(`The missile silo exterminated many enemy soldiers even before the battle would begin.`);
+				}
+			}
+			App.Events.addParagraph(node, r);
+			r = [];
+
+			let menialPrice = Math.trunc((V.slaveCostFactor * 1000) / 100) * 100;
+			menialPrice = Math.clamp(menialPrice, 500, 1500);
+			captives = Math.trunc(captives);
+			if (captives > 0) {
+				let candidates = 0;
+				r.push(`During the battle ${captives} attackers were captured.`);
+				if (random(1, 100) <= 25) {
+					candidates = Math.min(captives, random(1, 3));
+					r.push(`${capFirstChar(num(candidates, true))} of them have the potential to be sex slaves.`);
+				}
+
+				const sell = function() {
+					cashX((menialPrice * captives), "menialTransfer");
+					return `Captives sold`;
+				};
+				const keep = function() {
+					V.menials += (captives - candidates);
+					for (let i = 0; i < candidates; i++) {
+						const generateFemale = random(0, 99) < V.seeDicks;
+						let slave = GenerateNewSlave((generateFemale ? "XY" : "XX"), {minAge: 16, maxAge: 32, disableDisability: 1});
+						slave.weight = (generateFemale ? random(-20, 30) : random(0, 30));
+						slave.muscles = (generateFemale ? random(15, 80) : random(25, 80));
+						slave.waist = (generateFemale ? random(10, 80) : random(-20, 20));
+						slave.skill.combat = 1;
+						slave.origin = `$He is an enslaved ${V.SecExp.war.attacker.type} soldier captured during a battle.`;
+						newSlave(slave); // skip New Slave Intro
+					}
+					return `Captives primarily added as menial slaves.`;
+				};
+
+				App.Events.addResponses(node, [
+					new App.Events.Result(`sell them all immediately`, sell),
+					new App.Events.Result(`keep them as primarily menial slaves`, keep),
+				]);
+			}
+		}
+	} else {
+		if (result === -1) {
+			if (inRebellion) {
+				r.push(`Rather than waste the lives of your men you decided to surrender, hoping the rebels will cause less damage if you indulge them, this is however a big hit to your status.`);
+				r.push(`Your <span class="red">reputation</span> and <span class="red">authority</span> are significantly impacted.`);
+				r.push(`The surrender allows the arcology to survive <span class="yellow">mostly intact</span>`);
+				r.push(`however reports of <span class="red">mass looting and killing of citizens</span> flood your office for a few days.`);
+				App.Events.addParagraph(node, r);
+				r = [];
+
+				if (slaveRebellion) {
+					App.UI.DOM.appendNewElement("div", node, `After the battle most of the rebelling slaves managed to escape, while others remained in the arcology for days looting and hunting their former masters. The arcology will bear the scars of this day for a long time.`);
+				} else {
+					App.UI.DOM.appendNewElement("div", node, `After the battle most of the rebelling citizens remained in the arcology for days looting and hunting their former arcology. We will bear the scars of this day for a long time.`);
+				}
+				cashX(-1000, "war");
+				repX(random(-1000, -1200), "war");
+				V.SecExp.core.authority -= random(1000, 1200);
+				if (V.week <= 30) {
+					arcologyEffects(100, 150, 5);
+				} else if (V.week <= 60) {
+					arcologyEffects(120, 170, 10);
+				} else if (V.week <= 90) {
+					arcologyEffects(140, 190, 15);
+				} else if (V.week <= 120) {
+					arcologyEffects(160, 210, 20);
+				} else {
+					arcologyEffects(180, 230, 25);
+				}
+				V.lowerClass -= random(50, 100);
+				lostSlaves = Math.trunc((V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.8);
+				App.SecExp.slavesDamaged(lostSlaves);
+			} else {
+				r.push(`Rather than waste the lives of your men you decided to surrender, hoping your enemy will cause less damage if you indulge them, this is however a big hit to your status. Your <span class="red">reputation</span> and <span class="red">authority</span> are significantly impacted.`);
+				if (V.SecExp.war.attacker.type === "raiders") {
+					repX(forceNeg(600 * majorBattleMod), "war");
+					V.SecExp.core.authority -= 600 * majorBattleMod;
+				} else if (V.SecExp.war.attacker.type === "free city") {
+					repX(forceNeg(800 * majorBattleMod), "war");
+					V.SecExp.core.authority -= 800 * majorBattleMod;
+				} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+					repX(forceNeg(1000 * majorBattleMod), "war");
+					V.SecExp.core.authority -= 1000 * majorBattleMod;
+				} else if (V.SecExp.war.attacker.type === "old world") {
+					repX(forceNeg(1200 * majorBattleMod), "war");
+					V.SecExp.core.authority -= 1200 * majorBattleMod;
+				}
+				App.Events.addParagraph(node, r);
+				r = [];
+				r.push(`The surrender allows the arcology to survive <span class="red">mostly intact,</span> however reports of <span class="red">mass looting and killing of citizens</span> flood your office for a few days.`);
+				r.push(`${IncreasePCSkills('engineering', 0.1)}`);
+				cashX(forceNeg(1000 * majorBattleMod), "war");
+				if (V.week <= 30) {
+					V.lowerClass -= random(80) * majorBattleMod;
+					App.SecExp.slavesDamaged(random(120) * majorBattleMod);
+					V.arcologies[0].prosperity -= random(5) * majorBattleMod;
+				} else if (V.week <= 60) {
+					V.lowerClass -= random(100) * majorBattleMod;
+					App.SecExp.slavesDamaged(random(140) * majorBattleMod);
+					V.arcologies[0].prosperity -= random(10) * majorBattleMod;
+				} else if (V.week <= 90) {
+					V.lowerClass -= random(120) * majorBattleMod;
+					App.SecExp.slavesDamaged(random(160) * majorBattleMod);
+					V.arcologies[0].prosperity -= random(15) * majorBattleMod;
+				} else if (V.week <= 120) {
+					V.lowerClass -= random(140) * majorBattleMod;
+					App.SecExp.slavesDamaged(random(180) * majorBattleMod);
+					V.arcologies[0].prosperity -= random(20) * majorBattleMod;
+				} else {
+					V.lowerClass -= random(160) * majorBattleMod;
+					App.SecExp.slavesDamaged(random(200) * majorBattleMod);
+					V.arcologies[0].prosperity -= random(25) * majorBattleMod;
+				}
+			}
+		} else if (result === 0) { // Battles only
+			r.push(`Unfortunately your adversary did not accept your money.`);
+			if (V.SecExp.war.attacker.type === "freedom fighters") {
+				r.push(`Their ideological crusade would not allow such thing.`);
+			} else {
+				r.push(`They saw your attempt as nothing more than admission of weakness.`);
+			}
+			r.push(`There was no time to organize a defense and so the enemy walked into the arcology as it was his. Your reputation and authority suffer a hit.`);
+			if (V.SecExp.war.attacker.type === "raiders") {
+				repX(forceNeg(400 * majorBattleMod), "war");
+				V.SecExp.core.authority -= 400 * majorBattleMod;
+			} else if (V.SecExp.war.attacker.type === "free city") {
+				repX(forceNeg(600 * majorBattleMod), "war");
+				V.SecExp.core.authority -= 600 * majorBattleMod;
+			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+				repX(forceNeg(750 * majorBattleMod), "war");
+				V.SecExp.core.authority -= 750 * majorBattleMod;
+			} else if (V.SecExp.war.attacker.type === "old world") {
+				repX(forceNeg(800 * majorBattleMod), "war");
+				V.SecExp.core.authority -= 800 * majorBattleMod;
+			}
+			V.SecExp.core.authority = Math.clamp(V.SecExp.core.authority, 0, 20000);
+			App.Events.addParagraph(node, r);
+			r = [];
+			r.push(`Fortunately the arcology survives <span class="yellow">mostly intact,</span> however reports of <span class="red">mass looting and killing of citizens</span> flood your office for a few days.`);
+			r.push(`${IncreasePCSkills('engineering', 0.1)}`);
+			cashX(-1000, "war");
+			if (V.week <= 30) {
+				V.lowerClass -= random(80) * majorBattleMod;
+				App.SecExp.slavesDamaged(random(120) * majorBattleMod);
+				V.arcologies[0].prosperity -= random(5) * majorBattleMod;
+			} else if (V.week <= 60) {
+				V.lowerClass -= random(100) * majorBattleMod;
+				App.SecExp.slavesDamaged(random(140) * majorBattleMod);
+				V.arcologies[0].prosperity -= random(10) * majorBattleMod;
+			} else if (V.week <= 90) {
+				V.lowerClass -= random(120) * majorBattleMod;
+				App.SecExp.slavesDamaged(random(160) * majorBattleMod);
+				V.arcologies[0].prosperity -= random(15) * majorBattleMod;
+			} else if (V.week <= 120) {
+				V.lowerClass -= random(140) * majorBattleMod;
+				App.SecExp.slavesDamaged(random(180) * majorBattleMod);
+				V.arcologies[0].prosperity -= random(20) * majorBattleMod;
+			} else {
+				V.lowerClass -= random(160) * majorBattleMod;
+				App.SecExp.slavesDamaged(random(200) * majorBattleMod);
+				V.arcologies[0].prosperity -= random(25) * majorBattleMod;
+			}
+		} else if (result === 1) { // Battles only
+			r.push(`The attackers wisely take the money offered them to leave your territory without further issues. The strength of the Free Cities was never in their guns but in their dollars, and today's events are the perfect demonstration of such strength.`);
+			r.push(`Your <span class="green">reputation slightly increases.</span>`);
+			if (V.SecExp.war.attacker.type === "raiders") {
+				repX(500 * majorBattleMod, "war");
+			} else if (V.SecExp.war.attacker.type === "free city") {
+				repX(750 * majorBattleMod, "war");
+			} else if (V.SecExp.war.attacker.type === "freedom fighters") {
+				repX(1000 * majorBattleMod, "war");
+			} else if (V.SecExp.war.attacker.type === "old world") {
+				repX(1250 * majorBattleMod, "war");
+			}
+			cashX(forceNeg(App.SecExp.battle.bribeCost()), "war");
+		}
+	}
+
+	App.Events.addParagraph(node, r);
+	if (inBattle) {
+		V.SecExp.units.bots.isDeployed = 0;
+		App.SecExp.unit.humanSquads().forEach(s => s.isDeployed = 0);
+	} else {
+		V.SecExp.rebellions[V.SecExp.war.type.toLowerCase().replace(' rebellion', '') + 'Progress'] = 0;
+		V.SecExp.rebellions.tension = Math.clamp(V.SecExp.rebellions.tension - random(50, 100), 0, 100);
+		if (slaveRebellion) {
+			V.SecExp.rebellions.citizenProgress = Math.clamp(V.SecExp.rebellions.citizenProgress - random(50, 100), 0, 100);
+		} else {
+			V.SecExp.rebellions.slaveProgress = Math.clamp(V.SecExp.rebellions.slaveProgress - random(50, 100), 0, 100);
+		}
+	}
+	return node;
+};
diff --git a/src/Mods/SecExp/events/rebellionReport.js b/src/Mods/SecExp/events/rebellionReport.js
deleted file mode 100644
index 32d940507ac..00000000000
--- a/src/Mods/SecExp/events/rebellionReport.js
+++ /dev/null
@@ -1,683 +0,0 @@
-App.Events.rebellionReport = function() {
-	V.nextButton = "Continue";
-	V.nextLink = "Scheduled Event";
-	V.encyclopedia = "Battles";
-
-	let lostSlaves;
-	let r = [];
-	const node = new DocumentFragment();
-	const slaveRebellion = V.SecExp.war.type.includes("Slave");
-	const allKilled = V.SecExp.war.attacker.losses === V.SecExp.war.attacker.troops;
-	const result = V.SecExp.war.result;
-
-	/**
-	 * @param {string} [target]
-	 * @param {number} [value]
-	 */
-	const setRepairTime = function(target, value, cost=2000) {
-		V.SecExp.rebellions.repairTime[target] = 3 + random(1) - value;
-		cashX(-cost, "war");
-		return IncreasePCSkills('engineering', 0.1);
-	};
-
-	/**
-	 * @param {string} [type]
-	 * @param {number} [loss]
-	 */
-	const casualtiesReport = function(type, loss, squad=null) {
-		const isSpecial = squad && App.SecExp.unit.list().slice(1).includes(type);
-		let r = [];
-		if (loss <= 0) {
-			r.push(`No`);
-		} else if (loss <= (isSpecial ? (squad.troops * 0.2) : 10)) {
-			r.push(`Light`);
-		} else if (loss <= (isSpecial ? (squad.troops * 0.4) : 30)) {
-			r.push(`Moderate`);
-		} else if (loss <= (isSpecial ? (squad.troops * 0.6) : 60)) {
-			r.push(`Heavy`);
-		} else {
-			r.push(`Catastrophic`);
-		}
-		r.push(`casualties suffered.`);
-		if (App.SecExp.unit.list().includes(type)) {
-			if (squad.troops <= 0) {
-				squad.active = 0;
-				r.push(`Unfortunately the losses they took were simply too great, their effective combatants are in so small number you can no longer call them a deployable unit.`);
-				if (type === "bots") {
-					r.push(`It will take quite the investment to rebuild them.`);
-				} else {
-					r.push(`The remnants will be sent home honored as veterans or reorganized in a new unit.`);
-				}
-			} else if (squad.troops <= 10) {
-				r.push(`The unit has very few operatives left, it risks complete annihilation if deployed again.`);
-			}
-		}
-		return r.join(" ");
-	};
-
-	/**
-	 * @param {number} [lowerClass]
-	 * @param {number} [slaves]
-	 * @param {number} [prosperity]
-	 */
-	const arcologyEffects = function(lowerClass, slaves, prosperity) {
-		V.lowerClass -= random(lowerClass);
-		App.SecExp.slavesDamaged(random(slaves));
-		V.arcologies[0].prosperity -= random(prosperity);
-	};
-
-	/**
-	 * Does the target become wounded?
-	 * @param {string} [target]
-	 * @returns {string}
-	 */
-	const checkWoundStatus = function(target) {
-		let slave;
-		let woundChance = 0;
-		const r = [];
-		if (target === "PC") {
-			if (V.PC.career === "mercenary" || V.PC.career === "gang") {
-				woundChance -= 5;
-			} else if (V.PC.skill.warfare >= 75) {
-				woundChance -= 3;
-			}
-			if (V.personalArms >= 1) {
-				woundChance -= 5;
-			}
-			if (V.PC.physicalAge >= 60) {
-				woundChance += random(1, 5);
-			}
-			if (V.PC.belly > 5000) {
-				woundChance += random(1, 5);
-			}
-			if (V.PC.boobs >= 1000) {
-				woundChance += random(1, 5);
-			}
-			if (V.PC.butt >= 4) {
-				woundChance += random(1, 5);
-			}
-			if (V.PC.preg >= 30) {
-				woundChance += random(1, 5);
-			}
-			if (V.PC.balls >= 20) {
-				woundChance += random(5, 10);
-			}
-			if (V.PC.balls >= 9) {
-				woundChance += random(1, 5);
-			}
-			woundChance *= random(1, 2);
-		} else {
-			if (target === "Concubine") {
-				slave = S.Concubine;
-			} else if (target === "Bodyguard") {
-				slave = S.Bodyguard;
-			}
-
-			if (!slave) {
-				return ``;
-			}
-
-			if (slave.skill.combat === 1) {
-				woundChance -= 2;
-			}
-			woundChance -= 0.25 * (getLimbCount(slave, 105));
-			if (slave.health.condition >= 50) {
-				woundChance -= 1;
-			}
-			if (slave.weight > 130) {
-				woundChance += 1;
-			}
-			if (slave.muscles < -30) {
-				woundChance += 1;
-			}
-			if (getBestVision(slave) === 0) {
-				woundChance += 1;
-			}
-			if (slave.heels === 1) {
-				woundChance += 1;
-			}
-			if (slave.boobs >= 1400) {
-				woundChance += 1;
-			}
-			if (slave.butt >= 6) {
-				woundChance += 1;
-			}
-			if (slave.belly >= 10000) {
-				woundChance += 1;
-			}
-			if (slave.dick >= 8) {
-				woundChance += 1;
-			}
-			if (slave.balls >= 8) {
-				woundChance += 1;
-			}
-			if (slave.intelligence + slave.intelligenceImplant < -95) {
-				woundChance += 1;
-			}
-			woundChance *= random(2, 4);
-		}
-
-		if (random(1, 100) <= woundChance) {
-			if (target === "PC") {
-				healthDamage(V.PC, 60);
-				r.push(`A lucky shot managed to find its way to you, leaving a painful, but thankfully not lethal, wound.`);
-			} else {
-				const woundType = App.SecExp.inflictBattleWound(slave);
-				const {his, him} = getPronouns(slave);
-				if (target === "Concubine") {
-					r.push(`Your Concubine was unfortunately caught in the crossfire.`);
-				} else {
-					r.push(`During one of the assaults your Bodyguard was hit.`);
-				}
-				if (woundType === "voice") {
-					r.push(`A splinter pierced ${his} throat, severing ${his} vocal cords.`);
-				} else if (woundType === "eyes") {
-					r.push(`A splinter hit ${his} face, severely damaging ${his} eyes.`);
-				} else if (woundType === "legs") {
-					r.push(`An explosion near ${him} caused the loss of both of ${his} legs.`);
-				} else if (woundType === "arm") {
-					r.push(`An explosion near ${him} caused the loss of one of ${his} arms.`);
-				} else if (woundType === "flesh") {
-					r.push(`A stray shot severely wounded ${him}.`);
-				}
-			}
-		} else if (target === "PC") {
-			r.push(`Fortunately you managed to avoid injury.`);
-		}
-		return r.join(" ");
-	};
-
-	/**
-	 * @param {FC.SecExp.PlayerHumanUnitType} [unit]
-	 * @param {number} [averageLosses]
-	 */
-	const rebellingUnitsFate = function(unit, averageLosses) {
-		let manpower = 0;
-		const node = new DocumentFragment();
-		const r = [];
-		const rebels = {ID: [], names: []};
-
-		const Dissolve = function() {
-			App.SecExp.unit.unitFree(unit).add(manpower);
-			for (const u of V.SecExp.units[unit].squads.filter(s => s.active === 1)) {
-				u.loyalty = Math.clamp(u.loyalty - random(10, 40), 0, 100);
-			}
-			return `Units dissolved.`;
-		};
-		const Purge = function() {
-			App.SecExp.unit.unitFree(unit).add(manpower * 0.5);
-			return `Dissidents purged and units dissolved.`;
-		};
-		const Execute = function() {
-			for (const u of V.SecExp.units[unit].squads.filter(s => s.active === 1)) {
-				u.loyalty = Math.clamp(u.loyalty + random(10, 40), 0, 100);
-			}
-			return `Units executed. Dissent will not be tolerated.`;
-		};
-
-		App.UI.DOM.appendNewElement("div", node);
-		for (const u of V.SecExp.units[unit].squads.filter(s => s.active === 1)) {
-			if (V.SecExp.war.rebellingID.contains(u.ID)) {
-				rebels.names.push(`${u.platoonName}`);
-				rebels.ID.push(u.ID);
-				manpower += Math.clamp(u.troops - random(averageLosses), 0, u.troops);
-			}
-		}
-
-		if (rebels.ID.length > 0) {
-			V.SecExp.units[unit].squads.deleteWith((u) => rebels.ID.contains(u.ID));
-			V.SecExp.battles.lastSelection.deleteWith((u) => rebels.ID.contains(u.ID));
-			if (unit === "slaves") {
-				r.push(`${toSentence(rebels.names)} decided in their blind arrogance to betray you.`);
-			} else if (unit === "militia") {
-				r.push(`${toSentence(rebels.names)} had the gall to betray you and join your enemies.`);
-			} else if (unit === "mercs") {
-				r.push(`${toSentence(rebels.names)} made the grave mistake of betraying you.`);
-			}
-			if (V.SecExp.war.result < 2) { // rebellion loss
-				r.push(`They participated in the looting following the battle, then vanished in the wastes.`);
-				cashX(forceNeg(1000 * rebels.ID.length), "war");
-			} else { // rebellion win
-				App.Events.addResponses(node, [
-					new App.Events.Result(
-						`Dissolve the units`,
-						Dissolve,
-						`Manpower will be refunded, but will negatively influence the loyalty of the other units`
-					),
-					new App.Events.Result(
-						`Purge the dissidents and dissolve the units`,
-						Purge,
-						`Will not influence the loyalty of the other units, but half the manpower will be refunded.`
-					),
-					new App.Events.Result(
-						`Execute them all`,
-						Execute,
-						`Will positively influence the loyalty of the other units, but manpower will not be refunded.`
-					),
-				]);
-			}
-			App.Events.addNode(node, r, "div");
-		}
-		return node;
-	};
-
-	V.SecExp.war.attacker.losses = Math.trunc(V.SecExp.war.attacker.losses);
-	if (V.SecExp.war.attacker.losses > V.SecExp.war.attacker.troops) {
-		V.SecExp.war.attacker.losses = V.SecExp.war.attacker.troops;
-	}
-	V.SecExp.core.totalKills += V.SecExp.war.attacker.losses;
-	V.SecExp.war.losses = Math.trunc(V.SecExp.war.losses);
-
-	if (result === 3 || result === 2) {
-		App.UI.DOM.appendNewElement("h1", node, `${result === 2 ? 'Partial ' : ''}Victory!`, "strong");
-		V.SecExp.rebellions.victories++;
-	} else if (result === -3 || result === -2) {
-		App.UI.DOM.appendNewElement("h1", node, `${result === -2 ? 'Partial ' : ''}Defeat!`, "strong");
-		V.SecExp.rebellions.losses++;
-	} else if (result === -1) {
-		App.UI.DOM.appendNewElement("h1", node, `We surrendered`, "strong");
-		V.SecExp.rebellions.losses++;
-	}
-	App.UI.DOM.appendNewElement("hr", node);
-
-	r.push(`Today, ${asDateString(V.week, random(0, 7))}, our arcology was inflamed by the fires of rebellion. ${num(Math.trunc(V.SecExp.war.attacker.troops))} rebels from all over the structure dared rise up`);
-	if (slaveRebellion) {
-		r.push(`against their owners and conquer their freedom through blood.`);
-	} else {
-		r.push(`to dethrone their arcology owner.`);
-	}
-	r.push(`Our defense force, ${num(App.SecExp.battle.troopCount())} strong, fought with them street by street`);
-	if (allKilled) {
-		r.push(`completely annihilating their troops, while sustaining`);
-	} else {
-		r.push(`inflicting ${V.SecExp.war.attacker.losses} casualties, while sustaining`);
-	}
-	if (V.SecExp.war.losses > 1) {
-		r.push(`${num(Math.trunc(V.SecExp.war.losses))} casualties`);
-	} else if (V.SecExp.war.losses > 0) {
-		r.push(`a casualty`);
-	} else {
-		r.push(`zero casualties`);
-	}
-	r.push(`${allKilled ? '' : 'themselves'}.`);
-	if (V.SecExp.rebellions.sfArmor) {
-		r.push(`More units were able to survive thanks to wearing ${V.SF.Lower}'s combat armor suits.`);
-	}
-	App.Events.addNode(node, r);
-	r = [];
-
-	App.SecExp.slavesDamaged(V.SecExp.war.attacker.losses);
-	if (result === 3) {
-		if (V.SecExp.war.turns <= 5) {
-			r.push(`The fight was quick and one sided: our men easily stopped the disorganized revolt in a few well aimed assaults.`);
-		} else if (V.SecExp.war.turns <= 7) {
-			r.push(`The fight was hard, but in the end our men stopped the disorganized revolt with several well aimed assaults.`);
-		} else {
-			r.push(`The fight was long and hard, but in the end our men stopped the revolt before it could accumulate momentum.`);
-		}
-	} else if (result === -3) {
-		if (V.SecExp.war.turns <= 5) {
-			r.push(`The fight was quick and one sided: our men were easily crushed by the furious charge of the rebels.`);
-		} else if (V.SecExp.war.turns <= 7) {
-			r.push(`The fight was hard and in the end the rebels proved too much to handle for our men.`);
-		} else {
-			r.push(`The fight was long and hard, but despite their bravery the rebels proved too much for our men.`);
-		}
-	} else if (result === 2) {
-		r.push(`The fight was long and hard, but in the end our men managed to stop the revolt, though not without difficulty.`);
-	} else if (result === -2) {
-		r.push(`The fight was long and hard. In the end, our men had to yield to the rebelling slaves, which were fortunately unable to capitalize on their victory.`);
-	} else if (result === -1) {
-		r.push(`You gave your troops the order to surrender; they obediently stand down.`);
-	}
-	App.Events.addNode(node, r);
-	r = [];
-
-	// Effects
-	if (result === 3 || result === 2) {
-		node.append(` Thanks to your victory, your `, App.UI.DOM.makeElement("span", `reputation`, "green"), ` and `, App.UI.DOM.makeElement("span", `authority`, "darkviolet"), ` increased.`);
-		if (slaveRebellion) {
-			App.UI.DOM.appendNewElement("div", node, `Many of the rebelling slaves were recaptured and punished.`);
-		} else {
-			App.UI.DOM.appendNewElement("div", node, `Many of the rebelling citizens were captured and punished, many others enslaved.`);
-		}
-		App.UI.DOM.appendNewElement("div", node, `The instigators were executed one after another in a public trial that lasted for almost three days.`);
-		if (slaveRebellion) {
-			V.NPCSlaves -= random(10, 30);
-		} else {
-			V.lowerClass -= random(10, 30);
-		}
-		repX((result === 3 ? random(800, 1000) : random(600, 180)), "war");
-		V.SecExp.core.authority += (result === 3 ? random(800, 1000) : random(600, 800));
-	} else if (result === -3 || result === -2) {
-		node.append(` Thanks to your defeat, your `, App.UI.DOM.makeElement("span", `reputation`, "red"), ` and `, App.UI.DOM.makeElement("span", `authority`, "red"), ` increased.`);
-		if (slaveRebellion) {
-			App.UI.DOM.appendNewElement("div", node, `After the battle most of the rebelling slaves managed to escape, while others remained in the arcology for days looting and hunting their former masters. The arcology will bear the scars of this day for a long time.`);
-			V.lowerClass -= (result === -3 ? random(50, 100) : random(40, 80));
-			lostSlaves = Math.trunc((V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.8);
-			App.SecExp.slavesDamaged(lostSlaves);
-		} else {
-			App.UI.DOM.appendNewElement("div", node, `After the battle most of the rebelling citizens remained in the arcology for days looting and hunting their former arcology. We will bear the scars of this day for a long time.`);
-			V.lowerClass -= Math.trunc((V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.6);
-		}
-		repX((result === -3 ? random(-800, -1000) : random(-600, -800)), "war");
-		V.SecExp.core.authority -= (result === -3 ? random(800, 1000) : random(600, 800));
-	} else if (result === -1) {
-		r.push(`Rather than waste the lives of your men you decided to surrender, hoping the rebels will cause less damage if you indulge them, this is however a big hit to your status.`);
-		r.push(`Your <span class="red">reputation</span> and <span class="red">authority</span> are significantly impacted.`);
-		r.push(`The surrender allows the arcology to survive <span class="yellow">mostly intact</span>`);
-		r.push(`however reports of <span class="red">mass looting and killing of citizens</span> flood your office for a few days.`);
-		App.Events.addParagraph(node, r);
-		r = [];
-
-		if (slaveRebellion) {
-			App.UI.DOM.appendNewElement("div", node, `After the battle most of the rebelling slaves managed to escape, while others remained in the arcology for days looting and hunting their former masters. The arcology will bear the scars of this day for a long time.`);
-		} else {
-			App.UI.DOM.appendNewElement("div", node, `After the battle most of the rebelling citizens remained in the arcology for days looting and hunting their former arcology. We will bear the scars of this day for a long time.`);
-		}
-		cashX(-1000, "war");
-		repX(random(-1000, -1200), "war");
-		V.SecExp.core.authority -= random(1000, 1200);
-		if (V.week <= 30) {
-			arcologyEffects(100, 150, 5);
-		} else if (V.week <= 60) {
-			arcologyEffects(120, 170, 10);
-		} else if (V.week <= 90) {
-			arcologyEffects(140, 190, 15);
-		} else if (V.week <= 120) {
-			arcologyEffects(160, 210, 20);
-		} else {
-			arcologyEffects(180, 230, 25);
-		}
-		V.lowerClass -= random(50, 100);
-		lostSlaves = Math.trunc((V.SecExp.war.attacker.troops - V.SecExp.war.attacker.losses) * 0.8);
-		App.SecExp.slavesDamaged(lostSlaves);
-	}
-	V.SecExp.core.authority = Math.clamp(V.SecExp.core.authority, 0, 20000);
-
-	if (result !== -1) {
-		if (V.SecExp.war.engageRule === 0) {
-			r.push(`Since you ordered your troops to limit their weaponry to low caliber or nonlethal, the arcology reported only`);
-			r.push(`<span class="red">minor damage.</span>`);
-			r.push(`Most citizens and non involved slaves remained unharmed, though some casualties between the civilians were inevitable.`);
-			r.push(`A few businesses were looted and burned, but the damage was pretty limited.`);
-			r.push(setRepairTime("arc", 3, 1500));
-			if (V.week <= 30) {
-				arcologyEffects(40, 65, 2);
-			} else if (V.week <= 60) {
-				arcologyEffects(50, 75, 5);
-			} else if (V.week <= 90) {
-				arcologyEffects(60, 85, 7);
-			} else if (V.week <= 120) {
-				arcologyEffects(70, 95, 10);
-			} else {
-				arcologyEffects(80, 105, 12);
-			}
-		} else if (V.SecExp.war.engageRule === 1) {
-			r.push(`You ordered your troops to limit their weaponry to non-heavy, non-explosive, because of this the arcology reported`);
-			r.push(`<span class="red">moderate damage.</span>`);
-			r.push(`Most citizens and non involved slaves remained unharmed or only lightly wounded, but many others did not make it. Unfortunately casualties between the civilians were inevitable.`);
-			r.push(`A few businesses were looted and burned, but the damage was pretty limited.`);
-			r.push(setRepairTime("arc", 5, 2000));
-			if (V.week <= 30) {
-				arcologyEffects(60, 85, 4);
-			} else if (V.week <= 60) {
-				arcologyEffects(70, 95, 7);
-			} else if (V.week <= 90) {
-				arcologyEffects(80, 105, 9);
-			} else if (V.week <= 120) {
-				arcologyEffects(90, 115, 12);
-			} else {
-				arcologyEffects(100, 125, 14);
-			}
-		} else if (V.SecExp.war.engageRule === 2) {
-			r.push(`Since you did not apply any restriction on the weapons your forces should use, the arcology reported`);
-			r.push(`<span class="red">heavy damage.</span>`);
-			r.push(`Many citizens and uninvolved slaves are reported killed or missing. Casualties between the civilians were inevitable.`);
-			r.push(`Many businesses were damaged during the battle either by the fight itself, by fires which spread unchecked for hours or by looters.`);
-			r.push(setRepairTime("arc", 7, 3000));
-			if (V.week <= 30) {
-				arcologyEffects(100, 150, 5);
-			} else if (V.week <= 60) {
-				arcologyEffects(120, 170, 10);
-			} else if (V.week <= 90) {
-				arcologyEffects(140, 190, 15);
-			} else if (V.week <= 120) {
-				arcologyEffects(160, 210, 20);
-			} else {
-				arcologyEffects(180, 230, 25);
-			}
-		} else {
-			r.push(`Thanks to the advance riot control weaponry developed by your experts, the rebels were mostly subdued or killed with`);
-			r.push(`<span class="yellow">little to no collateral damage to the arcology</span> and its inhabitants.`);
-			r.push(`A few businesses were looted, but the damage was very limited.`);
-			r.push(setRepairTime("arc", 2, 1000));
-			if (V.week <= 30) {
-				arcologyEffects(20, 45, 2);
-			} else if (V.week <= 60) {
-				arcologyEffects(30, 55, 4);
-			} else if (V.week <= 90) {
-				arcologyEffects(40, 65, 6);
-			} else if (V.week <= 120) {
-				arcologyEffects(50, 75, 8);
-			} else {
-				arcologyEffects(60, 85, 10);
-			}
-		}
-	}
-	V.lowerClass = Math.max(V.lowerClass, 0);
-	V.NPCSlaves = Math.max(V.NPCSlaves, 0);
-	App.Events.addParagraph(node, r);
-	r = [];
-
-	// Garrisons
-	if (!V.SecExp.war.reactorDefense) {
-		if (random(1, 100) <= (75 - ((V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.reactor : 0) * 25))) {
-			r.push(`Unfortunately during the fighting a group of slaves infiltrated the reactor complex and sabotaged it, causing massive power fluctuations and blackouts.`);
-			r.push(`<span class="red">time and money to repair the damage.</span>`);
-			r.push(setRepairTime("reactor", (V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.reactor : 0)));
-		} else {
-			r.push(`While the reactor was left defenseless without a garrison, there was no attempt at sabotage. Let's hope we'll always be this lucky.`);
-		}
-	} else {
-		r.push(`The garrison assigned to the reactor protected it from the multiple sabotage attempts carried out by the rebels.`);
-	}
-	App.Events.addNode(node, r, "div");
-	r = [];
-
-	if (!V.SecExp.war.waterwayDefense) {
-		if (random(1, 100) <= (75 - ((V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.waterway : 0) * 25))) {
-			r.push(`Unfortunately during the fighting a group of slaves infiltrated the water management complex and sabotaged it, causing huge water leaks throughout the arcology and severely limiting the water supply.`);
-			r.push(`<span class="red">time and money to repair the damage.</span>`);
-			r.push(setRepairTime("waterway", (V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.waterway : 0)));
-		} else {
-			r.push(`While the water management complex was left defenseless without a garrison, there was no attempt at sabotage. Let's hope we'll always be this lucky.`);
-		}
-	} else {
-		r.push(`The garrison assigned to the water management complex protected it from the sabotage attempt of the rebels.`);
-	}
-	App.Events.addNode(node, r, "div");
-	r = [];
-
-	if (!V.SecExp.war.assistantDefense) {
-		if (random(1, 100) <= (75 - ((V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.assistant : 0) * 25))) {
-			r.push(`Unfortunately during the fighting a group of slaves infiltrated the facility housing ${V.assistant.name}'s mainframe and sabotaged it. Without its AI, the arcology will be next to impossible to manage.`);
-			r.push(`<span class="red">time and money to repair the damage.</span>`);
-			r.push(setRepairTime("assistant", (V.SecExp.buildings.riotCenter ? V.SecExp.buildings.riotCenter.fort.assistant : 0)));
-		} else {
-			r.push(`While the ${V.assistant.name}'s mainframe was left defenseless without a garrison, there was no attempt at sabotage. Let's hope we'll always be this lucky.`);
-		}
-	} else {
-		r.push(`The garrison assigned to the facility housing ${V.assistant.name}'s mainframe prevented any sabotage attempt.`);
-	}
-	App.Events.addNode(node, r, "div");
-	r = [];
-
-	if (V.SecExp.war.penthouseDefense && V.BodyguardID !== 0) {
-		r.push(`The garrison assigned to the penthouse together with your loyal Bodyguard stopped all assaults against your penthouse with ease.`);
-	} else {
-		if (random(1, 100) <= 75) {
-			r.push(`During the fighting a group of slaves assaulted the penthouse.`);
-			if (S.Bodyguard) {
-				r.push(`Your Bodyguard, ${S.Bodyguard.slaveName}, stood strong against the furious attack.`);
-			} else if (V.SecExp.war.penthouseDefense) {
-				r.push(`The garrison stood strong against the furious attack.`);
-			} else {
-				r.push(`Isolated and alone, you stood strong against the furious attack.`);
-			}
-			["PC", "Concubine", "Bodyguard"].forEach(c => r.push(checkWoundStatus(c)));
-			r.push(`<span class="red">The damage to the structure will be</span> costly to repair.`);
-			r.push(IncreasePCSkills('engineering', 0.1));
-			cashX(-2000, "war");
-		} else {
-			if (!V.SecExp.war.penthouseDefense) {
-				r.push(`While the penthouse was left without a sizable garrison, there was no dangerous assault against it. Let's hope we'll always be this lucky.`);
-			} else {
-				r.push(`There was no sizable assault against the penthouse. Let's hope we'll always be this lucky.`);
-			}
-		}
-	}
-	App.Events.addNode(node, r);
-
-	App.UI.DOM.appendNewElement("p", node, unitsRebellionReport());
-	V.SecExp.rebellions[V.SecExp.war.type.toLowerCase().replace(' rebellion', '') + 'Progress'] = 0;
-	V.SecExp.rebellions.tension = Math.clamp(V.SecExp.rebellions.tension - random(50, 100), 0, 100);
-	if (slaveRebellion) {
-		V.SecExp.rebellions.citizenProgress = Math.clamp(V.SecExp.rebellions.citizenProgress - random(50, 100), 0, 100);
-	} else {
-		V.SecExp.rebellions.slaveProgress = Math.clamp(V.SecExp.rebellions.slaveProgress - random(50, 100), 0, 100);
-	}
-	return node;
-
-	function unitsRebellionReport() {
-		let rand;
-		let r = [];
-		let count = 0;
-		let averageLosses = 0;
-		let loss = 0;
-		const node = new DocumentFragment();
-		const lossesList = [];
-		const hasLosses = V.SecExp.war.losses > 0;
-
-		if (hasLosses || V.SecExp.war.losses === 0) {
-			if (hasLosses) { // Generates a list of randomized losses, from which each unit picks one at random
-				averageLosses = Math.trunc(V.SecExp.war.losses / App.SecExp.battle.deployedUnits());
-				for (let i = 0; i < App.SecExp.battle.deployedUnits(); i++) {
-					let assignedLosses = Math.trunc(Math.clamp(averageLosses + random(-5, 5), 0, 100));
-					if (assignedLosses > V.SecExp.war.losses) {
-						assignedLosses = V.SecExp.war.losses;
-						V.SecExp.war.losses = 0;
-					} else {
-						V.SecExp.war.losses -= assignedLosses;
-					}
-					lossesList.push(assignedLosses);
-				}
-				if (V.SecExp.war.losses > 0) {
-					lossesList[random(lossesList.length - 1)] += V.SecExp.war.losses;
-				}
-				lossesList.shuffle();
-
-				// Sanity check for losses
-				for (let l of lossesList) {
-					if (!Number.isInteger(l)) {
-						l = 0;
-					}
-					count += l;
-				}
-				if (count < V.SecExp.war.losses) {
-					rand = random(lossesList.length - 1);
-					lossesList[rand] += V.SecExp.war.losses - count;
-				} else if (count > V.SecExp.war.losses) {
-					const diff = count - V.SecExp.war.losses;
-					rand = random(lossesList.length - 1);
-					lossesList[rand] = Math.clamp(lossesList[rand]-diff, 0, 100);
-				}
-			}
-		} else {
-			throw(`Losses are ${V.SecExp.war.losses}.`);
-		}
-
-		if (V.SecExp.war.irregulars > 0) {
-			if (hasLosses) {
-				loss = lossesList.pluck();
-				if (loss > V.ACitizens * 0.95) { // This is unlikely to happen, but might as well be safe
-					loss = Math.trunc(V.ACitizens * 0.95);
-				}
-			}
-			App.UI.DOM.appendNewElement("div", node, `The volunteering citizens were quickly organized into an irregular militia unit and deployed in the arcology: ${casualtiesReport('irregulars', loss)}`);
-			if (hasLosses) {
-				if (loss > V.lowerClass * 0.95) { // I suspect only lower class ever get to fight/die, but being safe
-					V.lowerClass = Math.trunc(V.lowerClass * 0.05);
-					loss -= Math.trunc(V.lowerClass * 0.95);
-					if (loss > V.middleClass * 0.95) {
-						V.middleClass = Math.trunc(V.middleClass * 0.05);
-						loss -= Math.trunc(V.middleClass *0.95);
-						if (loss > V.upperClass * 0.95) {
-							V.upperClass = Math.trunc(V.upperClass * 0.05);
-							loss -= Math.trunc(V.upperClass * 0.95);
-							if (loss > V.topClass * 0.95) {
-								V.topClass = Math.trunc(V.topClass * 0.05);
-							} else {
-								V.topClass -= loss;
-							}
-						} else {
-							V.upperClass -= loss;
-						}
-					} else {
-						V.middleClass -= loss;
-					}
-				} else {
-					V.lowerClass -= loss;
-				}
-			}
-		}
-		if (App.SecExp.battle.deployedUnits('bots')) {
-			if (hasLosses) {
-				loss = lossesList.pluck();
-				loss = Math.clamp(loss, 0, V.SecExp.units.bots.troops);
-				V.SecExp.units.bots.troops -= loss;
-			}
-			App.UI.DOM.appendNewElement("div", node, `Security drones: ${casualtiesReport('bots', loss, V.SecExp.units.bots)} `);
-		}
-		if (V.SF.Toggle && V.SF.Active >= 1) {
-			if (hasLosses) {
-				loss = lossesList.pluck();
-				loss = Math.clamp(loss, 0, V.SF.ArmySize);
-				V.SF.ArmySize -= loss;
-			}
-			App.UI.DOM.appendNewElement("div", node, `${capFirstChar(V.SF.Lower)}, ${num(V.SF.ArmySize)} strong, is called to join the battle: ${casualtiesReport('SF', loss)}`);
-		}
-		for (const u of App.SecExp.unit.list().slice(1)) {
-			if (App.SecExp.battle.deployedUnits(u) >= 1) {
-				let med = 0;
-				for (const s of V.SecExp.units[u].squads.filter(t => App.SecExp.unit.isDeployed(t))) {
-					r = [];
-					s.battlesFought++;
-					if (hasLosses) {
-						loss = lossesList.pluck();
-						loss = Math.clamp(loss, 0, s.troops);
-					}
-					r.push(`${s.platoonName} participated in the battle. They remained loyal to you. ${casualtiesReport(u, loss, s)}`);
-					if (hasLosses) {
-						med = Math.round(Math.clamp(loss * s.medics * 0.25, 1, loss));
-						if (s.medics === 1 && loss > 0) {
-							r.push(`Some men were saved by their medics.`);
-						}
-						s.troops -= Math.trunc(Math.clamp(loss - med, 0, s.maxTroops));
-						V.SecExp.units[u].dead += Math.trunc(loss - med);
-					}
-					if (s.training < 100 && random(1, 100) > 60) {
-						r.push(`Experience has increased.`);
-						s.training += random(5, 15);
-					}
-					App.Events.addNode(node, r, "div");
-				}
-			}
-		}
-
-		for (const unit of App.SecExp.unit.list().slice(1)) {
-			App.UI.DOM.appendNewElement("p", node, rebellingUnitsFate(unit, averageLosses));
-		}
-		return node;
-	}
-};
diff --git a/src/Mods/SecExp/js/edicts.js b/src/Mods/SecExp/js/edicts.js
new file mode 100644
index 00000000000..8bfeee066df
--- /dev/null
+++ b/src/Mods/SecExp/js/edicts.js
@@ -0,0 +1,971 @@
+App.SecExp.edicts = function() {
+	function genMenu(name, detail) {
+		const t = new DocumentFragment();
+		if (detail.implement.find(s => s.conditional) || detail.repeal && detail.repeal.find(s => s.conditional)) {
+			App.UI.DOM.appendNewElement("span", t, `${name}: `, detail.tag || "bold");
+			for (let i = 0; i < detail.implement.length; i++) {
+				let current;
+				if (detail.implement[i].conditional) {
+					current = detail.implement[i];
+				} else if (detail.repeal) {
+					current = detail.repeal[i];
+				}
+				if (current) {
+					if (current.text) {
+						if (detail.implement.filter(s => s.conditional).length > 1) {
+							App.UI.DOM.appendNewElement("div", t);
+						}
+						t.append(`${capFirstChar(current.text)} `);
+					}
+					if (V.SecExp.core.authority >= 1000 && current.set) {
+						t.append(App.UI.DOM.makeElement("span",
+							App.UI.DOM.link(`${detail.implement[i].conditional ? "Implement" : "Repeal"}`,
+								() => {
+									if (detail.implement[i].conditional) {
+										cashX(-5000, "edicts");
+										V.SecExp.core.authority -= 1000;
+									}
+									current.set();
+									App.UI.reload();
+								},
+							)
+							, (detail.implement[i].conditional ? "green" : "yellow")
+						));
+						App.UI.DOM.appendNewElement("div", t);
+						if (detail.implement[i].conditional && detail.implement[i].note) {
+							App.UI.DOM.appendNewElement("div", t, `${detail.implement[i].note}`, ["note", "indent"]);
+						}
+					}
+				}
+			}
+		}
+		return t;
+	}
+
+	function Society() {
+		const weaponsStatus = function() {
+			switch(V.SecExp.edicts.weaponsLaw ) {
+				case 3: return "There are no restrictions on weapons";
+				case 2: return "Non-heavy, non-explosive weapons are legal";
+				case 1: return "Non-automatic, non-high caliber weapons are legal";
+				case 0: return "Residents are unable to buy, sell and keep weapons";
+			}
+		};
+		const data = new Map([
+			["Alternative rent payment", {
+				repeal: [
+					{
+						text: "you are allowing citizens to pay for their rents in menial slaves rather than cash.",
+						conditional: V.SecExp.edicts.alternativeRents === 1,
+						set: function() {
+							V.SecExp.edicts.alternativeRents = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "allow citizens to pay for their rents in menial slaves rather than cash, if so they wish.",
+						conditional: V.SecExp.edicts.alternativeRents === 0,
+						set: function() {
+							V.SecExp.edicts.alternativeRents = 1;
+						},
+						note: "Will decrease rents, but will supply a small amount of menial slaves each week."
+					}
+				]
+			}],
+			["Enslavement rights", {
+				repeal: [
+					{
+						text: "you are the only authority able to declare a person enslaved or not.",
+						conditional: V.SecExp.edicts.enslavementRights === 1,
+						set: function() {
+							V.SecExp.edicts.enslavementRights = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "the arcology owner will be the only authority able to declare a person enslaved or not.",
+						conditional: V.SecExp.edicts.enslavementRights === 0,
+						set: function() {
+							V.SecExp.edicts.enslavementRights = 1;
+						},
+						note: "Will provide cash each week at the cost of a small authority hit. The higher the flux of citizens to slaves the higher the income."
+					}
+				]
+			}],
+			["Private Data marketization", {
+				repeal: [
+					{
+						text: "you are selling private citizens' data to the best bidder.",
+						conditional: V.SecExp.buildings.secHub && V.SecExp.edicts.sellData === 1,
+						set: function() {
+							V.SecExp.edicts.sellData = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "allow the selling of private citizens' data.",
+						conditional: V.SecExp.buildings.secHub && V.SecExp.edicts.sellData === 0 && (Object.values(V.SecExp.buildings.secHub.upgrades.security).reduce((a, b) => a + b) > 0 || Object.values(V.SecExp.buildings.secHub.upgrades.crime).reduce((a, b) => a + b) > 0 || Object.values(V.SecExp.buildings.secHub.upgrades.intel).reduce((a, b) => a + b) > 0),
+						set: function() {
+							V.SecExp.edicts.sellData = 1;
+						},
+						note: "Will generate income dependent on the amount of upgrades installed in the security HQ, but cost a small amount of authority each week."
+					}
+				]
+			}],
+			["Propaganda Campaign Boost", {
+				repeal: [
+					{
+						text: "you are forcing residents to read curated educational material about the arcology.",
+						conditional: V.SecExp.buildings.propHub && V.SecExp.edicts.propCampaignBoost === 1,
+						set: function() {
+							V.SecExp.edicts.propCampaignBoost = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "force residents to read curated educational material about the arcology.",
+						conditional: V.SecExp.buildings.propHub && V.SecExp.edicts.propCampaignBoost === 0,
+						set: function() {
+							V.SecExp.edicts.propCampaignBoost = 1;
+						},
+						note: "Will increase the effectiveness of propaganda campaigns, but will incur upkeep costs."
+					}
+				]
+			}],
+			["Legal aid for new businesses:", {
+				repeal: [
+					{
+						text: "new businesses can rely on your help for legal expenses and issues.",
+						conditional: V.SecExp.buildings.transportHub && V.SecExp.edicts.tradeLegalAid === 1,
+						set: function() {
+							V.SecExp.edicts.tradeLegalAid = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "support new businesses in the arcology by helping them cover legal costs and issues.",
+						conditional: V.SecExp.buildings.transportHub && V.SecExp.edicts.tradeLegalAid === 0,
+						set: function() {
+							V.SecExp.edicts.tradeLegalAid = 1;
+						},
+						note: "Will increase trade, but will incur upkeep costs."
+					}
+				]
+			}],
+			["Trade tariffs", {
+				repeal: [
+					{
+						text: "all goods transitioning in your arcology have to pay a transition fee.",
+						conditional: V.SecExp.buildings.transportHub && V.SecExp.edicts.taxTrade === 1,
+						set: function() {
+							V.SecExp.edicts.taxTrade = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "all goods transitioning in your arcology will have to pay a transition fee.",
+						conditional: V.SecExp.buildings.transportHub && V.SecExp.edicts.taxTrade === 0,
+						set: function() {
+							V.SecExp.edicts.taxTrade = 1;
+						},
+						note: "Will provide income based on trade level, but will negatively affect trade."
+					}
+				]
+			}],
+			["Slave mistreatment watch", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "slaves are able access a special security service in case of mistreatment.",
+						conditional: V.arcologies[0].FSPaternalist !== "unset" && V.SecExp.edicts.slaveWatch === 1,
+						set: function() {
+							V.SecExp.edicts.slaveWatch = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "slaves will be able access a special security service in case of mistreatment.",
+						conditional: V.arcologies[0].FSPaternalist !== "unset" && V.SecExp.edicts.slaveWatch === 0,
+						set: function() {
+							V.SecExp.edicts.slaveWatch = 1;
+						},
+						note: "Will help advance paternalism, but will incur upkeep costs."
+					}
+				]
+			}],
+			["Religious activities subsidy", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "you are providing economic support to religious activities following the official dogma.",
+						conditional: V.arcologies[0].FSChattelReligionist >= 40 && V.SecExp.edicts.subsidyChurch === 1,
+						set: function() {
+							V.SecExp.edicts.subsidyChurch = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "will provide economic support to religious activities following the official dogma.",
+						conditional: V.arcologies[0].FSChattelReligionist >= 40 && V.SecExp.edicts.subsidyChurch === 0,
+						set: function() {
+							V.SecExp.edicts.subsidyChurch = 1;
+						},
+						note: "Will provide authority each week, but will incur upkeep costs."
+					}
+				]
+			}],
+			["Immigration limits", {
+				repeal: [
+					{
+						text: "you put strict limits to the amount of people the arcology can accept each week.",
+						conditional: V.SecExp.edicts.limitImmigration === 1,
+						set: function() {
+							V.SecExp.edicts.limitImmigration = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "institute limits to the amount of people the arcology will accept each week.",
+						conditional: V.SecExp.edicts.limitImmigration === 0,
+						set: function() {
+							V.SecExp.edicts.openBorders = 0;
+							V.SecExp.edicts.limitImmigration = 1;
+						},
+						note: "Will lower the amount of people immigrating into the arcology and enhance security."
+					}
+				]
+			}],
+			["Open borders", {
+				repeal: [
+					{
+						text: "you have lowered considerably the requirements to become citizens.",
+						conditional: V.SecExp.edicts.openBorders === 1,
+						set: function() {
+							V.SecExp.edicts.openBorders = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "considerably lower requirements to become citizens.",
+						conditional: V.SecExp.edicts.openBorders === 0,
+						set: function() {
+							V.SecExp.edicts.openBorders = 1;
+							V.SecExp.edicts.limitImmigration = 0;
+						},
+						note: "Will increase immigration to the arcology, but will increase crime."
+					}
+				]
+			}],
+
+			[`Weapons Law; ${weaponsStatus()}`, {
+				implement: [
+					{
+						text: "set the range of weapons allowed within the arcology to non-heavy, non-explosive.",
+						conditional: V.SecExp.edicts.weaponsLaw === 3,
+						set: function() {
+							V.SecExp.edicts.weaponsLaw = 2;
+						},
+						note: "Will slightly increase prosperity, but will cost a small amount of authority each week and will leave rebellions decently armed."
+					},
+					{
+						text: "allow residents of the arcology to buy, sell and keep weaponry of any kind within the arcology.",
+						conditional: V.SecExp.edicts.weaponsLaw === 2,
+						set: function() {
+							V.SecExp.edicts.weaponsLaw = 3;
+						},
+						note: "Will slightly increase prosperity and provide a small weekly amount of reputation, but rebellions will be very well armed."
+					},
+					{
+						text: "set the range of weapons allowed within the arcology to non-automatic, non-high caliber.",
+						conditional: V.SecExp.edicts.weaponsLaw === 2,
+						set: function() {
+							V.SecExp.edicts.weaponsLaw = 1;
+						},
+						note: "Will cost some authority each week, but rebellions will be poorly armed."
+					},
+					{
+						text: "set the range of weapons allowed within the arcology to non-heavy, non-explosive.",
+						conditional: V.SecExp.edicts.weaponsLaw === 1,
+						set: function() {
+							V.SecExp.edicts.weaponsLaw = 2;
+						},
+						note: "Will slightly increase prosperity, but will cost a small amount of authority each week and will leave rebellions decently armed."
+					},
+					{
+						text: "forbid residents to buy, sell and keep weaponry while within the arcology.",
+						conditional: V.SecExp.edicts.weaponsLaw === 1,
+						set: function() {
+							V.SecExp.edicts.weaponsLaw = 0;
+						},
+						note: "Will cost a moderate amount of authority each week, but rebellions will be very poorly armed."
+					},
+					{
+						text: "set the range of weapons allowed within the arcology to non-automatic, non-high caliber.",
+						conditional: V.SecExp.edicts.weaponsLaw === 0,
+						set: function() {
+							V.SecExp.edicts.weaponsLaw = 1;
+						},
+						note: "Will cost some authority each week, but rebellions will be poorly armed."
+					}
+				]
+			}],
+			["Legionaries traditions", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "you are funding specialized training for your recruits following the Roman tradition of professional armies.",
+						conditional: V.FSAnnounced && V.SecExp.edicts.defense.legionTradition === 1,
+						set: function() {
+							V.SecExp.edicts.defense.legionTradition = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "fund specialized training for your recruits to turn them into the professional of Roman tradition.",
+						conditional: V.FSAnnounced && V.SecExp.edicts.defense.militia >= 1 && V.arcologies[0].FSRomanRevivalist >= 40 && V.SecExp.edicts.defense.legionTradition === 0,
+						set: function() {
+							V.SecExp.edicts.defense.legionTradition = 1;
+						},
+						note: "Will increase defense, morale and hp of militia units, but will incur upkeep costs."
+					}
+				]
+			}],
+			["Neo-Imperial traditions", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: `you are funding specialized training for your recruits to inculcate them into a professional Imperial army, led by highly trained and hand-picked ${V.mercenariesTitle}.`,
+						conditional: V.FSAnnounced && V.SecExp.edicts.defense.imperialTradition === 1,
+						set: function() {
+							V.SecExp.edicts.defense.imperialTradition = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "fund specialized training for your recruits to turn them into a professional Imperial army, led by your handpicked Imperial Knights.",
+						conditional: V.FSAnnounced && V.SecExp.edicts.defense.militia >= 1 && V.arcologies[0].FSNeoImperialist >= 40 && !V.SecExp.edicts.defense.imperialTradition,
+						set: function() {
+							V.SecExp.edicts.defense.imperialTradition = 1;
+						},
+						note: "Will moderately increase defense, hp, and morale of your militia units and increase attack, defense and morale of your mercenaries, but will incur upkeep costs."
+					}
+				]
+			}],
+			["Pharaonic traditions", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "you are funding specialized training for your recruits to turn them into an army worthy of a pharaon.",
+						conditional: V.SecExp.edicts.defense.pharaonTradition === 1,
+						set: function() {
+							V.SecExp.edicts.defense.pharaonTradition = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "fund specialized training for your recruits to turn them into an army worthy of a pharaoh.",
+						conditional: V.FSAnnounced && V.SecExp.edicts.defense.militia >= 1 && V.arcologies[0].FSEgyptianRevivalist >= 40 && V.SecExp.edicts.defense.pharaonTradition === 0,
+						set: function() {
+							V.SecExp.edicts.defense.pharaonTradition = 1;
+						},
+						note: "Will increase attack, defense and morale of militia units, but will incur upkeep costs."
+					}
+				]
+			}],
+			["Eagle warriors traditions", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "you are funding specialized training for your mercenaries following the Aztec tradition of elite warriors.",
+						conditional: V.SecExp.edicts.defense.eagleWarriors === 1,
+						set: function() {
+							V.SecExp.edicts.defense.eagleWarriors = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "fund specialized training for your mercenaries to turn them into the elite units of Aztec tradition.",
+						conditional: V.FSAnnounced && V.mercenaries > 0 && V.arcologies[0].FSAztecRevivalist >= 40 && V.SecExp.edicts.defense.eagleWarriors === 0,
+						set: function() {
+							V.SecExp.edicts.defense.eagleWarriors = 1;
+						},
+						note: "Will give a high increase in attack and morale, but will lower defense of mercenary units and will incur upkeep costs."
+					}
+				]
+			}],
+			["Ronin traditions", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "you are funding specialized training for your mercenaries following the Japanese tradition of elite errant samurai.",
+						conditional: V.SecExp.edicts.defense.ronin === 1,
+						set: function() {
+							V.SecExp.edicts.defense.ronin = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "fund specialized training for your mercenaries to turn them into the errant samurai of Japanese tradition.",
+						conditional: V.FSAnnounced && V.mercenaries > 0 && V.arcologies[0].FSEdoRevivalist >= 40 && V.SecExp.edicts.defense.ronin === 0,
+						set: function() {
+							V.SecExp.edicts.defense.ronin = 1;
+						},
+						note: "Will increase attack, defense and morale of mercenary units, but will incur upkeep costs."
+					}
+				]
+			}],
+			["Mamluks traditions", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "you are funding specialized training for your slaves following the Arabian tradition of mamluks slave soldiers.",
+						conditional: V.SecExp.edicts.defense.mamluks === 1,
+						set: function() {
+							V.SecExp.edicts.defense.mamluks = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "fund specialized training for your slaves to turn them into the mamluks slave soldiers of Arabian tradition.",
+						conditional: V.FSAnnounced && V.arcologies[0].FSArabianRevivalist >= 40 && V.SecExp.edicts.defense.mamluks === 0,
+						set: function() {
+							V.SecExp.edicts.defense.mamluks = 1;
+						},
+						note: "Will increase attack, morale and hp of slave units, but will incur upkeep costs."
+					}
+				]
+			}],
+			["Sun Tzu Teachings", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: `you are funding specialized training for your units and officers to follow the teachings of the "Art of War".`,
+						conditional: V.SecExp.edicts.defense.sunTzu === 1,
+						set: function() {
+							V.SecExp.edicts.defense.sunTzu = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: `fund specialized training for your units and officers to conform your army to the teachings of the "Art of War".`,
+						conditional: V.FSAnnounced && V.arcologies[0].FSChineseRevivalist >= 40 && V.SecExp.edicts.defense.sunTzu === 0,
+						set: function() {
+							V.SecExp.edicts.defense.sunTzu = 1;
+						},
+						note: "Will slightly increase attack, defense and morale of all units, but will incur upkeep costs."
+					}
+				]
+			}],
+		]);
+
+		const c = new DocumentFragment();
+		const r = [];
+		let showFS = 0;
+		for (const [name, detail] of data) {
+			if (["Immigration limits", "Open Borders"].includes(name) && !r.includes(name)) {
+				App.UI.DOM.appendNewElement("h1", c, "Immigration:", "underline");
+				r.push(name);
+			} else if (name === "Weapons Law" && !r.includes(name)) {
+				App.UI.DOM.appendNewElement("h1", c, "Weapons:", "underline");
+				r.push(name);
+			} else if (V.FSAnnounced && ["traditions", "Teachings"].includes(name) && !showFS) {
+				App.UI.DOM.appendNewElement("h1", c, "Future Societies:", "underline");
+				showFS = 1;
+			}
+			App.UI.DOM.appendNewElement("p", c, genMenu(name, detail));
+		}
+		return c;
+	}
+	function Military() {
+		const soliderWages = function() {
+			switch(V.SecExp.edicts.defense.soldierWages) {
+				case 0: return "below market rates";
+				case 1: return "at market rates";
+				case 2: return "above market rates";
+			}
+		};
+		const militiaStatus = function() {
+			switch(V.SecExp.edicts.defense.militia) {
+				case 0: return "Not Founded";
+				case 1: return "Disbanded";
+				case 2: return "Volunteers only";
+				case 3: return "Conscription";
+				case 4: return "Obligatory military service";
+				case 5: return "Militarized Society";
+			}
+		};
+		const sfSupport = function() {
+			const x = [];
+			if (V.SecExp.edicts.SFSupportLevel === 0) {
+				x.push("no support");
+			} else {
+				if (V.SecExp.edicts.SFSupportLevel >= 1) {
+					x.push("provided the security HQ with advanced equipment");
+				}
+				if (V.SecExp.edicts.SFSupportLevel >= 2) {
+					x.push("advanced training for security HQ personnel");
+				}
+				if (V.SecExp.edicts.SFSupportLevel >= 3) {
+					x.push("assigned troops to the security department");
+				}
+				if (V.SecExp.edicts.SFSupportLevel >= 4) {
+					x.push("its full support");
+				}
+				if (V.SecExp.edicts.SFSupportLevel === 5) {
+					x.push("assisted with installing a local version of their custom network");
+				}
+			}
+			return toSentence(x);
+		};
+		const capSF = capFirstChar(V.SF.Lower || "the special force");
+		const data = new Map([
+			[`Wages for soldiers are ${soliderWages()}`, {
+				implement: [
+					{
+						text: "the wages paid to arcology soldiers will be at market rates.",
+						conditional: V.SecExp.edicts.defense.soldierWages === 0,
+						set: function() {
+							V.SecExp.edicts.defense.soldierWages = 1;
+						},
+						note: "Will raise all units upkeep and push loyalty to average levels."
+					},
+					{
+						text: "the wages paid to arcology soldiers will be below market rates.",
+						conditional: V.SecExp.edicts.defense.soldierWages === 1,
+						set: function() {
+							V.SecExp.edicts.defense.soldierWages = 0;
+						},
+						note: "Will lower all units upkeep and push loyalty to low levels."
+					},
+					{
+						text: "the wages paid to arcology soldiers will be above market rates.",
+						conditional: V.SecExp.edicts.defense.soldierWages === 1,
+						set: function() {
+							V.SecExp.edicts.defense.soldierWages = 2;
+						},
+						note: "Will raise all units upkeep and push loyalty to high levels."
+					},
+					{
+						text: "the wages paid to arcology soldiers will be at market rates.",
+						conditional: V.SecExp.edicts.defense.soldierWages === 2,
+						set: function() {
+							V.SecExp.edicts.defense.soldierWages = 1;
+						},
+						note: "Will lower all units upkeep and push loyalty to average levels."
+					}
+				]
+			}],
+			["Slave Officers", {
+				repeal: [
+					{
+						text: "your trusted slaves are allowed to lead the defense forces of the arcology.",
+						conditional: V.SecExp.edicts.defense.slavesOfficers === 1,
+						set: function() {
+							V.SecExp.edicts.defense.slavesOfficers = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "allow your trusted slaves to lead the defense forces of the arcology.",
+						conditional: V.SecExp.edicts.defense.slavesOfficers === 0,
+						set: function() {
+							V.SecExp.edicts.defense.slavesOfficers = 1;
+						},
+						note: "Will allow your bodyguard and Head Girl to lead troops into battle, but will cost a small amount of authority each week."
+					}
+				]
+			}],
+			["Mercenary subsidy", {
+				repeal: [
+					{
+						text: "mercenaries willing to immigrate in your arcology will be offered a discount on rent.",
+						conditional: V.SecExp.edicts.defense.discountMercenaries === 1,
+						set: function() {
+							V.SecExp.edicts.defense.discountMercenaries = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "mercenaries willing to immigrate in your arcology will be offered a discount on rent.",
+						conditional: V.mercenaries > 0 && V.SecExp.edicts.defense.discountMercenaries === 0,
+						set: function() {
+							V.SecExp.edicts.defense.discountMercenaries = 1;
+						},
+						note: "Will slightly lower rent, but will increase the amount of available mercenaries."
+					}
+				]
+			}],
+			[`Militia Status (${militiaStatus()})`, {
+				implement: [
+					{
+						text: `lay the groundwork for the formation of the arcology's citizens' army.`,
+						conditional: V.SecExp.edicts.defense.militia === 0,
+						set: function() {
+							V.SecExp.edicts.defense.militia = 2;
+						},
+						note: "Will allow for the recruitment and training of citizens."
+					},
+					{
+						text: `disband the militia.`,
+						conditional: V.SecExp.edicts.defense.militia > 1,
+						set: function() {
+							V.SecExp.edicts.defense.militia = 1;
+						}
+					},
+					{
+						text: `Reinstate the militia as volunteers only.`,
+						conditional: V.SecExp.edicts.defense.militia === 1,
+						set: function() {
+							V.SecExp.edicts.defense.militia = 2;
+						},
+					},
+					{
+						text: `only volunteers will be accepted in the militia.`,
+						conditional: V.SecExp.edicts.defense.militia > 2,
+						set: function() {
+							V.SecExp.edicts.defense.militia = 2;
+						},
+						note: `Will replenish militia manpower slowly and will cap at ${num(App.SecExp.militiaCap(2)*100)}% of the total citizens population.`
+					},
+					{
+						text: `ensure every citizen is required to train in the militia and serve the arcology if the need arises.`,
+						conditional: V.SecExp.edicts.defense.militia === 2,
+						set: function() {
+							V.SecExp.edicts.defense.militia = 3;
+						},
+						note: `Will replenish militia manpower moderately fast and will cap at ${num(App.SecExp.militiaCap(3)*100)}% of the total citizens population, but has a high authority cost.`
+					},
+					{
+						text: `ensure every citizen is required to register and serve under the militia.`,
+						conditional: V.SecExp.edicts.defense.militia === 3,
+						set: function() {
+							V.SecExp.edicts.defense.militia = 4;
+						},
+						note: `Will quickly replenish militia manpower and will cap at ${num(App.SecExp.militiaCap(4)*100)}% of the total citizens population, but has a very high authority cost.`
+					},
+					{
+						text: `ensure that very adult citizen is required to train and participate in the defense of the arcology.`,
+						conditional: V.SecExp.edicts.defense.militia === 4,
+						set: function() {
+							V.SecExp.edicts.defense.militia = 5;
+						},
+						note: `Will very quickly replenish militia manpower and will cap at ${num(App.SecExp.militiaCap(5)*100)}% of the total citizens population, but has an extremely high authority cost`
+					},
+				]
+			}],
+			["Military exemption", {
+				repeal: [
+					{
+						text: "you allow citizens to avoid military duty by paying a weekly fee.",
+						conditional: V.SecExp.edicts.defense.militaryExemption === 1,
+						set: function() {
+							V.SecExp.edicts.defense.militaryExemption = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "allow citizens to avoid military duty by paying a weekly fee.",
+						conditional: V.SecExp.edicts.defense.militia >= 3 && V.SecExp.edicts.defense.militaryExemption === 1,
+						set: function() {
+							V.SecExp.edicts.defense.militaryExemption = 1;
+						},
+						note: "Will slow down the replenishment of manpower, but will supply cash each week. More profitable with stricter recruitment laws."
+					}
+				]
+			}],
+			["Revised minimum requirements", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "you allow citizens outside the normally accepted range to join the militia.",
+						conditional: V.SecExp.edicts.defense.lowerRequirements === 1,
+						set: function() {
+							V.SecExp.edicts.defense.lowerRequirements = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "will allow citizens outside the normally accepted range to join the militia.",
+						conditional: V.SecExp.edicts.defense.militia >= 3 && V.arcologies[0].FSHedonisticDecadence >= 40 && V.SecExp.edicts.defense.lowerRequirements === 0,
+						set: function() {
+							V.SecExp.edicts.defense.lowerRequirements = 1;
+						},
+						note: "Will slightly lower defense and hp of militia units, but will increase the manpower replenishment rate."
+					}
+				]
+			}],
+			["No subhumans in the militia", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "it is forbidden for subhumans to join the militia.",
+						conditional: V.SecExp.edicts.defense.noSubhumansInArmy === 1,
+						set: function() {
+							V.SecExp.edicts.defense.noSubhumansInArmy = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "prevent subhumans from joining the militia.",
+						conditional: V.SecExp.edicts.defense.militia >= 3 && V.arcologies[0].FSSubjugationist >= 40 && V.SecExp.edicts.defense.noSubhumansInArmy === 0,
+						set: function() {
+							V.SecExp.edicts.defense.noSubhumansInArmy = 1;
+						},
+						note: "Will help advance racial Subjugation, but will slow down slightly manpower replenishment."
+					}
+				]
+			}],
+			["Military exemption for pregnancies", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "pregnant citizens are allowed, and encouraged, to avoid military service.",
+						conditional: V.SecExp.edicts.defense.pregExemption === 1,
+						set: function() {
+							V.SecExp.edicts.defense.pregExemption = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "pregnant citizens will be allowed, and encouraged, to avoid military service.",
+						conditional: V.SecExp.edicts.defense.militia >= 3 && V.arcologies[0].FSRepopulationFocus >= 40 && V.SecExp.edicts.defense.militia >= 3 && V.SecExp.edicts.defense.pregExemption === 0,
+						set: function() {
+							V.SecExp.edicts.defense.pregExemption = 1;
+						},
+						note: "Will help advance repopulation focus, but will slow down slightly manpower replenishment."
+					}
+				]
+			}],
+			["Special militia privileges", {
+				repeal: [
+					{
+						text: "citizens joining the militia are exempt from rent payment.",
+						conditional: V.SecExp.edicts.defense.privilege.militiaSoldier === 1,
+						set: function() {
+							V.SecExp.edicts.defense.privilege.militiaSoldier = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "will allow citizens joining the militia to avoid paying rent.",
+						conditional: V.SecExp.edicts.defense.militia >= 1 && V.SecExp.edicts.defense.privilege.militiaSoldier === 0,
+						set: function() {
+							V.SecExp.edicts.defense.privilege.militiaSoldier = 1;
+						},
+						note: "Will increase the loyalty of militia units, but will decrease rents."
+					}
+				]
+			}],
+			["Special slaves privileges", {
+				repeal: [
+					{
+						text: "slaves into the army are allowed to have material possessions.",
+						conditional: V.SecExp.edicts.defense.privilege.slaveSoldier === 1,
+						set: function() {
+							V.SecExp.edicts.defense.privilege.slaveSoldier = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "will allow slaves drafted into the army to be able to have material possessions.",
+						conditional: V.SecExp.edicts.defense.privilege.slaveSoldier === 0,
+						set: function() {
+							V.SecExp.edicts.defense.privilege.slaveSoldier = 1;
+						},
+						note: "Will increase the loyalty of slave units, but will cost authority each week."
+					}
+				]
+			}],
+			["Special mercenary privileges", {
+				repeal: [
+					{
+						text: "mercenaries under contract can claim part of the loot gained from battles.",
+						conditional: V.SecExp.edicts.defense.privilege.mercSoldier === 1,
+						set: function() {
+							V.SecExp.edicts.defense.privilege.mercSoldier = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "will allow mercenaries under contract to claim part of the loot gained from battles.",
+						conditional: V.mercenaries > 0 && V.SecExp.edicts.defense.privilege.mercSoldier === 0,
+						set: function() {
+							V.SecExp.edicts.defense.privilege.mercSoldier = 1;
+						},
+						note: "Will increase the loyalty of mercenary units, but will reduce cash and menial slaves gained from battles."
+					}
+				]
+			}],
+			["Slave martial schools", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "specialized schools are training slaves in martial arts and bodyguarding.",
+						conditional: V.SecExp.edicts.defense.martialSchool === 1,
+						set: function() {
+							V.SecExp.edicts.defense.martialSchool = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "specialized schools will be set up to train slaves in martial arts and bodyguarding.",
+						conditional: V.arcologies[0].FSPhysicalIdealist >= 40 && V.SecExp.edicts.defense.martialSchool === 0,
+						set: function() {
+							V.SecExp.edicts.defense.martialSchool = 1;
+						},
+						note: "Will slightly increase morale of slave units, but will incur upkeep costs."
+					}
+				]
+			}],
+			["Elite officers", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "officers are exclusively recruited from the elite of society.",
+						conditional: V.SecExp.edicts.defense.eliteOfficers === 1,
+						set: function() {
+							V.SecExp.edicts.defense.eliteOfficers = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "officers will be exclusively recruited from the elite of society.",
+						conditional: V.arcologies[0].FSRestart >= 40 && V.SecExp.edicts.defense.eliteOfficers === 0,
+						set: function() {
+							V.SecExp.edicts.defense.eliteOfficers = 1;
+						},
+						note: "Will help advance eugenics and provide a small morale boost to militia units, but will give a small morale malus to slave units."
+					}
+				]
+			}],
+			["Live targets drills", {
+				tag: ["bold", "lime"],
+				repeal: [
+					{
+						text: "disobedient slaves are used as live targets at shooting ranges.",
+						conditional: V.SecExp.edicts.defense.liveTargets === 1,
+						set: function() {
+							V.SecExp.edicts.defense.liveTargets = 0;
+						},
+					}
+				],
+				implement: [
+					{
+						text: "disobedient slaves will be used as live targets at shooting ranges.",
+						conditional: V.arcologies[0].FSDegradationist >= 40 && V.SecExp.edicts.defense.liveTargets === 0,
+						set: function() {
+							V.SecExp.edicts.defense.liveTargets = 1;
+						},
+						note: "Will help advance degradationism and provide a small amount of exp to units, but will make the slave population slowly decline."
+					}
+				]
+			}],
+			[`SF Assistance; ${sfSupport()}`, {
+				repeal: [
+					{
+						conditional: V.SF.Toggle && V.SF.Active >= 1 && V.SecExp.edicts.SFSupportLevel > 0,
+						set: function() {
+							V.SecExp.edicts.SFSupportLevel--;
+						},
+					}
+				],
+				implement: [
+					{
+						text: `${capSF} will provide the security HQ with advanced equipment.`,
+						conditional: V.SF.Toggle && V.SF.Active >= 1 && V.SecExp.edicts.SFSupportLevel === 0 && App.SecExp.Check.reqMenials() > 5,
+						set: function() {
+							V.SecExp.edicts.SFSupportLevel = 1;
+						},
+						note: "Will lower the amount of personnel necessary to man the security HQ by 5, but will incur upkeep costs."
+					},
+					{
+						text: `${capSF} will provide the security HQ personnel with advanced training.`,
+						conditional: V.SF.Toggle && V.SF.Active >= 1 && V.SecExp.edicts.SFSupportLevel === 1 && V.SF.Squad.Firebase >= 4 && App.SecExp.Check.reqMenials() > 5,
+						set: function() {
+							V.SecExp.edicts.SFSupportLevel = 2;
+						},
+						note: "Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs."
+					},
+					{
+						text: `${capSF} will provide troops to the security department.`,
+						conditional: V.SF.Toggle && V.SF.Active >= 1 && V.SecExp.edicts.SFSupportLevel === 2 && V.SF.Squad.Firebase >= 6 && App.SecExp.Check.reqMenials() > 5,
+						set: function() {
+							V.SecExp.edicts.SFSupportLevel = 3;
+						},
+						note: "Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs."
+					},
+					{
+						text: `${capSF} will give the security department its full support.`,
+						conditional: V.SF.Toggle && V.SF.Active >= 1 && V.SecExp.edicts.SFSupportLevel === 3 && V.SF.Squad.Firebase >= 6 && App.SecExp.Check.reqMenials() > 5,
+						set: function() {
+							V.SecExp.edicts.SFSupportLevel = 4;
+						},
+						note: "Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs."
+					},
+					{
+						text: `${capSF} will assist the security department with installing a local version of their custom network.`,
+						conditional: V.SF.Toggle && V.SF.Active >= 1 && V.SecExp.edicts.SFSupportLevel === 4 && V.SF.Squad.Firebase === 10 && App.SecExp.Check.reqMenials() > 5,
+						set: function() {
+							V.SecExp.edicts.SFSupportLevel = 5;
+						},
+						note: "Will lower the amount of personnel necessary to man the security HQ by a further 5, but will incur additional upkeep costs."
+					},
+				]
+			}],
+		]);
+
+		const c = new DocumentFragment();
+		const r = [];
+		for (const [name, detail] of data) {
+			if (V.SF.Toggle && V.SF.Active >= 1 && name === "SF Assistance" && !r.includes(name)) {
+				App.UI.DOM.appendNewElement("h1", c, "Special Force:", "underline");
+				r.push(name);
+			}
+			App.UI.DOM.appendNewElement("p", c, genMenu(name, detail));
+		}
+		return c;
+	}
+
+	const count = (x) => V.SecExp[x].victories + V.SecExp[x].losses;
+	const node = new DocumentFragment();
+	App.UI.DOM.appendNewElement("div", node, `Passing any edict will cost ${cashFormat(5000)} and some authority. More will become available as the arcology develops.`, "note");
+	const tabBar = new App.UI.Tabs.TabBar("SlaveInteract");
+	tabBar.addTab("Society", "Society", Society());
+	if (count("battles") > 0 || count("rebellions") > 0 || V.mercenaries > 0) {
+		tabBar.addTab("Military", "Military", Military());
+	}
+	V.SecExp.core.authority = Math.clamp(V.SecExp.core.authority, 0, 20000);
+	if (V.SecExp.core.authority < 1000) {
+		App.UI.DOM.appendNewElement("div", node, "Not enough Authority.", ["red", "note"]);
+	}
+	node.append(tabBar.render());
+	return node;
+};
-- 
GitLab