From 6d73b71a34177f3bb4c07242ce3bb888a29040a3 Mon Sep 17 00:00:00 2001
From: lowercase-donkey <lowercasedonkey@gmail.com>
Date: Fri, 2 Aug 2019 21:47:42 -0400
Subject: [PATCH] Display multiple reasons to  be in spa or clinic

---
 src/js/slaveListing.js | 68 ++++++++++++++++++++++++++++++++----------
 1 file changed, 53 insertions(+), 15 deletions(-)

diff --git a/src/js/slaveListing.js b/src/js/slaveListing.js
index 85381a0bffb..a227afaef65 100644
--- a/src/js/slaveListing.js
+++ b/src/js/slaveListing.js
@@ -196,26 +196,64 @@ App.UI.SlaveList.render = function() {
 			}
 		}
 		if (slave.assignment === "get treatment in the clinic") {
+			let list = [];
+			let i;
 			if (slave.health <= 40) {
-				assignment.innerText += ` for poor health`;
-			} else if ((V.Nurse !== 0) && (slave.chem > 15) && (V.clinicUpgradeFilters === 1)) {
-				assignment.innerText += ` for unhealthy chemicals`;
-			} else if ((V.Nurse !== 0) && (slave.pregKnown === 1) && (V.clinicSpeedGestation >= 0 || slave.pregControl === "speed up")) {
-				assignment.innerText += ` to hurry the pregnancy along safely`;
-			} else if ((V.Nurse !== 0) && (slave.pregAdaptation*1000 < slave.bellyPreg || slave.preg > slave.pregData.normalBirth/1.33)) {
-				assignment.innerText += ` while waiting for the child to be born`;
-			} else if ((V.Nurse !== 0) && (V.clinicInflateBelly > 0) && (slave.bellyImplant >= 0) && (slave.bellyImplant <= (V.arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000))) {
-				assignment.innerText += ` to fill implants`;
+				list.push(`poor health`);
+			}
+			if ((V.Nurse !== 0) && (slave.chem > 15) && (V.clinicUpgradeFilters === 1)) {
+				list.push(`unhealthy chemicals`);
+			}
+			if ((V.Nurse !== 0) && (slave.pregKnown === 1) && (V.clinicSpeedGestation >= 0 || slave.pregControl === "speed up")) {
+				list.push(`safely hurrying pregnancy along`);
+			}
+			if ((V.Nurse !== 0) && (slave.pregAdaptation*1000 < slave.bellyPreg || slave.preg > slave.pregData.normalBirth/1.33)) {
+				list.push(`observation while waiting for the child to be born`);
+			}
+			if ((V.Nurse !== 0) && (V.clinicInflateBelly > 0) && (slave.bellyImplant >= 0) && (slave.bellyImplant <= (V.arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000))) {
+				list.push(`implant filling`);
+			}
+			if (list.length > 0) {
+				assignment.innerText += " for ";
+			} else {
+				assignment.innerText += ", preparing to check out";
+			}
+			for (i = 0; i < list.length; i++) {
+				assignment.innerText += list[i];
+				if (i === (list.length - 2)) {
+					assignment.innerText += " and ";
+				} else if (i < (list.length - 2)) {
+					assignment.innerText += ", ";
+				}
 			}
 		} else if (slave.assignment === "rest in the spa") {
+			let list = [];
+			let i;
 			if (slave.fetish === "mindbroken") {
 				assignment.innerText += `,  mindbroken`;
-			} else if ((slave.sexualFlaw !== "none") || (slave.behavioralFlaw !== "none")) {
-				assignment.innerText += `, flawed`;
-			} else if ((slave.trust < 60) || (slave.devotion < 60)) {
-				assignment.innerText += `, learning to accept life as a slave`;
-			} else if (slave.health < 20) {
-				assignment.innerText += ` for poor health`;
+			} else {
+				if ((slave.sexualFlaw !== "none") || (slave.behavioralFlaw !== "none")) {
+					list.push(`flawed`);
+				}
+				if ((slave.trust < 60) || (slave.devotion < 60)) {
+					list.push(`learning to accept life as a slave`);
+				}
+				if (slave.health < 20) {
+					list.push(`for poor health`);
+				}
+				if (list.length > 0) {
+					assignment.innerText += ", ";
+				} else {
+					assignment.innerText += ", but preparing to move out";
+				}
+				for (i = 0; i < list.length; i++) {
+					assignment.innerText += list[i];
+					if (i === (list.length - 2)) {
+						assignment.innerText += " and ";
+					} else if (i < (list.length - 2)) {
+						assignment.innerText += ", ";
+					}
+				}
 			}
 		} else if (slave.assignment === "learn in the schoolroom") {
 			let lessons = [];
-- 
GitLab