diff --git a/src/facilities/nursery/nurseryWidgets.js b/src/facilities/nursery/nurseryWidgets.js index 2285091e07bb01074b973464facf270c96be1699..2ff911ca526844d2d975dabb4fd087af684ea7cc 100644 --- a/src/facilities/nursery/nurseryWidgets.js +++ b/src/facilities/nursery/nurseryWidgets.js @@ -1825,8 +1825,10 @@ App.Facilities.Nursery.LongInfantDescription = function(child) { r = ``, age, title, - father, - mother; + father = 0, + fatherPC = 0, + mother = 0, + motherPC = 0; const { @@ -1835,17 +1837,29 @@ App.Facilities.Nursery.LongInfantDescription = function(child) { if (child.father === -1 && child.mother === -1) { father = PC; + fatherPC = 1; mother = PC; + motherPC = 1; } else { if (child.father === -1) { father = PC; + fatherPC = 1; mother = getSlave(child.mother); } else if (child.mother === -1) { father = getSlave(child.father); mother = PC; + motherPC = 1; } else { - father = getSlave(child.father); - mother = getSlave(child.mother); + if (child.father > 0) { /* Fathered by a current slave */ + father = getSlave(child.father); + } else if (child.father < 0) { /* Fathered by a missing slave */ + father = -1; + } + if (child.father > 0) { /* Mothered by a current slave */ + mother = getSlave(child.mother); + } else if (child.mother < 0) { /* Mothered by a missing slave */ + mother = -1; + } } } @@ -2027,31 +2041,35 @@ App.Facilities.Nursery.LongInfantDescription = function(child) { /* OPEN FAMILY */ - if (father === PC && mother === PC) { + if (fatherPC && motherPC) { r += `${He} is <span class="lightgreen">your child;</span> you knocked yourself up with ${him}. `; - } else if (father === mother) { - r += `He was <span class="lightgreen">both fathered and mothered by ${father.slaveName}.</span> `; + } else if (child.father === child.mother) { + r += `${He} was <span class="lightgreen">both fathered and mothered by ${father.slaveName}.</span> `; } else { - if (father === PC) { + if (fatherPC) { r += `${He} is <span class="lightgreen">your child;</span> you knocked up ${his} mother, ${SlaveFullName(mother)}. `; - } else if (mother === PC) { + } else if (motherPC) { r += `${He} is <span class="lightgreen">your child;</span> you gave birth to ${him}. `; } else { let pName; - if (father > 0) { - if (child.father in V.missingTable && V.showMissingSlaves) { - pName = V.slaves[V.slaveIndices[child.father]].slaveName; - } else { + if (child.father !== 0) { + if (V.showMissingSlaves && child.father in V.missingTable) { pName = `your former slave ${V.missingTable[child.father].slaveName}`; + } else if (child.father in V.slaveIndices) { + pName = V.slaves[V.slaveIndices[child.father]].slaveName; } - r += `${He} was <span class="lightgreen">fathered by ${pName}'s</span> virile dick. `; - } else if (mother > 0) { - if (child.mother in V.missingTable && V.showMissingSlaves) { - pName = V.slaves[V.slaveIndices[child.mother]].slaveName; - } else { + if (pName) { + r += `${He} was <span class="lightgreen">fathered by ${pName}'s</span> virile dick. `; + } + } else if (child.mother !== 0) { + if (V.showMissingSlaves && child.mother in V.missingTable) { pName = `your former slave ${V.missingTable[child.mother].slaveName}`; + } else if (child.mother in V.slaveIndices){ + pName = V.slaves[V.slaveIndices[child.mother]].slaveName; + } + if (pName) { + r += `${He} was born from ${pName}'s fertile womb. `; } - r += `${He} was born from ${pName}'s fertile womb. `; } } } @@ -2082,7 +2100,7 @@ App.Facilities.Nursery.LongInfantDescription = function(child) { if (jsDef(fi)) { mfi = father.mother; ffi = father.father; - } else if (father === PC) { + } else if (fatherPC) { mfi = PC.mother; ffi = PC.father; } @@ -2384,17 +2402,19 @@ App.Facilities.Nursery.LongInfantDescription = function(child) { /* CLOSE FAMILY */ - if (father === PC) { + if (father && fatherPC) { if (child.eyeColor === PC.eyeColor) { r += `${He} has your ${child.eyeColor} eyes, `; - } else { + } else if (mother) { r += `${He} has ${his} mother ${mother.slaveName}'s ${child.eyeColor} eyes, `; } } else { - if (child.eyeColor === father.eyeColor) { + if (father && child.eyeColor === father.eyeColor) { r += `${He} has ${his} father ${father.slaveName}'s ${child.eyeColor} eyes, `; - } else { + } else if (mother) { r += `${He} has ${his} mother ${mother.slaveName}'s ${child.eyeColor} eyes, `; + } else { + r += `${He} has ${child.eyeColor} eyes, `; } } r += ` and ${he} will most likely have ${child.hColor} hair when ${he}'s older. `;