diff --git a/src/descriptions/familySummaries.js b/src/descriptions/familySummaries.js new file mode 100644 index 0000000000000000000000000000000000000000..7307cc0f375f4de200ead12f7d17a9758018d914 --- /dev/null +++ b/src/descriptions/familySummaries.js @@ -0,0 +1,655 @@ +App.Desc.family = (function() { + /** From a list of slaves, return their names, comma-separated and appended with "and" if necessary + * @param {Array<App.Entity.SlaveState>} slaveList + * @returns {string} + */ + function slaveListToText(slaveList) { + return slaveList.map(s => s.slaveName).reduce((res, ch, i, arr) => res + (i === arr.length - 1 ? ' and ' : ', ') + ch); + } + + /** From a slave ID, return text describing that slave (even if they aren't currently your slave) to use in place of their name + * @param {number} slaveID + * @returns {string} + */ + function knownSlave(slaveID) { + if (slaveID > 0) { + return getSlave(slaveID).slaveName; + } else { + return "your former slave " + V.missingTable[slaveID].slaveName; + } + } + + /** Splits an array of slaves by sex (nieces/nephews, aunts/uncles, brothers/sisters, etc) + * @param {Array<App.Entity.SlaveState>} slaves + * @returns {Object} + */ + function splitBySex(slaves) { + let r = {m: [], f: []}; + for (s of slaves) { + if (s.genes === "XX") { + r.f.push(s); + } else { + r.m.push(s); + } + } + return r; + } + + /** Describe the members of a character's family. + * @param {App.Entity.SlaveState} character (pass V.PC to get the PC's special family summary) + * @returns {string} + */ + function familySummary(character) { + if (character === V.PC) { + return PCFamilySummary(); + } else { + return slaveFamilySummary(character); + } + } + + /** Describe the members of a slave's family. + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ + function slaveFamilySummary(slave) { + let r = []; + + const {He, His, he, him, himself, his, sister} = getPronouns(slave); + + /* PC parentage */ + if (slave.ID === V.PC.mother && slave.ID === V.PC.father) { + r.push(`${He} is <span class="lightgreen">both your mother and father;</span> ${he} impregnated ${himself} with you.`); + } else if (slave.ID === V.PC.mother) { + r.push(`${He} is <span class="lightgreen">your mother.</span>`); + } else if (slave.ID === V.PC.father) { + r.push(`${He} is <span class="lightgreen">your father.</span>`); + } + + if (slave.father === -1 && slave.mother === -1) { + r.push(`${He}'s <span class="lightgreen">your child;</span> you knocked yourself up and gave birth to ${him}.`); + } else if (slave.father === slave.mother && (slave.father > 0 || (slave.father in V.missingTable && V.showMissingSlaves))) { + r.push(`${He} was <span class="lightgreen">both fathered and mothered by ${knownSlave(slave.father)}.</span>`); + } + + if (slave.father === -1 && slave.mother !== -1) { + r.push(`${He}'s <span class="lightgreen">your child;</span> you knocked ${his} mother up.`); + } else if ((slave.father > 0 || (slave.father in V.missingTable && V.showMissingSlaves)) && slave.father !== slave.mother) { + r.push(`${He} was <span class="lightgreen">fathered by ${knownSlave(slave.father)}'s</span> virile dick.`); + } + + if (slave.father !== -1 && slave.mother === -1) { + r.push(`${He}'s <span class="lightgreen">your child;</span> you gave birth to ${him}.`); + } else if ((slave.mother > 0 || (slave.mother in V.missingTable && V.showMissingSlaves)) && slave.father !== slave.mother) { + r.push(`${He} was <span class="lightgreen">born from ${knownSlave(slave.mother)}'s</span> fertile womb.`); + } + + let children = V.slaves.filter((s) => slave.ID === s.father); + if (children.length > 2) { + r.push(`${He} <span class="lightgreen">fathered ${slaveListToText(children)}.</span>`); + } else if (children.length > 1) { + r.push(`${He} <span class="lightgreen">fathered a pair of your slaves: ${slaveListToText(children)}.</span>`); + } else if (children.length > 0) { + r.push(`${He} <span class="lightgreen">fathered a single slave of yours: ${slaveListToText(children)}.</span>`); + } + + children = V.slaves.filter((s) => slave.ID === s.mother); + if (children.length > 2) { + r.push(`${He} <span class="lightgreen">gave birth to ${slaveListToText(children)}.</span>`); + } else if (children.length > 1) { + r.push(`${He} <span class="lightgreen">gave birth to a pair of your slaves: ${slaveListToText(children)}.</span>`); + } else if (children.length > 0) { + r.push(`${He} <span class="lightgreen">gave birth to a single slave of yours: ${slaveListToText(children)}.</span>`); + } + + function getParentIndices(slaveID) { + if (slaveID === V.PC.ID) { + return {mi: V.slaveIndices[V.PC.mother], fi: V.slaveIndices[V.PC.father]}; + } else { + const target = getSlave(slaveID); + if (target) { + return {mi: V.slaveIndices[target.mother], fi: V.slaveIndices[target.father]}; + } + } + return {mi: undefined, fi: undefined}; + } + + if (V.showDistantRelatives) { + /* grandparents */ + const mi = V.slaveIndices[slave.mother]; + const fi = V.slaveIndices[slave.father]; + const {mi: mmi, fi: fmi} = getParentIndices(slave.mother); + const {mi: mfi, fi: ffi} = getParentIndices(slave.father); + if ((jsDef(mi) || jsDef(fi)) && !jsDef(mmi) && !jsDef(fmi) && !jsDef(mfi) && !jsDef(ffi)) { + if (jsDef(mi)) { + if ((jsDef(fi)) && mi === fi) { + if (V.PC.ID === V.slaves[mi].mother && V.PC.ID === V.slaves[fi].father) { + r.push(`${He} is <span class="lightgreen">your grandchild.</span> You impregnated yourself with ${his} sole biological parent.`); + } else if (V.PC.ID === V.slaves[mi].mother) { + r.push(`${He} is <span class="lightgreen">your grandchild.</span> You gave birth to ${his} sole biological parent.`); + } else if (V.PC.ID === V.slaves[fi].father) { + r.push(`${He} is <span class="lightgreen">your grandchild.</span> You fathered ${his} sole biological parent.`); + } + } else if ((jsDef(fi)) && V.PC.ID === V.slaves[mi].mother && V.PC.ID === V.slaves[fi].mother) { + r.push(`${He} is <span class="lightgreen">your grandchild.</span> You gave birth to both of ${his} parents.`); + } else if ((jsDef(fi)) && V.PC.ID === V.slaves[mi].father && V.PC.ID === V.slaves[fi].father) { + r.push(`${He} is <span class="lightgreen">your grandchild.</span> You fathered both of ${his} parents.`); + } else if (V.PC.ID === V.slaves[mi].mother) { + r.push(`${He} is <span class="lightgreen">your grandchild.</span> You gave birth to ${his} mother.`); + } else if (V.PC.ID === V.slaves[mi].father) { + r.push(`${He} is <span class="lightgreen">your grandchild.</span> You fathered ${his} mother.`); + } + } else if (jsDef(fi)) { + if (V.PC.ID === V.slaves[fi].mother) { + r.push(`${He} is <span class="lightgreen">your grandchild.</span> You gave birth to ${his} father.`); + } else if (V.PC.ID === V.slaves[fi].father) { + r.push(`${He} is <span class="lightgreen">your grandchild.</span> You fathered ${his} father.`); + } + } + } else { + if ((jsDef(mmi)) && (jsDef(ffi)) && mmi === ffi) { + r.push(`${His} sole <span class="lightgreen">grandparent is ${V.slaves[mmi].slaveName}.</span>`); + } else { + if ((jsDef(mmi)) && (jsDef(mfi)) && mmi === mfi) { + r.push(`${His} sole <span class="lightgreen">grandmother is ${V.slaves[mmi].slaveName}.</span>`); + } else { + if (jsDef(mmi)) { + r.push(`${His} maternal <span class="lightgreen">grandmother is ${V.slaves[mmi].slaveName}.</span>`); + } + if (jsDef(mfi)) { + r.push(`${His} paternal <span class="lightgreen">grandmother is ${V.slaves[mfi].slaveName}.</span>`); + } + } + if ((jsDef(fmi)) && (jsDef(ffi)) && fmi === ffi) { + r.push(`${His} sole <span class="lightgreen">grandfather is ${V.slaves[ffi].slaveName}.</span>`); + } else { + if (jsDef(fmi)) { + r.push(`${His} maternal <span class="lightgreen">grandfather is ${V.slaves[fmi].slaveName}.</span>`); + } + if (ffi) { + r.push(`${His} paternal <span class="lightgreen">grandfather is ${V.slaves[ffi].slaveName}.</span>`); + } + } + } + } + + /* PC grandparents - determines if the current slave is your grandparent */ + const pcMother = getSlave(V.PC.mother); + const pcFather = getSlave(V.PC.father); + if (jsDef(pcMother)) { + if ((jsDef(pcFather)) && pcMother === pcFather) { + if (slave.ID === pcMother.mother && slave.ID === pcFather.father) { + r.push(`${He} is <span class="lightgreen">your sole grandparent.</span> ${He} impregnated ${himself} with your sole parent ${pcMother.slaveName} who in turn impregnated themselves with you.`); + } else if (slave.ID === pcMother.mother) { + r.push(`${He} is <span class="lightgreen">your sole grandmother.</span> ${He} gave birth to ${pcMother.slaveName} who in turn impregnated themselves with you.`); + } else if (slave.ID === pcFather.father) { + r.push(`${He} is <span class="lightgreen">your sole grandfather.</span> ${He} fathered ${pcFather.slaveName} who in turn impregnated themselves with you.`); + } + } else if ((jsDef(pcFather)) && slave.ID === pcMother.mother && slave.ID === pcFather.mother) { + r.push(`${He} is <span class="lightgreen">your sole grandmother.</span> ${He} gave birth to both of your parents, ${pcMother.slaveName} and ${pcFather.slaveName}.`); + } else if ((jsDef(pcFather)) && slave.ID === pcMother.father && slave.ID === pcFather.father) { + r.push(`${He} is <span class="lightgreen">your sole grandfather.</span> ${He} fathered both of your parents, ${pcFather.slaveName} and ${pcMother.slaveName}.`); + } else if (slave.ID === pcMother.mother) { + r.push(`${He} is <span class="lightgreen">your maternal grandmother.</span>`); + } else if (slave.ID === pcMother.father) { + r.push(`${He} is <span class="lightgreen">your maternal grandfather.</span>`); + } + } else if (jsDef(pcFather)) { + if (slave.ID === pcFather.mother) { + r.push(`${He} is <span class="lightgreen">your paternal grandmother.</span>`); + } else if (slave.ID === pcFather.father) { + r.push(`${He} is <span class="lightgreen">your paternal grandfather.</span>`); + } + } + + /* grandchild - determines how many grandchildren the current slave has */ + children = V.slaves.filter((s) => isGrandparentP(s, slave)); + if (children.length > 0) { + r.push(`${He} has`); + if (children.length > 2) { + r.push(`<span class="lightgreen">many grandchildren, ${slaveListToText(children)}, amongst your slaves.</span>`); + } else if ($children.length > 1) { + r.push(`<span class="lightgreen">two grandchildren, ${slaveListToText(children)}, amongst your slaves.</span>`); + } else { + r.push(`a <span class="lightgreen">grandchild, ${slaveListToText(children)}, as your slave.</span>`); + } + } + + /* PC aunt and uncle - determines how many aunts and uncles you have */ + if (isAunt(V.PC, slave)) { + const {m: uncles, f: aunts} = splitBySex(V.slaves.filter((s) => isAunt(V.PC, s))); + + r.push(`${He} is`); + if (slave.genes === "XX") { + if (aunts.length > 0) { + r.push(`<span class="lightgreen">your aunt along with ${slaveListToText(aunts)}.</span>`); + } else { + r.push(`<span class="lightgreen">your aunt.</span>`); + } + } else { + if (uncles.length > 0) { + r.push(`<span class="lightgreen">your uncle along with ${slaveListToText(uncles)}.</span>`); + } else { + r.push(`<span class="lightgreen">your uncle.</span>`); + } + } + } + + /* aunt and uncle - determines how many aunts and uncles a slave has*/ + const {m: uncles, f: aunts} = splitBySex(V.slaves.filter((s) => isAunt(slave, s))); + + if (aunts.length > 0) { + r.push(`${He} has`); + if (aunts.length > 2) { + r.push(`<span class="lightgreen">many aunts, ${slaveListToText(aunts)}.</span>`); + } else if (aunts.length > 1) { + r.push(`<span class="lightgreen">two aunts, ${slaveListToText(aunts)}.</span>`); + } else { + r.push(`<span class="lightgreen">an aunt, ${slaveListToText(aunts)}.</span>`); + } + } + if (uncles.length > 0) { + r.push(`${He} has`); + if (uncles.length > 2) { + r.push(`<span class="lightgreen">many uncles, ${slaveListToText(uncles)}.</span>`); + } else if (uncles.length > 1) { + r.push(`<span class="lightgreen">two uncles, ${slaveListToText(uncles)}.</span>`); + } else { + r.push(`<span class="lightgreen">an uncle, ${slaveListToText(uncles)}.</span>`); + } + } + + /* PC niece and nephew - determines how many nieces and nephews you have*/ + if (isAunt(slave, V.PC)) { + const {m: nephews, f: nieces} = splitBySex(V.slaves.filter((s) => isAunt(s, V.PC))); + + r.push(`${He} is`); + if (slave.genes === "XX") { + if (nieces.length > 0) { + r.push(`<span class="lightgreen">your niece along with ${slaveListToText(nieces)}.</span>`); + } else { + r.push(`<span class="lightgreen">your niece.</span>`); + } + } else { + if (nephews.length > 0) { + r.push(`<span class="lightgreen">your nephew along with ${slaveListToText(nephews)}.</span>`); + } else { + r.push(`<span class="lightgreen">your nephew.</span>`); + } + } + } + + /* niece and nephew - determines how many nieces and nephews a slave has*/ + const {m: nephews, f: nieces} = splitBySex(V.slaves.filter((s) => isAunt(s, slave))); + + if (nieces.length > 0) { + r.push(`${He} has`); + if (nieces.length > 2) { + r.push(`<span class="lightgreen">many nieces, ${slaveListToText(nieces)}, who are your slaves.</span>`); + } else if (nieces.length > 1) { + r.push(`<span class="lightgreen">two nieces, ${slaveListToText(nieces)}, who are your slaves.</span>`); + } else { + r.push(`<span class="lightgreen">a niece, ${slaveListToText(nieces)}, who is your slave.</span>`); + } + } + if (nephews.length > 0) { + r.push(`${He} has`); + if (nephews.length > 2) { + r.push(`<span class="lightgreen">many nephews, ${slaveListToText(nephews)}, who are your slaves.</span>`); + } else if (nephews.length > 1) { + r.push(`<span class="lightgreen">two nephews, ${slaveListToText(nephews)}, who are your slaves.</span>`); + } else { + r.push(`<span class="lightgreen">a nephew, ${slaveListToText(nephews)}, who is your slave.</span>`); + } + } + } /* end distant relatives toggle check */ + + let twins = []; + let sisters = []; + let brothers = []; + let halfSisters = []; + let halfBrothers = []; + let cousins = []; + + for (const s of V.slaves) { + let sisterCheck = areSisters(s, slave); + if (sisterCheck === 1) { + twins.push(s); + } + if (sisterCheck === 2) { + (s.genes === "XX" ? sisters : brothers).push(s); + } + if (sisterCheck === 3) { + (s.genes === "XX" ? halfSisters : halfBrothers).push(s); + } + if (V.showDistantRelatives) { + if (areCousins(s, slave)) { + cousins.push(s); + } + } + } + + /* PC twin - determines how many twins you have */ + if (areSisters(slave, V.PC) === 1) { + r.push(He); + if (twins.length > 1) { + r.push(`<span class="lightgreen">shared a cramped womb with you, ${slaveListToText(twins)}.</span>`); + } else if (twins.length > 0) { + r.push(`is <span class="lightgreen">your twin along with ${slaveListToText(twins)}.</span>`); + } else { + r.push(`is <span class="lightgreen">your twin.</span>`); + } + twins = []; // clear it so we don't output it a second time + } + + /* PC sister - determines how many sisters you have*/ + if (areSisters(slave, V.PC) === 2 && slave.genes === "XX") { + r.push(`${He} is`); + if (sisters.length > 0) { + r.push(`<span class="lightgreen">your ${sister} along with ${slaveListToText(sisters)}.</span>`); + } else { + r.push(`<span class="lightgreen">your ${sister}.</span>`); + } + sisters = []; // clear it so we don't output it a second time + } + + /* PC brother - determines how many brothers you have*/ + if (areSisters(slave, V.PC) === 2 && slave.genes === "XY") { + r.push(`${He} is`); + if (brothers.length > 0) { + r.push(`<span class="lightgreen">your ${sister} along with ${slaveListToText(brothers)}.</span>`); + } else { + r.push(`<span class="lightgreen">your ${sister}.</span>`); + } + brothers = []; // clear it so we don't output it a second time + } + + /* PC half-sister - determines how many half-sisters you have*/ + if (areSisters(slave, V.PC) === 3 && slave.genes === "XX") { + r.push(`${He} is`); + if (halfSisters.length > 0) { + r.push(`<span class="lightgreen">is your half-${sister} along with ${slaveListToText(halfSisters)}.</span>`); + } else { + r.push(`<span class="lightgreen">your half-${sister}.</span>`); + } + halfSisters = []; // clear it so we don't output it a second time + } + + /* PC half-brother - determines how many half-brothers you have*/ + if (areSisters(slave, V.PC) === 3 && slave.genes === "XY") { + r.push(`${He} is`); + if (halfBrothers.length > 0) { + r.push(`<span class="lightgreen">is your half-${sister} along with ${slaveListToText(halfBrothers)})>>.</span>`); + } else { + r.push(`<span class="lightgreen">your half-${sister}.</span>`); + } + halfBrothers = []; // clear it so we don't output it a second time + } + + /* twins? - determines how many twins a slave has*/ + if (twins.length > 0) { + r.push(`${He}`); + if (twins.length > 2) { + r.push(`<span class="lightgreen">shared a cramped womb with ${slaveListToText(twins)}.</span>`); + } else if (twins.length > 1) { + r.push(`is <span class="lightgreen">one of a set of triplets; ${slaveListToText(twins)}</span> complete the trio.`); + } else { + r.push(`is <span class="lightgreen">twins with ${twins[0].slaveName}.</span>`); + } + } + + /* sister - determines how many sisters a slave has*/ + if (sisters.length > 0) { + const sister2 = getPronouns(sisters[0]).sister; + if (sisters.length > 1) { + r.push(`<span class="lightgreen">${slaveListToText(sisters)} are ${his} ${sister2}s.</span>`); + } else { + r.push(`<span class="lightgreen">${sisters[0].slaveName} is ${his} ${sister2}.</span>`); + } + } + + /* brother - determines how many brothers a slave has*/ + if (brothers.length > 0) { + const sister2 = getPronouns(brothers[0]).sister; + if (brothers.length > 1) { + r.push(`<span class="lightgreen">${slaveListToText(brothers)} are ${his} ${sister2}s.</span>`); + } else { + r.push(`<span class="lightgreen">${brothers[0].slaveName} is ${his} ${sister2}.</span>`); + } + } + + /* half-sister - determines how many half-sisters a slave has*/ + if (halfSisters.length > 0) { + const sister2 = getPronouns(halfSisters[0]).sister; + if (halfSisters.length > 1) { + r.push(`<span class="lightgreen">${slaveListToText(halfSisters)} are half-${sister2}s to ${him}.</span>`); + } else { + r.push(`<span class="lightgreen">${halfSisters[0].slaveName} is a half-${sister2} to ${him}.</span>`); + } + } + + /* half-brother - determines how many half-brothers a slave has*/ + if (halfBrothers.length > 0) { + const sister2 = getPronouns(halfBrothers[0]).sister; + if (halfBrothers.length > 1) { + r.push(`<span class="lightgreen">${slaveListToText(halfBrothers)} are half-${sister2}s to ${him}.</span>`); + } else if (halfBrothers.length > 0) { + r.push(`<span class="lightgreen">${halfBrothers[0].slaveName} is a half-${sister2} to ${him}.</span>`); + } + } + + if (V.showDistantRelatives) { + /* PC cousin - determines how many cousins you have*/ + if (areCousins(slave, V.PC)) { + const PCcousins = V.slaves.filter((s) => areCousins(V.PC, s)); + r.push(`${He} is`); + if (PCcousins.length > 0) { + r.push(`<span class="lightgreen">your cousin along with ${slaveListToText(PCcousins)}.</span>`); + } else { + r.push(`<span class="lightgreen">your cousin.</span>`); + } + } + + /* cousin - determines how many cousins a slave has*/ + if (cousins.length > 1) { + r.push(`<span class="lightgreen">${slaveListToText(cousins)} are cousins to ${him}.</span>`); + } else if (cousins.length > 0) { + r.push(`<span class="lightgreen">${cousins[0].slaveName} is a cousin to ${him}.</span>`); + } + } + + if (slave.clone !== 0) { + r.push(`${He} is`); + if (slave.cloneID === -1) { + r.push(`your clone.`); + } else { + r.push(`a clone of ${slave.clone}.`); + } + } + + if (V.cheatMode) { + r.push(`${He} has ${numberWithPlural(slave.sisters, "sister")} and ${numberWithPlural(slave.daughters, "daughter")}.`); + } + + return r.join(" "); + } + + /** Describe the members of the PC's family. + * @returns {string} + */ + function PCFamilySummary() { + let r = []; + + r.push(`<br>Your family records show that:`); + + /* Player parents, lists both your parents, or just one. */ + let parents = []; + if (V.showMissingSlaves) { + if (V.PC.mother in V.missingTable) { + parents.push(V.missingTable[V.PC.mother]); + } + if (V.PC.father in V.missingTable && (V.PC.father !== V.PC.mother)) { + parents.push(V.missingTable[V.PC.father]); + } + } + parents.concat(V.slaves.filter((s) => isParentP(V.PC, s))); + + if (parents.length > 1) { + r.push(`<br>Your parents are <span class="lightgreen">${knownSlave(parents[0].ID)} and ${knownSlave(parents[1].ID)}.</span>`); + } else if (parents.length > 0) { + if (V.PC.father === V.PC.mother) { + /* apparently we don't keep pronoun records in the missing parents table??? */ + const himself = jsDef(parents[0].pronoun) ? getPronouns(parents[0]).himself : "herself"; + r.push(`<br>Your parent is <span class="lightgreen">${knownSlave(parents[0].ID)},</span> who impregnated ${himself} with you.`); + } else { + r.push(`<br>You know one of your parents, <span class="lightgreen">${knownSlave(parents[0].ID)}.</span>`); + } + } + + /* Player aunts and uncles */ + if (V.showDistantRelatives) { + const {m: uncles, f: aunts} = splitBySex(V.slaves.filter((s) => isAunt(V.PC, s))); + + if (aunts.length > 0) { + r.push(`<br>You have`); + if (aunts.length > 2) { + r.push(`<span class="lightgreen">many aunts, ${slaveListToText(aunts)}.</span>`); + } else if (aunts.length > 1) { + r.push(`<span class="lightgreen">two aunts, ${slaveListToText(aunts)}.</span>`); + } else { + r.push(`<span class="lightgreen">an aunt, ${slaveListToText(aunts)}.</span>`); + } + } + if (uncles.length > 0) { + r.push(`<br>You have`); + if (uncles.length > 2) { + r.push(`<span class="lightgreen">many uncles, ${slaveListToText(uncles)}.</span>`); + } else if (uncles.length > 1) { + r.push(`<span class="lightgreen">two uncles, ${slaveListToText(uncles)}.</span>`); + } else { + r.push(`<span class="lightgreen">an uncle, ${slaveListToText(uncles)}.</span>`); + } + } + } + + let twins = []; + let sisters = []; + let brothers = []; + let halfSisters = []; + let halfBrothers = []; + let cousins = []; + + for (const s of V.slaves) { + let sisterCheck = areSisters(s, V.PC); + if (sisterCheck === 1) { + twins.push(s); + } + if (sisterCheck === 2) { + (s.genes === "XX" ? sisters : brothers).push(s); + } + if (sisterCheck === 3) { + (s.genes === "XX" ? halfSisters : halfBrothers).push(s); + } + if (V.showDistantRelatives) { + if (areCousins(s, V.PC)) { + cousins.push(s); + } + } + } + + if (twins.length > 1) { + r.push(`<br>You are <span class="lightgreen">twins with ${slaveListToText(twins)}.</span>`); + } else if (twins.length > 0) { + r.push(`<br>Your twin is <span class="lightgreen">${twins[0].slaveName}.</span>`); + } + + if (sisters.length > 1) { + r.push(`<br><span class="lightgreen">${slaveListToText(sisters)}</span> are your sisters.`); + } else if (sisters.length > 0) { + const {sister} = getPronouns(sisters[0]); + r.push(`<br>Your ${sister} is <span class="lightgreen">${sisters[0].slaveName}.</span>`); + } + + if (brothers.length > 1) { + r.push(`<br><span class="lightgreen">${slaveListToText(brothers)}</span> are your brothers.`); + } else if (brothers.length > 0) { + const {sister} = getPronouns(brothers[0]); + r.push(`<br>Your ${sister} is <span class="lightgreen">${brothers[0].slaveName}.</span>`); + } + + if (halfSisters.length > 1) { + r.push(`<br><span class="lightgreen">${slaveListToText(halfSisters)}</span> are your half-sisters.`); + } else if (halfSisters.length > 0) { + const {sister} = getPronouns(halfSisters[0]); + r.push(`<br>You have one half-${sister}, <span class="lightgreen">${halfSisters[0].slaveName}.</span>`); + } + + if (halfBrothers.length > 1) { + r.push(`<br><span class="lightgreen">${slaveListToText(halfBrothers)}</span> are your half-brothers.`); + } else if (halfBrothers.length > 0) { + const {sister} = getPronouns(halfBrothers[0]); + r.push(`<br>You have one half-${sister}, <span class="lightgreen">${halfBrothers[0].slaveName}.</span>`); + } + + if (V.showDistantRelatives) { + if (cousins.length > 1) { + r.push(`<br><span class="lightgreen">${slaveListToText(cousins)}</span> are your cousins.`); + } else if (cousins.length > 0) { + r.push(`<br>You have one cousin, <span class="lightgreen">${cousins[0].slaveName}.</span>`); + } + } + + /* Player nieces and nephews */ + if (V.showDistantRelatives) { + const {m: nephews, f: nieces} = splitBySex(V.slaves.filter((s) => isAunt(s, V.PC))); + + if (nieces.length > 0) { + r.push(`<br>You have`); + if (nieces.length > 2) { + r.push(`<span class="lightgreen">many nieces, ${slaveListToText(nieces)}, who are your slaves.</span>`); + } else if (nieces.length > 1) { + r.push(`<span class="lightgreen">two nieces, ${slaveListToText(nieces)}, who are your slaves.</span>`); + } else { + r.push(`<span class="lightgreen">a niece, ${slaveListToText(nieces)}, who is your slave.</span>`); + } + } + if (nephews.length > 0) { + r.push(`<br>You have`); + if (nephews.length > 2) { + r.push(`<span class="lightgreen">many nephews, ${slaveListToText(nephews)}, who are your slaves.</span>`); + } else if (nephews.length > 1) { + r.push(`<span class="lightgreen">two nephews, ${slaveListToText(nephews)}, who are your slaves.</span>`); + } else { + r.push(`<span class="lightgreen">a nephew, ${slaveListToText(nephews)}, who is your slave.</span>`); + } + } + } + + /* Player is Father, lists children you fathered */ + let children = V.slaves.filter((s) => s.father === V.PC.ID); + if (children.length > 0) { + r.push(`<br>You fathered ${num(children.length)} of your slaves, <span class="lightgreen">${slaveListToText(children)}.</span>`); + } + + /* Player is Mother, lists birthed children */ + children = V.slaves.filter((s) => s.mother === V.PC.ID); + if (children.length > 0) { + r.push(`<br>You gave birth to ${num(children.length)} of your slaves, <span class="lightgreen">${slaveListToText(children)}.</span>`); + } + + /* Player is grandparent */ + if (V.showDistantRelatives) { + children = V.slaves.filter((s) => isGrandparentP(s, V.PC)); + if (children.length > 0) { + r.push(`<br>You have ${num(children.length)} grandchildren as your slaves, <span class="lightgreen">${slaveListToText(children)}.</span>`); + } + } + + if (V.cheatMode) { + r.push(`<br>You have ${numberWithPlural(V.PC.sisters, "sister")} and ${numberWithPlural(V.PC.daughters, "daughter")}.`); + } + + return r.join(" "); + } + + return familySummary; +})(); diff --git a/src/endWeek/saServeThePublic.js b/src/endWeek/saServeThePublic.js index d67fde13d9778c3fcb08c680fdbbcf8730205157..db878594dd591a5eacc3cc460227c7e1bda9ba05 100644 --- a/src/endWeek/saServeThePublic.js +++ b/src/endWeek/saServeThePublic.js @@ -552,12 +552,7 @@ window.saServeThePublic = (function saServeThePublic() { // Someone double check this block if (V.familyTesting === 1) { if (totalRelatives(slave) > 0) { - let children = []; - children = V.slaves.filter( - function(s) { - return ((slave.ID === s.father || slave.ID === s.mother || s.ID === slave.father || s.ID === slave.mother || areSisters(slave, s) > 0) && (s.assignment === slave.assignment)); - } - ); + let children = V.slaves.filter((s) => areRelated(slave, s) && (s.assignment === slave.assignment)); if (children.length > 2) { r += ` Since ${his} relatives,`; sstp = 0; diff --git a/src/endWeek/saWhore.js b/src/endWeek/saWhore.js index 008de40707c9a17c1ce3767313ba500eb88df3c5..2a087e5757fc33c19ebce60f8440aaf6b8830f2d 100644 --- a/src/endWeek/saWhore.js +++ b/src/endWeek/saWhore.js @@ -629,12 +629,7 @@ window.saWhore = (function saWhore() { if (V.familyTesting === 1) { if (totalRelatives(slave) > 0) { - let children = []; - children = V.slaves.filter( - function(s) { - return ((slave.ID === s.father || slave.ID === s.mother || s.ID === slave.father || s.ID === slave.mother || areSisters(slave, s) > 0) && (s.assignment === slave.assignment)); - } - ); + let children = V.slaves.filter((s) => areRelated(slave, s) && (s.assignment === slave.assignment)); if (children.length > 2) { r += ` Since ${his} relatives,`; SWi = 0; diff --git a/src/facilities/nursery/nurseryWidgets.js b/src/facilities/nursery/nurseryWidgets.js index 1dcc2cb283b204f7a4ff6d0106e1c2a48bb9c46c..ee6ffe658f3064e8ddee760fa2800480e445f34b 100644 --- a/src/facilities/nursery/nurseryWidgets.js +++ b/src/facilities/nursery/nurseryWidgets.js @@ -2032,315 +2032,7 @@ App.Facilities.Nursery.LongInfantDescription = function(child) { r += `. `; } - /* OPEN FAMILY */ - - if (fatherPC && motherPC) { - r += `${He} is <span class="lightgreen">your child;</span> you knocked yourself up with ${him}. `; - } else if (child.father === child.mother) { - r += `${He} was <span class="lightgreen">both fathered and mothered by ${father.slaveName}.</span> `; - } else { - if (fatherPC) { - r += `${He} is <span class="lightgreen">your child;</span> you knocked up ${his} mother, ${SlaveFullName(mother)}. `; - } else if (motherPC) { - r += `${He} is <span class="lightgreen">your child;</span> you gave birth to ${him}. `; - } else { - let pName; - 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; - } - 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. `; - } - } - } - } - - function jsDef(x) { - return typeof x !== "undefined"; - } - - if (V.showDistantRelatives) { - const - mi = mother, - fi = father; - - let - mmi, - fmi, - mfi, - ffi; - - if (jsDef(mi)) { - mmi = mother.mother; - fmi = mother.father; - } else if (mother === PC) { - mmi = PC.mother; - fmi = PC.father; - } - - if (jsDef(fi)) { - mfi = father.mother; - ffi = father.father; - } else if (fatherPC) { - mfi = PC.mother; - ffi = PC.father; - } - - // grandparents - if (jsDef(mi) || jsDef(fi) && !jsDef(mmi) && !jsDef(fmi) && !jsDef(mfi) && !jsDef(ffi)) { - if (jsDef(mi)) { - if (jsDef(fi) && mi === fi) { - if (PC === mother.mother && PC === father.father) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You impregnated yourself with ${his} sole biological parent. `; - } else if (PC === mother.mother) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You gave birth to ${his} sole biological parent. `; - } else if (PC === father.father) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You fathered ${his} sole biological parent. `; - } - } else if (jsDef(fi) && PC === mother.mother && PC === father.mother) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You gave birth to both of ${his} parents. `; - } else if (jsDef(fi) && PC === mother.father && PC === father.father) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You fathered both of ${his} parents. `; - } else if (PC === mother.mother) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You gave birth to ${his} mother. `; - } else if (PC === mother.father) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You fathered ${his} mother. `; - } - } else if (jsDef(fi)) { - if (PC === father.mother) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You gave birth to ${his} father. `; - } else if (PC === father.father) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You fathered ${his} father. `; - } - } - } else { - if (jsDef(mmi) && jsDef(ffi) && mmi === ffi) { - r += `${His} sole granparent is ${mmi.slaveName}.</span> `; - } else { - if (jsDef(mmi) && jsDef(mfi) && mmi === mfi) { - if (jsDef(mmi)) { - r += `${His} sole <span class="lightgreen">grandparent is ${mmi}.</span> `; - } - } else { - if (jsDef(mmi)) { - r += `${His} maternal <span class="lightgreen">grandmother is ${mmi.slaveName}.</span> `; - } - if (jsDef(mfi)) { - r += `${His} paternal <span class="lightgreen">grandmother is ${mfi.slaveName}.</span> `; - } - } - if (jsDef(fmi) && jsDef(ffi) && fmi === ffi) { - r += `${His} sole <span class="lightgreen">grandparent is ${ffi}.</span> `; - } else { - if (jsDef(fmi)) { - r += `${His} maternal <span class="lightgreen">grandfather is ${fmi.slaveName}.</span> `; - } - if (jsDef(ffi)) { - r += `${His} paternal <span class="lightgreen">grandfather is ${ffi.slaveName}.</span> `; - } - } - } - } - - // aunts and uncles - let aunts = [], uncles = []; - let momsiblings = V.slaves.filter((s) => { const sis = areSisters(s, child.mother); return sis === 1 || sis === 2; }); - let dadsiblings = V.slaves.filter((s) => { const sis = areSisters(s, child.father); return sis === 1 || sis === 2; }); - for (let i = 0; i < momsiblings.length; i++) { - if (momsiblings[i].genes === "XX") { - aunts.push(momsiblings[i]); - } else { - uncles.push(momsiblings[i]); - } - } - for (let i = 0; i < dadsiblings.length; i++) { - if (dadsiblings[i].genes === "XX") { - aunts.push(dadsiblings[i]); - } else { - uncles.push(dadsiblings[i]); - } - } - - if (aunts.length > 0) { - r += `${He} `; - if (aunts.length > 2) { - r += `has <span class="lightgreen">many aunts, ${aunts.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })}</span> `; - } else if (aunts.length === 2) { - r += `has <span class="lightgreen">two aunts, ${aunts[0].slaveName}, and ${aunts[1].slaveName}.</span> `; - } else { - r += `has <span class="lightgreen">an aunt, ${aunts[0].slaveName}.</span> `; - } - } - - if (uncles.length > 0) { - r += `${He} `; - if (uncles.length > 2) { - r += `has <span class="lightgreen">many uncles, ${uncles.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })}</span> `; - } else if (uncles.length === 2) { - r += `has <span class="lightgreen">two uncles, ${uncles[0].slaveName}, and ${uncles[1].slaveName}.</span> `; - } else { - r += `has <span class="lightgreen">an uncle, ${uncles[0].slaveName}.</span> `; - } - } - - // nieces and nephews - let nieces = $slaves.filter((s) => { return (isAunt(s, $activeSlave) && (s.genes === "XX")); }); - let nephews = $slaves.filter((s) => { return (isAunt(s, $activeSlave) && (s.genes === "XY")); }); - - if (nieces.length > 0) { - r += `${He} `; - if (nieces.length > 2) { - r += `has <span class="lightgreen">many nieces, ${nieces.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })}</span> `; - } else if (nieces.length === 2) { - r += `has <span class="lightgreen">two nieces, ${nieces[0].slaveName}, and ${nieces[1].slaveName}.</span> `; - } else { - r += `has <span class="lightgreen">a niece, ${nieces[0].slaveName}.</span> `; - } - } - - if (nephews.length > 0) { - r += `${He} `; - if (nephews.length > 2) { - r += `has <span class="lightgreen">many nephews, ${nephews.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })}</span> `; - } else if (nephews.length === 2) { - r += `has <span class="lightgreen">two nephews, ${nephews[0].slaveName}, and ${nephews[1].slaveName}.</span> `; - } else { - r += `has <span class="lightgreen">a nephew, ${nephews[0].slaveName}.</span> `; - } - } - - let - twins = [], - sisters = [], - brothers = [], - halfSisters = [], - halfBrothers = [], - cousins = []; - - for (let i = 0; i < V.slaves.length; i++) { - let sisterCheck = areSisters(V.slaves[i], child); - if (sisterCheck === 1) { - twins.push(V.slaves[i]); - } - if (sisterCheck === 2) { - (V.slaves[i].genes === "XX" ? sisters : brothers).push(V.slaves[i]); - } - if (sisterCheck === 3) { - (V.slaves[i].genes === "XX" ? halfSisters : halfBrothers).push(V.slaves[i]); - } - if (V.showDistantRelatives) { - if (areCousins(V.slaves[i], child)) { - cousins.push(V.slaves[i]); - } - } - } - - // twins - if (twins.length > 0) { - r += `${He} `; - if (twins.length > 2) { - r += `<span class="lightgreen">shared a cramped womb with ${twins.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })}</span> `; - } else if (twins.length === 2) { - r += `is <span class="lightgreen">one of a set of triplets; ${twins[0].slaveName} and ${twins[1].slaveName}</span> complete the trio. `; - } else { - r += `is <span class="lightgreen">twins with ${twins[0].slaveName}.</span> `; - } - } - - // sisters - if (sisters.length > 0) { - if (sisters.length > 1) { - r += `<span class="lightgreen">${sisters.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })} are ${his} sisters.</span> `; - } else { - r += `<span class="lightgreen">${sisters[0].slaveName} is ${his} sister. `; - } - } - - // brothers - if (brothers.length > 0) { - if (brothers.length > 1) { - r += `<span class="lightgreen">${brothers.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })} are ${his} brothers.</span> `; - } else { - r += `<span class="lightgreen">${brothers[0].slaveName} is ${his} brother. `; - } - } - - // half-sisters - V.children = V.slaves.filter(function(s) { - return areSisters(child, s) === 3 && s.genes === "XX"; - }); - if (V.children.length > 0) { - if (V.children.length > 2) { - r += `<span class="lightgreen">${V.children.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })} are half-sisters to ${him}.</span> `; - } else if (V.children.length === 2) { - r += `<span class="lightgreen">${V.children[0].slaveName} and ${V.children[1].slaveName} are half-sisters to ${him}.</span> `; - } else { - r += `<span class="lightgreen">${V.children[0].slaveName} is a half-sister to ${him}.</span> `; - } - } - - // half-brothers - V.children = V.slaves.filter(function(s) { - return areSisters(child, s) === 3 && s.genes === "XY"; - }); - if (V.children.length > 0) { - if (V.children.length > 2) { - r += `<span class="lightgreen">${V.children.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })} are half-brothers to ${him}.</span> `; - } else if (V.children.length === 2) { - r += `<span class="lightgreen">${V.children[0].slaveName} and ${V.children[1].slaveName} are half-brothers to ${him}.</span> `; - } else { - r += `<span class="lightgreen">${V.children[0].slaveName} is a half-brother to ${him}.</span> `; - } - } - - // cousins - V.children = V.slaves.filter(function(s) { - return areCousins(child, s); - }); - if (V.children.length > 0) { - if (V.children.length > 2) { - r += `<span class="lightgreen">${V.children.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })} are cousins to ${him}.</span> `; - } else if (V.children.length === 2) { - r += `<span class="lightgreen">${V.children[0].slaveName} and ${V.children[1].slaveName} are cousins to ${him}.</span> `; - } else { - r += `<span class="lightgreen">${V.children[0].slaveName} is a cousins to ${him}.</span> `; - } - } - } - - /* CLOSE FAMILY */ + r += App.Desc.family(child) + ' '; if (father && fatherPC) { if (child.eyeColor === PC.eye.origColor) { @@ -14060,407 +13752,20 @@ App.Facilities.Nursery.LongChildDescription = function(child) { /* OPEN FAMILY */ if (V.familyTesting) { - if (father === PC && mother === PC) { - 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 (father === PC) { - r += `${He} is <span class="lightgreen">your child;</span> you knocked up ${his} mother, ${SlaveFullName(mother)}. `; - } else if (mother === PC) { - 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 { - pName = `your former slave ${V.missingTable[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 { - pName = `your former slave ${V.missingTable[child.mother].slaveName}`; - } - r += `${He} was born from ${pName}'s fertile womb. `; - } - } - } - - if (V.showDistantRelatives) { - const - mi = mother, - fi = father; - - let - mmi, - fmi, - mfi, - ffi; - - if (jsDef(mi)) { - mmi = mother.mother; - fmi = mother.father; - } else if (mother === PC) { - mmi = PC.mother; - fmi = PC.father; - } - - if (jsDef(fi)) { - mfi = father.mother; - ffi = father.father; - } else if (father === PC) { - mfi = PC.mother; - ffi = PC.father; - } - - // grandparents - if (jsDef(mi) || jsDef(fi) && !jsDef(mmi) && !jsDef(fmi) && !jsDef(mfi) && !jsDef(ffi)) { - if (jsDef(mi)) { - if (jsDef(fi) && mi === fi) { - if (PC === mother.mother && PC === father.father) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You impregnated yourself with ${his} sole biological parent. `; - } else if (PC === mother.mother) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You gave birth to ${his} sole biological parent. `; - } else if (PC === father.father) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You fathered ${his} sole biological parent. `; - } - } else if (jsDef(fi) && PC === mother.mother && PC === father.mother) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You gave birth to both of ${his} parents. `; - } else if (jsDef(fi) && PC === mother.father && PC === father.father) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You fathered both of ${his} parents. `; - } else if (PC === mother.mother) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You gave birth to ${his} mother. `; - } else if (PC === mother.father) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You fathered ${his} mother. `; - } - } else if (jsDef(fi)) { - if (PC === father.mother) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You gave birth to ${his} father. `; - } else if (PC === father.father) { - r += `${He} is <span class="lightgreen">your grandchild.</span> You fathered ${his} father. `; - } - } - } else { - if (jsDef(mmi) && jsDef(ffi) && mmi === ffi) { - r += `${His} sole granparent is ${mmi.slaveName}.</span> `; - } else { - if (jsDef(mmi) && jsDef(mfi) && mmi === mfi) { - if (jsDef(mmi)) { - r += `${His} sole <span class="lightgreen">grandparent is ${mmi}.</span> `; - } - } else { - if (jsDef(mmi)) { - r += `${His} maternal <span class="lightgreen">grandmother is ${mmi.slaveName}.</span> `; - } - if (jsDef(mfi)) { - r += `${His} paternal <span class="lightgreen">grandmother is ${mfi.slaveName}.</span> `; - } - } - if (jsDef(fmi) && jsDef(ffi) && fmi === ffi) { - r += `${His} sole <span class="lightgreen">grandparent is ${ffi}.</span> `; - } else { - if (jsDef(fmi)) { - r += `${His} maternal <span class="lightgreen">grandfather is ${fmi.slaveName}.</span> `; - } - if (jsDef(ffi)) { - r += `${His} paternal <span class="lightgreen">grandfather is ${ffi.slaveName}.</span> `; - } - } - } - } - - // aunts - for (let i = 0; i < V.slaves.length; i++) { - if (V.slaves[i] === mother || V.slaves[i] === father) { - for (let j = 0; j < V.slaves.length; j++) { - if (V.slaves[j].genes === "XX") { - if (areSisters(V.slaves[i], V.slaves[j]) === 1 || areSisters(V.slaves[i], V.slaves[j] === 2)) { - V.children.push(V.slaves[j]); - } - } - } - } - } - - if (V.children.length > 0) { - r += `${He} `; - if (V.children.length > 2) { - r += `has <span class="lightgreen">many aunts, `; - for (j = 0; j < V.children.length; j++) { - if (j < V.children.length - 1) { - r += `${V.children[j].slaveName}, `; - } else { - r += `and ${V.children[j].slaveName}.</span> `; - } - } - } else if (V.children.length === 2) { - r += `has <span class="lightgreen">two aunts, ${V.children[0].slaveName}, and ${V.children[1].slaveName}.</span> `; - } else { - r += `has <span class="lightgreen">an aunt, ${V.children[0].slaveName}.</span> `; - } - } - V.children = []; - - // uncles - for (let i = 0; i < V.slaves.length; i++) { - if (V.slaves[i] === mother || V.slaves[i] === father) { - for (let j = 0; j < V.slaves.length; j++) { - if (V.slaves[j].genes === "XY") { - if (areSisters(V.slaves[i], V.slaves[j]) === 1 || areSisters(V.slaves[i], V.slaves[j] === 2)) { - V.children.push(V.slaves[j]); - } - } - } - } - } - - if (V.children.length > 0) { - r += `${He} `; - if (V.children.length > 2) { - r += `has <span class="lightgreen">many uncles, `; - for (j = 0; j < V.children.length; j++) { - if (j < V.children.length - 1) { - r += `${V.children[j].slaveName}, `; - } else { - r += `and ${V.children[j].slaveName}.</span> `; - } - } - } else if (V.children.length === 2) { - r += `has <span class="lightgreen">two uncles, ${V.children[0].slaveName}, and ${V.children[1].slaveName}.</span> `; - } else { - r += `has <span class="lightgreen">an uncle, ${V.children[0].slaveName}.</span> `; - } - } - V.children = []; - - // nieces - for (let i = 0; i < V.slaves.length; i++) { - if (areSisters(V.slaves[i], child) === 1 || areSisters(V.slaves[i], child) === 2) { - for (let j = 0; j < V.slaves.length; j++) { - if (V.slaves[i].ID !== V.slaves[j].ID && V.slaves[j].genes === "XX") { - if (V.slaves[i].ID === V.slaves[j].mother || V.slaves[i].ID === V.slaves[j].father) { - V.children.push(V.slaves[j]); - } - } - } - } - } - - if (V.children.length > 0) { - r += `${He} `; - if (V.children.length > 2) { - r += `has <span class="lightgreen">many nieces, `; - for (j = 0; j < V.children.length; j++) { - if (j < V.children.length - 1) { - r += `${V.children[j].slaveName}, `; - } else { - r += `and ${V.children[j].slaveName}.</span> `; - } - } - } else if (V.children.length === 2) { - r += `has <span class="lightgreen">two nieces, ${V.children[0].slaveName}, and ${V.children[1].slaveName}.</span> `; - } else { - r += `has <span class="lightgreen">a niece, ${V.children[0].slaveName}.</span> `; - } - } - V.children = []; - - // nephews - for (let i = 0; i < V.slaves.length; i++) { - if (areSisters(V.slaves[i], child) === 1 || areSisters(V.slaves[i], child) === 2) { - for (let j = 0; j < V.slaves.length; j++) { - if (V.slaves[i].ID !== V.slaves[j].ID && V.slaves[j].genes === "XY") { - if (V.slaves[i].ID === V.slaves[j].mother || V.slaves[i].ID === V.slaves[j].father) { - V.children.push(V.slaves[j]); - } - } - } - } - } - - if (V.children.length > 0) { - r += `${He} `; - if (V.children.length > 2) { - r += `has <span class="lightgreen">many nephews, `; - for (j = 0; j < V.children.length; j++) { - if (j < V.children.length - 1) { - r += `${V.children[j].slaveName}, `; - } else { - r += `and ${V.children[j].slaveName}.</span> `; - } - } - } else if (V.children.length === 2) { - r += `has <span class="lightgreen">two nephews, ${V.children[0].slaveName}, and ${V.children[1].slaveName}.</span> `; - } else { - r += `has <span class="lightgreen">a nephew, ${V.children[0].slaveName}.</span> `; - } - } - V.children = []; - - let - twins = [], - sisters = [], - brothers = [], - halfSisters = [], - halfBrothers = [], - cousins = []; - - for (let i = 0; i < V.slaves.length; i++) { - let sisterCheck = areSisters(V.slaves[i], child); - if (sisterCheck === 1) { - twins.push(V.slaves[i]); - } - if (sisterCheck === 2) { - (V.slaves[i].genes === "XX" ? sisters : brothers).push(V.slaves[i]); - } - if (sisterCheck === 3) { - (V.slaves[i].genes === "XX" ? halfSisters : halfBrothers).push(V.slaves[i]); - } - if (V.showDistantRelatives) { - if (areCousins(V.slaves[i], child)) { - cousins.push(V.slaves[i]); - } - } - } - - // twins - if (twins.length > 0) { - r += `${He} `; - if (twins.length > 2) { - r += `<span class="lightgreen">shared a cramped womb with ${twins.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })}</span> `; - } else if (twins.length === 2) { - r += `is <span class="lightgreen">one of a set of triplets; ${twins[0].slaveName} and ${twins[1].slaveName}</span> complete the trio. `; - } else { - r += `is <span class="lightgreen">twins with ${twins[0].slaveName}.</span> `; - } - } - - // sisters - if (sisters.length > 0) { - if (sisters.length > 1) { - r += `<span class="lightgreen">${sisters.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })} are ${his} sisters.</span> `; - } else { - r += `<span class="lightgreen">${sisters[0].slaveName} is ${his} sister. `; - } - } - - // brothers - if (brothers.length > 0) { - if (brothers.length > 1) { - r += `<span class="lightgreen">${brothers.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })} are ${his} brothers.</span> `; - } else { - r += `<span class="lightgreen">${brothers[0].slaveName} is ${his} brother. `; - } - } - - // half-sisters - V.children = V.slaves.filter(function(s) { - return areSisters(child, s) === 3 && s.genes === "XX"; - }); - if (V.children.length > 0) { - if (V.children.length > 2) { - r += `<span class="lightgreen">${V.children.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })} are half-sisters to ${him}.</span> `; - } else if (V.children.length === 2) { - r += `<span class="lightgreen">${V.children[0].slaveName} and ${V.children[1].slaveName} are half-sisters to ${him}.</span> `; - } else { - r += `<span class="lightgreen">${V.children[0].slaveName} is a half-sister to ${him}.</span> `; - } - } - - // half-brothers - V.children = V.slaves.filter(function(s) { - return areSisters(child, s) === 3 && s.genes === "XY"; - }); - if (V.children.length > 0) { - if (V.children.length > 2) { - r += `<span class="lightgreen">${V.children.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })} are half-brothers to ${him}.</span> `; - } else if (V.children.length === 2) { - r += `<span class="lightgreen">${V.children[0].slaveName} and ${V.children[1].slaveName} are half-brothers to ${him}.</span> `; - } else { - r += `<span class="lightgreen">${V.children[0].slaveName} is a half-brother to ${him}.</span> `; - } - } - - // cousins - V.children = V.slaves.filter(function(s) { - return areCousins(child, s); - }); - if (V.children.length > 0) { - if (V.children.length > 2) { - r += `<span class="lightgreen">${V.children.reduce(function(res, ch, i, arr) { - return (res.slaveName || res) + (i === arr.length - 1 ? ` and ` : `, `) + ch.slaveName; - })} are cousins to ${him}.</span> `; - } else if (V.children.length === 2) { - r += `<span class="lightgreen">${V.children[0].slaveName} and ${V.children[1].slaveName} are cousins to ${him}.</span> `; - } else { - r += `<span class="lightgreen">${V.children[0].slaveName} is a cousins to ${him}.</span> `; - } - } - } + r += App.Desc.family(child) + ' '; if (child.relationship >= 3 && totalRelatives(child) > 0) { const lover = getSlave(child.relationshipTarget); if (jsDef(lover)) { - if (child.mother === lover.ID) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} mother, ${SlaveFullName(lover)}.</span> `; - } else if (child.father === lover.ID) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} father, ${SlaveFullName(lover)}.</span> `; - } else if (lover.mother === child.ID || lover.father === child.ID) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} daughter, ${SlaveFullName(lover)}.</span> `; - } else { - switch (areSisters(child, lover)) { - case 1: - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} twin, ${SlaveFullName(lover)}.</span> `; - break; - case 2: - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} sister, ${SlaveFullName(lover)}.</span> `; - break; - case 3: - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} half-sister, ${SlaveFullName(lover)}.</span> `; - break; - } + const relTerm = relativeTerm($activeSlave, _lover); + if (relTerm !== null) { + r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} ${relTerm}, ${SlaveFullName(lover)}.</span> `; } } } else if (child.relationship <= -2) { - if (child.mother === -1 || child.father === -1) { - if (child.mother === -1 && child.father === -1) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} sole parent, you.</span> `; - } else if (child.mother === -1) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} mother, you.</span> `; - } else if (child.father === -1) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} father, you.</span> `; - } - } else if (areSisters(PC, child) === 1) { - if (PC.title === 1) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} twin brother, you.</span> `; - } else if (PC.title === 0) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} twin sister, you.</span> `; - } - } else if (areSisters(PC, child) === 2) { - if (PC.title === 1) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} brother, you.</span> `; - } else if (PC.title === 0) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} sister, you.</span> `; - } - } else if (areSisters(PC, child) === 3) { - if (PC.title === 1) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} half-brother, you.</span> `; - } else if (PC.title === 0) { - r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} half-sister, you.</span> `; - } + const relTerm = relativeTerm($activeSlave, $PC); + if (relTerm !== null) { + r += `${He} is in an <span class="lightgreen">incestuous relationship with ${his} ${relTerm}, you.</span> `; } } } else { diff --git a/src/pregmod/managePersonalAffairs.tw b/src/pregmod/managePersonalAffairs.tw index 4163a2b32e1604a556841a78cd7bf411349caf7e..eb1818ee7120f30bec4e6f7149b6c4e1f23f92d9 100644 --- a/src/pregmod/managePersonalAffairs.tw +++ b/src/pregmod/managePersonalAffairs.tw @@ -508,7 +508,7 @@ </span> <<if totalPlayerRelatives($PC) > 0 || ($showMissingSlaves && ($PC.mother in $missingTable || $PC.father in $missingTable))>> <div> - <<PlayerFamily>> + <<= App.Desc.family($PC)>> </div> <</if>> </p> diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw index 28e8f6c699b01ac1528c91612bc2389ba1f06739..ce5ebfdba680962a8f22a40af9afceffd2b5f031 100644 --- a/src/uncategorized/longSlaveDescription.tw +++ b/src/uncategorized/longSlaveDescription.tw @@ -954,7 +954,7 @@ is <<if $familyTesting == 1>> - <<Family>> + <<= App.Desc.family($activeSlave)>> <<if $activeSlave.relationship >= 3 && totalRelatives($activeSlave) > 0>> <<set _lover = getSlave($activeSlave.relationshipTarget)>> diff --git a/src/utility/extendedFamilyWidgets.tw b/src/utility/extendedFamilyWidgets.tw index c97e6f8bf09fc27565e4d6abbc77cd38224439f9..38d3529ddaa817c4dadd9ecde785df948565f747 100644 --- a/src/utility/extendedFamilyWidgets.tw +++ b/src/utility/extendedFamilyWidgets.tw @@ -1,719 +1,5 @@ :: extended family widgets [nobr widget] -<<widget "Family">> - -/*testtest PC parent passage - determines if the current slave is your mother or father*/ -<<if $activeSlave.ID == $PC.mother && $activeSlave.ID == $PC.father>> - $He @@.lightgreen;is both your mother and father;@@ $he impregnated $himself with you. -<<elseif $activeSlave.ID == $PC.mother>> - $He @@.lightgreen;is your mother.@@ -<<elseif $activeSlave.ID == $PC.father>> - $He @@.lightgreen;is your father.@@ -<</if>> - -<<if $activeSlave.father == -1 && $activeSlave.mother == -1>> - $He's @@.lightgreen;your child;@@ you knocked yourself up and gave birth to $him. -<<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 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.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; })>> -<<if _children.length > 2>> - $He @@.lightgreen;fathered <<print _children.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ -<<elseif _children.length > 1>> - $He @@.lightgreen;fathered a pair of your slaves: _children[0].slaveName, and _children[1].slaveName.@@ -<<elseif _children.length > 0>> - $He @@.lightgreen;fathered a single slave of yours: _children[0].slaveName.@@ -<</if>> - -<<set _children = $slaves.filter(function(s) { return $activeSlave.ID == s.mother; })>> -<<if _children.length > 2>> - $He @@.lightgreen;gave birth to <<print _children.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ -<<elseif _children.length > 1>> - $He @@.lightgreen;gave birth to a pair of your slaves: _children[0].slaveName, and _children[1].slaveName.@@ -<<elseif _children.length > 0>> - $He @@.lightgreen;gave birth to a single one of your slaves: _children[0].slaveName.@@ -<</if>> - -<<if (def $showDistantRelatives) && $showDistantRelatives == 1>> - /*testtest maternal grandma passage - determines if the current slave has a maternal grandmother*/ - <<set _mi = $slaveIndices[$activeSlave.mother]>> - <<set _fi = $slaveIndices[$activeSlave.father]>> - <<if def _mi>> - <<set _mmi = $slaveIndices[$slaves[_mi].mother]>> - <<set _fmi = $slaveIndices[$slaves[_mi].father]>> - <<elseif $PC.ID == $activeSlave.mother>> - <<set _mmi = $slaveIndices[$PC.mother]>> - <<set _fmi = $slaveIndices[$PC.father]>> - <</if>> - <<if def _fi>> - <<set _mfi = $slaveIndices[$slaves[_fi].mother]>> - <<set _ffi = $slaveIndices[$slaves[_fi].father]>> - <<elseif $PC.ID == $activeSlave.father>> - <<set _mfi = $slaveIndices[$PC.mother]>> - <<set _ffi = $slaveIndices[$PC.father]>> - <</if>> - <<if (def _mi || def _fi) && ndef _mmi && ndef _fmi && ndef _mfi && ndef _ffi>> - <<if def _mi>> - <<if (def _fi) && _mi == _fi>> - <<if $PC.ID == $slaves[_mi].mother && $PC.ID == $slaves[_fi].father>> - $He is @@.lightgreen;your grandchild.@@ You impregnated yourself with $his sole biological parent. - <<elseif $PC.ID == $slaves[_mi].mother>> - $He is @@.lightgreen;your grandchild.@@ You gave birth to $his sole biological parent. - <<elseif $PC.ID == $slaves[_fi].father>> - $He is @@.lightgreen;your grandchild.@@ You fathered $his sole biological parent. - <</if>> - <<elseif (def _fi) && $PC.ID == $slaves[_mi].mother && $PC.ID == $slaves[_fi].mother>> - $He is @@.lightgreen;your grandchild.@@ You gave birth to both of $his parents. - <<elseif (def _fi) && $PC.ID == $slaves[_mi].father && $PC.ID == $slaves[_fi].father>> - $He is @@.lightgreen;your grandchild.@@ You fathered both of $his parents. - <<elseif $PC.ID == $slaves[_mi].mother>> - $He is @@.lightgreen;your grandchild.@@ You gave birth to $his mother. - <<elseif $PC.ID == $slaves[_mi].father>> - $He is @@.lightgreen;your grandchild.@@ You fathered $his mother. - <</if>> - <<elseif def _fi>> - <<if $PC.ID == $slaves[_fi].mother>> - $He is @@.lightgreen;your grandchild.@@ You gave birth to $his father. - <<elseif $PC.ID == $slaves[_fi].father>> - $He is @@.lightgreen;your grandchild.@@ You fathered $his father. - <</if>> - <</if>> - <<else>> - <<if (def _mmi) && (def _ffi) && _mmi == _ffi>> - $His sole @@.lightgreen;grandparent is $slaves[_mmi].slaveName.@@ - <<else>> - <<if (def _mmi) && (def _mfi) && _mmi == _mfi>> - $His sole @@.lightgreen;grandmother is $slaves[_mmi].slaveName.@@ - <<else>> - <<if def _mmi>> - $His maternal @@.lightgreen;grandmother is $slaves[_mmi].slaveName.@@ - <</if>> - <<if def _mfi>> - $His paternal @@.lightgreen;grandmother is $slaves[_mfi].slaveName.@@ - <</if>> - <</if>> - <<if (def _fmi) && (def _ffi) && _fmi == _ffi>> - $His sole @@.lightgreen;grandfather is $slaves[_ffi].slaveName.@@ - <<else>> - <<if def _fmi>> - $His maternal @@.lightgreen;grandfather is $slaves[_fmi].slaveName.@@ - <</if>> - <<if _ffi>> - $His paternal @@.lightgreen;grandfather is $slaves[_ffi].slaveName.@@ - <</if>> - <</if>> - <</if>> - <</if>> - - - /*testtest PC grandparents passage - determines if the current slave is your grandparent*/ - <<set _pcMother = $slaveIndices[$PC.mother]>> - <<set _pcFather = $slaveIndices[$PC.father]>> - <<if def _pcMother>> - <<if (def _pcFather) && _pcMother == _pcFather>> - <<if $activeSlave.ID == $slaves[_pcMother].mother && $activeSlave.ID == $slaves[_pcFather].father>> - $He is @@.lightgreen;your sole grandparent.@@ $He impregnated $himself with your mother/father who in turn impregnated themselves with you. - <<elseif $activeSlave.ID == $slaves[_pcMother].mother>> - $He is @@.lightgreen;your sole grandmother.@@ $He gave birth to $slaves[_pcMother].slaveName who in turn impregnated themselves with you. - <<elseif $activeSlave.ID == $slaves[_pcFather].father>> - $He is @@.lightgreen;your sole grandfather.@@ $He fathered $slaves[_pcFather].slaveName who in turn impregnated themselves with you. - <</if>> - <<elseif (def _pcFather) && $activeSlave.ID == $slaves[_pcMother].mother && $activeSlave.ID == $slaves[_pcFather].mother>> - $He is @@.lightgreen;your sole grandmother.@@ $He gave birth to both of your parents, $slaves[_pcMother].slaveName and $slaves[_pcFather].slaveName. - <<elseif (def _pcFather) && $activeSlave.ID == $slaves[_pcMother].father && $activeSlave.ID == $slaves[_pcFather].father>> - $He is @@.lightgreen;your sole grandfather.@@ $He fathered both of your parents, $slaves[_pcFather].slaveName and $slaves[_pcMother].slaveName. - <<elseif $activeSlave.ID == $slaves[_pcMother].mother>> - $He is @@.lightgreen;your maternal grandmother.@@ - <<elseif $activeSlave.ID == $slaves[_pcMother].father>> - $He is @@.lightgreen;your maternal grandfather.@@ - <</if>> - <<elseif def _pcFather>> - <<if $activeSlave.ID == $slaves[_pcFather].mother>> - $He is @@.lightgreen;your paternal grandmother.@@ - <<elseif $activeSlave.ID == $slaves[_pcFather].father>> - $He is @@.lightgreen;your paternal grandfather.@@ - <</if>> - <</if>> - - /*testtest grandchild passage - determines how many grandchildren the current slave has*/ - <<set $children = $slaves.filter((s) => { return isGrandparentP(s, $activeSlave); });>> - <<if $children.length > 0>> - $He - <<if $children.length > 2>> - has @@.lightgreen;many grandchildren, <<print $children.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>, amongst your slaves.@@ - <<elseif $children.length > 1>> - has @@.lightgreen;two grandchildren, $children[0].slaveName, and $children[1].slaveName as your slaves.@@ - <<else>> - has a @@.lightgreen;grandchild, $children[0].slaveName as your slave.@@ - <</if>> - <</if>> - <<set $children = []>> - - /*testtest PC aunt and uncle passage - determines how many aunts and uncles you have*/ - <<set _aunts = [], _uncles = []>> - <<if isAunt($PC, $activeSlave)>> - <<set _momsiblings = $slaves.filter((s) => { const sis = areSisters(s, $PC.mother); return sis == 1 || sis == 2; }), - _dadsiblings = $slaves.filter((s) => { const sis = areSisters(s, $PC.father); return sis == 1 || sis == 2; })>> - <<for $i = 0; $i < _momsiblings.length; $i++>> - <<if _momsiblings[$i].ID != $activeSlave.ID>> - <<if _momsiblings[$i].genes == "XX">> - <<set _aunts.push(_momsiblings[$i])>> - <<else>> - <<set _uncles.push(_momsiblings[$i])>> - <</if>> - <</if>> - <</for>> - <<for $i = 0; $i < _dadsiblings.length; $i++>> - <<if _dadsiblings[$i].ID != $activeSlave.ID>> - <<if _dadsiblings[$i].genes == "XX">> - <<set _aunts.push(_dadsiblings[$i])>> - <<else>> - <<set _uncles.push(_dadsiblings[$i])>> - <</if>> - <</if>> - <</for>> - - <<if $activeSlave.genes == "XX">> - $He - <<if _aunts.length > 1>> - is @@.lightgreen;your aunt along with <<print _aunts.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _aunts.length > 0>> - is @@.lightgreen;your aunt along with _aunts[0].slaveName.@@ - <<else>> - is @@.lightgreen;your aunt.@@ - <</if>> - <<else>> - $He - <<if _uncles.length > 1>> - is @@.lightgreen;your uncle along with <<print _uncles.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _uncles.length > 0>> - is @@.lightgreen;your uncle along with _uncles[0].slaveName.@@ - <<else>> - is @@.lightgreen;your uncle.@@ - <</if>> - <</if>> - <</if>> - - /*testtest aunt and uncle passage - determines how many aunts and uncles a slave has*/ - <<set _aunts = [], _uncles = []>> - <<set _momsiblings = $slaves.filter((s) => { const sis = areSisters(s, $activeSlave.mother); return sis == 1 || sis == 2; }), - _dadsiblings = $slaves.filter((s) => { const sis = areSisters(s, $activeSlave.father); return sis == 1 || sis == 2; })>> - <<for $i = 0; $i < _momsiblings.length; $i++>> - <<if _momsiblings[$i].genes == "XX">> - <<set _aunts.push(_momsiblings[$i])>> - <<else>> - <<set _uncles.push(_momsiblings[$i])>> - <</if>> - <</for>> - <<for $i = 0; $i < _dadsiblings.length; $i++>> - <<if _dadsiblings[$i].genes == "XX">> - <<set _aunts.push(_dadsiblings[$i])>> - <<else>> - <<set _uncles.push(_dadsiblings[$i])>> - <</if>> - <</for>> - - <<if _aunts.length > 0>> - $He - <<if _aunts.length > 2>> - has @@.lightgreen;many aunts, <<print _aunts.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _aunts.length > 1>> - has @@.lightgreen;two aunts, _aunts[0].slaveName, and _aunts[1].slaveName.@@ - <<else>> - has @@.lightgreen;an aunt, _aunts[0].slaveName.@@ - <</if>> - <</if>> - <<if _uncles.length > 0>> - $He - <<if _uncles.length > 2>> - has @@.lightgreen;many uncles, <<print _uncles.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _uncles.length > 1>> - has @@.lightgreen;two uncles, _uncles[0].slaveName, and _uncles[1].slaveName.@@ - <<else>> - has @@.lightgreen;an uncle, _uncles[0].slaveName.@@ - <</if>> - <</if>> - - /*testtest PC niece and nephew passage - determines how many nieces and nephews you have*/ - <<set _nieces = [], _nephews = []>> - <<if isAunt($activeSlave, $PC)>> - <<set _nieces = $slaves.filter((s) => { return (isAunt(s, $PC) && (s.genes == "XX")); })>> - <<set _nephews = $slaves.filter((s) => { return (isAunt(s, $PC) && (s.genes == "XY")); })>> - - <<if $activeSlave.genes == "XX">> - $He - <<if _nieces.length > 1>> - is @@.lightgreen;your niece along with <<print _nieces.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _nieces.length > 0>> - is @@.lightgreen;your niece along with _nieces[0].slaveName.@@ - <<else>> - is @@.lightgreen;your niece.@@ - <</if>> - <<else>> - $He - <<if _nephews.length > 1>> - is @@.lightgreen;your nephew along with <<print _nephews.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _nephews.length > 0>> - is @@.lightgreen;your nephew along with _nephews[0].slaveName.@@ - <<else>> - is @@.lightgreen;your nephew.@@ - <</if>> - <</if>> - <</if>> - - /* testtest niece and nephew passage - determines how many nieces and nephews a slave has*/ - <<set _nieces = $slaves.filter((s) => { return( (s.ID != $activeSlave.ID) && (isAunt(s, $activeSlave)) && (s.genes == "XX")); })>> - <<set _nephews = $slaves.filter((s) => { return( (s.ID != $activeSlave.ID) && (isAunt(s, $activeSlave)) && (s.genes == "XY")); })>> - - <<if _nieces.length > 0>> - $He - <<if _nieces.length > 2>> - has @@.lightgreen;many nieces, <<print _nieces.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>, who are your slaves.@@ - <<elseif _nieces.length > 1>> - has @@.lightgreen;two nieces, _nieces[0].slaveName, and _nieces[1].slaveName, who are your slaves.@@ - <<else>> - has @@.lightgreen;a niece, _nieces[0].slaveName, who is your slave.@@ - <</if>> - <</if>> - - <<if _nephews.length > 0>> - $He - <<if _nephews.length > 2>> - has @@.lightgreen;many nephews, <<print _nephews.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>, who are your slaves.@@ - <<elseif _nephews.length > 1>> - has @@.lightgreen;two nephews, _nephews[0].slaveName, and _nephews[1].slaveName, who are your slaves.@@ - <<else>> - has @@.lightgreen;a nephew, _nephews[0].slaveName, who is your slave.@@ - <</if>> - <</if>> - <<set $children = []>> -<</if>> /* end distant relatives toggle check */ - -/*testtest PC sibling passages - determines how many siblings you have*/ -<<set _twins = [], _sisters = [], _brothers = [], _halfsisters = [], _halfbrothers = [], _cousins = []>> -<<for _efw = 0; _efw < $slaves.length; _efw++>> - <<set _sisterCheck = areSisters($slaves[_efw], $activeSlave)>> - <<if _sisterCheck == 1>> - <<run _twins.push($slaves[_efw])>> - <</if>> - <<if _sisterCheck == 2>> - <<run ($slaves[_efw].genes == 'XX' ? _sisters : _brothers).push($slaves[_efw])>> - <</if>> - <<if _sisterCheck == 3>> - <<run ($slaves[_efw].genes == 'XX' ? _halfsisters : _halfbrothers).push($slaves[_efw])>> - <</if>> - <<if (def $showDistantRelatives) && $showDistantRelatives == 1>> - <<if areCousins($slaves[_efw], $activeSlave) == true>> - <<run _cousins.push($slaves[_efw])>> - <</if>> - <</if>> -<</for>> - -/*testtest PC twin passages - determines how many twins you have but not implemented yet*/ -<<if areSisters($activeSlave, $PC) == 1>> - $He - <<if _twins.length > 1>> - @@.lightgreen;shared a cramped womb with you, <<print _twins.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _twins.length > 0>> - is @@.lightgreen;your twin along with _twins[0].slaveName.@@ - <<else>> - is @@.lightgreen;your twin $sister.@@ - <</if>> -<</if>> - -/*testtest PC sister passages - determines how many sisters you have*/ -<<if areSisters($activeSlave, $PC) < 3 && areSisters($activeSlave, $PC) > 0 && $activeSlave.genes == "XX">> - $He - <<if _sisters.length > 1>> - @@.lightgreen;is your $sister along with <<print _sisters.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _sisters.length > 0>> - is @@.lightgreen;your $sister along with _sisters[0].slaveName.@@ - <<else>> - is @@.lightgreen;your $sister.@@ - <</if>> -<</if>> - -/*testtest PC brother passages - determines how many brothers you have*/ -<<if areSisters($activeSlave, $PC) < 3 && areSisters($activeSlave, $PC) > 0 && $activeSlave.genes == "XY">> - $He - <<if _brothers.length > 1>> - @@.lightgreen;is your $sister along with <<print _brothers.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _brothers.length > 0>> - is @@.lightgreen;your $sister along with _brothers[0].slaveName.@@ - <<else>> - is @@.lightgreen;your $sister.@@ - <</if>> -<</if>> - -/*testtest PC half-sister passages - determines how many half-sisters you have*/ -<<if areSisters($activeSlave, $PC) == 3 && $activeSlave.genes == "XX">> - $He - <<if _halfsisters.length > 1>> - @@.lightgreen;is your half-<<= $sister>> along with <<print _halfsisters.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _halfsisters.length > 0>> - is @@.lightgreen;your half-<<= $sister>> along with _halfsisters[0].slaveName.@@ - <<else>> - is @@.lightgreen;your half-<<= $sister>>.@@ - <</if>> -<</if>> - -/*testtest PC half-brother passages - determines how many half-brothers you have*/ -<<if areSisters($activeSlave, $PC) == 3 && $activeSlave.genes == "XY">> - $He - <<if _halfbrothers.length > 1>> - @@.lightgreen;is your half-<<= $sister>> along with <<print _halfbrothers.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _halfbrothers.length > 0>> - is @@.lightgreen;your half-<<= $sister>> along with _halfbrothers[0].slaveName.@@ - <<else>> - is @@.lightgreen;your half-<<= $sister>>.@@ - <</if>> -<</if>> - -/*testtest twins? - determines how many twins a slave has*/ -<<if _twins.length > 0>> - $He - <<if _twins.length > 2>> - @@.lightgreen;shared a cramped womb with <<print _twins.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _twins.length > 1>> - is @@.lightgreen;one of a set of triplets; _twins[0].slaveName and _twins[1].slaveName@@ complete the trio. - <<else>> - is @@.lightgreen;twins with _twins[0].slaveName.@@ - <</if>> -<</if>> - -/*testtest sister - determines how many sisters a slave has*/ -<<if _sisters.length > 0>> - <<if _sisters.length > 1>> - @@.lightgreen;<<print _sisters.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>> are $his sisters.@@ - <<else>> - <<setLocalPronouns _sisters[0] 2>> - @@.lightgreen; _sisters[0].slaveName is $his _sister2.@@ - <</if>> -<</if>> - -/*testtest brother - determines how many brothers a slave has*/ -<<if _brothers.length > 0>> - <<if _brothers.length > 1>> - @@.lightgreen;<<print _brothers.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>> are $his brothers.@@ - <<else>> - <<setLocalPronouns _brothers[0] 2>> - @@.lightgreen;_brothers[0].slaveName is $his _sister2.@@ - <</if>> -<</if>> - -/*testtest half-sister - determines how many half-sisters a slave has*/ -<<set _children = $slaves.filter(function(s) { return s.ID != $activeSlave.ID && areSisters($activeSlave, s) == 3 && s.genes == "XX"; })>> -<<if _children.length > 2>> - @@.lightgreen;<<print _children.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>> are half-sisters to $him.@@ -<<elseif _children.length > 1>> - @@.lightgreen;_children[0].slaveName and _children[1].slaveName are half-sisters to $him.@@ -<<elseif _children.length > 0>> - <<setLocalPronouns _children[0] 2>> - @@.lightgreen;_children[0].slaveName is a half-<<= _sister2>> to $him.@@ -<</if>> - -/*testtest half-brother - determines how many half-brothers a slave has*/ -<<set _children = $slaves.filter(function(s) { return s.ID != $activeSlave.ID && areSisters($activeSlave, s) == 3 && s.genes == "XY"; })>> -<<if _children.length > 2>> - @@.lightgreen;<<print _children.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>> are half-brothers to $him.@@ -<<elseif _children.length > 1>> - @@.lightgreen;_children[0].slaveName and _children[1].slaveName are half-brothers to $him.@@ -<<elseif _children.length > 0>> - @@.lightgreen;_children[0].slaveName is a half-brother to $him.@@ -<</if>> - -<<if (def $showDistantRelatives) && $showDistantRelatives == 1>> - /*testtest PC cousin passage - determines how many cousins you have*/ - <<if areCousins($activeSlave, $PC)>> - $He - <<if _cousins.length > 1>> - @@.lightgreen;is your cousin along with <<print _cousins.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>>.@@ - <<elseif _cousins.length > 0>> - is @@.lightgreen;your cousin along with _cousins[0].slaveName.@@ - <<else>> - is @@.lightgreen;your cousin.@@ - <</if>> - <</if>> - - /*testtest cousin - determines how many cousins a slave has*/ - <<set _children = $slaves.filter(function(s) { return s.ID != $activeSlave.ID && areCousins($activeSlave, s)})>> - <<if _children.length > 2>> - @@.lightgreen;<<print _children.reduce(function(res, ch, i, arr) { return (res.slaveName || res) + (i == arr.length - 1 ? ' and ' : ', ') + ch.slaveName; })>> are cousins to $him.@@ - <<elseif _children.length > 1>> - @@.lightgreen;_children[0].slaveName and _children[1].slaveName are cousins to $him.@@ - <<elseif _children.length > 0>> - @@.lightgreen;_children[0].slaveName is a cousin to $him.@@ - <</if>> -<</if>> /* end distant relatives toggle check */ - -<<if $activeSlave.clone != 0>> - $He is - <<if $activeSlave.cloneID == -1>> - your clone. - <<else>> - a clone of $activeSlave.clone. - <</if>> -<</if>> - -<<if $cheatMode == 1>> - $He has $activeSlave.sisters sister<<if $activeSlave.sisters > 1>>s<</if>>, and $activeSlave.daughters daughter<<if $activeSlave.daughters > 1>>s<</if>>. -<</if>> - -<</widget>> - -<<widget PlayerFamily>> - -<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;<<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;<<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;<<if $children[0].ID < 0>>your former slave<</if>> $children[0].slaveName.@@ - <</if>> -<</if>> -<<set $children = []>> - -/*Twins Test with aresisters*/ -<<for $i = 0; $i < $slaves.length; $i++>> - <<if $slaves[$i].ID != $PC.ID>> - <<if areSisters($slaves[$i], $PC) == 1 && areSisters($slaves[$i], $slaves[$i]) == 1>> - <<set $children.push($slaves[$i])>> - <</if>> - <</if>> -<</for>> -<<if $children.length > 2>> - <br>You are @@.lightgreen;twins with - <<for $j = 0; $j < $children.length; $j++>> - <<if $j < $children.length-1>> - $children[$j].slaveName, - <<else>> - and $children[$j].slaveName.@@ - <</if>> - <</for>> -<<elseif $children.length > 1>> - <br>You are twins with @@.lightgreen;$children[0].slaveName and $children[1].slaveName.@@ -<<elseif $children.length > 0>> - <br>Your twin is @@.lightgreen;$children[0].slaveName.@@ -<</if>> -<<set $children = []>> - -/*Sister Test with aresisters*/ -<<for $i = 0; $i < $slaves.length; $i++>> - <<if $slaves[$i].ID != $PC.ID>> - <<if areSisters($PC, $slaves[$i]) === 2 && areSisters($slaves[$i], $PC) === 2>> - <<if $slaves[$i].genes == "XX">> - <<set $children.push($slaves[$i])>> - <</if>> - <</if>> - <</if>> -<</for>> -<<if $children.length > 2>> - <br>@@.lightgreen; - <<for $j = 0; $j < $children.length; $j++>> - <<if $j < $children.length-1>> - $children[$j].slaveName, - <<else>> - and $children[$j].slaveName - <</if>> - <</for>>@@ - are your sisters. -<<elseif $children.length > 1>> - <br>@@.lightgreen;$children[0].slaveName and $children[1].slaveName@@ are your sisters. -<<elseif $children.length > 0>> - <<setLocalPronouns $children[0]>> - <br>Your $sister is @@.lightgreen;$children[0].slaveName.@@ -<</if>> -<<set $children = []>> - -/*Brother Test with aresisters*/ -<<for $i = 0; $i < $slaves.length; $i++>> - <<if $slaves[$i].ID != $PC.ID>> - <<if areSisters($PC, $slaves[$i]) === 2 && areSisters($slaves[$i], $PC) === 2>> - <<if $slaves[$i].genes == "XY">> - <<set $children.push($slaves[$i])>> - <</if>> - <</if>> - <</if>> -<</for>> -<<if $children.length > 2>> - <br>@@.lightgreen; - <<for $j = 0; $j < $children.length; $j++>> - <<if $j < $children.length-1>> - $children[$j].slaveName, - <<else>> - and $children[$j].slaveName - <</if>> - <</for>>@@ - are your brothers. -<<elseif $children.length > 1>> - <br>@@.lightgreen;$children[0].slaveName and $children[1].slaveName@@ are your brothers. -<<elseif $children.length > 0>> - <<setLocalPronouns $children[0]>> - <br>Your $sister is @@.lightgreen;$children[0].slaveName.@@ -<</if>> -<<set $children = []>> - -/*Half-Sister Test with aresisters */ -<<for $i = 0; $i < $slaves.length; $i++>> - <<if $slaves[$i].ID != $PC.ID>> - <<if areSisters($slaves[$i], $PC) == 3 && areSisters($PC, $slaves[$i]) == 3>> - <<if $slaves[$i].genes == "XX">> - <<set $children.push($slaves[$i])>> - <</if>> - <</if>> - <</if>> -<</for>> -<<if $children.length > 2>> - <br>@@.lightgreen; - <<for $j = 0; $j < $children.length; $j++>> - <<if $j < $children.length-1>> - $children[$j].slaveName, - <<else>> - and $children[$j].slaveName. - <</if>> - <</for>>@@ - are your half-sisters. -<<elseif $children.length > 1>> - <br>@@.lightgreen;$children[0].slaveName and $children[1].slaveName@@ are your half-sisters. -<<elseif $children.length > 0>> - <<setLocalPronouns $children[0]>> - <br>You have one half-<<= $sister>>, @@.lightgreen;$children[0].slaveName.@@ -<</if>> -<<set $children = []>> - -/*Half-Brother Test with aresisters */ -<<for $i = 0; $i < $slaves.length; $i++>> - <<if $slaves[$i].ID != $PC.ID>> - <<if areSisters($slaves[$i], $PC) == 3 && areSisters($PC, $slaves[$i]) == 3>> - <<if $slaves[$i].genes == "XY">> - <<set $children.push($slaves[$i])>> - <</if>> - <</if>> - <</if>> -<</for>> -<<if $children.length > 2>> - <br>@@.lightgreen; - <<for $j = 0; $j < $children.length; $j++>> - <<if $j < $children.length-1>> - $children[$j].slaveName, - <<else>> - and $children[$j].slaveName. - <</if>> - <</for>>@@ - are your half-brothers. -<<elseif $children.length > 1>> - <br>@@.lightgreen;$children[0].slaveName and $children[1].slaveName@@ are your half-brothers. -<<elseif $children.length > 0>> - <br>You have one half-brother, @@.lightgreen;$children[0].slaveName.@@ -<</if>> -<<set $children = []>> - -/* -<<if $PC.clone != 0>> - <br>You are a clone of - <<if $activeSlave.cloneID == -1>> - yourself. - <<else>> - $PC.clone. - <</if>> -<</if>> -*/ - -/*Player is Father, lists children you fathered*/ -<<for $i = 0; $i < $slaves.length; $i++>> - <<if $PC.ID == $slaves[$i].father>> - <<set $children.push($slaves[$i])>> - <</if>> -<</for>> -<<if $children.length > 2>> - <br>You are the father of @@.lightgreen; - <<for $j = 0; $j < $children.length; $j++>> - <<if $j < $children.length-1>> - $children[$j].slaveName, - <<else>> - and $children[$j].slaveName.@@ - <</if>> - <</for>> -<<elseif $children.length > 1>> - <br>You are the father of two of your slaves, @@.lightgreen;$children[0].slaveName, and $children[1].slaveName.@@ -<<elseif $children.length > 0>> - <br>You are the father of one of your slaves, @@.lightgreen;$children[0].slaveName.@@ -<</if>> -<<set $children = []>> - -/*Player is Mother, lists birthed children*/ -<<for $i = 0; $i < $slaves.length; $i++>> - <<if $PC.ID == $slaves[$i].mother>> - <<set $children.push($slaves[$i])>> - <</if>> -<</for>> -<<if $children.length > 2>> - <br>You are the mother of@@.lightgreen; - <<for $j = 0; $j < $children.length; $j++>> - <<if $j < $children.length-1>> - $children[$j].slaveName, - <<else>> - and $children[$j].slaveName.@@ - <</if>> - <</for>> -<<elseif $children.length > 1>> - <br>You are the mother of two of your slaves, @@.lightgreen;$children[0].slaveName, and $children[1].slaveName.@@ -<<elseif $children.length > 0>> - <br>You are the mother of one of your slaves, @@.lightgreen;$children[0].slaveName.@@ -<</if>> -<<set $children = []>> - -<<if $cheatMode == 1>> - You have $PC.sisters sister<<if $PC.sisters > 1>>s<</if>>, and $PC.daughters daughter<<if $PC.daughters > 1>>s<</if>>. -<</if>> - -<</widget>> - <<widget "parentName">> <<if $activeSlave[$args[0]] == $PC.ID>> You @@ -727,32 +13,15 @@ <</if>> <</widget>> -<<widget "listOfSlavesWithSameParent">> -<<if $activeSlave[$args[0]] != 0>> - <<set _printSeperator = false>> - <<if $activeSlave[$args[0]] == $PC[$args[0]]>> - You - <<set _printSeperator = true>> - <</if>> - <<for _j = 0; _j < $slaves.length; _j++>> - <<if $slaves[_j][$args[0]] == $activeSlave[$args[0]]>> - <<if _printSeperator>> | <</if>> - <<set _printSeperator = true>> - <<print $slaves[_j].slaveName>> - <</if>> - <</for>> -<</if>> -<</widget>> - <<widget "redisplayFamily">> <<replace '#dontBeDumb'>><br> //You will break things by making impossible relations such as being your own father. If you do this, clearing all PC relations will fix it. Probably.//<</replace>> <<replace '#fatheredNames'>><<listOfSlavesWithParent "father" $activeSlave.ID>><</replace>> <<replace '#motheredNames'>><<listOfSlavesWithParent "mother" $activeSlave.ID>><</replace>> -<<replace '#familySummary'>><<Family>><</replace>> +<<replace '#familySummary'>><<= App.Desc.family($activeSlave)>><</replace>> <<replace '#motherName'>><<parentName "mother">><</replace>> <<replace '#fatherName'>><<parentName "father">><</replace>> -<<replace '#sameMotherNames'>><<listOfSlavesWithSameParent 'mother'>><</replace>> -<<replace '#sameFatherNames'>><<listOfSlavesWithSameParent 'father'>><</replace>> +<<replace '#sameMotherNames'>><<listOfSlavesWithParent "mother" $activeSlave.mother>><</replace>> +<<replace '#sameFatherNames'>><<listOfSlavesWithParent "father" $activeSlave.father>><</replace>> /* <<run updateFamilyTree($activeSlave, $slaves, $PC)>> */ <<set _tSlaveList = [$activeSlave]>> <<set _tSlaveList.push.apply(_tSlaveList, $slaves)>> @@ -826,7 +95,7 @@ <</if>> <</for>> -<br>''Same mother as:'' <span id="sameMotherNames"><<listOfSlavesWithSameParent 'mother'>></span> +<br>''Same mother as:'' <span id="sameMotherNames"><<listOfSlavesWithParent 'mother' $activeSlave.mother>></span> <<link "Reset">> <<set $activeSlave.mother = 0>> <<redisplayFamily>> @@ -870,7 +139,7 @@ <</if>> <</for>> -<br>''Same father as:'' <span id="sameFatherNames"><<listOfSlavesWithSameParent 'father'>></span> +<br>''Same father as:'' <span id="sameFatherNames"><<listOfSlavesWithParent 'father' activeSlave.father>></span> <<link "Reset">> <<set $activeSlave.father = 0>> <<replace '#fatherName'>><</replace>> @@ -1049,7 +318,7 @@ <</if>> <br> - <span id="familySummary"><<Family>></span> + <span id="familySummary"><<= App.Desc.family($activeSlave)>></span> <br> </div> <div id="familyTree"></div>