From fb308e5b95b22a9a539b840f0c12afe44959dae7 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Sat, 26 Sep 2020 02:09:08 -0400
Subject: [PATCH] csec

---
 src/js/birth/birth.js | 66 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 62 insertions(+), 4 deletions(-)

diff --git a/src/js/birth/birth.js b/src/js/birth/birth.js
index 586f3e9e97b..4a30052ceb5 100644
--- a/src/js/birth/birth.js
+++ b/src/js/birth/birth.js
@@ -31,6 +31,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 	let slaveDead = 0;
 	let birthDamage = 0;
 	const newMother = (slave.counter.laborCount === 0 && slave.counter.birthsTotal === 0);
+	const beforeSize = WombGetVolume(slave);
 	let diffSize;
 	let numStillborn = 0;
 	let babiesBeingBorn;
@@ -64,6 +65,10 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 			slave.counter.laborCount++;
 		}
 		el.append(birthCritical());
+		console.log(cSection, slave.broodmother);
+		if (cSection && slave.broodmother === 0 && V.bellyImplants === 1) {
+			el.append(implantImplant());
+		}
 	}
 
 	if (slaveDead) {
@@ -285,6 +290,8 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 				}
 				healthDamage(slave, 30);
 			}
+		} else if (cSection) {
+			r.push(`${slave.slaveName} is sedated, ${his} ${children} extracted, and taken to a bed to recover.`);
 		} else if (slave.burst === 1) {
 			r.push(`${slave.slaveName}'s straining womb gave out and burst, taking ${his} life.`);
 		} else if (slave.fuckdoll === 0) {
@@ -437,7 +444,6 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 	}
 	function birthCalc() {
 		slave.pregControl = "none";
-		const beforeSize = WombGetVolume(slave);
 
 		if (slave.broodmother > 0) {
 			babiesBeingBorn = WombBirth(slave, 37); // broodmothers - give birth for all 37+ week fetuses.
@@ -579,8 +585,12 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 				slaveDead = 1;
 			} else if (cSection) {
 				r.push(`${He} was given`);
-				r.push(App.UI.DOM.makeElement("span", `a cesarean section`, "orange"));
-				r.push(`due to health concerns.`);
+				if (birthDamage > 5) {
+					r.push(App.UI.DOM.makeElement("span", `a cesarean section`, "orange"));
+					r.push(`due to health concerns.`);
+				} else {
+					r.push(App.UI.DOM.makeElement("span", `a cesarean section.`, "orange"));
+				}
 				App.Events.addNode(el, r, "p"); // New paragraph
 				r = [];
 				r.push(`From ${his} womb,`);
@@ -1884,7 +1894,6 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 				slave.pregWeek = -4;
 			}
 		}
-		cSection = false;
 		SetBellySize(slave);
 		if (slave.birthsTat > -1) {
 			slave.birthsTat++;
@@ -1983,6 +1992,55 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {})
 		return el;
 	}
 
+	function implantImplant() {
+		const el = document.createElement("div");
+		el.id = "bir";
+		App.UI.DOM.appendNewElement("div", el, `Since ${he} is already in surgery and ${his} body already stretched, it would be possible to preserve ${his} pregnant appearance via fillable implant.`, "note");
+
+		el.append(
+			App.UI.DOM.link(
+				"Do it.",
+				() => {
+					const result = document.createElement("div");
+					const r = [];
+					surgeryDamage(slave, 10);
+					result.append(`Installation of belly implant is relatively simple procedure. Using the fact that ${his} body and internal organs have already adapted to pregnancy, it's possible to greatly expand the initial size of implant. ${He} will still look pregnant post surgery and recovery.`);
+					if (slave.devotion > 50) {
+						r.push(`${He} leaves the surgery with ${his} belly still very gravid, and as such, knows you put something into ${his} womb replacing ${his} prior natural pregnancy. ${He} is `);
+						r.push(App.UI.DOM.makeElement("span", `curious`, "hotpink"));
+						r.push(` about the details of the implant, and eagerly awaits to see the end result.`);
+						slave.devotion += 4;
+					} else if ((slave.devotion >= -20)) {
+						r.push(`${He} leaves the surgery with ${his} belly still very gravid, and as such, knows you put something into ${his} womb replacing ${his} prior natural pregnancy. ${He} understands the realities of ${his} life as a slave, but ${he} is still surprised at what now resides in ${his} womb. ${He} is `);
+						r.push(App.UI.DOM.makeElement("span", `sensibly fearful`, "gold"));
+						r.push(` of your total power over ${his} body.`);
+						slave.trust -= 5;
+					} else {
+						r.push(`${He} leaves the surgery with ${his} belly still very gravid, and as such, knows you put something into ${his} womb replacing ${his} prior natural pregnancy. ${He} does not understand the realities of ${his} life as a slave at a core level, so ${he}'s `);
+						r.push(App.UI.DOM.makeElement("span", `terrified and angry`, "mediumorchid"));
+						r.push(`at the potential that ${he}'s been turned in some sort of freak. Even after what has been implanted into ${his} womb is explained to ${him}, ${he} is no less defiant; though ${he} is relieved that procedure is reversible and there is no truly permanent damage. ${He} is `);
+						r.push(App.UI.DOM.makeElement("span", `sensibly fearful`, "gold"));
+						r.push(` of your total power over ${his} body.`);
+						slave.trust -= 5;
+						slave.devotion -= 5;
+					}
+					slave.bellyImplant = Math.floor(beforeSize);
+					if (slave.bellyImplant > 800000 && V.arcologies[0].FSTransformationFetishistResearch > 0) {
+						slave.bellyImplant = 800000;
+					} else if (slave.bellyImplant > 130000 && V.arcologies[0].FSTransformationFetishistResearch < 1) {
+						slave.bellyImplant = 130000;
+					}
+					slave.preg = -2;
+					SetBellySize(slave);
+					App.Events.addNode(result, r);
+					jQuery(`#${dispositionId}`).empty().append(result);
+				}
+			)
+		);
+
+		return el;
+	}
+
 	function broodmotherBirth() {
 		const el = document.createElement("p");
 		const birthScene = random(1, 100);
-- 
GitLab