From 00652321b2d473802bf21f57d0eab93c61b321e3 Mon Sep 17 00:00:00 2001
From: Jones <Jones>
Date: Fri, 7 Dec 2018 17:23:12 +0100
Subject: [PATCH] Tiny bit of messing around

---
 src/js/corporationJS.tw                      | 45 ++++++++++++++++++++
 src/uncategorized/corporationDevelopments.tw | 33 ++++++++++++--
 src/uncategorized/manageCorporation.tw       |  3 ++
 3 files changed, 77 insertions(+), 4 deletions(-)
 create mode 100644 src/js/corporationJS.tw
 create mode 100644 src/uncategorized/manageCorporation.tw

diff --git a/src/js/corporationJS.tw b/src/js/corporationJS.tw
new file mode 100644
index 00000000000..2cc61541eb9
--- /dev/null
+++ b/src/js/corporationJS.tw
@@ -0,0 +1,45 @@
+:: Corporation Management [script]
+
+window.rulesAssistantOptions = (function() {
+	"use strict";
+	let V, current_rule;
+
+	function rulesAssistantOptions(element) {
+		V = State.variables;
+		V.nextButton = "Back to Main";
+		V.nextLink = "Main";
+		V.returnTo = "Main";
+		V.showEncyclopedia = 1;
+		V.encyclopedia = "Personal Assistant";
+		if (V.currentRule !== null) {
+			const idx = V.defaultRules.findIndex(rule => rule.ID === V.currentRule);
+			if (idx === -1)
+				current_rule = V.defaultRules[0];
+			else
+				current_rule = V.defaultRules[idx];
+		}
+		const root = new Root(element);
+	}
+
+	function lowerPriority(root) {
+		if (V.defaultRules.length === 1) return; // nothing to swap with
+		const idx = V.defaultRules.findIndex(rule => rule.ID === current_rule.ID);
+		if (idx === 0) return; // no lower rule
+		arraySwap(V.defaultRules, idx, idx-1);
+		reload(root);
+	}
+
+	function higherPriority(root) {
+		if (V.defaultRules.length === 1) return; // nothing to swap with
+		const idx = V.defaultRules.findIndex(rule => rule.ID === current_rule.ID);
+		if (idx === V.defaultRules.length - 1) return; // no higher rule
+		arraySwap(V.defaultRules, idx, idx+1);
+		reload(root);
+	}
+}
+
+window.divLegalOutput = function(slaves) {
+	let V = State.variables;
+	var divisions = [V.divBreaker, V.divArcade, V.divDairy]
+
+}
diff --git a/src/uncategorized/corporationDevelopments.tw b/src/uncategorized/corporationDevelopments.tw
index 5deab057d2b..6959cd296f0 100644
--- a/src/uncategorized/corporationDevelopments.tw
+++ b/src/uncategorized/corporationDevelopments.tw
@@ -1,10 +1,34 @@
 :: Corporation Developments [nobr]
 
 /*Main Corporation Loop*/
-<<set _corpTurnover = Math.trunc(($corpAssets + random(1,10) * 1000) * $slaveCostFactor * $localEcon * 0.04),
-_corpUpkeep = Math.trunc($corpAssets * $corpSizePenalty),
-$corpDividend += Math.trunc(_corpTurnover * $dividendRatio),
-$corpCash += _corpTurnover * (1 - $dividendRatio) - _corpUpkeep>>
+
+<<if $corpCash < 0>>
+	<<set $corpCash = $corpCash * 1.02>> /*2% weekly interest rate on negative cash*/
+<</if>>
+
+/*Division Operational Results*/
+/*Extralegal Enslavement*/
+<<if $corpDivExtra == 1>>
+	<<set $corpCash -= 9000 * $divExtraDevelopment + 5 * $divExtraDevelopment ^ 2, /*This is the cost of acquiring slaves, the level of development is also the amount of slaves*/
+	_divExtraSlaves = Math.trunc($divExtraDevelopment * (1 + random(-40,40) / 100))>>
+
+	
+
+	<<if _divLegalSlaves > 0>>
+		$corpCash += menialSlaveCost(-_divLegalSlaves) * 11.5>> /*amount of money earned from selling to market*/
+	<</if>>
+
+/*etc*/
+
+/*Aggregate Corporation Results*/
+<<set _corpRevenue = _divLegal + _divExtralegal + _divBreak + _divTrain + _divSurgery + _divArcade + _divDairy + _divMenial + _divEscort,
+_corpOverhead = _someOverheadVariable /*TBD*,
+_corpProfit = _corpRevenue - _corpOverhead,
+$corpDividend += Math.trunc(_corpProfit * $dividendRatio),
+$corpCash += Math.trunc(_corpProfit * (1 - $dividendRatio))>>
+
+
+
 <<if $corpAssets == $corpAssetCap>> /*The corporation is at it's current asset limit and will not invest in assets until it can afford a major investment*/
 	<<if $corpCash >= $corpInvestment>> 
 		<<set $corpCash -= $corpInvestment,
@@ -357,6 +381,7 @@ Granting specialization tokens*/
 
 /*Some anon wanted better control of the sexy bits slaves get to have*/
 /*Sell slaves that are still virgin*/
+/*Choose the height of slaves getting captured*/
 
 </span>
 
diff --git a/src/uncategorized/manageCorporation.tw b/src/uncategorized/manageCorporation.tw
new file mode 100644
index 00000000000..f9a8fdd3c41
--- /dev/null
+++ b/src/uncategorized/manageCorporation.tw
@@ -0,0 +1,3 @@
+:: Manage Corporation
+
+
-- 
GitLab