From 352d29cf75c9c3b9ad253706a399acaba7951275 Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Thu, 17 Jan 2019 12:30:40 -0500
Subject: [PATCH] birthJS correction and cleaning

---
 src/js/birthJS.tw | 58 +++++++++++++++++++++++++----------------------
 1 file changed, 31 insertions(+), 27 deletions(-)

diff --git a/src/js/birthJS.tw b/src/js/birthJS.tw
index cf62acf8686..7cfaf9a4fb1 100644
--- a/src/js/birthJS.tw
+++ b/src/js/birthJS.tw
@@ -1,9 +1,13 @@
 :: birthJS [script]
 
 window.BirthDestinationText = function(choice,slave) {
-	const V = State.variables,T = State.temporary,sn = SlaveFullName(slave);
+	var pronouns = getPronouns(slave);
+	var he = pronouns.pronoun, him = pronouns.object, his = pronouns.possessive, hers = pronouns.possessivePronoun, himself = pronouns.objectReflexive, boy = pronouns.noun;
+	var He = capFirstChar(he), His = capFirstChar(his);
+	const V = State.variables,T = State.temporary, sn = SlaveFullName(slave);
+	var child = T.count > 1 ? 'children' : 'child';
 	var r = ``;
-	if (T.call !== 1) { if (choice !== "Private") r += `sent to one of ${arcologies[0].name}'s `;
+	if (T.call !== 1) { if (choice !== "Private") r += `sent to one of ${V.arcologies[0].name}'s `;
 	} else { if (choice !== "Sold") r += ` ${sn} `;
 	}
 	switch(choice) {
@@ -12,15 +16,15 @@ window.BirthDestinationText = function(choice,slave) {
 			if (slave.fetish == "mindbroken" || slave.fuckdoll > 0) {
 				r += `has few thoughts about the matter.`;
 			} else if (slave.devotion > 95) {
-				r += `loves you already, but ${V.he}'ll <span class='hotpink'>love you even more</span> for this. ${V.he} can't wait to see ${V.his} child${T.count > 1 ? 'ren':''} proudly furthering your cause.`;
+				r += `loves you already, but ${he}'ll <span class='hotpink'>love you even more</span> for this. ${He} can't wait to see ${his} ${child} proudly furthering your cause.`;
 				slave.devotion += 4;
 			} else if (slave.devotion > 50) {
-				r += `heard about these and will be <span class='hotpink;happy that ${V.his} child${T.count > 1 ? 'ren':''} will have a purpose in your society other than slavery.</span> ${V.he} will miss ${V.his} child${T.count > 1 ? 'ren':''}, but ${V.he} expected that.`;
+				r += `heard about these and will be <span class='hotpink;happy that ${his} ${child} will have a purpose in your society other than slavery.</span> ${He} will miss ${his} ${child}, but ${he} expected that.`;
 				slave.devotion += 4;
 			} else if (slave.devotion > 20) {
-				r += `will naturally miss ${V.his} child${T.count > 1 ? 'ren':''}, but will is broken enough to hope that ${V.his} offspring will have a better life, or at least an enjoyable one.`;
+				r += `will naturally miss ${his} ${child}, but will is broken enough to hope that ${his} offspring will have a better life, or at least an enjoyable one.`;
 			} else {
-				r += `will of course <span class='mediumorchid'>hate you for this.</span> The mere thought of ${V.his} ${fertilityAge} year old daughter${T.count > 1 ? 's':''} swollen with life, and proud of it, fills ${V.him} with <span class='gold'>disdain.</span>`;
+				r += `will of course <span class='mediumorchid'>hate you for this.</span> The mere thought of ${his} ${V.fertilityAge} year old daughter${T.count > 1 ? 's':''} swollen with life, and proud of it, fills ${him} with <span class='gold'>disdain.</span>`;
 				slave.devotion -= 4, slave.trust -= 4;
 			}
 			break;
@@ -28,12 +32,12 @@ window.BirthDestinationText = function(choice,slave) {
 			if (slave.fetish == "mindbroken" || slave.fuckdoll > 0) {
 			r += `has few thoughts about the matter.`;
 			} else if (slave.devotion > 95) {
-				r += `worships you so completely that ${V.he} will not resent this.`;
+				r += `worships you so completely that ${he} will not resent this.`;
 			} else if ( slave.devotion > 50) {
-				r += `is devoted to you, but ${V.he} will <span class='mediumorchid'>struggle to accept this.</span>`;
+				r += `is devoted to you, but ${he} will <span class='mediumorchid'>struggle to accept this.</span>`;
 				slave.devotion -= 2;
 			} else if ( slave.devotion > 20) {
-				r += `has accepted being a sex slave, but ${V.he} will <span class='mediumorchid'>resent this intensely.</span>`;
+				r += `has accepted being a sex slave, but ${he} will <span class='mediumorchid'>resent this intensely.</span>`;
 				slave.devotion -= 3;
 			} else {
 				r += `will of course <span class='mediumorchid'>hate you for this.</span>`;
@@ -45,13 +49,13 @@ window.BirthDestinationText = function(choice,slave) {
 			if (slave.fetish == "mindbroken" || slave.fuckdoll > 0) {
 			r += `has few thoughts about the matter.`;
 			} else if (slave.devotion > 95) {
-				r += `loves you already, but ${V.he}'ll <span class='hotpink'>love you even more</span> for this.`;
+				r += `loves you already, but ${he}'ll <span class='hotpink'>love you even more</span> for this.`;
 			} else if (slave.devotion > 50) {
-				r += `knows about these and will be <span class='hotpink'>overjoyed,</span> ${V.he} will miss ${V.his} child${T.count > 1 ? 'ren':''}, but ${V.he} expected that.`;
+				r += `knows about these and will be <span class='hotpink'>overjoyed,</span> ${he} will miss ${his} ${child}, but ${he} expected that.`;
 			} else if (slave.devotion > 20) {
-				r += `will naturally miss ${V.his} child${T.count > 1 ? 'ren':''}, but will <span class='hotpink;take comfort@@ in the hope that ${V.his} offspring will have a better life.`;
+				r += `will naturally miss ${his} ${child}, but will <span class='hotpink;take comfort@@ in the hope that ${his} offspring will have a better life.`;
 			} else {
-				r += `will naturally retain some resentment over being separated from ${V.his} child${T.count > 1 ? 'ren':''}, but this should be balanced by hope that ${V.his} offspring will have a better life.`;
+				r += `will naturally retain some resentment over being separated from ${his} ${child}, but this should be balanced by hope that ${his} offspring will have a better life.`;
 			}
 			break;
 		case "Private":
@@ -63,38 +67,38 @@ window.BirthDestinationText = function(choice,slave) {
 			} else if (slave.devotion > 50) {
 				r += `understands that this is the best possible outcome for the offspring of a slave, and will be <span class='hotpink'>overjoyed.</span>`;
 			} else if (slave.devotion > 20) {
-				r += `will miss ${V.his} child${T.count > 1 ? 'ren':''}, but will be <span class='hotpink'>very grateful,</span> since ${V.he}'ll understand this is the best possible outcome for a slave mother.`;
+				r += `will miss ${his} ${child}, but will be <span class='hotpink'>very grateful,</span> since ${he}'ll understand this is the best possible outcome for a slave mother.`;
 			} else {
-				r += `will resent being separated from ${V.his} child${T.count > 1 ? 'ren':''}, but <span class='hotpink'>should understand and be grateful</span> that this is the best possible outcome here.`;
+				r += `will resent being separated from ${his} ${child}, but <span class='hotpink'>should understand and be grateful</span> that this is the best possible outcome here.`;
 			}
-			r += ` The child${T.count > 1 ? 'ren':''} will be raised privately, with expert care and tutoring, an expensive proposition.`;
+			r += ` The ${child} will be raised privately, with expert care and tutoring, an expensive proposition.`;
 			break;
 		case "Sold":
 			r += `${T.call !== 1 ? "${V.his} ${T.count > 1 ? 'babies':'baby'}":"Where they"} `;
-   if (slave.prestige > 1 || slave.pornPrestige > 2) {
+			if (slave.prestige > 1 || slave.pornPrestige > 2) {
 				T.babyCost = jsRandom(-12,100);
-				if (slave.prematureBirth > 0) T.babyCost = jsRandom(-32,40);
-    r += `went for ${T.curBabies > 1 ? ' a total ':'a'} bid of`;
+				if (slave.prematureBirth > 0) { T.babyCost = jsRandom(-32,40); }
+				r += `went for ${T.curBabies > 1 ? ' a total ':'a'} bid of`;
 			} else {
 				T.babyCost = jsRandom(-12,12);
-				if (slave.prematureBirth > 0) T.babyCost = -45;
-    r += `sold for ${T.curBabies > 1 ? ' a total of':''}`;
+				if (slave.prematureBirth > 0) { T.babyCost = -45; }
+				r += `sold for ${T.curBabies > 1 ? ' a total of':''}`;
 			}
-   const cash = cashFormat(T.count*(50+T.babyCost));r += ` <span class='yellowgreen'>${cash}.</span>`;
+			const cash = cashFormat(T.count*(50+T.babyCost));r += ` <span class='yellowgreen'>${cash}.</span>`;
 			if (slave.prematureBirth > 0) r += ` A low price due to the added costs of caring for ${T.count > 1 ? 'them':'it'}.`;
 			if (slave.devotion > 20) r += ` ${sn} `;
 			if (slave.fetish == "mindbroken" || slave.fuckdoll > 0) {
-			r += `has few thoughts about the matter.`;
+				r += `has few thoughts about the matter.`;
 			} else if (slave.devotion > 95) {
-				r += `adheres to your thoughts so strongly that even though you backed out of caring for ${V.his} child${T.count > 1 ? 'ren':''}, ${V.he} still truly believes you are doing ${V.him} an honor.`;
+				r += `adheres to your thoughts so strongly that even though you backed out of caring for ${his} ${child}, ${he} still truly believes you are doing ${him} an honor.`;
 			} else if (slave.devotion > 50) {
-				r += `is <span class='mediumorchid'>deeply hurt</span> by your sudden decision to sell ${V.his} child${T.count > 1 ? 'ren':''} instead of having ${T.count > 1 ? 'them':'it'} cared for. ${V.his} trust in your words <span class='gold'>wavers</span> as ${V.he} thinks of ${V.his} child${T.count > 1 ? 'ren':''}'s future.`;
+				r += `is <span class='mediumorchid'>deeply hurt</span> by your sudden decision to sell ${his} ${child} instead of having ${T.count > 1 ? 'them':'it'} cared for. ${His} trust in your words <span class='gold'>wavers</span> as ${he} thinks of ${his} ${child}'s future.`;
 				slave.trust -= 5, slave.devotion -= 5;
 			} else if (slave.devotion > 20) {
-				r += `is <span class='mediumorchid'>devastated</span> by your sudden decision to sell ${V.his} child${T.count > 1 ? 'ren':''}instead of having ${T.count > 1 ? 'them':'it'} cared for. ${V.his} mind struggles to comprehend <span class='gold'>such betrayal.</span>`;
+				r += `is <span class='mediumorchid'>devastated</span> by your sudden decision to sell ${his} ${child} instead of having ${T.count > 1 ? 'them':'it'} cared for. ${His} mind struggles to comprehend <span class='gold'>such betrayal.</span>`;
 				slave.trust -= 10, slave.devotion -= 10;
 			} else {
-				r += `For a moment, ${V.he} saw a glimmer of good in you; <span class='mediumorchid'>${V.he} was clearly wrong.</span> ${V.his} mind struggles to comprehend <span class='gold'>why ${V.he} could ever even think of trusting such a person.</span>`;
+				r += `For a moment, ${he} saw a glimmer of good in you; <span class='mediumorchid'>${He} was clearly wrong.</span> ${His} mind struggles to comprehend <span class='gold'>why ${he} could ever even think of trusting such a person.</span>`;
 				slave.trust -= 30, slave.devotion -= 30;
 			}
 			V.cash += T.curBabies*(50+T.babyCost);
-- 
GitLab