diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index c347dddefd72c1a252f4ce89ac27e7aa528e99b1..fa659f210e12e621ca4d19050f918e7cb033484c 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -811,6 +811,20 @@ window.ngUpdateGenePool = function(genePool) { }); } +window.ngUpdateMissingTable = function(missingTable) { + var newTable = {}; + + (State.variables.slaves || []) + .forEach(s => ([s.pregSource+1200000,s.mother+1200000,s.father+1200000] + .filter(i => (i in missingTable)) + .forEach(i => { + newTable[i-1200000] = missingTable[i]; + newTable[i-1200000].ID -= 1200000; + }))); + + return newTable; +}; + window.toJson = function(obj) { var jsontext = JSON.stringify(obj); jsontext = jsontext.replace(/^{/,""); @@ -9794,6 +9808,14 @@ window.WombZeroID = function(actor, id) { WombNormalizePreg(actor); }; +window.WombChangeID = function(actor, fromID, toID) { + WombInit(actor); + actor.womb + .filter(ft => ft.fatherID === fromID) + .forEach(ft => ft.fatherID = toID); + WombNormalizePreg(actor); +}; + /* Sorts the womb object by age with oldest and thus soonest to be born, first. This will be needed in the future once individual fertilization is a possibility.*/ window.WombSort = function(actor) { actor.womb.sort((a, b) => { return b.age - a.age; }); @@ -11862,10 +11884,16 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } var mom = character.mother; if(mom < -6) { - if(typeof outmoms[mom] == 'undefined') { - outmoms[mom] = []; + if (mom in State.variables.missingTable && State.variables.showMissingSlaves) { + node_lookup[mom] = family_graph.nodes.length; + var missing = State.variables.missingTable[mom]; + charList.push({ID: mom, mother: 0, father: 0, is_mother: true, dick: missing.dick, vagina: missing.vagina, slaveName: missing.slaveName}); + } else { + if(typeof outmoms[mom] == 'undefined') { + outmoms[mom] = []; + } + outmoms[mom].push(character.slaveName); } - outmoms[mom].push(character.slaveName); } else if(mom < 0 && typeof node_lookup[mom] == 'undefined' && typeof preset_lookup[mom] != 'undefined') { node_lookup[mom] = family_graph.nodes.length; charList.push({ID: mom, mother: 0, father: 0, is_father: true, dick: 0, vagina: 1, slaveName: preset_lookup[mom]}); @@ -11873,10 +11901,16 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { var dad = character.father; if(dad < -6) { - if(typeof outdads[dad] == 'undefined') { - outdads[dad] = []; + if (dad in State.variables.missingTable && State.variables.showMissingSlaves) { + node_lookup[dad] = family_graph.nodes.length; + var missing = State.variables.missingTable[dad]; + charList.push({ID: dad, mother: 0, father: 0, is_father: true, dick: missing.dick, vagina: missing.vagina, slaveName: missing.slaveName}); + } else { + if(typeof outdads[dad] == 'undefined') { + outdads[dad] = []; + } + outdads[dad].push(character.slaveName); } - outdads[dad].push(character.slaveName); } else if(dad < 0 && typeof node_lookup[dad] == 'undefined' && typeof preset_lookup[dad] != 'undefined') { node_lookup[dad] = family_graph.nodes.length; charList.push({ID: dad, mother: 0, father: 0, is_father: true, dick: 1, vagina: -1, slaveName: preset_lookup[dad]}); @@ -23136,6 +23170,8 @@ window.SlaveSummaryUncached = (function(){ handled = 1; } r += " "; + } else if (slave.mother in V.missingTable && V.showMissingSlavesSD && V.showMissingSlaves) { + r += `${V.missingTable[slave.mother].fullName}'s daughter `; } if (slave.father > 0 && slave.father !== slave.mother) { let _ssj = V.slaves.findIndex(function(s) { @@ -23169,6 +23205,8 @@ window.SlaveSummaryUncached = (function(){ handled = 1; } r += " "; + } else if (slave.father in V.missingTable && slave.father !== slave.mother && V.showMissingSlavesSD && V.showMissingSlaves) { + r += `${V.missingTable[slave.father].fullName}'s daughter`; } if (slave.daughters === 1) { let _ssj = V.slaves.findIndex(function(s) { @@ -23396,6 +23434,8 @@ window.SlaveSummaryUncached = (function(){ } else { r += `<span class="lightgreen">daughter.</span> `; } + } else if (slave.mother in V.missingTable && V.showMissingSlavesSD && V.showMissingSlaves) { + r += `${V.missingTable[slave.mother].fullName}'s <span class="lightgreen">daughter.</span> `; } if (slave.father > 0 && slave.father !== slave.mother) { let _ssj = V.slaves.findIndex(function(s) { @@ -23430,6 +23470,8 @@ window.SlaveSummaryUncached = (function(){ } else { r += `<span class="lightgreen">daughter.</span> `; } + } else if (slave.father in V.missingTable && slave.father !== slave.mother && V.showMissingSlavesSD && V.showMissingSlaves) { + r += `${V.missingTable[slave.father].fullName}'s <span class="lightgreen">daughter.</span> `; } if (slave.daughters === 1) { let _ssj = V.slaves.findIndex(function(s) { @@ -24075,7 +24117,10 @@ window.removeActiveSlave = function removeActiveSlave() { const INDEX = V.slaveIndices[AS_ID]; let missing = false; - WombZeroID(V.PC, AS_ID); + WombChangeID(V.PC, AS_ID, V.missingParentID); + if (V.PC.pregSource === V.missingParentID) { + missing = true; + } if (V.activeSlave.reservedChildren > 0) { V.reservedChildren -= V.activeSlave.reservedChildren; } @@ -24112,7 +24157,10 @@ window.removeActiveSlave = function removeActiveSlave() { }); } V.slaves.forEach(slave => { - WombZeroID(slave, AS_ID); /* This check is complex, should be done in JS now, all needed will be done here. */ + WombChangeID(slave, AS_ID, V.missingParentID); /* This check is complex, should be done in JS now, all needed will be done here. */ + if (slave.pregSource === V.missingParentID) { + missing = true; + } if (V.activeSlave.daughters > 0) { if (slave.mother === AS_ID) { slave.mother = V.missingParentID; @@ -24263,13 +24311,19 @@ window.removeActiveSlave = function removeActiveSlave() { } } - removeSlave(INDEX); - LENGTH--; - V.activeSlave = 0; - if (missing) { + V.missingTable[V.missingParentID] = { slaveName: V.activeSlave.slaveName, + slaveSurname: V.activeSlave.slaveSurname, + fullName: SlaveFullName(V.activeSlave), + dick : V.activeSlave.dick, + vagina : V.activeSlave.vagina, + ID : V.missingParentID }; V.missingParentID--; } + + removeSlave(INDEX); + LENGTH--; + V.activeSlave = 0; } }; diff --git a/src/SpecialForce/Upgrades.tw b/src/SpecialForce/Upgrades.tw index 2da2e46c89b517ca5cba75d9510689d33a0e53c4..269032de2318c798cbf97ea87c9e23c185ff5af4 100644 --- a/src/SpecialForce/Upgrades.tw +++ b/src/SpecialForce/Upgrades.tw @@ -234,7 +234,7 @@ <<link "Upgrade Satellite">><<set $SF.U = 1, $SFUnit.Satellite++, $cash -= _cSat>> <<goto "Firebase">><</link>> - <<else>>//Cannot afford to upgrade Satellite.//>><</if>> + <<else>>//Cannot afford to upgrade Satellite.//<</if>> //Costs @@.yellowgreen;<<print cashFormat(_cSat)>>@@//<span style="float:right;"><<print progress($SFUnit.Satellite)>> </span> diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index 0333301642cfdf07724a7b588faa5fcf43a6b107..7e20c5d5a525913543d61dc755feca78cddd1880 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -97,6 +97,11 @@ You should have received a copy of the GNU General Public License along with thi <</if>> <</for>> <<set $genePool = ngUpdateGenePool($genePool)>> + <<if ndef $missingTable || $showMissingSlaves == 0>> + <<set $missingTable = {}>> + <<else>> + <<set $missingTable = ngUpdateMissingTable($missingTable)>> + <</if>> /* <<for $i = 0; $i < $genePool.length; $i++>> <<for $k = 0; $k < $slaves.length; $k++>> @@ -244,6 +249,9 @@ You should have received a copy of the GNU General Public License along with thi <<set $slavesOriginal = []>> /* not used by pregmod */ <<set $genePool = []>> <<set $slaveIndices = slaves2indices()>> + <<set $missingTable = {}>> + <<set $showMissingSlaves = false>> + <<set $showMissingSlavesSD = false>> <</if>> <<set $organs = []>> diff --git a/src/js/familyTree.tw b/src/js/familyTree.tw index 4a8fbfec0a204396730e049092baa8a0d1ec8906..74a03a79a1909fb3a5ab03023280798676b327c6 100644 --- a/src/js/familyTree.tw +++ b/src/js/familyTree.tw @@ -265,10 +265,16 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { } var mom = character.mother; if(mom < -6) { - if(typeof outmoms[mom] == 'undefined') { - outmoms[mom] = []; + if (mom in State.variables.missingTable && State.variables.showMissingSlaves) { + node_lookup[mom] = family_graph.nodes.length; + var missing = State.variables.missingTable[mom]; + charList.push({ID: mom, mother: 0, father: 0, is_mother: true, dick: missing.dick, vagina: missing.vagina, slaveName: missing.slaveName}); + } else { + if(typeof outmoms[mom] == 'undefined') { + outmoms[mom] = []; + } + outmoms[mom].push(character.slaveName); } - outmoms[mom].push(character.slaveName); } else if(mom < 0 && typeof node_lookup[mom] == 'undefined' && typeof preset_lookup[mom] != 'undefined') { node_lookup[mom] = family_graph.nodes.length; charList.push({ID: mom, mother: 0, father: 0, is_father: true, dick: 0, vagina: 1, slaveName: preset_lookup[mom]}); @@ -276,10 +282,16 @@ window.buildFamilyTree = function(slaves = State.variables.slaves, filterID) { var dad = character.father; if(dad < -6) { - if(typeof outdads[dad] == 'undefined') { - outdads[dad] = []; + if (dad in State.variables.missingTable && State.variables.showMissingSlaves) { + node_lookup[dad] = family_graph.nodes.length; + var missing = State.variables.missingTable[dad]; + charList.push({ID: dad, mother: 0, father: 0, is_father: true, dick: missing.dick, vagina: missing.vagina, slaveName: missing.slaveName}); + } else { + if(typeof outdads[dad] == 'undefined') { + outdads[dad] = []; + } + outdads[dad].push(character.slaveName); } - outdads[dad].push(character.slaveName); } else if(dad < 0 && typeof node_lookup[dad] == 'undefined' && typeof preset_lookup[dad] != 'undefined') { node_lookup[dad] = family_graph.nodes.length; charList.push({ID: dad, mother: 0, father: 0, is_father: true, dick: 1, vagina: -1, slaveName: preset_lookup[dad]}); diff --git a/src/js/removeActiveSlave.tw b/src/js/removeActiveSlave.tw index 889349a420f6d5b664fe9da3d56a2345c30c9be9..4c69f001ed07aab0cc351168e8f6a05c50a59321 100644 --- a/src/js/removeActiveSlave.tw +++ b/src/js/removeActiveSlave.tw @@ -9,7 +9,10 @@ window.removeActiveSlave = function removeActiveSlave() { const INDEX = V.slaveIndices[AS_ID]; let missing = false; - WombZeroID(V.PC, AS_ID); + WombChangeID(V.PC, AS_ID, V.missingParentID); + if (V.PC.pregSource === V.missingParentID) { + missing = true; + } if (V.activeSlave.reservedChildren > 0) { V.reservedChildren -= V.activeSlave.reservedChildren; } @@ -46,7 +49,10 @@ window.removeActiveSlave = function removeActiveSlave() { }); } V.slaves.forEach(slave => { - WombZeroID(slave, AS_ID); /* This check is complex, should be done in JS now, all needed will be done here. */ + WombChangeID(slave, AS_ID, V.missingParentID); /* This check is complex, should be done in JS now, all needed will be done here. */ + if (slave.pregSource === V.missingParentID) { + missing = true; + } if (V.activeSlave.daughters > 0) { if (slave.mother === AS_ID) { slave.mother = V.missingParentID; @@ -197,12 +203,18 @@ window.removeActiveSlave = function removeActiveSlave() { } } - removeSlave(INDEX); - LENGTH--; - V.activeSlave = 0; - if (missing) { + V.missingTable[V.missingParentID] = { slaveName: V.activeSlave.slaveName, + slaveSurname: V.activeSlave.slaveSurname, + fullName: SlaveFullName(V.activeSlave), + dick : V.activeSlave.dick, + vagina : V.activeSlave.vagina, + ID : V.missingParentID }; V.missingParentID--; } + + removeSlave(INDEX); + LENGTH--; + V.activeSlave = 0; } }; diff --git a/src/js/slaveSummaryWidgets.tw b/src/js/slaveSummaryWidgets.tw index 5108abda289bc71ba2398c5e5f832b0f1632ff3a..9a8bbc60adc405291d0b6b026663ec091560cd03 100644 --- a/src/js/slaveSummaryWidgets.tw +++ b/src/js/slaveSummaryWidgets.tw @@ -3647,6 +3647,8 @@ window.SlaveSummaryUncached = (function(){ handled = 1; } r += " "; + } else if (slave.mother in V.missingTable && V.showMissingSlavesSD && V.showMissingSlaves) { + r += `${V.missingTable[slave.mother].fullName}'s daughter `; } if (slave.father > 0 && slave.father !== slave.mother) { let _ssj = V.slaves.findIndex(function(s) { @@ -3680,6 +3682,8 @@ window.SlaveSummaryUncached = (function(){ handled = 1; } r += " "; + } else if (slave.father in V.missingTable && slave.father !== slave.mother && V.showMissingSlavesSD && V.showMissingSlaves) { + r += `${V.missingTable[slave.father].fullName}'s daughter`; } if (slave.daughters === 1) { let _ssj = V.slaves.findIndex(function(s) { @@ -3907,6 +3911,8 @@ window.SlaveSummaryUncached = (function(){ } else { r += `<span class="lightgreen">daughter.</span> `; } + } else if (slave.mother in V.missingTable && V.showMissingSlavesSD && V.showMissingSlaves) { + r += `${V.missingTable[slave.mother].fullName}'s <span class="lightgreen">daughter.</span> `; } if (slave.father > 0 && slave.father !== slave.mother) { let _ssj = V.slaves.findIndex(function(s) { @@ -3941,6 +3947,8 @@ window.SlaveSummaryUncached = (function(){ } else { r += `<span class="lightgreen">daughter.</span> `; } + } else if (slave.father in V.missingTable && slave.father !== slave.mother && V.showMissingSlavesSD && V.showMissingSlaves) { + r += `${V.missingTable[slave.father].fullName}'s <span class="lightgreen">daughter.</span> `; } if (slave.daughters === 1) { let _ssj = V.slaves.findIndex(function(s) { diff --git a/src/js/storyJS.tw b/src/js/storyJS.tw index 7dc0173b5f3fe0624d30fd4b6ebc2318629b6c12..59995968ae1531a85678733c52d85d211f1b332e 100644 --- a/src/js/storyJS.tw +++ b/src/js/storyJS.tw @@ -808,6 +808,20 @@ window.ngUpdateGenePool = function(genePool) { }); } +window.ngUpdateMissingTable = function(missingTable) { + var newTable = {}; + + (State.variables.slaves || []) + .forEach(s => ([s.pregSource+1200000,s.mother+1200000,s.father+1200000] + .filter(i => (i in missingTable)) + .forEach(i => { + newTable[i-1200000] = missingTable[i]; + newTable[i-1200000].ID -= 1200000; + }))); + + return newTable; +}; + window.toJson = function(obj) { var jsontext = JSON.stringify(obj); jsontext = jsontext.replace(/^{/,""); @@ -953,4 +967,4 @@ window.SoftenSexualFlaw = function SoftenSexualFlaw(slave) { break; } slave.sexualFlaw = "none"; -}; \ No newline at end of file +}; diff --git a/src/js/wombJS.tw b/src/js/wombJS.tw index ea9fc9d33e425c48fd48caf7b007c67327d35828..ca6a44655a6a8036b602a1fbaa57ec2798ad1cad 100644 --- a/src/js/wombJS.tw +++ b/src/js/wombJS.tw @@ -276,6 +276,15 @@ window.WombZeroID = function(actor, id) { WombNormalizePreg(actor); }; +window.WombChangeID = function(actor, fromID, toID) { + WombInit(actor); + actor.womb + .filter(ft => ft.fatherID === fromID) + .forEach(ft => ft.fatherID = toID); + WombNormalizePreg(actor); +}; + + /* Sorts the womb object by age with oldest and thus soonest to be born, first. This will be needed in the future once individual fertilization is a possibility.*/ window.WombSort = function(actor) { actor.womb.sort((a, b) => { return b.age - a.age; }); diff --git a/src/pregmod/managePersonalAffairs.tw b/src/pregmod/managePersonalAffairs.tw index 08e48ab8cda1f0e113590b60b2d30e68c7fff150..3eeff1bdd2ee65cebfac28e914828d1b3e3158d5 100644 --- a/src/pregmod/managePersonalAffairs.tw +++ b/src/pregmod/managePersonalAffairs.tw @@ -358,7 +358,7 @@ __Rumors__ <</link>> </span> */ - <<if totalPlayerRelatives($PC) > 0>> + <<if totalPlayerRelatives($PC) > 0 || ($showMissingSlaves && ($PC.mother in $missingTable || $PC.father in $missingTable))>> <<PlayerFamily>> <</if>> <</if>> diff --git a/src/pregmod/widgets/seBirthWidgets.tw b/src/pregmod/widgets/seBirthWidgets.tw index 1f4f1e11dde6eb3fb5959240d4a480547c63727b..f7778f9cc791654b98667d2ea6b842f1b7f22368 100644 --- a/src/pregmod/widgets/seBirthWidgets.tw +++ b/src/pregmod/widgets/seBirthWidgets.tw @@ -338,6 +338,8 @@ <<set _getFather = $slaves.find(function(s) { return s.ID == $slaves[$i].pregSource; })>> <<if def _getFather>> <<set $daddy = _getFather.slaveName>> +<<elseif $slaves[$i].pregSource in $missingTable && $showMissingSlaves>> + <<set $daddy = $missingTable[$slaves[$i].pregSource].slaveName>> <<else>> <<set $daddy = "some unknown father">> <</if>> diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index bc543fc28b3d5de415115e0efdbbb540710a4ef3..90d2161b0e109bd026f43efc3eae307d609be074 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -3460,6 +3460,16 @@ Done! <<set $brothelAdsSpending = 0>> <</if>> +<<if ndef $missingTable>> + <<set $missingTable = {}>> +<</if>> +<<if ndef $showMissingSlaves>> + <<set $showMissingSlaves = false>> +<</if>> +<<if ndef $showMissingSlavesSD>> + <<set $showMissingSlavesSD = false>> +<</if>> + <<for _bci = 0; _bci < $defaultRules.length; _bci++>> <<set _rule = $defaultRules[_bci].set>> <<if !([true, false, "no default setting"].includes(_rule.preg))>> diff --git a/src/uncategorized/options.tw b/src/uncategorized/options.tw index b54111b94993fe26f7a67b12a08516d0573fe608..fe994fdb72c0538ecea1a48784e42c614e68c2c2 100644 --- a/src/uncategorized/options.tw +++ b/src/uncategorized/options.tw @@ -405,6 +405,13 @@ Male slave names are currently @@.red;FORBIDDEN@@. [[Allow|Options][$allowMaleSl <</if>> //This only affects slave generation and not your ability to name your slaves.// +<br> +<<if $showMissingSlaves>> +Missing slave names are currently @@.cyan;SHOWN@@. [[Hide|Options][$showMissingSlaves = 0]] +<<else>> +Missing slave names are currently @@.red;HIDDEN@@. [[Show|Options][$showMissingSlaves = 1]] +<</if>> + <br><br> ''INTERSECTING MECHANICS'' <br> diff --git a/src/uncategorized/summaryOptions.tw b/src/uncategorized/summaryOptions.tw index a3ba75c1c552a5b699ba091e61e2dfbd2bce28a0..8cad7e4ec01e2da4e16c4ad5cca467dba199521a 100644 --- a/src/uncategorized/summaryOptions.tw +++ b/src/uncategorized/summaryOptions.tw @@ -73,6 +73,11 @@ <br> <span id="OptionAbbreviateOrigins"><<OptionAbbreviateOrigins>></span> +<<if $showMissingSlaves>> +<br> +<span id="OptionAbbreviateMissing"><<OptionAbbreviateMissing>></span> +<</if>> + <br><br> //[[FC Dev's preferred options|Summary Options][$seeDesk = 0, $seeFCNN = 0, $sortSlavesBy = "devotion",$sortSlavesOrder = "descending",$sortSlavesMain = 0,$rulesAssistantMain = 1,$abbreviateDevotion = 1,$abbreviateRules = 1,$abbreviateClothes = 2,$abbreviateHealth = 1,$abbreviateDiet = 1,$abbreviateDrugs = 1,$abbreviateRace = 1,$abbreviateGenitalia = 1,$abbreviatePhysicals = 1,$abbreviateSkills = 1,$abbreviateMental = 1,$abbreviateSidebar = 1]]// diff --git a/src/utility/descriptionWidgetsFlesh.tw b/src/utility/descriptionWidgetsFlesh.tw index e2477a8fe7d35e632ec5956378282fc1082b6fe0..8b313f6dfb1d5e097cf4ca40a1c217a882e064ac 100644 --- a/src/utility/descriptionWidgetsFlesh.tw +++ b/src/utility/descriptionWidgetsFlesh.tw @@ -13743,6 +13743,8 @@ $He has <<else>> <<set _daddy = "partner">> <</if>> +<<elseif $activeSlave.pregSource in $missingTable && $showMissingSlaves>> + <<set _daddy = $missingTable[$activeSlave.pregSource].fullName>> <</if>> <<if ($activeSlave.preg == -2) && ($activeSlave.vagina < 0) && ($activeSlave.mpreg == 0)>> diff --git a/src/utility/extendedFamilyWidgets.tw b/src/utility/extendedFamilyWidgets.tw index 5555c84e79a7ca2d93f3acb8eb705853a12e4b67..9a91f9927e5efce1a6ccd069e9e50f3ada7c7381 100644 --- a/src/utility/extendedFamilyWidgets.tw +++ b/src/utility/extendedFamilyWidgets.tw @@ -13,23 +13,35 @@ <<if $activeSlave.father == -1 && $activeSlave.mother == -1>> $He's @@.lightgreen;your child;@@ you knocked yourself up and gave birth to $him. -<<elseif $activeSlave.father > 0 && $activeSlave.mother > 0 && $activeSlave.father == $activeSlave.mother>> - <<set _efw = $slaveIndices[$activeSlave.father]>> - $He was @@.lightgreen;both fathered and mothered by $slaves[_efw].slaveName.@@ +<<elseif $activeSlave.father == $activeSlave.mother && ($activeSlave.father > 0 || ($activeSlave.father in $missingTable && $showMissingSlaves))>> + <<if $activeSlave.father > 0>> + <<set _pName = $slaves[$slaveIndices[$activeSlave.father]].slaveName>> + <<else>> + <<set _pName = "your former slave "+$missingTable[$activeSlave.father].slaveName>> + <</if>> + $He was @@.lightgreen;both fathered and mothered by _pName.@@ <</if>> <<if $activeSlave.father == -1 && $activeSlave.mother != -1>> $He's @@.lightgreen;your child;@@ you knocked $his mother up. -<<elseif $activeSlave.father > 0 && $activeSlave.father != $activeSlave.mother>> - <<set _efw = $slaveIndices[$activeSlave.father]>> - $He was @@.lightgreen;fathered by $slaves[_efw].slaveName's@@ virile dick. +<<elseif ($activeSlave.father > 0 || ($activeSlave.father in $missingTable && $showMissingSlaves)) && $activeSlave.father != $activeSlave.mother>> + <<if $activeSlave.father > 0>> + <<set _pName = $slaves[$slaveIndices[$activeSlave.father]].slaveName>> + <<else>> + <<set _pName = "your former slave "+$missingTable[$activeSlave.father].slaveName>> + <</if>> + $He was @@.lightgreen;fathered by _pName's@@ virile dick. <</if>> <<if $activeSlave.father != -1 && $activeSlave.mother == -1>> $He's @@.lightgreen;your child;@@ you gave birth to $him. -<<elseif $activeSlave.mother > 0 && $activeSlave.father != $activeSlave.mother>> - <<set _efw = $slaveIndices[$activeSlave.mother]>> - $He was @@.lightgreen;born from $slaves[_efw].slaveName's@@ fertile womb. +<<elseif ($activeSlave.mother > 0 || ($activeSlave.mother in $missingTable && $showMissingSlaves)) && $activeSlave.father != $activeSlave.mother>> + <<if $activeSlave.mother > 0>> + <<set _pName = $slaves[$slaveIndices[$activeSlave.mother]].slaveName>> + <<else>> + <<set _pName = "your former slave "+$missingTable[$activeSlave.mother].slaveName>> + <</if>> + $He was @@.lightgreen;born from _pName's@@ fertile womb. <</if>> <<set _children = $slaves.filter(function(s) { return $activeSlave.ID == s.father; })>> @@ -698,18 +710,26 @@ <br><br>Your present family includes: /*Player parents, lists both your parents, or just one.*/ +<<if $showMissingSlaves>> + <<if $PC.mother in $missingTable>> + <<set $children.push($missingTable[$PC.mother])>> + <</if>> + <<if $PC.father in $missingTable && !($PC.father == $PC.mother)>> + <<set $children.push($missingTable[$PC.father])>> + <</if>> +<</if>> <<for $i = 0; $i < $slaves.length; $i++>> <<if $slaves[$i].ID == $PC.father || $slaves[$i].ID == $PC.mother>> <<set $children.push($slaves[$i])>> <</if>> <</for>> <<if $children.length > 1>> - <br>Your parents are @@.lightgreen;$children[0].slaveName and $children[1].slaveName@@. + <br>Your parents are @@.lightgreen;<<if $children[0].ID < 0>>your former slave<<if $children[1].ID < 0>>s<</if>><</if>> $children[0].slaveName and <<if $children[1].ID < 0 && $children[0].ID > 0>>your former slave<</if>> $children[1].slaveName@@. <<elseif $children.length > 0>> <<if $PC.father == $PC.mother>> - <br>Your parent is @@.lightgreen;$children[0].slaveName@@, who impregnated $himself with you. + <br>Your parent is @@.lightgreen;<<if $children[0].ID < 0>>your former slave<</if>> $children[0].slaveName@@, who impregnated $himself with you. <<else>> - <br>You know one of your parents, @@.lightgreen;$children[0].slaveName@@. + <br>You know one of your parents, @@.lightgreen;<<if $children[0].ID < 0>>your former slave<</if>> $children[0].slaveName@@. <</if>> <</if>> <<set $children = []>> diff --git a/src/utility/optionsWidgets.tw b/src/utility/optionsWidgets.tw index da0c8265dcda4a2e3c61dbfc405a6ac27a807fe0..c19abdd471ad11fdf41ad32f9d7b27271b4af086 100644 --- a/src/utility/optionsWidgets.tw +++ b/src/utility/optionsWidgets.tw @@ -790,3 +790,28 @@ Facilities in the sidebar are <</link>>// <</if>> <</widget>> + +/% + Call as <<OptionAbbreviateMissing>> + Should be placed in a <span> with id = "OptionAbbreviateMissing" +%/ +<<widget "OptionAbbreviateMissing">> +Missing slave parents are +<<if $showMissingSlavesSD>> + @@.cyan;SHOWN.@@ + //<<link 'Hide'>> + <<set $showMissingSlavesSD = false>> + <<replace '#OptionAbbreviateMissing'>> + <<OptionAbbreviateMissing>> + <</replace>> + <</link>>// +<<else>> + @@.red;HIDDEN.@@ + //<<link 'Show'>> + <<set $showMissingSlavesSD = true>> + <<replace '#OptionAbbreviateMissing'>> + <<OptionAbbreviateMissing>> + <</replace>> + <</link>>// +<</if>> +<</widget>>