diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 3bae3e47e6a64655128ba2a4687bc6da9b0fd723..fcbca4509a864daf2959048ac7551d1ff1a7634e 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -609,7 +609,7 @@ App.Data.resetOnNGPlus = { brothelNameCaps: "The Brothel", brothel: 0, brothelBoost: { - selected: 0, eligable: 0 + selected: 0, eligible: 0 }, dairyDecoration: "standard", dairyPrepUpgrade: 0, diff --git a/src/data/backwardsCompatibility/datatypeCleanup.js b/src/data/backwardsCompatibility/datatypeCleanup.js index c60a6ff8ae67fb32cff8fe64febd60cc7492b04d..08d293890faf3fe712766541c66c2da0eafa31d7 100644 --- a/src/data/backwardsCompatibility/datatypeCleanup.js +++ b/src/data/backwardsCompatibility/datatypeCleanup.js @@ -2080,7 +2080,11 @@ window.FacilityDatatypeCleanup = (function() { V.brothel = Math.max(+V.brothel, 0) || 0; V.brothelUpgradeDrugs = Math.clamp(+V.brothelUpgradeDrugs, 0, 2) || 0; V.brothelBoost.selected = Math.clamp(+V.brothelBoost.selected, 0, 10) || 0; - V.brothelBoost.eligable = Math.clamp(+V.brothelBoost.eligable, 0, 10) || 0; + if (typeof V.brothelBoost.eligable !== "undefined") { // FFS, spell it right... + V.brothelBoost.eligible = V.brothelBoost.eligable; + delete V.brothelBoost.eligable; + } + V.brothelBoost.eligible = Math.clamp(+V.brothelBoost.eligible, 0, 10) || 0; /* madam */ V.Madam = V.slaves.find(s => s.assignment === "be the Madam") || 0; V.MadamIgnoresFlaws = Math.clamp(+V.MadamIgnoresFlaws, 0, 1) || 0; diff --git a/src/descriptions/familySummaries.js b/src/descriptions/familySummaries.js new file mode 100644 index 0000000000000000000000000000000000000000..d59f952dc45cfa50792a1f10b748f1a1b828fe89 --- /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 (const 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 f569e44a8474c1a783b73583b8f0d43225437b27..0dbbe6ae9370fc49d19f24da0ec08cbb7fe5fb5b 100644 --- a/src/endWeek/saWhore.js +++ b/src/endWeek/saWhore.js @@ -133,11 +133,11 @@ window.saWhore = (function saWhore() { if ((V.universalRulesFacilityWork === 1 && slave.assignment === "whore" && V.brothelSpots > 0) || (slave.assignment === "work in the brothel")) { if (slave.assignment === "whore") { r += ` Since there's extra space in ${V.brothelName}, ${he} sells ${himself} there.`; - const maxBrothelBoost = Math.max(Math.trunc(100 * Math.pow(1.26, V.brothelBoost.eligable - 1)) * 50 * V.brothelBoost.eligable, 1); // Correcting prices in case benefits outgrow the cap + const maxBrothelBoost = Math.max(Math.trunc(100 * Math.pow(1.26, V.brothelBoost.eligible - 1)) * 50 * V.brothelBoost.eligible, 1); // Correcting prices in case benefits outgrow the cap if (maxBrothelBoost < V.slaveJobValues.brothel.boost) { - FuckResult = Math.trunc(FuckResult * (1 + V.brothelBoost.eligable / 20) * maxBrothelBoost / V.slaveJobValues.brothel.boost); + FuckResult = Math.trunc(FuckResult * (1 + V.brothelBoost.eligible / 20) * maxBrothelBoost / V.slaveJobValues.brothel.boost); } else { - FuckResult = Math.trunc(FuckResult * (1 + V.brothelBoost.eligable / 20)); + FuckResult = Math.trunc(FuckResult * (1 + V.brothelBoost.eligible / 20)); } } @@ -665,12 +665,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/endWeek/saWorkTheFarm.js b/src/endWeek/saWorkTheFarm.js index c486f3f079ca88d7e9aaa76836456deebb6daf82..9df9ad1a7a17bd82e1b0e9fcde1225c842661442 100644 --- a/src/endWeek/saWorkTheFarm.js +++ b/src/endWeek/saWorkTheFarm.js @@ -30,6 +30,7 @@ window.saWorkTheFarm = function(slave) { if (V.Farmer) { return `${V.Farmer.slaveName} watches over ${him}, making sure that ${he} doesn't slack off and works as hard as ${he} should. `; } + return ``; }; const foodDevotion = slave => { @@ -38,13 +39,12 @@ window.saWorkTheFarm = function(slave) { } else if (slave.devotion < -50) { return `${He}'s so resistant that ${he} doesn't work as hard, and thus produces less food. `; } else { - // TODO: third case for neutral? + return ``; // TODO: third case for neutral? } }; const foodHealth = slave => { - foodHealthCondition(slave); - foodHealthIllness(slave); + return foodHealthCondition(slave) + foodHealthIllness(slave); }; const foodHealthCondition = slave => { @@ -53,13 +53,14 @@ window.saWorkTheFarm = function(slave) { } else if (slave.health.condition < -50) { return `${His} poor health impedes ${his} ability to work efficiently. `; } else { - // TODO: third case? + return ``; // TODO: third case? } }; const foodHealthIllness = slave => { + let t = ``; if (slave.health.illness > 0 || slave.health.tired > 60) { - let t = ` ${He} performed worse this week due to<span class="red">`; + t += ` ${He} performed worse this week due to<span class="red">`; if (slave.health.illness === 1) { t += ` feeling under the weather`; } else if (slave.health.illness === 2) { @@ -78,9 +79,8 @@ window.saWorkTheFarm = function(slave) { t += `.</span> `; t += foodTired(slave); - - return t; } + return t; }; const foodHealthTired = slave => { @@ -89,9 +89,11 @@ window.saWorkTheFarm = function(slave) { } else if (slave.health.tired > 60) { return ` being tired`; } + return ``; }; - + const foodTired = slave => { + let t = ``; if (!slave.fuckdoll) { if (slaveResting(slave)) { t = ` ${He} spends reduced hours working the soil in order to <span class="green">offset ${his} lack of rest.</span>`; @@ -114,21 +116,21 @@ window.saWorkTheFarm = function(slave) { } else if (slave.muscles < -50) { return `${He} is so weak that ${he} is not able to work effectively. `; } else { - // TODO: third case? + return ``; // TODO: third case? } }; const foodWeight = slave => { - return slave.weight > 95 ? `${He} is so overweight that ${he} has to stop every few minutes to catch ${his} breath, and so ${his} productivity suffers. ` : null; + return slave.weight > 95 ? `${He} is so overweight that ${he} has to stop every few minutes to catch ${his} breath, and so ${his} productivity suffers. ` : ``; }; const foodSight = slave => { if (!canSee(slave)) { - t += `${His} blindness makes it extremely difficult for ${him} to work, severely limiting ${his} production. `; + return `${His} blindness makes it extremely difficult for ${him} to work, severely limiting ${his} production. `; } else if (!canSeePerfectly(slave)) { - t += `${His} nearsightedness makes it harder for ${him} to work as hard as ${he} otherwise would. `; + return `${His} nearsightedness makes it harder for ${him} to work as hard as ${he} otherwise would. `; } else { - // TODO: third case? + return ``; // TODO: third case? } }; @@ -138,7 +140,7 @@ window.saWorkTheFarm = function(slave) { } else if (slave.hears < -1) { return `${He} is deaf, which gets in the way of ${his} work whenever ${he} misses directions${V.Farmer ? ` from ${V.Farmer.slaveName}` : ``}. `; } else { - // TODO: third case? + return ``; // TODO: third case? } }; 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/js/economyJS.js b/src/js/economyJS.js index 56dae4cf8b9885188f6e3a204f01c385aeb2656d..cddfd3593ec3984ec8443c3761526704d0a9df2e 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -1946,7 +1946,7 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef /** * The whoreScore function finds the appropriate customer class and then calculates the whore income stats associated with that class and adds to the class supply. - * whoreClass is the MAXIMUM player set class the whore is allowed to service, if the whore is not eligable it will service the highest it is capable of servicing properly. A whoreClass of 0 means it is on auto (always service the highest possible class). + * whoreClass is the MAXIMUM player set class the whore is allowed to service, if the whore is not eligible it will service the highest it is capable of servicing properly. A whoreClass of 0 means it is on auto (always service the highest possible class). * @param {App.Entity.SlaveState} s * @param {number} lowerClassSexDemandRef * @param {number} middleClassSexDemandRef @@ -1980,8 +1980,8 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef let priceBoost = 1; if (toTheBrothel === 1 || s.assignment === "work in the brothel") { - demandBoost += V.brothelBoost.eligable / 50; - priceBoost += V.brothelBoost.eligable / 20; + demandBoost += V.brothelBoost.eligible / 50; + priceBoost += V.brothelBoost.eligible / 20; } if (s.effectiveWhoreClass === 4 && topSDRatio > 1 && topSDRatio > upperSDRatio) { @@ -2034,7 +2034,7 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef s.sexQuality = Math.trunc((income * demandBoost * priceBoost) / s.sexAmount); const incomeBoostCorrected = Math.trunc(s.sexAmount * s.sexQuality / priceBoost); - if ((toTheBrothel === 1 || s.assignment === "work in the brothel") && V.brothelBoost.eligable > 0) { + if ((toTheBrothel === 1 || s.assignment === "work in the brothel") && V.brothelBoost.eligible > 0) { slaveJobValues.brothel.boost += Math.max(Math.trunc(s.sexAmount * s.sexQuality / demandBoost) - Math.trunc(income), 0); // Keeping track of additional benefits from boosting the brothel on the price side and not the amount side. } @@ -2081,7 +2081,7 @@ window.effectiveWhoreClass = function(s) { } else { result = s.whoreClass; } - // Find maximum eligable class + // Find maximum eligible class // these could be refined further if needed. if (result === 4 && !(score > 5000 && s.skill.whoring > 80 && s.skill.entertainment > 50)) { result -= 1; diff --git a/src/js/food.js b/src/js/food.js index 34c908b82fd8199f0c0e9e9c88d5ccbb9ce9bad6..ef90c684006d7137d2a53e8e9713ace85fc109ec 100644 --- a/src/js/food.js +++ b/src/js/food.js @@ -19,49 +19,45 @@ App.Facilities.Farmyard.foodAmount = function(slave) { if (V.farmyardUpgrade.machinery === 1) { food += 65; // machinery upgrade for farmyard } - if (V.Farmer === 0) { - return null; - } else { - if (V.Farmer !== 0) { // if a farmer is assigned - food *= 1.1; // TODO: expand this to account for farmer XP and skill - if (V.Farmer.skill.farmer >= V.masteredXP) { // if farmer is master - food *= 1.1; - } - } - if (slave.devotion > 50) { + if (V.Farmer !== 0) { // if a farmer is assigned + food *= 1.1; // TODO: expand this to account for farmer XP and skill + if (V.Farmer.skill.farmer >= V.masteredXP) { // if farmer is master food *= 1.1; - } else if (slave.devotion < -50) { - food *= 0.8; } - if (slave.muscles > 30) { // slave is muscular or more - food *= 1.1; - } else if (slave.muscles <= -6) { // slave is weak or less - food *= 0.8; - } - if (slave.weight > 95) { // slave is overweight or more - food *= 0.9; - } else if (slave.weight > 130) { // slave is fat or more - food *= 0.8; - } else if (slave.weight > 160) { // slave is obese or more - food *= 0.7; - } else if (slave.weight > 190) { // slave is very obese or more - food *= 0.6; - } - if (!canSee(slave)) { // slave is blind - food *= 0.6; - } else if (!canSeePerfectly(slave)) { // slave is nearsighted - food *= 0.8; - } - if (slave.hears === -1) { // slave is hard of hearing - food *= 0.8; - } else if (slave.hears < -1) { // slave is deaf - food *= 0.6; - } - food *= restEffects(slave, 20); - food = Math.trunc(food); - food = Math.clamp(food, 1, 1000000000000000000); - return food; } + if (slave.devotion > 50) { + food *= 1.1; + } else if (slave.devotion < -50) { + food *= 0.8; + } + if (slave.muscles > 30) { // slave is muscular or more + food *= 1.1; + } else if (slave.muscles <= -6) { // slave is weak or less + food *= 0.8; + } + if (slave.weight > 95) { // slave is overweight or more + food *= 0.9; + } else if (slave.weight > 130) { // slave is fat or more + food *= 0.8; + } else if (slave.weight > 160) { // slave is obese or more + food *= 0.7; + } else if (slave.weight > 190) { // slave is very obese or more + food *= 0.6; + } + if (!canSee(slave)) { // slave is blind + food *= 0.6; + } else if (!canSeePerfectly(slave)) { // slave is nearsighted + food *= 0.8; + } + if (slave.hears === -1) { // slave is hard of hearing + food *= 0.8; + } else if (slave.hears < -1) { // slave is deaf + food *= 0.6; + } + food *= restEffects(slave, 20); + food = Math.trunc(food); + food = Math.clamp(food, 1, 1000000000000000000); + return food; }; /** diff --git a/src/js/generateRelatedSlave.js b/src/js/generateRelatedSlave.js index 2b6ec834cb314efd2bd1c5082b1700524f31101d..fef0c3948699998b04530dbd8351a919d7fa6253 100644 --- a/src/js/generateRelatedSlave.js +++ b/src/js/generateRelatedSlave.js @@ -1,4 +1,6 @@ window.generateRelatedSlave = (function() { + let sourceID; + /** * Generate a very similar relative for an existing slave (for use in Household Liquidators, for example). * @param {App.Entity.SlaveState} slave - the source relative @@ -61,8 +63,9 @@ window.generateRelatedSlave = (function() { relative.attrXY = Math.clamp(relative.attrXX, 0, 100); relative.energy += random(-20, 20); - // set ID (the original slave expects this to be their ID + 1000) - relative.ID += 1000; + // store old ID and set the new ID + sourceID = slave.ID; + relative.ID = generateSlaveID(); return relative; } @@ -74,7 +77,7 @@ window.generateRelatedSlave = (function() { function makeTwin(slave) { if (!V.familyTesting) { slave.relation = "twin"; - slave.relationTarget = slave.ID - 1000; + slave.relationTarget = sourceID; } } @@ -85,7 +88,7 @@ window.generateRelatedSlave = (function() { function makeSibling(slave) { if (!V.familyTesting) { slave.relation = "sister"; - slave.relationTarget = slave.ID - 1000; + slave.relationTarget = sourceID; } // reduce age @@ -114,10 +117,10 @@ window.generateRelatedSlave = (function() { function makeDaughter(slave) { if (!V.familyTesting) { slave.relation = "daughter"; - slave.relationTarget = slave.ID - 1000; + slave.relationTarget = sourceID; } else { - slave.mother = slave.genes === "XX" ? slave.ID - 1000 : 0; - slave.father = slave.genes !== "XX" ? slave.ID - 1000 : 0; + slave.mother = slave.genes === "XX" ? sourceID : 0; + slave.father = slave.genes !== "XX" ? sourceID : 0; } // select age 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/REroyalblood.tw b/src/uncategorized/REroyalblood.tw index 16ad198a98a6bea970879e8b87d71c535972220e..f262fe7468dfe38fc8c3d94775b2816d83b33831 100644 --- a/src/uncategorized/REroyalblood.tw +++ b/src/uncategorized/REroyalblood.tw @@ -799,7 +799,7 @@ Time is short, but you are well placed to acquire some choice slaves. With an ad <<set $activeSlave.behavioralFlaw = either("arrogant", "bitchy")>> <<run newSlave($activeSlave)>> /* skip New Slave Intro */ <<set $activeSlave.recruiter = 0>> /* override New Slave Intro */ - <<run cashX(-250000, "slaveTransfer", $activeSlave)>> + <<run cashX(-133333, "slaveTransfer", $activeSlave)>> <</for>> /* princess */ <<set _princess.origin = "$He was a princess of a royal kingdom, till $his family was overthrown and $he was sold for credits.">> @@ -808,7 +808,7 @@ Time is short, but you are well placed to acquire some choice slaves. With an ad <<set _princess.father = $missingParentID>> <<set $missingParentID-->> <<run newSlave(_princess)>> /* skip New Slave Intro */ - <<run cashX(-1500000, "slaveTransfer", _princess)>> + <<run cashX(-1100000, "slaveTransfer", _princess)>> /* prince */ <<if $seeDicks > 0>> <<set _prince.origin = "$He was the crown prince of a royal kingdom, till $his family was overthrown and $he was sold for credits.">> @@ -816,7 +816,7 @@ Time is short, but you are well placed to acquire some choice slaves. With an ad <<set _prince.mother = _princess.mother>> <<set _prince.father = _princess.father>> <<run newSlave(_prince)>> /* skip New Slave Intro */ - <<run cashX(-150000, "slaveTransfer", _prince)>> + <<run cashX(-750000, "slaveTransfer", _prince)>> <</if>> /*Queen*/ <<set _queen.origin = "$He was the Queen of a royal kingdom, till $his husband was overthrown and $he was sold for credits.">> @@ -826,7 +826,7 @@ Time is short, but you are well placed to acquire some choice slaves. With an ad <<set _queen.father = $missingParentID>> <<set $missingParentID-->> <<run newSlave(_queen)>> /* skip New Slave Intro */ - <<run cashX(-600000, "slaveTransfer", _queen)>> + <<run cashX(-250000, "slaveTransfer", _queen)>> <</replace>> <</link>> // It will cost about <<print cashFormat(2500000)>> to enslave the entire court.// <<elseif $familyTesting == 1>> diff --git a/src/uncategorized/brothel.tw b/src/uncategorized/brothel.tw index 9c4a618f6158cb0202033ebb11ea90f9c26ab1a9..e8268bf1fdf16ff8bea7ab31ea127284ca5013c3 100644 --- a/src/uncategorized/brothel.tw +++ b/src/uncategorized/brothel.tw @@ -151,9 +151,9 @@ <</link>> </div> <</if>> - <br>The brothel could be more profitable if started spending time in the brothel you would otherwise spend in public. Your reputation will suffer, but paying customers may seek out your whores if they think it means you'll lend them your ear. + <br>The brothel could be more profitable if you started spending time in the brothel you would otherwise spend in public. Your reputation will suffer, but paying customers may seek out your whores if they think it means you'll lend them your ear. <br>Boost: <<if $brothelBoost.selected != 0>>[[None|Brothel][$brothelBoost.selected = 0]]<<else>>None<</if>> | <<if $brothelBoost.selected != 1>>[[5%|Brothel][$brothelBoost.selected = 1]]<<else>>5%<</if>> | <<if $brothelBoost.selected != 2>>[[10%|Brothel][$brothelBoost.selected = 2]]<<else>>10%<</if>> | <<if $brothelBoost.selected != 3>>[[15%|Brothel][$brothelBoost.selected = 3]]<<else>>15%<</if>> | <<if $brothelBoost.selected != 4>>[[20%|Brothel][$brothelBoost.selected = 4]]<<else>>20%<</if>> | <<if $brothelBoost.selected != 5>>[[25%|Brothel][$brothelBoost.selected = 5]]<<else>>25%<</if>> | <<if $brothelBoost.selected != 6>>[[30%|Brothel][$brothelBoost.selected = 6]]<<else>>30%<</if>> | <<if $brothelBoost.selected != 7>>[[35%|Brothel][$brothelBoost.selected = 7]]<<else>>35%<</if>> | <<if $brothelBoost.selected != 8>>[[40%|Brothel][$brothelBoost.selected = 8]]<<else>>40%<</if>> | <<if $brothelBoost.selected != 9>>[[45%|Brothel][$brothelBoost.selected = 9]]<<else>>45%<</if>> | <<if $brothelBoost.selected != 10>>[[50%|Brothel][$brothelBoost.selected = 10]]<<else>>50%<</if>> - <br>Every 5% you attempt to boost income also increases the amount of customers by 2% and costs 50 reputation more. A minimum of 2500 reputation is required and every additional level increases this by another 500. You may choose whichever level you please, only the highest level you are eligable for will be used at any time. + <br>Every 5% you attempt to boost income also increases the amount of customers by 2% and costs 50 reputation more. A minimum of 2500 reputation is required and every additional level increases this by another 500. You may choose whichever level you please, only the highest level you are eligible for will be used at any time. </p> <div> diff --git a/src/uncategorized/householdLiquidator.tw b/src/uncategorized/householdLiquidator.tw index 9a64f6dacd787e339e44ff27fd0453635034bec4..23e5fb99a49328b1d0aa17c6872041c6e29d56c4 100644 --- a/src/uncategorized/householdLiquidator.tw +++ b/src/uncategorized/householdLiquidator.tw @@ -19,15 +19,16 @@ <<set $activeSlave.father = $missingParentID>> <<set $missingParentID-->> <<set $activeSlave.canRecruit = 0>> -<<else>> - <<set $activeSlave.relation = "sister">> - <<set $activeSlave.relationTarget = $activeSlave.ID + 1000>> <</if>> The household liquidator is offering a set of siblings for sale. As usual, you will only be permitted to inspect the older, but there is a guarantee that the younger will be similar. <br><br> <<set _relativeSlave = generateRelatedSlave($activeSlave, "sibling")>> +<<if $familyTesting != 1>> + <<set $activeSlave.relation = "sister">> + <<set $activeSlave.relationTarget = _relativeSlave.ID>> +<</if>> <<run _newSlaves.push($activeSlave), _newSlaves.push(_relativeSlave)>> <<set _slaveCost = slaveCost($activeSlave)>> @@ -55,9 +56,6 @@ The household liquidator is offering a set of siblings for sale. As usual, you w <<set $activeSlave.counter.birthsTotal = 1>> <<if $familyTesting == 1>> <<set $activeSlave.canRecruit = 0>> -<<else>> - <<set $activeSlave.relation = "mother">> - <<set $activeSlave.relationTarget = $activeSlave.ID + 1000>> <</if>> <<setLocalPronouns $activeSlave>> @@ -65,6 +63,10 @@ The household liquidator is offering a mother and $his daughter for sale. As usu <br><br> <<set _relativeSlave = generateRelatedSlave($activeSlave, "daughter")>> +<<if $familyTesting != 1>> + <<set $activeSlave.relation = "mother">> + <<set $activeSlave.relationTarget = _relativeSlave.ID>> +<</if>> <<run _newSlaves.push($activeSlave), _newSlaves.push(_relativeSlave)>> <<set _slaveCost = slaveCost($activeSlave)>> @@ -87,15 +89,16 @@ The household liquidator is offering a mother and $his daughter for sale. As usu <<set $activeSlave.father = $missingParentID>> <<set $missingParentID-->> <<set $activeSlave.canRecruit = 0>> -<<else>> - <<set $activeSlave.relation = "twin">> - <<set $activeSlave.relationTarget = $activeSlave.ID + 1000>> <</if>> The household liquidator is offering something special: identical twins. The markup is huge, but the merchandise isn't something you see every day. <br><br> <<set _relativeSlave = generateRelatedSlave($activeSlave, "twin")>> +<<if $familyTesting != 1>> + <<set $activeSlave.relation = "twin">> + <<set $activeSlave.relationTarget = _relativeSlave.ID>> +<</if>> <<run _newSlaves.push($activeSlave), _newSlaves.push(_relativeSlave)>> <<set _slaveCost = slaveCost($activeSlave)>> 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/uncategorized/reFSEgyptianRevivalistAcquisition.tw b/src/uncategorized/reFSEgyptianRevivalistAcquisition.tw index 091043260405743d655475fcdcf0ed78fc48f7ed..45405d5a43fbedff34f11ca0b79b6226938400db 100644 --- a/src/uncategorized/reFSEgyptianRevivalistAcquisition.tw +++ b/src/uncategorized/reFSEgyptianRevivalistAcquisition.tw @@ -21,18 +21,20 @@ <<set $activeSlave.father = $missingParentID>> <<set $activeSlave.canRecruit = 0>> <<set $missingParentID-->> -<<else>> - <<set $activeSlave.relation = "sister">> - <<set $activeSlave.relationTarget = $activeSlave.ID + 1000>> <</if>> <<if ($activeSlave.dick > 0) && ($activeSlave.balls == 0)>><<set $activeSlave.balls = random(1,5)>><</if>> -<<set $activeSlave.relationship = 4>> -<<set $activeSlave.relationshipTarget = $activeSlave.ID + 1000>> <<set _oppositeSex = $seeDicks > 0 && $seeDicks < 100 && (random(1, 4) <= 3)>> <<set _secondSlave = generateRelatedSlave($activeSlave, "sibling", _oppositeSex)>> + <<set _secondSlave.relationship = 4>> <<set _secondSlave.relationshipTarget = $activeSlave.ID>> +<<set $activeSlave.relationship = 4>> +<<set $activeSlave.relationshipTarget = _secondSlave.ID>> +<<if $familyTesting != 1>> + <<set $activeSlave.relation = "sister">> + <<set $activeSlave.relationTarget = _secondSlave.ID>> +<</if>> <<if (_secondSlave.actualAge <= 22)>> <<set _secondSlave.career = setup.youngCareers.random()>> diff --git a/src/uncategorized/slaveAssignmentsReport.tw b/src/uncategorized/slaveAssignmentsReport.tw index d0374933238cc3a7a5cbf929b833d06cd3ad32e0..e47eccc45077f10bfaf6e53a31687ac356eaca9c 100644 --- a/src/uncategorized/slaveAssignmentsReport.tw +++ b/src/uncategorized/slaveAssignmentsReport.tw @@ -29,14 +29,14 @@ Depending on the conditions they may derive more or less 'utility' out of their i.e. a highly paternalist arcology with little choice for its lower class but Fuckdolls may still put money into them but not get the same satisfaction out of it*/ /*Low rent increases demand/available money for sexual services, high rent decreases it*/ <<if $brothelBoost.selected > 0 && $rep < $brothelBoost.selected * 500 + 2000>> - <<set $brothelBoost.eligable = Math.trunc((rep - 2000) / 500)>> - <<if $brothelBoost.eligable < 0>> - <<set $brothelBoost.eligable = 0>> + <<set $brothelBoost.eligible = Math.trunc((rep - 2000) / 500)>> + <<if $brothelBoost.eligible < 0>> + <<set $brothelBoost.eligible = 0>> <</if>> <<else>> - <<set $brothelBoost.eligable = $brothelBoost.selected>> + <<set $brothelBoost.eligible = $brothelBoost.selected>> <</if>> -<<run repX(forceNeg(50 * $brothelBoost.eligable), "brothel")>> +<<run repX(forceNeg(50 * $brothelBoost.eligible), "brothel")>> <<set _lowerClassSexDemand = Math.trunc($lowerClass * $whoreBudget.lowerClass) * 2, _lowerClassSexDemandRef = Math.max(_lowerClassSexDemand, 1), @@ -116,7 +116,6 @@ _middleClassClubRatio = _middleClassSexDemand / _clubDemand>> _clubSupply.middleClass = Math.trunc($slaveJobValues.club * $slaveJobValues.clubSP * _middleClassClubRatio)>> /* Brothel or street whore sex supply */ -boost: <<print $slaveJobValues.brothel.boost>> <<if _lowerClassSexDemand < $slaveJobValues.brothel.lowerClass>> <<set $whorePriceAdjustment.lowerClass = Math.max(Math.pow(_lowerClassSexDemand / ($slaveJobValues.brothel.lowerClass + $NPCSexSupply.lowerClass), 1.513), 0.3), _lowerClassSexDemand = 0>> /*This accounts for people having too much choice and getting more picky how they spend their money*/ diff --git a/src/utility/extendedFamilyWidgets.tw b/src/utility/extendedFamilyWidgets.tw index c97e6f8bf09fc27565e4d6abbc77cd38224439f9..1349aaf6cb15df3846a5adc926cea827772e79f6 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>