diff --git a/src/js/birth/birth.js b/src/js/birth/birth.js index 8cc28478b8fd687dd5546e49c23866ca71622077..dbf89b73c9d299766d9f64ad9ebedf0434cc094e 100644 --- a/src/js/birth/birth.js +++ b/src/js/birth/birth.js @@ -18,7 +18,10 @@ globalThis.allBirths = function() { return hr; } }; - +/** + * + * @param {App.Entity.SlaveState} slave + */ globalThis.birth = function(slave) { const el = document.createElement("p"); el.style.overflow = "hidden"; // Keep image from floating into the next slave. @@ -31,7 +34,7 @@ globalThis.birth = function(slave) { let newMother = 0; let diffSize; let curBabies; - let curStill; + let numStillborn = 0; const babies = (slave.pregType > 1) ? `babies` : `baby`; const children = (slave.pregType > 1) ? `children` : `child`; const childrenAre = (slave.pregType > 1) ? `children are` : `child is`; @@ -436,7 +439,6 @@ globalThis.birth = function(slave) { } else { slave.curBabies = WombBirth(slave, slave.pregData.minLiveBirth); // Normal human pregnancy - 34 week is minimal gestation time for live birth. } - slave.curStillBirth = 0; curBabies = slave.curBabies.length; // just to improve speed and usability here. slave.counter.births += curBabies; slave.counter.birthsTotal += curBabies; @@ -456,12 +458,12 @@ globalThis.birth = function(slave) { if (slave.broodmother === 0) { if (slave.prematureBirth === 1) { // emergency birth, anything less than 23 weeks of age is not making it through this - slave.curStillBirth = slave.womb.length; + numStillborn = slave.womb.length; WombFlush(slave); } else if (V.surgeryUpgrade === 1) { // if true - need nothing, birthed babies already in slave.curBabies, stillbirth is 0. } else { - slave.curStillBirth = slave.womb.length; + numStillborn = slave.womb.length; WombFlush(slave); // cleaning rest of superfetation pregnancy if no tech for safe partial birth } @@ -471,7 +473,6 @@ globalThis.birth = function(slave) { function birthMainScene() { const el = new DocumentFragment(); let r = []; - curStill = slave.curStillBirth; /* -------- cow birth variant ---------------------------------------------------------------------*/ /* diffSize used for check result of partial birth size changes - if it = 2 then womb lost half of it's original size after partial birth, if it = 1 - no size lost. (We get this value as result of dividing of original womb size by after birth size) @@ -509,9 +510,9 @@ globalThis.birth = function(slave) { } else { r.push(`to calf ${pregNumberName(curBabies, 2)}.`); } - if (curStill > 0 && curBabies > 0) { - r.push(`An additional ${curStill}`); - if (curStill === 1) { + if (numStillborn > 0 && curBabies > 0) { + r.push(`An additional ${numStillborn}`); + if (numStillborn === 1) { r.push(`was`); } else { r.push(`were`); @@ -607,9 +608,9 @@ globalThis.birth = function(slave) { if (curBabies > 0) { r.push(`created by ${arrayToSentence(fathersReduced)}${(cSection === 1) ? ', entered the world' : ''}.`); } - if (curStill > 0 && curBabies > 0) { - r.push(`An additional ${curStill}`); - if (curStill === 1) { + if (numStillborn > 0 && curBabies > 0) { + r.push(`An additional ${numStillborn}`); + if (numStillborn === 1) { r.push(`was`); } else { r.push(`were`); @@ -1152,21 +1153,21 @@ globalThis.birth = function(slave) { App.Events.addNode(p, r, "div"); } /* this needs a tally of how many babies were lost due to underdevelopment instead of relying off a check */ - if (V.surgeryUpgrade !== 1 && slave.curStillBirth > 0) { + if (V.surgeryUpgrade !== 1 && numStillborn > 0) { App.UI.DOM.appendNewElement("div", p, `It's possible that`); r.push(App.UI.DOM.makeElement("span", `having advanced equipment`, "red")); - r.push(`in the remote surgery could have prevented the loss of ${his} ${slave.curStillBirth} unborn ${(slave.curStillBirth > 1) ? `children` : `child`}.`); + r.push(`in the remote surgery could have prevented the loss of ${his} ${numStillborn} unborn ${(numStillborn > 1) ? `children` : `child`}.`); } el.append(p); /* ----- Postbirth reactions, mind ------------------------------- */ if (slave.fetish !== "mindbroken" && slave.fuckdoll === 0) { r = []; - if (curStill > 0) { // TODO: Here should be descriptions of reactions from losing some of babies, need tweak, only draft for now + if (numStillborn > 0) { // TODO: Here should be descriptions of reactions from losing some of babies, need tweak, only draft for now if (slave.sexualFlaw === "breeder") { r.push(`${He} is`); r.push(App.UI.DOM.makeElement("span", `filled with violent, all-consuming hatred`, "mediumorchid")); r.push(`at ${himself} for failing ${his} unborn and you for allowing this to happen.`); - if (curStill > 4) { + if (numStillborn > 4) { r.push(`The loss of so many children at once`); r.push(App.UI.DOM.makeElement("span", `shatters the distraught breeder's mind.`, "red")); slave.fetish = "mindbroken"; @@ -1178,7 +1179,7 @@ globalThis.birth = function(slave) { slave.trust = 0; } else { r.push(`${He} cares little for what punishment awaits ${his} actions.`); - slave.devotion -= 25 * curStill; + slave.devotion -= 25 * numStillborn; } } else if (slave.devotion > 80) { r.push(`${He}`); diff --git a/src/npc/interaction/passage/csec.tw b/src/npc/interaction/passage/csec.tw index eda9862a2c6c6df361d894ecded20afba99495a4..4ba8baa6d54351c7a7d9b9da3c7de459c006985a 100644 --- a/src/npc/interaction/passage/csec.tw +++ b/src/npc/interaction/passage/csec.tw @@ -10,7 +10,6 @@ <<set getSlave($AS).pregControl = "none">> <<set _beforeSize = WombGetVolume(getSlave($AS))>> <<set getSlave($AS).curBabies = WombBirth(getSlave($AS), getSlave($AS).pregData.minLiveBirth)>> /* 34 week is minimal gestation time for human live birth. Here we take only ready to survive. With others we will deal later in code. */ -<<set getSlave($AS).curStillBirth = 0 >> <<set _curBabies = getSlave($AS).curBabies.length>> /*just to improve speed and usability here.*/ @@ -122,7 +121,6 @@ <<if $surgeryUpgrade == 1 >> /* nothing right now. For partial birthers, who can do it. For future use.*/ <<else>> - <<set getSlave($AS).curStillBirth = getSlave($AS).womb.length>> <<set WombFlush(getSlave($AS))>> /* normally fetuses before 34 week will not survive */ <</if>>