diff --git a/src/js/slaveListing.js b/src/js/slaveListing.js index 85381a0bffb75da7cc84650701ae359a4eade18c..85523a58c13b96584a521b896c1c02a898c4d3f6 100644 --- a/src/js/slaveListing.js +++ b/src/js/slaveListing.js @@ -196,26 +196,67 @@ 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) { + if ((slave.chem > 15) && (V.clinicUpgradeFilters === 1)) { + list.push(`unhealthy chemicals`); + } + if ((V.clinicInflateBelly > 0) && (slave.bellyImplant >= 0) && (slave.bellyImplant <= (V.arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000))) { + list.push(`implant filling`); + } + if ((slave.pregKnown === 1) && (V.clinicSpeedGestation >= 0 || slave.pregControl === "speed up") && ((slave.pregAdaptation*1000 < slave.bellyPreg || slave.preg > slave.pregData.normalBirth/1.33))) { + list.push(`observation of accelerated pregnancy`); + } else if ((slave.pregKnown === 1) && (V.clinicSpeedGestation >= 0 || slave.pregControl === "speed up")) { + list.push(`safely hurrying pregnancy along`); + } else if ((slave.pregAdaptation*1000 < slave.bellyPreg || slave.preg > slave.pregData.normalBirth/1.33)) { + list.push(`observation during pregnancy`); + } + } + 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(`overcoming flaws`); + } + if ((slave.trust < 60) || (slave.devotion < 60)) { + list.push(`learning to accept life as a slave`); + } + if (slave.health < 20) { + list.push(`improving in 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 = [];