From 07440d60628c698e5bd2c38d58ed0a8bc8e196b8 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Mon, 21 Sep 2020 00:18:55 -0400
Subject: [PATCH] files

---
 js/birth/birth.js                           | 242 +++++++++++++++++++-
 js/{birth.js => birth/birthDescriptions.js} |   2 +-
 src/pregmod/widgets/seBirthWidgets.tw       |   4 +-
 3 files changed, 244 insertions(+), 4 deletions(-)
 rename js/{birth.js => birth/birthDescriptions.js} (99%)

diff --git a/js/birth/birth.js b/js/birth/birth.js
index 370e2c91824..427cf589f56 100644
--- a/js/birth/birth.js
+++ b/js/birth/birth.js
@@ -1,4 +1,4 @@
-globalThis.birth = function() {
+globalThis.birth1 = function() {
 	const el = new DocumentFragment();
 	let humiliation;
 	let suddenBirth;
@@ -247,7 +247,247 @@ globalThis.birth = function() {
 		V.suddenBirth -= Math.trunc((slave.intelligence + slave.intelligenceImplant) / 10);
 		/* end calcs */
 	}
+
+	function preBirthScene(slave) {
+		const el = new DocumentFragment();
+		App.Events.image
+	if (V.seeImages && V.seeReportImages) {
+		App.Events.drawEventArt(el, slave);
+
+	}
+	if (slave.fuckdoll === 0) {
+		if (slave.broodmother === 0 || slave.broodmotherCountDown === 1) {
+			if (slave.assignment !== "work in the dairy") {
+				if (V.universalRulesCSec === 1 || (slave.mpreg === 0 && slave.vagina < 0)) {
+					birthDescription(slave)
+				} else {
+					if (hasAnyLegs(slave)) {
+		r.push(` /* legless slaves are always carried in time */`);
+						if (random(1,20) > V.suddenBirth) || (V.universalRulesBirthing === 1) {
+		r.push(` /* did she make it to her birthing area? */`);
+							r.push(`Feeling childbirth approaching, `);
+	if (!canWalk(slave)) {
+		r.push(`${slave.slaveName} is helped`);
+	} else {
+		r.push(`${slave.slaveName} makes ${his} way`);
+	}
+		r.push(` to ${his} prepared birthing area.`);
+							<<includeDOM birthDescription(slave)>>
+						} else {
+		r.push(` /* did not make it to birthing area */`);
+							if ((V.birthDamage > 15 && random(1,100) > 50) || (V.birthDamage > 20)) && (slave.assignment !== "be the Nurse" && slave.assignment !== "get treatment in the clinic") {
+								<<includeDOM deadlyBirth(slave, _curBabies)>>
+							} else {
+								<<includeDOM suddenBirth(slave)>>
+							}
+		r.push(` /* closes deadly birth */`);
+						}
+		r.push(` /* closes reg birth */`);
+					} else {
+		r.push(` /* made it to birthing area */`);
+						r.push(`With childbirth approaching, ${slave.slaveName} is carried to ${his} prepared birthing area.`);
+						<<includeDOM ampBirth(slave)>>
+					}
+		r.push(` /* close amp birth */`);
+				}
+		r.push(` /* close always c-sec */`);
+			} else {
+				<br>
+				if (V.dairyRestraintsSetting > 1 && slave.career === "a bioreactor") {
+					r.push(`As ${slave.slaveName}'s water breaks, a mechanical basket is extended under ${his} laboring `);
+	if (slave.mpreg === 1) {
+		r.push(`ass`);
+	} else {
+		r.push(`cunt`);
+	}
+		r.push(`. Once the child`);
+	if (slave.pregType > 1) {
+		r.push(`ren are`);
+	} else {
+		r.push(` is`);
+	}
+		r.push(` secure, the basket retracts allowing access to ${his} `);
+	if (slave.mpreg === 1) {
+		r.push(`rear`);
+	} else {
+		r.push(`vagina`);
+	}
+		r.push(`.`);
+	if (V.dairyPregSetting > 0) {
+		r.push(` The impregnation tube is promptly reinserted, bloating ${his} empty womb with fresh cum, where it will remain until ${he} is pregnant once more.`);
+	}
+		r.push(` All these events are meaningless to ${him}, as ${his} consciousness has long since been snuffed out.`);
+				} else if (V.dairyRestraintsSetting > 1) {
+					if (slave.fetish === "mindbroken") {
+						r.push(`As ${slave.slaveName}'s water breaks, a mechanical basket is extended under ${his} laboring `);
+	if (slave.mpreg === 1) {
+		r.push(`ass`);
+	} else {
+		r.push(`cunt`);
+	}
+		r.push(`. Once the child`);
+	if (slave.pregType > 1) {
+		r.push(`ren are`);
+	} else {
+		r.push(` is`);
+	}
+		r.push(` secure, the basket retracts allowing access to ${his} `);
+	if (slave.mpreg === 1) {
+		r.push(`rear`);
+	} else {
+		r.push(`vagina`);
+	}
+		r.push(`.`);
+	if (V.dairyPregSetting > 0) {
+		r.push(` The impregnation tube is promptly reinserted, bloating ${his} empty womb with fresh cum, where it will remain until ${he} is pregnant once more.`);
+	}
+		r.push(` ${He} doesn't care about any of this, as the only thoughts left in ${his} empty mind revolve around the sensations in ${his} crotch and breasts.`);
+					} else {
+						r.push(`As ${slave.slaveName}'s water breaks, a mechanical basket is extended under ${his} laboring `);
+	if (slave.mpreg === 1) {
+		r.push(`ass`);
+	} else {
+		r.push(`cunt`);
+	}
+		r.push(`. ${He} struggles in ${his} bindings, attempting to break free in order to birth ${his} coming child, but ${his} efforts are pointless. `);
+	if (slave.geneticQuirks.uterineHypersensitivity === 2) {
+		r.push(`Soon ${he} is convulsing with powerful orgasms while giving birth, restrained, into the waiting holder.`);
+	} else {
+		r.push(`${He} is forced to give birth, restrained, into the waiting holder.`);
+	}
+		r.push(` Once the child`);
+	if (slave.pregType > 1) {
+		r.push(`ren are`);
+	} else {
+		r.push(` is`);
+	}
+		r.push(` secure, the basket retracts allowing access to ${his} vagina.`);
+	if (V.dairyPregSetting > 0) {
+		r.push(` The impregnation tube is promptly reinserted, bloating ${his} empty womb with fresh cum, where it will remain until ${he} is pregnant once more. ${slave.slaveName} moans, partially with pleasure and partially with defeat, under the growing pressure within ${his} body. Tears stream down ${his} face as `);
+	if (slave.counter.births > 0) {
+		r.push(`${he} is forcibly impregnated once more`);
+	} else {
+		r.push(`${he} attempts to shift in ${his} restraints to peek around ${his} swollen breasts, but ${he} is too well secured. ${He}'ll realize what is happening when ${his} belly grows large enough to brush against ${his} udders as the milker sucks from them`);
+	if (slave.dick > 0) {
+		r.push(` or ${his} dick begins rubbing its underside`);
+	}
+	}
+		r.push(`.`);
+	}
+		r.push(` ${His} mind slips slightly more as ${he} focuses on ${his} fate as nothing more than an animal destined to be milked and bare offspring until ${his} body gives out.`);
+						slave.trust -= 10;
+						slave.devotion -= 10;
+					}
+				} else {
+					if (slave.fetish === "mindbroken") {
+						r.push(`While getting milked, ${slave.slaveName}'s water breaks. ${He} shows little interest and continues kneading ${his} breasts. Instinctively ${he} begins to push out ${his} bab`);
+	if (slave.pregType > 1) {
+		r.push(`ies`);
+	} else {
+		r.push(`y`);
+	}
+		r.push(`. ${He} pays no heed to ${his} child`);
+	if (slave.pregType > 1) {
+		r.push(`ren`);
+	}
+		r.push(` being removed from the milking stall, instead focusing entirely on draining ${his} breasts.`);
+					} else if (slave.geneticQuirks.uterineHypersensitivity === 2) {
+						r.push(`While getting milked, ${slave.slaveName}'s water breaks, a moment she anxiously waited for`);
+	if (slave.counter.birthsTotal > 0) {
+		r.push(` no matter how many times it happened before.`);
+	}
+		r.push(` ${He} begins to push out ${his} bab`);
+	if (slave.pregType > 1) {
+		r.push(`ies`);
+	} else {
+		r.push(`y`);
+	}
+		r.push(` orgasming during the whole process. By the time ${he} regains ${his} senses ${his} child`);
+	if (slave.pregType > 1) {
+		r.push(`ren`);
+	}
+		r.push(` have already been removed from the milking stall.`);
+					} else {
+						r.push(`While getting milked, ${slave.slaveName}'s water breaks,`);
+	if (V.dairyPregSetting > 0) {
+		r.push(` this is a regular occurrence to ${him} now so`);
+	} else {
+		r.push(` but`);
+	}
+		r.push(` ${he} continues enjoying ${his} milking. ${He} begins to push out ${his} bab`);
+	if (slave.pregType > 1) {
+		r.push(`ies`);
+	} else {
+		r.push(`y`);
+	}
+		r.push(`. ${He} catches `);
+	if (canSee(slave)) {
+		r.push(`a glimpse`);
+	} else if (canHear(slave)) {
+		r.push(`the sound`);
+	} else {
+		r.push(`the feeling`);
+	}
+		r.push(` of ${his} child`);
+	if (slave.pregType > 1) {
+		r.push(`ren`);
+	}
+		r.push(` being removed from the milking stall before returning ${his} focus to draining ${his} breasts.`);
+					}
+				}
+			}
+		r.push(` /* close cow birth */`);
+		} else {
+			if (!hasAnyLegs(slave)) {
+				r.push(`With childbirth approaching, ${slave.slaveName} is carried to ${his} prepared birthing area.`);
+				<<includeDOM ampBirth(slave)>>
+			} else if (slave.broodmother === 1) {
+				<<includeDOM broodmotherBirth(slave)>>
+			} else {
+				<<includeDOM hyperBroodmotherBirth(slave)>>
+			}
+		}
+		r.push(` /* close broodmother birth */`);
+	} else {
+		r.push(` /* Fuckdoll birth */`);
+		if (V.universalRulesCSec === 1 || (slave.mpreg === 0 && slave.vagina < 0)) {
+			V.csec = 1;
+			r.push(`${slave.slaveName}'s suit's systems alert that it is ready to give birth; it is taken to the remote surgery to have its child`);
+	if (slave.pregType > 1) {
+		r.push(`ren`);
+	}
+		r.push(` extracted and for it to be cleaned up.`);
+		} else if (V.universalRulesBirthing === 1) {
+			r.push(`${slave.slaveName}'s suit's systems alert that it is ready to give birth. It is taken to the remote surgery to have its child`);
+	if (slave.pregType > 1) {
+		r.push(`ren`);
+	}
+		r.push(` extracted and for it to be cleaned up.`);
+		} else if (V.birthDamage > 10) {
+			V.csec = 1;
+			r.push(`${slave.slaveName}'s suit's systems alert that it is ready to give birth. Since it fails to qualify as a birthing model, it is quickly taken to the remote surgery to have its child`);
+	if (slave.pregType > 1) {
+		r.push(`ren`);
+	}
+		r.push(` extracted and to be cleaned up.`);
+		} else {
+			r.push(`${slave.slaveName}'s suit's systems alert you that it is ready to give birth. You carefully pose it as it labors on bringing its child`);
+	if (slave.pregType > 1) {
+		r.push(`ren`);
+	}
+		r.push(` into the world and sit back to enjoy yourself as its `);
+	if (slave.pregType > 1) {
+		r.push(`first`);
+	}
+		r.push(` baby starts to crown. Once both it and yourself are finished, you send its offspring off and it to the autosurgery for cleaning.`);
+		}
+		r.push(`It barely comprehends what has happened, nor will it realize when another child is conceived in it.`);
+	}
+		r.push(` /* close Fuckdoll birth */`);
 	
+	/* end of 2.*/
+	}
+
 };
 globalThis.birth2 = function() {
 	const p = document.createElement("p");
diff --git a/js/birth.js b/js/birth/birthDescriptions.js
similarity index 99%
rename from js/birth.js
rename to js/birth/birthDescriptions.js
index 1558aa49d6e..8767a5862af 100644
--- a/js/birth.js
+++ b/js/birth/birthDescriptions.js
@@ -4,7 +4,7 @@
  * @returns {Node}
  */
 
-globalThis.birth = function(slave) {
+globalThis.birthDescription = function(slave) {
 	const el = document.createElement("p");
 	const {
 		He, His,
diff --git a/src/pregmod/widgets/seBirthWidgets.tw b/src/pregmod/widgets/seBirthWidgets.tw
index 71c293057c5..784347e0084 100644
--- a/src/pregmod/widgets/seBirthWidgets.tw
+++ b/src/pregmod/widgets/seBirthWidgets.tw
@@ -20,12 +20,12 @@
 	<<if $slaves[$i].broodmother == 0 || $slaves[$i].broodmotherCountDown == 1>>
 		<<if $slaves[$i].assignment != "work in the dairy">>
 			<<if $universalRulesCSec == 1 || ($slaves[$i].mpreg == 0 && $slaves[$i].vagina < 0)>>
-				<<includeDOM birth($slaves[$i])>>
+				<<includeDOM birthDescription($slaves[$i])>>
 			<<else>>
 				<<if hasAnyLegs($slaves[$i])>> /* legless slaves are always carried in time */
 					<<if (random(1,20) > $suddenBirth) || ($universalRulesBirthing == 1)>> /* did she make it to her birthing area? */
 						Feeling childbirth approaching, <<if !canWalk($slaves[$i])>>$slaves[$i].slaveName is helped<<else>>$slaves[$i].slaveName makes $his way<</if>> to $his prepared birthing area.
-						<<includeDOM birth($slaves[$i])>>
+						<<includeDOM birthDescription($slaves[$i])>>
 					<<else>> /* did not make it to birthing area */
 						<<if (($birthDamage > 15 && random(1,100) > 50) || ($birthDamage > 20)) && ($slaves[$i].assignment != "be the Nurse" && $slaves[$i].assignment != "get treatment in the clinic")>>
 							<<includeDOM deadlyBirth($slaves[$i], _curBabies)>>
-- 
GitLab