From f4476a9004a544c3372cac85d728bf362a896baa Mon Sep 17 00:00:00 2001 From: Pregmodder <pregmodder@gmail.com> Date: Mon, 26 Nov 2018 01:31:35 -0500 Subject: [PATCH] tweaks to father locating --- devNotes/Useful JS Function Documentation.txt | 2 +- devNotes/VersionChangeLog-Premod+LoliMod.txt | 3 + devNotes/twine JS.txt | 60 ++++++++++++++++++- src/js/DefaultRules.tw | 8 +++ src/js/generateNewSlaveJS.tw | 4 +- src/js/pregJS.tw | 39 ++++++++++++ src/js/slaveCostJS.tw | 3 + src/js/slaveSummaryWidgets.tw | 4 ++ src/js/storyJS.tw | 2 +- src/pregmod/csec.tw | 13 ++-- src/pregmod/saAgent.tw | 7 ++- src/pregmod/sePlayerBirth.tw | 10 ++-- .../widgets/playerDescriptionWidgets.tw | 26 ++++---- src/pregmod/widgets/seBirthWidgets.tw | 11 ++-- src/uncategorized/saLongTermEffects.tw | 15 +++-- src/utility/descriptionWidgetsFlesh.tw | 16 ++--- src/utility/descriptionWidgetsStyle.tw | 2 +- 17 files changed, 175 insertions(+), 50 deletions(-) diff --git a/devNotes/Useful JS Function Documentation.txt b/devNotes/Useful JS Function Documentation.txt index f5cc80a9a67..dab52615a10 100644 --- a/devNotes/Useful JS Function Documentation.txt +++ b/devNotes/Useful JS Function Documentation.txt @@ -316,7 +316,7 @@ WombFlush($slave) - clean womb (array). Can be used at broodmother birthstorm or $slave.bellyPreg = WombGetWolume($slave) - return double, with current womb volume in CC - for updating $slave.bellyPreg, or if need to update individual fetuses sizes. - +findFather(ID) - searchs for the ID given and returns an object or undefined diff --git a/devNotes/VersionChangeLog-Premod+LoliMod.txt b/devNotes/VersionChangeLog-Premod+LoliMod.txt index 414aad21858..6f4fa620691 100644 --- a/devNotes/VersionChangeLog-Premod+LoliMod.txt +++ b/devNotes/VersionChangeLog-Premod+LoliMod.txt @@ -4,6 +4,9 @@ 11/25/2018 + 3 + -fixed an issue with csec and reservations + 2 -fixes -more names and stuff (I think) diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index 328ae073196..09ddb4f4241 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -203,7 +203,7 @@ if (typeof SlaveStatsChecker == "undefined") { return false; } /* End mod section: toggle whether slaves lisp. */ - return ((slave.lips > 70) || (slave.lipsPiercing + slave.tonguePiercing > 2)) + return ((slave.lips > 70) || (slave.lipsPiercing + slave.tonguePiercing > 2) || (slave.teeth == "gapped")) } }; // Raise namespace scope to Global. @@ -1857,6 +1857,45 @@ window.getNurseryReserved = function (slaves) { return FetusGlobalReserveCount("nursery"); } +window.findFather = function(fatherID) { + let father; + let V = State.variables; + + father = V.slaves[V.slaveIndices[fatherID]]; + if (father === undefined) { + if (V.incubator > 0) { + father = V.tanks.find(function(s) { return s.ID == fatherID; }); + } + } + if (father === undefined) { + if (V.nursery > 0) { + father = V.cribs.find(function(s) { return s.ID == fatherID; }); + } + } + + return father; +} + +window.adjustFatherProperty = function(actor, property, newValue) { + let V = State.variables; + let fatherID; + + fatherID = V.slaves.findIndex(function(s) { return s.ID == actor.ID; }); + if (fatherID > 0) { + V.slaves[fatherID][property] = newValue; + } else if (V.incubator > 0) { + fatherID = V.tanks.findIndex(function(s) { return s.ID == actor.ID; }); + if (fatherID > 0) { + V.tanks[fatherID][property] = newValue; + } else if (V.nursery > 0) { + father = V.cribs.findIndex(function(s) { return s.ID == actor.ID; }); + if (fatherID !== -1) { + V.cribs[fatherID][property] = newValue; + } + } + } +} + /* not to be used until that last part is defined. It may become slave.boobWomb.volume or some shit */ window.getBaseBoobs = function(slave) { return slave.boobs-slave.boobsImplant-slave.boobsWombVolume; @@ -16084,6 +16123,10 @@ window.DefaultRules = (function() { slave.teeth = "straightening braces"; V.cash -= V.surgeryCost; r += `<br>${slave.slaveName} has been given braces for her crooked teeth.`; + } else if (slave.teeth == "gapped") { + slave.teeth = "straightening braces"; + V.cash -= V.surgeryCost; + r += `<br>${slave.slaveName} has been given braces to close the gap in her teeth.`; } else if ((slave.teeth == "normal")) { slave.teeth = "cosmetic braces"; V.cash -= V.surgeryCost; @@ -16094,6 +16137,10 @@ window.DefaultRules = (function() { slave.teeth = "straightening braces"; V.cash -= V.surgeryCost; r += `<br>${slave.slaveName} has been given braces for her crooked teeth.`; + } else if (slave.teeth == "gapped") { + slave.teeth = "straightening braces"; + V.cash -= V.surgeryCost; + r += `<br>${slave.slaveName} has been given braces to close the gap in her teeth.`; } else if ((slave.teeth == "cosmetic braces")) { slave.teeth = "normal"; r += `<br>${slave.slaveName} has gotten her braces off, since her teeth are straight.`; @@ -23325,6 +23372,8 @@ window.SlaveSummaryUncached = (function(){ function short_teeth(slave) { if (slave.teeth === "crooked") { r += `<span class="yellow">Cr Teeth</span>`; + } else if (slave.teeth === "gapped") { + r += `<span class="yellow">Gap</span>`; } else if (slave.teeth === "cosmetic braces") { r += `Cos Braces`; } else if (slave.teeth === "straightening braces") { @@ -23643,6 +23692,8 @@ window.SlaveSummaryUncached = (function(){ function long_teeth(slave) { if (slave.teeth === "crooked") { r += `<span class="yellow">Crooked teeth.</span>`; + } else if (slave.teeth === "gapped") { + r += `<span class="yellow">Tooth gap.</span>`; } else if (slave.teeth === "cosmetic braces") { r += `Cosmetic braces.`; } else if (slave.teeth === "straightening braces") { @@ -34033,7 +34084,7 @@ window.GenerateNewSlave = (function(){ } if (jsRandom(0, femaleCrookedTeethGen) <= 15 && slave.physicalAge >= 12) { - slave.teeth = "crooked"; + slave.teeth = jsEither(["crooked", "crooked", "crooked", "crooked", "crooked", "crooked", "crooked", "gapped"]); } if (slave.physicalAge < 6) { @@ -34054,7 +34105,7 @@ window.GenerateNewSlave = (function(){ } if (jsRandom(0, maleCrookedTeethGen) <= 15 && slave.physicalAge >= 12) { - slave.teeth = "crooked"; + slave.teeth = jsEither(["crooked", "crooked", "crooked", "crooked", "crooked", "crooked", "crooked", "gapped"]); } if (slave.physicalAge < 6) { @@ -37105,6 +37156,9 @@ window.Beauty = (function() { case "crooked": beauty -= 3; break; + case "gapped": + beauty -= 1; + break; case "braces": case "cosmetic braces": if (slave.visualAge > 14 && slave.visualAge < 18) { diff --git a/src/js/DefaultRules.tw b/src/js/DefaultRules.tw index 4930dab05c0..9cac5e730f6 100644 --- a/src/js/DefaultRules.tw +++ b/src/js/DefaultRules.tw @@ -1847,6 +1847,10 @@ window.DefaultRules = (function() { slave.teeth = "straightening braces"; V.cash -= V.surgeryCost; r += `<br>${slave.slaveName} has been given braces for her crooked teeth.`; + } else if (slave.teeth == "gapped") { + slave.teeth = "straightening braces"; + V.cash -= V.surgeryCost; + r += `<br>${slave.slaveName} has been given braces to close the gap in her teeth.`; } else if ((slave.teeth == "normal")) { slave.teeth = "cosmetic braces"; V.cash -= V.surgeryCost; @@ -1857,6 +1861,10 @@ window.DefaultRules = (function() { slave.teeth = "straightening braces"; V.cash -= V.surgeryCost; r += `<br>${slave.slaveName} has been given braces for her crooked teeth.`; + } else if (slave.teeth == "gapped") { + slave.teeth = "straightening braces"; + V.cash -= V.surgeryCost; + r += `<br>${slave.slaveName} has been given braces to close the gap in her teeth.`; } else if ((slave.teeth == "cosmetic braces")) { slave.teeth = "normal"; r += `<br>${slave.slaveName} has gotten her braces off, since her teeth are straight.`; diff --git a/src/js/generateNewSlaveJS.tw b/src/js/generateNewSlaveJS.tw index ef2f543963f..df902983bc9 100644 --- a/src/js/generateNewSlaveJS.tw +++ b/src/js/generateNewSlaveJS.tw @@ -925,7 +925,7 @@ window.GenerateNewSlave = (function(){ } if (jsRandom(0, femaleCrookedTeethGen) <= 15 && slave.physicalAge >= 12) { - slave.teeth = "crooked"; + slave.teeth = jsEither(["crooked", "crooked", "crooked", "crooked", "crooked", "crooked", "crooked", "gapped"]); } if (slave.physicalAge < 6) { @@ -946,7 +946,7 @@ window.GenerateNewSlave = (function(){ } if (jsRandom(0, maleCrookedTeethGen) <= 15 && slave.physicalAge >= 12) { - slave.teeth = "crooked"; + slave.teeth = jsEither(["crooked", "crooked", "crooked", "crooked", "crooked", "crooked", "crooked", "gapped"]); } if (slave.physicalAge < 6) { diff --git a/src/js/pregJS.tw b/src/js/pregJS.tw index 08d85e8d346..8508cbfbf66 100644 --- a/src/js/pregJS.tw +++ b/src/js/pregJS.tw @@ -240,6 +240,45 @@ window.getNurseryReserved = function (slaves) { return FetusGlobalReserveCount("nursery"); } +window.findFather = function(fatherID) { + let father; + let V = State.variables; + + father = V.slaves[V.slaveIndices[fatherID]]; + if (father === undefined) { + if (V.incubator > 0) { + father = V.tanks.find(function(s) { return s.ID == fatherID; }); + } + } + if (father === undefined) { + if (V.nursery > 0) { + father = V.cribs.find(function(s) { return s.ID == fatherID; }); + } + } + + return father; +} + +window.adjustFatherProperty = function(actor, property, newValue) { + let V = State.variables; + let fatherID; + + fatherID = V.slaves.findIndex(function(s) { return s.ID == actor.ID; }); + if (fatherID > 0) { + V.slaves[fatherID][property] = newValue; + } else if (V.incubator > 0) { + fatherID = V.tanks.findIndex(function(s) { return s.ID == actor.ID; }); + if (fatherID > 0) { + V.tanks[fatherID][property] = newValue; + } else if (V.nursery > 0) { + father = V.cribs.findIndex(function(s) { return s.ID == actor.ID; }); + if (fatherID !== -1) { + V.cribs[fatherID][property] = newValue; + } + } + } +} + /* not to be used until that last part is defined. It may become slave.boobWomb.volume or some shit */ window.getBaseBoobs = function(slave) { return slave.boobs-slave.boobsImplant-slave.boobsWombVolume; diff --git a/src/js/slaveCostJS.tw b/src/js/slaveCostJS.tw index 30b53971a55..0089e34745a 100644 --- a/src/js/slaveCostJS.tw +++ b/src/js/slaveCostJS.tw @@ -118,6 +118,9 @@ window.Beauty = (function() { case "crooked": beauty -= 3; break; + case "gapped": + beauty -= 1; + break; case "braces": case "cosmetic braces": if (slave.visualAge > 14 && slave.visualAge < 18) { diff --git a/src/js/slaveSummaryWidgets.tw b/src/js/slaveSummaryWidgets.tw index dc26bcf5c59..2957128b33e 100644 --- a/src/js/slaveSummaryWidgets.tw +++ b/src/js/slaveSummaryWidgets.tw @@ -1986,6 +1986,8 @@ window.SlaveSummaryUncached = (function(){ function short_teeth(slave) { if (slave.teeth === "crooked") { r += `<span class="yellow">Cr Teeth</span>`; + } else if (slave.teeth === "gapped") { + r += `<span class="yellow">Gap</span>`; } else if (slave.teeth === "cosmetic braces") { r += `Cos Braces`; } else if (slave.teeth === "straightening braces") { @@ -2304,6 +2306,8 @@ window.SlaveSummaryUncached = (function(){ function long_teeth(slave) { if (slave.teeth === "crooked") { r += `<span class="yellow">Crooked teeth.</span>`; + } else if (slave.teeth === "gapped") { + r += `<span class="yellow">Tooth gap.</span>`; } else if (slave.teeth === "cosmetic braces") { r += `Cosmetic braces.`; } else if (slave.teeth === "straightening braces") { diff --git a/src/js/storyJS.tw b/src/js/storyJS.tw index 5ca395259be..658d6c155b8 100644 --- a/src/js/storyJS.tw +++ b/src/js/storyJS.tw @@ -200,7 +200,7 @@ if (typeof SlaveStatsChecker == "undefined") { return false; } /* End mod section: toggle whether slaves lisp. */ - return ((slave.lips > 70) || (slave.lipsPiercing + slave.tonguePiercing > 2)) + return ((slave.lips > 70) || (slave.lipsPiercing + slave.tonguePiercing > 2) || (slave.teeth == "gapped")) } }; // Raise namespace scope to Global. diff --git a/src/pregmod/csec.tw b/src/pregmod/csec.tw index 680cd16ac4d..158e5492f5b 100644 --- a/src/pregmod/csec.tw +++ b/src/pregmod/csec.tw @@ -41,9 +41,9 @@ <<set _lab++>> <<set _fathers.push("the gene lab's")>> <<else>> - <<set _babyDaddy = $slaveIndices[$activeSlave.curBabies[_cb].fatherID]>> + <<set _babyDaddy = findFather($activeSlave.curBabies[_cb].fatherID)>> <<if def _babyDaddy>> - <<if $slaves[_babyDaddy].ID == $activeSlave.ID>> + <<if _babyDaddy.ID == $activeSlave.ID>> <<set _fathers.push(String($his + " own"))>> <<for _cb2 = 0; _cb2 < _babyFatherLink.length; _cb2++>> <<if _babyFatherLink[_cb2].string == String($his + " own")>> @@ -53,16 +53,17 @@ <</if>> <</for>> <<else>> - <<set _fathers.push(String($slaves[_babyDaddy].slaveName+ "'s"))>> + <<set _fathers.push(String(_babyDaddy.slaveName+ "'s"))>> <<for _cb2 = 0; _cb2 < _babyFatherLink.length; _cb2++>> - <<if _babyFatherLink[_cb2].string == String($slaves[_babyDaddy].slaveName+ "'s")>> + <<if _babyFatherLink[_cb2].string == String(_babyDaddy.slaveName+ "'s")>> <<set _babyFatherLink[_cb2].count++>> <<else>> - <<set _babyFatherLink[_cb2] = {string: String($slaves[_babyDaddy].slaveName+ "'s"), count: 1}>> + <<set _babyFatherLink[_cb2] = {string: String(_babyDaddy.slaveName+ "'s"), count: 1}>> <</if>> <</for>> <</if>> - <<set $slaves[_babyDaddy].slavesFathered++>> + <<set _adjust = _babyDaddy.slavesFathered++>> + <<set adjustFatherProperty(_babyDaddy, slavesFathered, _adjust)>> <<else>> <<set _others++>> <<set _fathers.push("some man's")>> diff --git a/src/pregmod/saAgent.tw b/src/pregmod/saAgent.tw index f338098741b..a19f10c5fd1 100644 --- a/src/pregmod/saAgent.tw +++ b/src/pregmod/saAgent.tw @@ -121,8 +121,11 @@ <<if $slaves[$i].pregSource == -1>> <<set $PC.slavesKnockedUp++>> <<elseif $slaves[$i].pregSource > 0>> - <<set _babyDaddy = $slaveIndices[$slaves[$i].pregSource]>> - <<set $slaves[_babyDaddy].slavesKnockedUp++>> + <<set _babyDaddy = findFather($slaves[$i].pregSource)>> + <<if def _babyDaddy>> + <<set _adjust = _babyDaddy.slavesKnockedUp++>> + <<set adjustFatherProperty(_babyDaddy, slavesKnockedUp, _adjust)>> + <</if>> <</if>> <</if>> <<if ($slaves[$i].preg >= 10)>> diff --git a/src/pregmod/sePlayerBirth.tw b/src/pregmod/sePlayerBirth.tw index 1a4814937ce..53d2ae9d8d3 100644 --- a/src/pregmod/sePlayerBirth.tw +++ b/src/pregmod/sePlayerBirth.tw @@ -551,7 +551,7 @@ You arrange yourself to give birth, relaxing until your body urges you to begin <<if $PC.pregSource > 0 && _curBabies > 0>> - <<set _pb = $slaveIndices[$PC.pregSource]>> + <<set _pb = findFather($PC.pregSource)>> <<if def _pb>> <<if $arcologies[0].FSRestartDecoration == 100 && $eugenicsFullControl != 1>> Word spreads fast through your peers that you gave birth to <<if _curBabies > 1>>low class infants<<else>>a low class child<</if>> @@.red;utterly devastating your standing among the Elite.@@ @@ -559,13 +559,13 @@ You arrange yourself to give birth, relaxing until your body urges you to begin <<elseif $arcologies[0].FSChattelReligionistLaw == 1>> Rumors spread that The Prophet gave birth to a slave's child<<if _curBabies > 1>>ren<</if>>. <<if $arcologies[0].FSSupremacist != "unset">> - <<if $slaves[_pb].race != $arcologies[0].FSSupremacistRace>> + <<if _pb.race != $arcologies[0].FSSupremacistRace>> Word is that your child<<if _curBabies > 1>>ren were<<else>> was<</if>> not $arcologies[0].FSSupremacistRace. As The Prophet saw fit to bear such a child, society views it as a sign to @@.red;reject $arcologies[0].FSSupremacistRace supremacy.@@ <<set $arcologies[0].FSSupremacist -= 120>> <</if>> <</if>> <<if $arcologies[0].FSSubjugationist != "unset">> - <<if $slaves[_pb].race == $arcologies[0].FSSubjugationistRace>> + <<if _pb.race == $arcologies[0].FSSubjugationistRace>> In addition, The Prophet's womb bore <<if _curBabies == 1>>a <</if>>$arcologies[0].FSSubjugationistRace child<<if _curBabies > 1>>ren<</if>>, surely a sign to end @@.red;reject $arcologies[0].FSSubjugationistRace subjugation.@@ <<set $arcologies[0].FSSubjugationist -= 120>> <</if>> @@ -574,13 +574,13 @@ You arrange yourself to give birth, relaxing until your body urges you to begin Rumors spread that your child<<if _curBabies > 1>>ren were<<else>> was<</if>> fathered by a slave, @@.red;harming your lasting reputation.@@ <<set $PC.degeneracy += 20>> <<if $arcologies[0].FSSupremacist != "unset">> - <<if $slaves[_pb].race != $arcologies[0].FSSupremacistRace>> + <<if _pb.race != $arcologies[0].FSSupremacistRace>> Furthermore, word is that your child<<if _curBabies > 1>>ren were<<else>> was<</if>> not $arcologies[0].FSSupremacistRace, @@.red;further hurting your lasting reputation.@@ <<set $PC.degeneracy += 10>> <</if>> <</if>> <<if $arcologies[0].FSSubjugationist != "unset">> - <<if $slaves[_pb].race == $arcologies[0].FSSubjugationistRace>> + <<if _pb.race == $arcologies[0].FSSubjugationistRace>> In addition, there is a nasty rumor that you gave birth to <<if _curBabies == 1>>a <</if>>$arcologies[0].FSSubjugationistRace child<<if _curBabies > 1>>ren<</if>>, @@.red;devastating your lasting reputation.@@ <<set $PC.degeneracy += 50>> <</if>> diff --git a/src/pregmod/widgets/playerDescriptionWidgets.tw b/src/pregmod/widgets/playerDescriptionWidgets.tw index a5ee364c832..879259fede1 100644 --- a/src/pregmod/widgets/playerDescriptionWidgets.tw +++ b/src/pregmod/widgets/playerDescriptionWidgets.tw @@ -370,9 +370,11 @@ <<elseif $PC.preg == 22>> Something startling happened this week; while enjoying a slave, your belly button popped out! <<elseif $PC.preg == 8 && $PC.pregSource > 0>> - <<set _babyDaddy = $slaveIndices[$PC.pregSource]>> - <<set $slaves[_babyDaddy].PCKnockedUp++>> - Rumors spread among your slaves that your middle is swollen with $slaves[_babyDaddy].slaveName's child. They're not wrong, though <<if $slaves[_babyDaddy].devotion > 20>>$slaves[_babyDaddy].slaveName is broken enough to not try and use it against you. In fact, it might even draw her closer to you<<else>>you'd have liked it to have kept that from $slaves[_babyDaddy].slaveName, lest the rebellious bitch uses it to remain defiant<</if>>. + <<set _babyDaddy = findFather($PC.pregSource)>> + <<set _babyDaddy.PCKnockedUp++>> + <<if def $slaveIndices[$PC.pregSource]>> + Rumors spread among your slaves that your middle is swollen with $slaves[_babyDaddy].slaveName's child. They're not wrong, though <<if $slaves[_babyDaddy].devotion > 20>>$slaves[_babyDaddy].slaveName is broken enough to not try and use it against you. In fact, it might even draw her closer to you<<else>>you'd have liked it to have kept that from $slaves[_babyDaddy].slaveName, lest the rebellious bitch uses it to remain defiant<</if>>. + <</if>> <</if>> <</if>> <<elseif $PC.career == "escort">> @@ -437,9 +439,11 @@ <<elseif $PC.preg == 22>> Something startling happened this week; while enjoying a slave, your belly button popped out! <<elseif $PC.preg == 8 && $PC.pregSource > 0>> - <<set _babyDaddy = $slaveIndices[$PC.pregSource]>> - <<set $slaves[_babyDaddy].PCKnockedUp++>> - Rumors spread among your slaves that your middle is swollen with $slaves[_babyDaddy].slaveName's child. They're not wrong, though <<if $slaves[_babyDaddy].devotion > 20>>$slaves[_babyDaddy].slaveName is broken enough to not try and use it against you. In fact, it might even draw her closer to you<<else>>you'd have liked it to have kept that from $slaves[_babyDaddy].slaveName, lest the rebellious bitch uses it to remain defiant<</if>>. + <<set _babyDaddy = findFather($PC.pregSource)>> + <<set _babyDaddy.PCKnockedUp++>> + <<if def $slaveIndices[$PC.pregSource]>> + Rumors spread among your slaves that your middle is swollen with $slaves[_babyDaddy].slaveName's child. They're not wrong, though <<if $slaves[_babyDaddy].devotion > 20>>$slaves[_babyDaddy].slaveName is broken enough to not try and use it against you. In fact, it might even draw her closer to you<<else>>you'd have liked it to have kept that from $slaves[_babyDaddy].slaveName, lest the rebellious bitch uses it to remain defiant<</if>>. + <</if>> <</if>> <</if>> <<else>> @@ -504,15 +508,17 @@ <<elseif $PC.preg == 22>> Something startling happened this week; while enjoying a slave, your belly button popped out! <<elseif $PC.preg == 8 && $PC.pregSource > 0>> - <<set _babyDaddy = $slaveIndices[$PC.pregSource]>> - <<set $slaves[_babyDaddy].PCKnockedUp++>> - Rumors spread among your slaves that your middle is swollen with $slaves[_babyDaddy].slaveName's child. They're not wrong, though <<if $slaves[_babyDaddy].devotion > 20>>$slaves[_babyDaddy].slaveName is broken enough to not try and use it against you. In fact, it might even draw her closer to you<<else>>you'd have liked it to have kept that from $slaves[_babyDaddy].slaveName, lest the rebellious bitch uses it to remain defiant<</if>>. + <<set _babyDaddy = findFather($PC.pregSource)>> + <<set _babyDaddy.PCKnockedUp++>> + <<if def $slaveIndices[$PC.pregSource]>> + Rumors spread among your slaves that your middle is swollen with $slaves[_babyDaddy].slaveName's child. They're not wrong, though <<if $slaves[_babyDaddy].devotion > 20>>$slaves[_babyDaddy].slaveName is broken enough to not try and use it against you. In fact, it might even draw her closer to you<<else>>you'd have liked it to have kept that from $slaves[_babyDaddy].slaveName, lest the rebellious bitch uses it to remain defiant<</if>>. + <</if>> <</if>> <</if>> <</if>> <<elseif _passage == "Analyze PC Pregnancy">> <<if $PC.belly >= 120000>> - You shudder at the cool touch of the sensor running along the curve of your sensitve pregnancy. While you've devised a way to scan the distant peak of your navel and the depths of your underbelly, you failed to take into account just how excited your children would get over the attention. Every pass is a battle against your kicking brood. + You shudder at the cool touch of the sensor running along the curve of your sensitive pregnancy. While you've devised a way to scan the distant peak of your navel and the depths of your underbelly, you failed to take into account just how excited your children would get over the attention. Every pass is a battle against your kicking brood. <<elseif $PC.belly >= 90000>> You shudder at the cool touch of the sensor running along the curve of your pregnancy. It takes some stretching, but you can just barely scan yourself without assistance. If you grow much larger, you'll have to call in help for those places that elude your reach. <<elseif $PC.belly >= 45000>> diff --git a/src/pregmod/widgets/seBirthWidgets.tw b/src/pregmod/widgets/seBirthWidgets.tw index d699037e8ef..3dcea780f01 100644 --- a/src/pregmod/widgets/seBirthWidgets.tw +++ b/src/pregmod/widgets/seBirthWidgets.tw @@ -314,9 +314,10 @@ <<if $slaves[$i].curBabies[_cb].fatherID == -1>> <<set $PC.slavesFathered++>> <<elseif $slaves[$i].curBabies[_cb].fatherID > 0>> - <<set _babyDaddy = $slaveIndices[$slaves[$i].curBabies[_cb].fatherID]>> + <<set _babyDaddy = findFather($slaves[$i].curBabies[_cb].fatherID)>> <<if def _babyDaddy>> - <<set $slaves[_babyDaddy].slavesFathered++>> + <<set _adjust = _babyDaddy.slavesFathered++>> + <<set adjustFatherProperty(_babyDaddy, slavesFathered, _adjust)>> <</if>> <</if>> <</for>> @@ -411,12 +412,12 @@ This decriptions can be expanded with more outcomes later. But it's not practica <<elseif $slaves[$i].curBabies[_seb].fatherID == -7>> <<set _fathers.push("your own design")>> <<else>> - <<set _babyDaddy = $slaveIndices[$slaves[$i].curBabies[_seb].fatherID]>> + <<set _babyDaddy = findFather($slaves[$i].curBabies[_seb].fatherID)>> <<if def _babyDaddy>> - <<if $slaves[_babyDaddy].ID == $slaves[$i].ID>> + <<if _babyDaddy.ID == $slaves[$i].ID>> <<set _fathers.push(String($his + " own curiosity over if " + $he + " could fuck " + $himself))>> <<else>> - <<set _fathers.push(String($slaves[_babyDaddy].slaveName+ "'s virile cock and balls"))>> + <<set _fathers.push(String(_babyDaddy.slaveName+ "'s virile cock and balls"))>> <</if>> <<else>> <<set _fathers.push("an unknown father")>> diff --git a/src/uncategorized/saLongTermEffects.tw b/src/uncategorized/saLongTermEffects.tw index af5d833daac..a809641a977 100644 --- a/src/uncategorized/saLongTermEffects.tw +++ b/src/uncategorized/saLongTermEffects.tw @@ -2922,8 +2922,11 @@ <<if $slaves[$i].pregSource == -1>> <<set $PC.slavesKnockedUp++>> <<elseif $slaves[$i].pregSource > 0>> - <<set _babyDaddy = $slaveIndices[$slaves[$i].pregSource]>> - <<set $slaves[_babyDaddy].slavesKnockedUp++>> + <<set _babyDaddy = findFather($slaves[$i].pregSource)>> + <<if def _babyDaddy>> + <<set _adjust = _babyDaddy.slavesKnockedUp++>> + <<set adjustFatherProperty(_babyDaddy, slavesKnockedUp, _adjust)>> + <</if>> <</if>> <</if>> <<if $slaves[$i].bellyFluid > 2000>> @@ -4256,7 +4259,7 @@ <</if>> <<if $slaves[$i].pregKnown == 1>> <<if $slaves[$i].pregSource > 0>> - <<set _saLTE = getSlave($slaves[$i].pregSource)>> + <<set _saLTE = findFather($slaves[$i].pregSource)>> <<if def _saLTE>> <<if $slaves[$i].race != _saLTE.race>> Society @@.red;strongly disapproves@@ of your allowing a pure $arcologies[0].FSSupremacistRace slave to be miscegenated by _saLTE.slaveName. @@ -4306,10 +4309,10 @@ <</if>> <<else>> <<if $slaves[$i].pregKnown == 1 && $slaves[$i].pregSource > 0>> - <<set _lte = $slaveIndices[$slaves[$i].pregSource]>> + <<set _lte = findFather($slaves[$i].pregSource)>> <<if ndef _lte>>@@.red;Error, pregSource not found.@@<</if>> - <<if $slaves[_lte].race == $arcologies[0].FSSubjugationistRace>> - Society @@.red;strongly disapproves@@ of your allowing $slaves[$i].slaveName to be miscegenated by a $arcologies[0].FSSubjugationistRace subhuman like $slaves[_lte].slaveName. + <<if _lte.race == $arcologies[0].FSSubjugationistRace>> + Society @@.red;strongly disapproves@@ of your allowing $slaves[$i].slaveName to be miscegenated by a $arcologies[0].FSSubjugationistRace subhuman like _lte.slaveName. <<= FSChangePorn("Subjugationist", -2)>> <</if>> <</if>> diff --git a/src/utility/descriptionWidgetsFlesh.tw b/src/utility/descriptionWidgetsFlesh.tw index 1e6eb76b879..48a381cc54d 100644 --- a/src/utility/descriptionWidgetsFlesh.tw +++ b/src/utility/descriptionWidgetsFlesh.tw @@ -15235,19 +15235,19 @@ $He has <<widget "pregnancyDescription">> <<if $activeSlave.pregSource > 0>> - <<set _lsd = $slaves.findIndex(function(s) { return s.ID == $activeSlave.pregSource; })>> - <<if _lsd != -1>> + <<set _lsd = findFather($activeSlave.pregSource)>> + <<if def _lsd>> <<if $surnameOrder != 1>> - <<switch $slaves[_lsd].nationality>> + <<switch _lsd.nationality>> <<case "Cambodian" "Chinese" "Hungarian" "Japanese" "Korean" "Mongolian" "Taiwanese" "Vietnamese">> - <<if $slaves[_lsd].slaveSurname>><<set _daddy = $slaves[_lsd].slaveSurname>><<set _daddy += " " + $slaves[_lsd].slaveName>><<else>><<set _daddy = $slaves[_lsd].slaveName>><</if>> + <<if _lsd.slaveSurname>><<set _daddy = _lsd.slaveSurname>><<set _daddy += " " + _lsd.slaveName>><<else>><<set _daddy = _lsd.slaveName>><</if>> <<default>> - <<set _daddy = $slaves[_lsd].slaveName>> - <<if $slaves[_lsd].slaveSurname>><<set _daddy += " " + $slaves[_lsd].slaveSurname>><</if>> + <<set _daddy = _lsd.slaveName>> + <<if _lsd.slaveSurname>><<set _daddy += " " + _lsd.slaveSurname>><</if>> <</switch>> <<else>> - <<set _daddy = $slaves[_lsd].slaveName>> - <<if $slaves[_lsd].slaveSurname>><<set _daddy += " " + $slaves[_lsd].slaveSurname>><</if>> + <<set _daddy = _lsd.slaveName>> + <<if _lsd.slaveSurname>><<set _daddy += " " + _lsd.slaveSurname>><</if>> <</if>> <<else>> <<set _daddy = "partner">> diff --git a/src/utility/descriptionWidgetsStyle.tw b/src/utility/descriptionWidgetsStyle.tw index b73da8f1d4c..11251b9250b 100644 --- a/src/utility/descriptionWidgetsStyle.tw +++ b/src/utility/descriptionWidgetsStyle.tw @@ -3506,7 +3506,7 @@ $His $He is wearing a sturdy leather collar that continues up to restrict $his jaw as well. It acts as an anchor for an enormous inward-facing dildo that reaches deep down $his throat. The sheer size of the phallus forces $his mouth as wide as it will go and considerably bulges $his throat. Fortunately for $him, it is designed to allow $him to be able to breathe through $his nose; though when removed, the poor girl finds $himself incapable of closing $his mouth for some time. <<case "preg biometrics">> <<if $activeSlave.pregSource > 0>> - <<set _daddy = $slaves.find(function(s) { return s.ID == $activeSlave.pregSource; }), _daddy = _daddy.slaveName>> + <<set _daddy = findFather($activeSlave.pregSource), _daddy = _daddy.slaveName>> <</if>> <<set _pregCollar = either(1, 2, 3)>> $He is wearing a heavy metal collar with a digital display; it currently reads: -- GitLab