From d8bd2efb45767dda4052a5475b5fd654ed51f313 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Wed, 10 Aug 2022 15:56:33 -0400
Subject: [PATCH] Slightly relax slaves' "choose own clothes" behavior under
 chattel religionism.  They are now able to select an outfit other than the
 chattel habit (as long as said outfit still gives the chattel religionism
 social bonus).

---
 src/endWeek/saChoosesOwnClothes.js | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/endWeek/saChoosesOwnClothes.js b/src/endWeek/saChoosesOwnClothes.js
index c17ee47cbc6..57d40f7c4d7 100644
--- a/src/endWeek/saChoosesOwnClothes.js
+++ b/src/endWeek/saChoosesOwnClothes.js
@@ -186,9 +186,7 @@ App.SlaveAssignment.choosesOwnClothes = function saChoosesOwnClothes(slave) {
 			}
 			selection = jsEither(clothing);
 		} else {
-			if (V.arcologies[0].FSChattelReligionist > 0) {
-				clothing.push({text: `and wears a chattel habit to conform to your arcology's culture.`, clothes: "a chattel habit"});
-			} else if (slave.assignment === Job.NURSE) { /* Chooses clothes according to assignment (no exceptions)*/
+			if (slave.assignment === Job.NURSE) { /* Chooses clothes according to assignment (no exceptions)*/
 				if (slave.energy > 95 || slave.need > 100) {
 					wardrobeAssignment.push({text: `and wears a slutty nurse outfit to make it clear just how much this nurse needs ${his} daily lay.`, clothes: "a slutty nurse outfit"});
 				} else if (slave.energy > 80) {
@@ -277,7 +275,9 @@ App.SlaveAssignment.choosesOwnClothes = function saChoosesOwnClothes(slave) {
 				wardrobeAssignment.push({text: `and wears a slutty suit to give ${him} an air of authority while keeping all eyes focused on ${him}.`, clothes: "slutty business attire"});
 				wardrobeAssignment.push({text: `and wears a schoolgirl outfit to help keep ${his} charges focused on ${him}.`, clothes: "a schoolgirl outfit"});
 				wardrobeAssignment.push({text: `and dresses up as a succubus to give ${his} sex lessons an extra kick.`, clothes: "a succubus outfit"});
-				if (isItemAccessible.entry("conservative clothing") === true) {
+				if (slave.race === "middle eastern" && isItemAccessible.entry("a burqa") === true) {
+					wardrobeAssignment.push({text: `and wears a conservative burqa to not detract from this week's lesson.`, clothes: "a burqa"});
+				} else if (isItemAccessible.entry("conservative clothing") === true) {
 					wardrobeAssignment.push({text: `and wears conservative clothes to not detract from this week's lesson.`, clothes: "conservative clothing"});
 				}
 				if (isItemAccessible.entry("a toga") === true) {
@@ -661,13 +661,16 @@ App.SlaveAssignment.choosesOwnClothes = function saChoosesOwnClothes(slave) {
 							wardrobeFS.push({text: `and wears one of the beautiful folk costumes of the asian race.`, clothes: "a long qipao"});
 						}
 						if (isItemAccessible.entry("a kimono") === true) {
-							wardrobeAssignment.push({text: `and wears one of the beautiful folk costumes of the asian race.`, clothes: "a kimono"});
+							wardrobeFS.push({text: `and wears one of the beautiful folk costumes of the asian race.`, clothes: "a kimono"});
 						}
 						if (isItemAccessible.entry("a hanbok") === true) {
-							wardrobeAssignment.push({text: `and wears one of the beautiful folk costumes of the asian race.`, clothes: "a hanbok"});
+							wardrobeFS.push({text: `and wears one of the beautiful folk costumes of the asian race.`, clothes: "a hanbok"});
 						}
 					}
 				}
+				if (V.arcologies[0].FSChattelReligionist > 0) {
+					wardrobeFS.push({text: `and wears a chattel habit to conform to your arcology's culture.`, clothes: "a chattel habit"});
+				}
 
 				if (V.arcologies[0].FSSubjugationist > 0) {
 					if (V.arcologies[0].FSSubjugationistRace === "black") {
@@ -979,6 +982,17 @@ App.SlaveAssignment.choosesOwnClothes = function saChoosesOwnClothes(slave) {
 					clothing.push(wardrobeTastes[i]);
 				}
 			}
+			if (V.arcologies[0].FSChattelReligionist > 0) {
+				// Chattel religionism is currently the only FS with a hard advancement link to clothing.  Accepting slaves should never voluntarily select an outfit that won't help.
+				clothing.deleteWith(c => {
+					const clothes = App.Data.clothes.get(c.clothes);
+					const goodForChattel = clothes.fs && clothes.fs.loves && clothes.fs.loves.has("FSChattelReligionist");
+					return !goodForChattel;
+				});
+				if (clothing.length < 1) {
+					clothing.push({text: `and wears a chattel habit to conform to your arcology's culture.`, clothes: "a chattel habit"});
+				}
+			}
 			selection = jsEither(clothing);
 		}
 
-- 
GitLab