From 039386ec3534376a6b0a36be2879fb53b20f0de1 Mon Sep 17 00:00:00 2001 From: Pregmodder <pregmodder@gmail.com> Date: Thu, 28 Feb 2019 01:18:45 -0500 Subject: [PATCH] Bulk incubator release --- devNotes/VersionChangeLog-Premod+LoliMod.txt | 1 + src/init/storyInit.tw | 1 + src/npc/startingGirls/startingGirls.tw | 3 + src/pregmod/incubator.tw | 46 ++++++-- src/pregmod/incubatorRetrievalWorkaround.tw | 113 +++++++++++++++---- 5 files changed, 134 insertions(+), 30 deletions(-) diff --git a/devNotes/VersionChangeLog-Premod+LoliMod.txt b/devNotes/VersionChangeLog-Premod+LoliMod.txt index d0130fd7213..d3fb52c8070 100644 --- a/devNotes/VersionChangeLog-Premod+LoliMod.txt +++ b/devNotes/VersionChangeLog-Premod+LoliMod.txt @@ -12,6 +12,7 @@ Pregmod -RA can now apply contraceptives to postpartum slaves -RA can now manage basic abortions -added abortion tracking tattoos + -added bulk incubator retrieval -fixes 0.10.7.1-2.1.x diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index ae273a874dc..c62aa478cb9 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -557,6 +557,7 @@ You should have received a copy of the GNU General Public License along with thi <<set $incubator = 0>> <<set $incubatorSlaves = 0>> +<<set $incubatorBulkRelease = 0>> <<set $incubatorOrgans = []>> <<set $incubatorOldID = 0>> <<set $incubatorUpgradeSpeed = 5>> diff --git a/src/npc/startingGirls/startingGirls.tw b/src/npc/startingGirls/startingGirls.tw index 6be5c85f459..1dbb64f0b71 100644 --- a/src/npc/startingGirls/startingGirls.tw +++ b/src/npc/startingGirls/startingGirls.tw @@ -1008,6 +1008,9 @@ Her nationality is $activeSlave.nationality. <<else>>Barren. <</if>> </span> +<<if $seeHyperPreg == 1 && $cheatMode == 1>> + <<link "Bursting at the seams">><<set $activeSlave.preg = 43,$activeSlave.pregType = 150,$activeSlave.pregWeek = 43,$activeSlave.pregKnown = 1,$activeSlave.belly = 2700000,$activeSlave.bellyPreg = 2700000,$activeSlave.pubertyXX = 1>><<replace "#preg">>Ready to test extreme hyperpreg content.<</replace>><<StartingGirlsCost>><</link>> | +<</if>> <<link "Completely Filled">><<set $activeSlave.preg = 43,$activeSlave.pregType = 8,$activeSlave.pregWeek = 43,$activeSlave.pregKnown = 1,$activeSlave.belly = 120000,$activeSlave.bellyPreg = 120000,$activeSlave.pubertyXX = 1>><<replace "#preg">>Stuffed to capacity.<</replace>><<StartingGirlsCost>><</link>> | <<link "Ready to Drop">><<set $activeSlave.preg = 40,$activeSlave.pregType = 1,$activeSlave.pregWeek = 40,$activeSlave.pregKnown = 1,$activeSlave.belly = 15000,$activeSlave.bellyPreg = 15000,$activeSlave.pubertyXX = 1>><<replace "#preg">>Ready to drop.<</replace>><<StartingGirlsCost>><</link>> | <<link "Advanced">><<set $activeSlave.preg = 34,$activeSlave.pregType = 1,$activeSlave.pregWeek = 34,$activeSlave.pregKnown = 1,$activeSlave.belly = 10000,$activeSlave.bellyPreg = 10000,$activeSlave.pubertyXX = 1>><<replace "#preg">>Advanced.<</replace>><<StartingGirlsCost>><</link>> | diff --git a/src/pregmod/incubator.tw b/src/pregmod/incubator.tw index c4681d40bf9..a06a4c647d9 100644 --- a/src/pregmod/incubator.tw +++ b/src/pregmod/incubator.tw @@ -8,7 +8,7 @@ <<set $incubatorNameCaps = $incubatorName.replace("the ", "The ")>> <</if>> -<<set $readySlaves = 0, $readySlave = 0, $incubatorSlaves = $tanks.length, $freeTanks = $incubator - $incubatorSlaves, _SL = $slaves.length, _eligibility = 0, $reservedChildren = FetusGlobalReserveCount("incubator"), $reservedChildrenNursery = FetusGlobalReserveCount("nursery")>> +<<set _readySlaves = 0, $readySlave = 0, $incubatorSlaves = $tanks.length, $freeTanks = $incubator - $incubatorSlaves, _SL = $slaves.length, _eligibility = 0, $reservedChildren = FetusGlobalReserveCount("incubator"), $reservedChildrenNursery = FetusGlobalReserveCount("nursery")>> <br><br> $incubatorNameCaps is a clean, cold hall designed to be lined with tanks and their connected monitoring systems. @@ -239,6 +239,15 @@ Reserve an eligible mother-to-be's child to be placed in a tank upon birth. Of $ Target age for release: <<textbox "$targetAge" $targetAge "Incubator">> [[Minimum Legal Age|Incubator][$targetAge = $minimumSlaveAge]] | [[Average Age of Fertility|Incubator][$targetAge = $fertilityAge]] | [[Average Age of Potency|Incubator][$targetAge = $potencyAge]] | [[Legal Adulthood|Incubator][$targetAge = 18]] //Setting will not be applied to tanks in use.// +<br> +<<if $incubatorBulkRelease == 1>> + Released children will be handled in bulk and not recieve personal attention. + [[Individual release|Incubator][$incubatorBulkRelease = 0]] +<<else>> + Released children will be seen to personally. + [[Bulk release|Incubator][$incubatorBulkRelease = 1]] +<</if>> + <br> <<if $incubatorUpgradeSpeed == 52>> It has been upgraded with perfected growth accelerants; children grow at the rate of 1 week to 1 year. @@ -393,7 +402,7 @@ Target age for release: <<textbox "$targetAge" $targetAge "Incubator">> [[Minimu <</if>> <</if>> <<if $tanks[$i].growTime <= 0>> - <<set $readySlaves = 1>> + <<set _readySlaves = 1>> <br>$He is ready to be released from $his tank. <<else>> <br>$His growth is currently being accelerated. $He will be ready for release in about <<print Math.round($tanks[$i].growTime/$incubatorUpgradeSpeed)>> weeks. @@ -585,15 +594,32 @@ Target age for release: <<textbox "$targetAge" $targetAge "Incubator">> [[Minimu <</if>> <</if>> -<<if $readySlaves == 1>> - <<for $i = 0; $i < $incubatorSlaves; $i++>> - <<if $tanks[$i].growTime <= 0>> - <<set $incubatorOldID = $tanks[$i].ID>> - <<set $readySlave = $tanks[$i]>> - <<run $tanks.splice($i, 1)>> - <<break>> +<<if _readySlaves == 1>> + <<if $incubatorBulkRelease == 1>> + <<set $newSlavePool = []>> + <<for _inc = 0; _inc < $incubatorSlaves; _inc++>> + <<if $tanks[_inc].growTime <= 0>> + <<set $incubatorOldID = $tanks[_inc].ID>> /* single slave case */ + <<set _tempObject = {object: $tanks[_inc], ID: $tanks[_inc].ID}>> + <<set $newSlavePool.push(clone(_tempObject))>> + <<run $tanks.splice(_inc, 1)>> + <<set _inc-->> + <</if>> + <</for>> + <<if $newSlavePool.length == 1>> + <<set $readySlave = $newSlavePool[0]>> + <<set $newSlavePool = 0>> <</if>> - <</for>> + <<else>> + <<for _inc = 0; _inc < $incubatorSlaves; _inc++>> + <<if $tanks[_inc].growTime <= 0>> + <<set $incubatorOldID = $tanks[_inc].ID>> + <<set $readySlave = $tanks[_inc]>> + <<run $tanks.splice(_inc, 1)>> + <<break>> + <</if>> + <</for>> + <</if>> <<goto "Incubator Retrieval Workaround">> <</if>> diff --git a/src/pregmod/incubatorRetrievalWorkaround.tw b/src/pregmod/incubatorRetrievalWorkaround.tw index 48405e08bf9..488b17854a6 100644 --- a/src/pregmod/incubatorRetrievalWorkaround.tw +++ b/src/pregmod/incubatorRetrievalWorkaround.tw @@ -1,28 +1,101 @@ :: Incubator Retrieval Workaround [nobr] -<<setLocalPronouns $readySlave>> -$readySlave.slaveName has been discharged from $incubatorName and is ready for $his first ever inspection. +<<set $nextLink = "AS Dump", $returnTo = "Main">> -<br><br> +<<if $readySlave != 0>> + <<setLocalPronouns $readySlave>> + $readySlave.slaveName has been discharged from $incubatorName and is ready for $his first ever inspection. -<<set $activeSlave = $readySlave>> -<<set $saleDescription = 0, $applyLaw = 0>> -<<set $incubatorSlaves-->> -<<include "Long Slave Description">> -<<run newSlave($activeSlave)>> -<<set $nextLink = "AS Dump">> -<<set $returnTo = "Main">> -<<if $incubatorOrgans.length > 0>> - <<for _i = 0; _i < $incubatorOrgans.length; _i++>> - <<if $incubatorOrgans[_i].ID == $incubatorOldID>> - <<set _newOrgan = {type: $incubatorOrgans[_i].type, weeksToCompletion: $incubatorOrgans[_i].weeksToCompletion, ID: $activeSlave.ID}>> - <<if _newOrgan.weeksToCompletion <= 0>> - <<set $completedOrgans.push($incubatorOrgans[_i])>> + <br><br> + + <<set $activeSlave = $readySlave>> + <<set $saleDescription = 0, $applyLaw = 0>> + <<set $incubatorSlaves-->> + <<include "Long Slave Description">> + <<run newSlave($activeSlave)>> + <<if $incubatorOrgans.length > 0>> + <<for _irw = 0; _irw < $incubatorOrgans.length; _irw++>> + <<if $incubatorOrgans[_irw].ID == $incubatorOldID>> + <<set _newOrgan = {type: $incubatorOrgans[_irw].type, weeksToCompletion: $incubatorOrgans[_irw].weeksToCompletion, ID: $activeSlave.ID}>> + <<if _newOrgan.weeksToCompletion <= 0>> + <<set $completedOrgans.push($incubatorOrgans[_irw])>> + <<else>> + <<set $organs.push(_newOrgan)>> + <</if>> + <<set $incubatorOrgans.deleteAt(_irw), _irw-->> + <</if>> + <</for>> + <</if>> + <<include "New Child Intro">> +<<else>> + The following slaves were discharged from $incubatorName: + + <<for _irw = 0; _irw < $newSlavePool.length; _irw++>> + <br><br> + <<set $incubatorSlaves-->> + <<set _newSlave = $newSlavePool[_irw].object>> + + Name: <<= SlaveFullName(_newSlave)>> + <br>Mother: + <<if _newSlave.mother > 0>> + <<set _tempMom = getSlave(_newSlave.mother)>> + <<if ndef _tempMom>> + Unknown. + <<else>> + <<= SlaveFullName(_tempMom)>> + <</if>> + <<elseif _newSlave.mother == -1>> + <<= PlayerName()>>. + <<else>> + Your former slave, $missingTable[_newSlave.mother].slaveName. + <</if>> + <br>Father: + <<if _newSlave.father > 0>> + <<set _tempDad = getSlave(_newSlave.father)>> + <<if ndef _tempDad>> + Unknown. <<else>> - <<set $organs.push(_newOrgan)>> + <<= SlaveFullName(_tempDad)>> <</if>> - <<set $incubatorOrgans.deleteAt(_i), _i-->> + <<elseif _newSlave.father == -1>> + <<= PlayerName()>>. + <<elseif _newSlave.father == -2>> + Unknown citizen. + <<elseif _newSlave.father == -3>> + Your former Master. + <<elseif _newSlave.father == -4>> + Another arcology's owner. + <<elseif _newSlave.father == -5>> + One of your clients. + <<elseif _newSlave.father == -6>> + Societal elite. + <<elseif _newSlave.father == -7>> + Lab crafted. + <<elseif _newSlave.father == -8>> + //Error! Animal fathered children shouldn't be here!// + <<else>> + <<if def $missingTable[_newSlave.father]>> + Your former slave, $missingTable[_newSlave.father].slaveName. + <<else>> + Unknown. + <</if>> + <</if>> + + <<run newSlave(_newSlave)>> + <<if $incubatorOrgans.length > 0>> + <<for _irw2 = 0; _irw2 < $incubatorOrgans.length; _irw2++>> + <<if $incubatorOrgans[_irw2].ID == $newSlavePool[_irw].ID>> + <<set _newOrgan = {type: $incubatorOrgans[_irw2].type, weeksToCompletion: $incubatorOrgans[_irw2].weeksToCompletion, ID: _newSlave.ID}>> + <<if _newOrgan.weeksToCompletion <= 0>> + <<set $completedOrgans.push($incubatorOrgans[_irw2])>> + <<else>> + <<set $organs.push(_newOrgan)>> + <</if>> + <<set $incubatorOrgans.deleteAt(_irw2), _irw2-->> + <</if>> + <</for>> <</if>> + <</for>> -<</if>> -<<include "New Child Intro">> + <<set $newSlavePool = 0>> +<</if>> \ No newline at end of file -- GitLab