Skip to content
Snippets Groups Projects
Commit a1cb8ad2 authored by Pregmodder's avatar Pregmodder
Browse files

fixes and sufficiently grown children may survive slave bursting.

parent 04d2982c
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,9 @@
01/21/2019
2
-more budget fixes to seeUnit and pPeaceKeepersDeficit
1
-fixed an error with cloning
......
......@@ -6,7 +6,288 @@
<<if $slaves[_b].burst == 1>>
<<if (($slaves[_b].belly > ($slaves[_b].pregAdaptation*3200)) || $slaves[_b].bellyPreg > 600000)>>
$slaves[_b].slaveName's straining womb finally gave out and burst, taking $his life and that of $his children. //Placeholder//
<<set $slaves[_b].curBabies = WombBirth($slaves[_b], $slaves[_b].pregData.minLiveBirth)>>
<<set $slaves[_b].curStillBirth = 0 >>
<<set _curBabies = $slaves[_b].curBabies.length>> /*just to improve speed and usability here.*/
<<set $birthsTotal += _curBabies>>
<<set _others = 0, _PC = 0, _citizens = 0, _oldMaster = 0, _arcOwner = 0, _lab = 0, _fathers = [], _babyFatherLink = []>>
<<for _cb = 0; _cb < $slaves[_b].curBabies.length; _cb++>>
<<if $slaves[_b].curBabies[_cb].fatherID == 0 || $slaves[_b].curBabies[_cb].fatherID == -5>>
<<set _others++>>
<<set _fathers.push("some man's")>>
<<elseif $slaves[_b].curBabies[_cb].fatherID == -1>>
<<set $PC.slavesFathered++>>
<<set _PC++>>
<<set _fathers.push("your")>>
<<elseif $slaves[_b].curBabies[_cb].fatherID == -2>>
<<set _citizens++>>
<<set _fathers.push("your arcology's")>>
<<elseif $slaves[_b].curBabies[_cb].fatherID == -3>>
<<set _oldMaster++>>
<<set _fathers.push("your former Master's")>>
<<elseif $slaves[_b].curBabies[_cb].fatherID == -4>>
<<set _arcOwner++>>
<<set _fathers.push("another arcology owner's")>>
<<elseif $slaves[_b].curBabies[_cb].fatherID == -7>>
<<set _lab++>>
<<set _fathers.push("the gene lab's")>>
<<else>>
<<set _babyDaddy = findFather($slaves[_b].curBabies[_cb].fatherID)>>
<<if def _babyDaddy>>
<<if _babyDaddy.ID == $slaves[_b].ID>>
<<set _fathers.push(String($his + " own"))>>
<<for _cb2 = 0; _cb2 < _babyFatherLink.length; _cb2++>>
<<if _babyFatherLink[_cb2].string == String($his + " own")>>
<<set _babyFatherLink[_cb2].count++>>
<<else>>
<<set _babyFatherLink[_cb2] = {string: String($his + " own"), count: 1}>>
<</if>>
<</for>>
<<else>>
<<set _fathers.push(String(_babyDaddy.slaveName+ "'s"))>>
<<for _cb2 = 0; _cb2 < _babyFatherLink.length; _cb2++>>
<<if _babyFatherLink[_cb2].string == String(_babyDaddy.slaveName+ "'s")>>
<<set _babyFatherLink[_cb2].count++>>
<<else>>
<<set _babyFatherLink[_cb2] = {string: String(_babyDaddy.slaveName+ "'s"), count: 1}>>
<</if>>
<</for>>
<</if>>
<<set _adjust = _babyDaddy.slavesFathered++>>
<<set adjustFatherProperty(_babyDaddy, "slavesFathered", _adjust)>>
<<else>>
<<set _others++>>
<<set _fathers.push("some man's")>>
<</if>>
<</if>>
<</for>>
<<set _fathersReduced = removeDuplicates(_fathers)>>
<<for _cb = 0; _cb < _fathersReduced.length; _cb++>>
<<set _num = 0>>
<<if _fathersReduced[_cb] == "some man's">>
<<set _num = _others>>
<<elseif _fathersReduced[_cb] == "your">>
<<set _num = _PC>>
<<elseif _fathersReduced[_cb] == "your arcology's">>
<<set _num = _citizens>>
<<elseif _fathersReduced[_cb] == "your former Master's">>
<<set _num = _oldMaster>>
<<elseif _fathersReduced[_cb] == "another arcology owner's">>
<<set _num = _arcOwner>>
<<elseif _fathersReduced[_cb] == "the gene lab's">>
<<set _num = _lab>>
<<else>>
<<set _cb2 = _babyFatherLink.findIndex(function(s) {_fathersReduced[_cb] == _babyFatherLink[s].string; })>>
<<if _cb2 != -1>>
<<set _num = _babyFatherLink[_cb2].count>>
<</if>>
<</if>>
<<if _num == 1>>
<<set _fathersReduced[_cb] += " baby">>
<<elseif _num >= 40>>
<<set _fathersReduced[_cb] += String(" massive brood of " + _num + " babies")>>
<<elseif _num >= 20>>
<<set _fathersReduced[_cb] += String(" brood of " + _num + " babies")>>
<<elseif _num >= 10>>
<<set _fathersReduced[_cb] += String(" impressive group of " + _num + " babies")>>
<<elseif _num == 9>>
<<set _fathersReduced[_cb] += " nonuplets">>
<<elseif _num == 8>>
<<set _fathersReduced[_cb] += " octuplets">>
<<elseif _num == 7>>
<<set _fathersReduced[_cb] += " septuplets">>
<<elseif _num == 6>>
<<set _fathersReduced[_cb] += " sextuplets">>
<<elseif _num == 5>>
<<set _fathersReduced[_cb] += " quintuplets">>
<<elseif _num == 4>>
<<set _fathersReduced[_cb] += " quadruplets">>
<<elseif _num == 3>>
<<set _fathersReduced[_cb] += " triplets">>
<<elseif _num == 2>>
<<set _fathersReduced[_cb] += " twins">>
<</if>>
<</for>>
<<if $slaves[_b].broodmother < 1>>
<<set $slaves[_b].curStillBirth = $slaves[_b].womb.length>>
<<set WombFlush($slaves[_b])>>
<</if>>
<<set _incubated = 0>>
<<set _cToIncub = 0, _cToNursery = 0>>
<<for _csec = 0; _csec < _curBabies; _csec++>>
<<if $slaves[_b].curBabies[_csec].reserve === "incubator">>
<<set _cToIncub++>>
<<elseif $slaves[_b].curBabies[_csec].reserve === "nursery">>
<<set _cToNursery++>>
<</if>>
<</for>>
/* ------------------------------------------------ */
$slaves[_b].slaveName's straining womb finally gave out and burst, taking $his
<<if _curBabies > 0>>
life, but not <<if _curBabies <= 1>>that of $his child<<else>>those of all $his children<</if>>;
<<if _fathersReduced.length > 2>>
<<for _cb = 0; _cb < _fathersReduced.length; _cb++>>
<<if _cb < _fathersReduced.length-1>>
_fathersReduced[_cb],
<<else>>
and _fathersReduced[_cb]
<</if>>
<</for>>
<<elseif _fathersReduced.length > 1>>
_fathersReduced[0] and _fathersReduced[1]
<<else>>
_fathersReduced[0]
<</if>>
<<if _curBabies <= 1>>has<<else>>have<</if>>
promptly been
<<set _incubated = 0>>
<<if _cToIncub == _curBabies>>
taken to $incubatorName.
<<elseif _cToIncub < _curBabies && _cToIncub > 0>>
split between $incubatorName and
<<if _cToNursery == _curBabies-_cToIncub && _incubated > 0>>
$nurseryName.
<<elseif _cToNursery < _curBabies-_cToIncub && _cToNursery > 0>>
$nurseryName, and the medical suite.
<</if>>
<<elseif _cToNursery == _curBabies>>
taken to $nurseryName.
<<elseif _cToNursery < _curBabies && _cToNursery > 0>>
split between $nurseryName and the medical suite.
<<else>>
taken to the medical suite.
<</if>>
<<set $mom = $slaves[_b]>>
<<if _cToIncub > 0 || _cToNursery > 0>>
<<for _cb = 0; _cb < _curBabies; _cb++>> /* if there is no reserved children, code in loop will not trigger */
<<if $mom.curBabies[_cb].reserve == "incubator">>
<<set $slaves[_b] = generateChild($mom, $mom.curBabies[_cb], 1)>>
<<include "Incubator Workaround">>
<<run $mom.curBabies.splice($mom.curBabies[_cb], 1)>>
<<set _cb--, _curBabies-->>
<<elseif $mom.curBabies[_cb].reserve == "nursery">>
<<set $slaves[_b] = generateChild($mom, $mom.curBabies[_cb])>>
<<include "Nursery Workaround">>
<<run $mom.curBabies.splice($mom.curBabies[_cb], 1)>>
<<set _cb--, _curBabies-->>
<</if>>
<</for>>
<</if>>
<<set $slaves[_b] = $mom>>
<<else>>
life and <<if _curBabies <= 1>>that of $his child<<else>>those of $his children<</if>>.
<</if>>
<<set _curBabies = $slaves[_b].curBabies.length>>
<<if _curBabies > 0>>
<<set _count = _curBabies>>
<br><br>
<<span $dispositionId>>
<<if $arcologies[0].FSRestart != "unset" && $slaves[[_b].breedingMark == 1 && $propOutcome == 1 && $slaves[$i].pregSource == -1>>
<<set _lostBabies = 1>>
From there, $his child<<if _curBabies > 1>>ren are<<else>> is<</if>> collected by the Societal Elite to be raised into upstanding members of the new society.
<<elseif $Cash4Babies == 1 && $DefaultBirthDestination !== "the market">>
<<set _lostBabies = 1>>
<<set _babyCost = random(-12,12)>>
<<if $slaves[$i].prematureBirth == 1>><<set _babyCost = -45>><</if>>
$His <<if _curBabies > 1>>babies<<else>>baby<</if>> sold for <<if _curBabies > 1>>a total of <</if>>@@.yellowgreen;<<print cashFormat(_curBabies*(50+_babyCost))>>.@@<<if $slaves[$i].prematureBirth == 1>> A low price due to the added costs of caring for them.<</if>>
<<run cashX((_curBabies*(50+_babyCost)), "babyTransfer")>>
<</if>>
<<if _lostBabies != 1 && $universalRulesChildrenBecomeBreeders > 0 && $arcologies[0].FSRepopulationFocus > 40 && $DefaultBirthDestination === "individually decided fates">>
<<set _lostBabies = 1>>
$His child<<if _curBabies > 1>>ren are<<else>> is<</if>> sent to one of $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.
<<set $breederOrphanageTotal += _count>>
<<elseif _lostBabies != 1 && $DefaultBirthDestination === "individually decided fates" && $universalRulesChildrenBecomeBreeders < 1>>
<<set $slaveOrphanageTotal += _curBabies>>
Unless you provide otherwise, the child<<if _curBabies > 1>>ren<</if>> will be remanded to one of $arcologies[0].name's slave orphanages.
<<capture $i, $dispositionId, _count>>
<br>
<<if $arcologies[0].FSRepopulationFocus > 40>>
<<link 'Send them to a breeder school'>>
<<replace `"#" + $dispositionId`>>
The child<<if _count > 1>>ren are<<else>> is<</if>> sent to one of $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.
<<set $breederOrphanageTotal += _count, $slaveOrphanageTotal -= _count>>
<</replace>>
<</link>>
//Will cost a one-time <<print cashFormat(50)>>// |
<</if>>
<<link 'Send them to a citizen school'>>
<<replace `"#" + $dispositionId`>>
The child<<if _count > 1>>ren are<<else>> is<</if>> sent to one of $arcologies[0].name's citizen schools, to be brought up coequal with the arcology's other young people.
<<set $slaves[$i].devotion += 4, $citizenOrphanageTotal += _count, $slaveOrphanageTotal -= _count>>
<</replace>>
<</link>>
//Will cost <<print cashFormat(100)>> weekly//
| <<link 'Have them raised privately'>>
<<replace `"#" + $dispositionId`>>
The child<<if _count > 1>>ren are<<else>> is<</if>> sent to be privately raised, to be brought up as a future high class citizen.
<<set $slaves[$i].devotion += 6, $privateOrphanageTotal += _count, $slaveOrphanageTotal -= _count>>
<</replace>>
<</link>>
//Will cost <<print cashFormat(500)>> weekly//
<<if $Cash4Babies == 1>>
<<if $slaves[$i].prestige > 1 || $slaves[$i].pornPrestige > 2>>
| <<link 'Send them to auction'>>
<<replace `"#" + $dispositionId`>>
<<<set _babyCost = random(-12,12)>>
<<if $slaves[$i].prematureBirth == 1>><<set _babyCost = -45>><</if>>
$His <<if _curBabies > 1>>babies<<else>>baby<</if>> sold for <<if _curBabies > 1>>a total of <</if>>@@.yellowgreen;<<print cashFormat(_curBabies*(50+_babyCost))>>.@@<<if $slaves[$i].prematureBirth == 1>> A low price due to the added costs of caring for them.<</if>>
<<run cashX((_curBabies*(50+_babyCost)), "babyTransfer")>>
<<set $slaveOrphanageTotal -= _count>>
<</replace>>
<</link>>
<<else>>
| <<link 'Sell them anyway'>>
<<replace `"#" + $dispositionId`>>
<<set _babyCost = random(-12,12)>>
<<if $slaves[$i].prematureBirth == 1>><<set _babyCost = -45>><</if>>
$His <<if _curBabies > 1>>babies<<else>>baby<</if>> sold for <<if _curBabies > 1>>a total of <</if>>@@.yellowgreen;<<print cashFormat(_curBabies*(50+_babyCost))>>.@@<<if $slaves[$i].prematureBirth == 1>> A low price due to the added costs of caring for them.<</if>>
<<run cashX((_curBabies*(50+_babyCost)), "babyTransfer")>>
<<set $slaveOrphanageTotal -= _count>>
<</replace>>
<</link>>
<</if>>
<</if>>
<</capture>>
<</if>>
<</span>>
<<elseif $Cash4Babies == 1 && _curBabies > 0 && $DefaultBirthDestination === "individually decided fates" && $universalRulesChildrenBecomeBreeders < 1>>
<br><br>
<<set _babyCost = random(-12,12)>>
<<if $slaves[$i].prematureBirth == 1>><<set _babyCost = -45>><</if>>
$His <<if _curBabies > 1>>babies<<else>>baby<</if>> were sold for <<if _curBabies > 1>>a total of <</if>>@@.yellowgreen;<<print cashFormat(_curBabies*(50+_babyCost))>>.@@<<if $slaves[$i].prematureBirth == 1>> A low price due to the added costs of caring for them.<</if>>
<<run cashX((_curBabies*(50+_babyCost)), "babyTransfer")>>
<</if>>
<<if $arcologies[0].FSRestart != "unset" && _curBabies > 0 && $eugenicsFullControl != 1>>
<br><br>
<<if $slaves[_b].breedingMark == 1 && ($slaves[_b].pregSource == -1 || $slaves[_b].pregSource == -6) && $propOutcome == 1>>
The Societal Elite @@.green;are pleased@@ at the new additions to their class, despite it claiming a promising breeder.
<<set $failedElite -= _curBabies>>
<<else>>
The Societal Elite @@.red;are disappointed@@ that you would allow subhuman filth to dirty society under your watch. Society @@.red;frowns@@ on the unwelcome addition of more subhumans into the world. At least the "birth" claimed the wretched $girl's life.
<<if $eugenicsFullControl != 1>>
<<set $failedElite += 5*_curBabies>>
<</if>>
<<set $rep -= 10*_curBabies>>
<</if>>
<</if>>
<<set $reservedChildren = FetusGlobalReserveCount("incubator")>>
<<set $reservedChildrenNursery = FetusGlobalReserveCount("nursery")>>
<<elseif $slaves[_b].inflation != 0>>
<<pop $slaves[_b]>>
<</if>>
......
......@@ -919,7 +919,7 @@ All in all,
<<if _lostBabies != 1 && $universalRulesChildrenBecomeBreeders > 0 && $arcologies[0].FSRepopulationFocus > 40 && $DefaultBirthDestination === "individually decided fates">>
<<set _lostBabies = 1>>
$His <<= BirthDestinationText("Orphanage",$slaves[$i])>>
<<set $breederOrphanageTotal += _count, $slaveOrphanageTotal -= _count>>
<<set $breederOrphanageTotal += _curBabies>>
<<elseif _lostBabies != 1 && $DefaultBirthDestination === "individually decided fates" && $universalRulesChildrenBecomeBreeders < 1>>
<<set $slaveOrphanageTotal += _curBabies>>
Unless you provide otherwise, the child<<if _curBabies > 1>>ren<</if>> will be remanded to one of $arcologies[0].name's slave orphanages.
......@@ -954,12 +954,14 @@ All in all,
| <<link 'Send them to auction'>>
<<replace `"#" + $dispositionId`>>
<<= BirthDestinationText("Sold",$slaves[$i])>>
<<set $slaveOrphanageTotal -= _count>>
<</replace>>
<</link>>
<<else>>
| <<link 'Sell them anyway'>>
<<replace `"#" + $dispositionId`>>
<<= BirthDestinationText("Sold",$slaves[$i])>>
<<set $slaveOrphanageTotal -= _count>>
<</replace>>
<</link>>
<</if>>
......
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