Skip to content
Snippets Groups Projects
Commit 894eac2a authored by lowercasedonkey's avatar lowercasedonkey
Browse files

start birth

parent 7fdc21e2
No related branches found
No related tags found
No related merge requests found
globalThis.birth = function() {
const p = document.createElement("p");
let r = [];
let cashText;
const { His, his, he, girl } = getPronouns(slave);
const curBabies = slave.curBabies.length;
const curStill = slave.curStillBirth;
/* 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)
This descriptions can be expanded with more outcomes later. But it's not practical to check values above 5-10 - it become too affected by actual value of womb size.
*/
if (slave.assignment === "work in the dairy" && V.dairyPregSetting > 0) {
r.push(`As a human cow, ${he} <span class="orange">gave birth</span> `);
if (slave.prematureBirth === 1) {
r.push(`<span class="red">prematurely</span>`);
}
if (V.diffSize < 1.15) {
r.push(`but ${his} overfilled womb barely lost any size. ${His} body gave life`);
} else if (V.diffSize < 1.3) {
r.push(`but ${his} stomach barely shrank at all. ${His} body gave life`);
}
if (curBabies < 1) {
r.push(`to nothing, as it was a stillbirth. `); /* syntax wise this has problems. Will likely need to be reworked. */
} else if (curBabies === 1) {
r.push(`to a single calf.`);
} else if (curBabies >= 40) {
r.push(`to a massive brood of ${curBabies} calves.`);
} else if (curBabies >= 20) {
r.push(`to a brood of ${curBabies} calves.`);
} else if (curBabies >= 10) {
r.push(`to a squirming pile of ${curBabies} calves.`);
} else {
r.push(`to calf ${pregNumberName(curBabies, 2)}.`);
}
if (curStill > 0 && curBabies > 0) {
r.push(`An additional${curStill} `);
if (curStill === 1) {
r.push(` was`);
} else {
r.push(`were`);
}
r.push(` unfortunately stillborn.`);
}
App.Events.addParagraph(p, r);
} else {
let others = 0, PC = 0, citizens = 0, oldMaster = 0, arcOwner = 0, clients = 0, elite = 0, lab = 0, futaS = 0, fathers = [], babyFatherLink = [];
for (let baby of slave.curBabies) {
if (baby.fatherID === 0) {
others++;
fathers.push("some man's");
} else if (baby.fatherID === -1) {
V.PC.counter.slavesFathered++;
PC++;
fathers.push("your");
} else if (baby.fatherID === -2) {
citizens++;
fathers.push("a citizen's");
} else if (baby.fatherID === -3) {
oldMaster++;
fathers.push("your former Master's");
} else if (baby.fatherID === -4) {
arcOwner++;
fathers.push("another arcology owner's");
} else if (baby.fatherID === -5) {
clients++;
fathers.push("your client's");
} else if (baby.fatherID === -6) {
elite++;
fathers.push("the Societal Elite's");
} else if (baby.fatherID === -7) {
lab++;
fathers.push("the gene lab's");
} else if (baby.fatherID === -9) {
futaS++;
fathers.push("a Futanari Sister's");
} else {
let babyDaddy = findFather(baby.fatherID);
if (babyDaddy) {
if (babyDaddy.ID === slave.ID) {
fathers.push(`${his} own`);
for (let baby2 of babyFatherLink) {
if (baby2.string === `${his} own`) {
baby2.count++;
} else {
baby2 = { string: `${his} own`, count: 1 };
}
}
} else {
fathers.push(`${babyDaddy.slaveName}'s`);
for (let baby2 of babyFatherLink) {
if (baby2.string === `${babyDaddy.slaveName}'s`) {
baby2.count++;
} else {
baby2 = { string: `${babyDaddy.slaveName}'s`, count: 1 };
}
}
}
let adjust = babyDaddy.counter.slavesFathered++;
adjustFatherProperty(babyDaddy, "slavesFathered", adjust);
} else {
others++;
fathers.push("some man's");
}
}
}
let fathersReduced = removeDuplicates(fathers);
for (let father of fathersReduced) {
let num = 0;
if (father === "some man's") {
num = others;
} else if (father === "your") {
num = PC;
} else if (father === "a citizen's") {
num = citizens;
} else if (father === "your former Master's") {
num = oldMaster;
} else if (father === "another arcology owner's") {
num = arcOwner;
} else if (father === "your client's") {
num = clients;
} else if (father === "the Societal Elite's") {
num = elite;
} else if (father === "the gene lab's") {
num = lab;
} else if (father === "a Futanari Sister's") {
num = futaS;
} else {
let cb2 = babyFatherLink.findIndex(function(s) { father === babyFatherLink[s].string; });
if (cb2 !== -1) {
num = babyFatherLink[cb2].count;
}
}
if (num === 1) {
father += " baby";
} else if (num >= 40) {
father += String(" massive brood of " + num + " babies");
} else if (num >= 20) {
father += String(" brood of " + num + " babies");
} else if (num >= 10) {
father += String(" impressive group of " + num + " babies");
} else {
father += String(" " + pregNumberName(num, 2));
}
}
if (slave.broodmother < 1) {
slave.curStillBirth = slave.womb.length;
WombFlush(slave);
}
let incubated = 0;
let cToIncub = 0, cToNursery = 0;
for (let csec = 0; csec < curBabies; csec++) {
if (slave.curBabies[csec].reserve === "incubator") {
cToIncub++;
} else if (slave.curBabies[csec].reserve === "nursery") {
cToNursery++;
}
}
/* ------------------------------------------------ */
r.push(`${slave.slaveName}'s straining womb finally gave out and burst, taking ${his}`);
if (curBabies > 0) {
r.push(`life, but not `);
if (curBabies <= 1) {
r.push(`that of ${his} child`);
} else {
r.push(`those of all ${his} children`);
}
if (fathersReduced.length > 2) {
for (let cb = 0; cb < fathersReduced.length; cb++) {
if (cb < fathersReduced.length - 1) {
r.push(`${fathersReduced[cb]},`);
} else {
r.push(`and ${fathersReduced[cb]}`);
}
}
} else if (fathersReduced.length > 1) {
r.push(`${fathersReduced[0]} and ${fathersReduced[1]}`);
} else {
r.push(fathersReduced[0]);
}
if (curBabies <= 1) {
r.push(`has`);
} else {
r.push(`have`);
}
r.push(`promptly been`);
incubated = 0;
if (cToIncub === curBabies) {
r.push(`taken to ${V.incubatorName}.`);
} else if (cToIncub < curBabies && cToIncub > 0) {
r.push(`split between ${V.incubatorName} and`);
if (cToNursery > 0) {
if (cToNursery === curBabies - cToIncub && incubated > 0) {
r.push(`${V.nurseryName}.`);
} else if (cToNursery < curBabies - cToIncub && cToNursery > 0) {
r.push(`${V.nurseryName}, and the medical suite.`);
}
} else {
r.push(`the medical suite.`);
}
} else if (cToNursery === curBabies) {
r.push(`taken to ${V.nurseryName}.`);
} else if (cToNursery < curBabies && cToNursery > 0) {
r.push(`split between ${V.nurseryName} and the medical suite.`);
} else {
r.push(`taken to the medical suite.`);
}
if (cToIncub > 0 || cToNursery > 0) {
sendNewbornsToFacility(slave);
}
} else {
r.push(`life and `);
if (curBabies <= 1) {
r.push(`that of ${his} child`);
} else {
r.push(`those of ${his} children`);
}
r.push(`.`);
}
if (curBabies > 0) {
let babyCost;
App.UI.DOM.appendNewElement("p", el, r.join(" "));
r = [];
const span = document.createElement("span");
span.id = V.dispositionId;
if (V.arcologies[0].FSRestart !== "unset" && slave.breedingMark === 1 && V.propOutcome === 1 && (slave.pregSource === -1 || slave.pregSource === -6)) {
span.append(`From there, ${his} ${(curBabies > 1) ? `children are` : `child is`} collected by the Societal Elite to be raised into upstanding members of the new society.`);
} else if (slave.breedingMark === 1 && V.propOutcome === 1 && (slave.pregSource === -1 || slave.pregSource === -6) && V.DefaultBirthDestination === "the market") {
babyCost = random(2000, 4500);
cashX((curBabies * (babyCost)), "babyTransfer");
span.append(`${His} ${(curBabies > 1) ? `babies were` : `baby was`} purchased by the Societal Elite for `);
const cashText = App.UI.DOM.cashFormat(curBabies * (babyCost));
cashText.append(`.`);
span.append(cashText);
} else if (slave.pregSource === -9 && V.DefaultBirthDestination === "the market") {
babyCost = random(1000, 2500);
span.append(`${His} ${(curBabies > 1) ? `babies were` : `baby was`} purchased by the Futanari Sisters for `);
const cashText = App.UI.DOM.cashFormat(curBabies * (babyCost));
cashText.append(`.`);
span.append(cashText);
cashX((curBabies * (babyCost)), "babyTransfer");
} else if (V.DefaultBirthDestination === "individually decided fates") {
span.append(`Unless you provide otherwise, the ${(curBabies > 1) ? `children` : `child`} will be remanded to one of ${V.arcologies[0].name}'s slave orphanages.`);
V.slaveOrphanageTotal += curBabies; // Move them now, deduct later if assigned elsewhere.
let div;
if (V.arcologies[0].FSRepopulationFocus > 40) {
div = document.createElement("div");
div.append(
App.UI.DOM.link(
"Send them to a breeder school",
() => {
V.breederOrphanageTotal += curBabies;
V.slaveOrphanageTotal -= curBabies;
jQuery(`#${V.dispositionId}`).empty().append(`The ${(curBabies > 1) ? `children are` : `child is`} sent to one of ${V.arcologies[0].name}'s future minded schools, to be administered fertility and virility treatments as well as be brought up to take pride in reproduction. Hopefully there they will be trained to not suffer the same fate.`);
}
)
);
App.UI.DOM.appendNewElement("span", div, `Will cost a one time ${cashFormat(50)}`, "note");
p.append(div);
}
div = document.createElement("div");
div.append(
App.UI.DOM.link(
"Send them to a citizen school",
() => {
V.citizenOrphanageTotal += curBabies;
V.slaveOrphanageTotal -= curBabies;
jQuery(`#${V.dispositionId}`).empty().append(`The ${(curBabies > 1) ? `children are` : `child is`} sent to one of ${V.arcologies[0].name}'s citizen schools, to be brought up coequal with the arcology's other young people.`);
}
)
);
App.UI.DOM.appendNewElement("span", div, `Will cost ${cashFormat(100)} weekly`, "note");
p.append(div);
if (slave.breedingMark === 1 && (slave.pregSource === -1 || slave.pregSource === -6) && V.propOutcome === 1) {
div = document.createElement("div");
div.append(
App.UI.DOM.link(
"Give them to the Societal Elite.",
() => {
V.citizenOrphanageTotal += curBabies;
V.slaveOrphanageTotal -= curBabies;
jQuery(`#${V.dispositionId}`).empty().append(`The ${(curBabies > 1) ? `children are` : `child is`} sent to be raised by the Societal Elite, to be brought up as ${(curBabies > 1) ? `future members` : `a future member`} of their vision of the world.`);
V.slaveOrphanageTotal -= curBabies;
V.nextButton = "Back";
App.Utils.updateUserButton();
}
)
);
App.UI.DOM.appendNewElement("span", div, `Will cost ${cashFormat(100)} weekly`, "note");
p.append(div);
}
if (slave.pregSource === -9) {
div = document.createElement("div");
div.append(
App.UI.DOM.link(
"Give them to the Futanari Sisters",
() => {
V.slaveOrphanageTotal -= curBabies;
jQuery(`#${V.dispositionId}`).empty().append(`The ${(curBabies > 1) ? `children are` : `child is`} handed off to be raised by their father, the Futanari Sisters. You recommend they take it easy for a while before any more burst into kids.`);
}
)
);
p.append(div);
}
div = document.createElement("div");
div.append(
App.UI.DOM.link(
"Have them raised privately",
() => {
V.privateOrphanageTotal += curBabies;
V.slaveOrphanageTotal -= curBabies;
jQuery(`#${V.dispositionId}`).empty().append(`The ${(curBabies > 1) ? `children are` : `child is`} sent to be privately raised, to be brought up as ${(curBabies > 1) ? `future high class citizens` : `a future high class citizen`}.`);
}
)
);
App.UI.DOM.appendNewElement("span", div, `Will cost ${cashFormat(500)} weekly`, "note");
p.append(div);
if (V.policies.cash4Babies === 1) {
if (slave.pregSource === -9) {
div = document.createElement("div");
div.append(
App.UI.DOM.link(
"Send them to auction",
() => {
if (slave.prestige > 1 || slave.porn.prestige > 2) {
babyCost = random(-12, 100);
if (slave.prematureBirth > 0) {
babyCost = random(-32, 40);
}
} else {
babyCost = random(-12, 12);
if (slave.prematureBirth > 0) {
babyCost = -45;
}
}
const aucResult = new DocumentFragment();
const auctionIncome = curBabies * (50 + babyCost);
aucResult.append(`${His} ${(curBabies > 1) ? `babies were` : `baby was`} sold for ${(curBabies > 1) ? `a total of ` : ``}`);
const cashSpan = App.UI.DOM.cashFormat(auctionIncome);
if (slave.prematureBirth === 1) {
cashSpan.append(`, `);
aucResult.append(cashSpan);
aucResult.append(`a low price, due to the added costs of caring for them.`);
} else {
cashSpan.append(`.`);
aucResult.append(cashSpan);
}
cashX(auctionIncome, "babyTransfer");
V.slaveOrphanageTotal -= curBabies;
jQuery(`#${V.dispositionId}`).empty().append(aucResult);
}
)
);
p.append(div);
}
}
} else {
switch (V.DefaultBirthDestination) {
case "an orphanage":
r.push(`The child`);
if (curBabies > 1) {
r.push(`ren`);
}
r.push(` will be remanded to one of ${V.arcologies[0].name}'s slave orphanages.`);
V.slaveOrphanageTotal += curBabies;
break;
case "a citizen school":
r.push(`The child`);
if (curBabies > 1) {
r.push(`ren are`);
} else {
r.push(` is`);
}
r.push(` sent to one of ${V.arcologies[0].name}'s citizen schools, to be brought up coequal with the arcology's other young people.`);
V.citizenOrphanageTotal += curBabies;
V.slaveOrphanageTotal -= curBabies;
break;
case "a private school":
r.push(`The child`);
if (curBabies > 1) {
r.push(`ren are`);
} else {
r.push(` is`);
}
r.push(` sent to be privately raised, to be brought up as `);
if (curBabies > 1) {
r.push(`future high class citizens`);
} else {
r.push(`a future high class citizen`);
}
r.push(`.`);
V.privateOrphanageTotal += curBabies;
V.slaveOrphanageTotal -= curBabies;
break;
case "breeder schools":
r.push(`The child`);
if (curBabies > 1) {
r.push(`ren are`);
} else {
r.push(` is`);
}
r.push(` sent to one of ${V.arcologies[0].name}'s future minded schools, to be administered fertility and virility treatments as well as be brought up to take pride in reproduction. Hopefully there they will be trained to not suffer the same fate.`);
V.breederOrphanageTotal += curBabies;
V.slaveOrphanageTotal -= curBabies;
break;
case "the market":
const auctionIncome = curBabies * (50 + babyCost);
if (slave.prestige > 1 || slave.porn.prestige > 2) {
babyCost = random(-12, 100);
if (slave.prematureBirth > 0) {
babyCost = random(-32, 40);
}
} else {
babyCost = random(-12, 12);
if (slave.prematureBirth > 0) {
babyCost = -45;
}
}
span.append(`${His} ${(curBabies > 1) ? `babies were` : `baby was`} sold for ${(curBabies > 1) ? `a total of` : ``} `);
cashText = App.UI.DOM.cashFormat(auctionIncome);
if (slave.prematureBirth === 1) {
cashText.append(`, `);
span.append(cashText);
span.append(`a low price, due to the added costs of caring for them.`);
} else {
cashText.append(`.`);
span.append(cashText);
}
cashX(auctionIncome, "babyTransfer");
}
}
p.append(span);
}
if (V.arcologies[0].FSRestart !== "unset" && curBabies > 0) {
const elitePara = document.createElement("p");
if (slave.breedingMark === 1 && (slave.pregSource === -1 || slave.pregSource === -6) && V.propOutcome === 1) {
elitePara.append(`The Societal Elite `);
App.UI.DOM.appendNewElement("span", elitePara, `are pleased `, "green");
elitePara.append(`at the new additions to their class, despite it claiming a promising breeder.`);
V.failedElite -= curBabies;
} else if (V.eugenicsFullControl !== 1) {
elitePara.append(`The Societal Elite `);
App.UI.DOM.appendNewElement("span", elitePara, `are disappointed `, "red");
elitePara.append(`that you would allow subhuman filth to dirty society under your watch. Society `);
App.UI.DOM.appendNewElement("span", elitePara, `frowns `, "red");
elitePara.append(`on the unwelcome addition of more subhumans into the world. At least the "birth" claimed the wretched ${girl}'s life.`);
V.failedElite += (5 * curBabies);
repX(forceNeg(10 * curBabies), "babyTransfer");
}
p.append(elitePara);
}
V.reservedChildren = FetusGlobalReserveCount("incubator");
V.reservedChildrenNursery = FetusGlobalReserveCount("nursery");
}
// <br>//<br><hr style="margin:0">//<br>
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment