From 82d56eaa0b4345d725f8c49bb9d0fba5505bd1d7 Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Sun, 8 Mar 2020 13:48:07 +0100
Subject: [PATCH] change prosperity cap calculation to make other sectors worth
 more to.

---
 src/js/economyJS.js | 41 ++++++++++++++++++++++++++++++-----------
 1 file changed, 30 insertions(+), 11 deletions(-)

diff --git a/src/js/economyJS.js b/src/js/economyJS.js
index 33dd17c3856..b0b77ec1e62 100644
--- a/src/js/economyJS.js
+++ b/src/js/economyJS.js
@@ -2087,17 +2087,36 @@ window.SectorCounts = function() {
 		}
 	});
 
-	const apartments = V.building.findCells(cell => cell instanceof App.Arcology.Cell.Apartment);
-	apartments.forEach(a => {
-		if (a.type === 2) {
-			V.AProsperityCap += 10;
-		} else if (a.type === 1) {
-			V.AProsperityCap += 15;
-		}
-	});
-
-	const sweatshops = V.building.findCells(cell => cell instanceof App.Arcology.Cell.Manufacturing && cell.type === "Sweatshops");
-	V.Sweatshops = sweatshops.length;
+	// The idea is that cells used for your private benefit contribute less to the economy as they cannot be used by
+	// others to generate revenue and therefore increase total cash flow. Can be offset by more luxury apartments.
+	V.Sweatshops = 0;
+	V.building.findCells(cell => !(cell instanceof App.Arcology.Cell.Penthouse))
+		.forEach(cell => {
+			if (cell instanceof App.Arcology.Cell.Apartment) {
+				if (cell.type === 1) {
+					V.AProsperityCap += 10;
+				} else if (cell.type === 0) {
+					V.AProsperityCap += 5;
+				}
+			} else if (cell instanceof App.Arcology.Cell.Shop) {
+				if (cell.type !== "Diary" && cell.type !== "Brothel") {
+					V.AProsperityCap += 10;
+				}
+			} else if (cell instanceof App.Arcology.Cell.Market) {
+				if (cell.type === "Transport Hub") {
+					V.AProsperityCap += 15;
+				} else if (cell.type !== "Pit" && cell.type !== "Arcade") {
+					V.AProsperityCap += 10;
+				}
+			} else if (cell instanceof App.Arcology.Cell.Manufacturing) {
+				if (cell.type !== "Diary" && cell.type !== "Farmyard" && cell.type !== "Barracks") {
+					V.AProsperityCap += 10;
+					if (cell.type === "Sweatshops") {
+						V.Sweatshops++;
+					}
+				}
+			}
+		});
 
 	V.AProsperityCap += V.AProsperityCapModified;
 };
-- 
GitLab