diff --git a/src/endWeek/saRelationships.js b/src/endWeek/saRelationships.js index e98d4a5534c4a62924e03c7e560f4f9315966bc9..7410f30303133eaf2398eaa6475506a8a54d361d 100644 --- a/src/endWeek/saRelationships.js +++ b/src/endWeek/saRelationships.js @@ -61,6 +61,7 @@ App.SlaveAssignment.relationships = (function() { /** Does the facility head accept her advances? * @param {App.Entity.SlaveState} potentialFriend + * @param {number} manipulationSkill * @returns {boolean} */ function silverTongue(potentialFriend, manipulationSkill) { @@ -70,6 +71,7 @@ App.SlaveAssignment.relationships = (function() { /** * @param {App.Entity.SlaveState} slave * @param {App.Entity.SlaveState} friend + * @param {number} degree */ function startFriendship(slave, friend, degree) { friend.relationship = degree; @@ -125,19 +127,17 @@ App.SlaveAssignment.relationships = (function() { slave.relationship = -2; } } else if (slave.career === "a Futanari Sister" && slave.rules.relationship === "permissive") { - for (const potentialFriend of V.slaves) { - if (potentialFriend.career === "a Futanari Sister" && potentialFriend.rules.relationship === "permissive" && canStartFriendship(slave, potentialFriend)) { - r.push(`${slave.slaveName} greets ${potentialFriend.slaveName} with joy. It's not clear whether they ever knew each other during their lives as Futanari Sisters, but it seems that they believe themselves to be in a relationship by simple virtue of having been Sisters. In any case, ${slave.slaveName} and ${potentialFriend.slaveName} <span class="relationship">become inseparable lovers</span> instantly, as though there's no possibility they would do anything else. They're even surprised when other slaves ask them about it; it's as though they're unaware that other possibilities even exist.`); - startFriendship(slave, potentialFriend, 4); - break; - } + const potentialFriend = V.slaves.find((s) => s.career === "a Futanari Sister" && s.rules.relationship === "permissive" && canStartFriendship(slave, s)); + if (potentialFriend !== undefined) { + r.push(`${slave.slaveName} greets ${potentialFriend.slaveName} with joy. It's not clear whether they ever knew each other during their lives as Futanari Sisters, but it seems that they believe themselves to be in a relationship by simple virtue of having been Sisters. In any case, ${slave.slaveName} and ${potentialFriend.slaveName} <span class="relationship">become inseparable lovers</span> instantly, as though there's no possibility they would do anything else. They're even surprised when other slaves ask them about it; it's as though they're unaware that other possibilities even exist.`); + startFriendship(slave, potentialFriend, 4); } - } else if (slave.origin === "You were acquainted with $him before you were an arcology owner; your rival tried to use $him to manipulate you, but you rescued $him." && V.rivalryDuration > 20 && !["Intellectual Dependency", "Paternalism", "Racial Supremacism", "Slave Professionalism"].includes(V.rivalryFS)&& slave.newGamePlus === 0) { - potentialFriend = V.slaves.find((s) => (s.prestigeDesc === "You bankrupted and enslaved $him in revenge for $his part in the attack on your arcology by the Daughters of Liberty." && s.fuckdoll === 0 && s.fetish !== "mindbroken" && s.newGamePlus === 0)); + } else if (slave.origin === "You were acquainted with $him before you were an arcology owner; your rival tried to use $him to manipulate you, but you rescued $him." && V.rivalryDuration > 20 && !["Intellectual Dependency", "Paternalism", "Racial Supremacism", "Slave Professionalism"].includes(V.rivalryFS) && slave.newGamePlus === 0) { + const potentialFriend = V.slaves.find((s) => (s.prestigeDesc === "You bankrupted and enslaved $him in revenge for $his part in the attack on your arcology by the Daughters of Liberty." && s.fuckdoll === 0 && s.fetish !== "mindbroken" && s.newGamePlus === 0)); if (potentialFriend !== undefined) { r.push(`${slave.slaveName} greets ${potentialFriend.slaveName} with joy, happy to see a familiar face again. Without any regard to you, <span class="relationship">they continue their prior relationship.</span>`); if (potentialFriend.relationship > 0) { // remove me with multi-friend system - formerFriend = V.slaves.find((s) => (s.ID === potentialFriend.relationshipTarget)); + const formerFriend = getSlave(potentialFriend.relationshipTarget); if (formerFriend !== undefined) { formerFriend.relationshipTarget = 0; formerFriend.relationship = 0; @@ -239,7 +239,7 @@ App.SlaveAssignment.relationships = (function() { } } else if (potentialFriend.ID === V.WardenessID && slave.assignment === Job.CELLBLOCK) { if (potentialFriend.rules.relationship !== "restrictive" && silverTongue(potentialFriend, manipulationSkill)) { - r.push(`${slave.slaveName} manages to earn the respect of the Wardeness, ${potentialFriend}.slaveName. The two slaves have <span class="relationship">struck up a friendship.</span>`); + r.push(`${slave.slaveName} manages to earn the respect of the Wardeness, ${potentialFriend.slaveName}. The two slaves have <span class="relationship">struck up a friendship.</span>`); startFriendship(slave, potentialFriend, 1); break; } else { @@ -372,7 +372,7 @@ App.SlaveAssignment.relationships = (function() { slave.relationship = 0; slave.relationshipTarget = 0; } else if (slave.relationship === -1) { - if ([Job.DJ, Job.CLUB, Job.PUBLIC, Job.WHORE, job.BROTHEL].includes(slave.assignment)) { + if ([Job.DJ, Job.CLUB, Job.PUBLIC, Job.WHORE, Job.BROTHEL].includes(slave.assignment)) { r.push(`${His} endless stream of lovers maintains and satisfies ${his} emotional reliance on sex.`); } else if (slave.assignment === Job.MASTERSUITE && V.masterSuiteUpgradeLuxury === 2) { r.push(`Forming a part of the pile of copulating bodies in ${V.masterSuiteName} satisfies ${his} voracious sexual appetite.`); @@ -393,7 +393,7 @@ App.SlaveAssignment.relationships = (function() { } else if (slave.relationship === -2) { incestReactions(slave, PC); if (slave.devotion + slave.trust < 150) { - if (random(1, 100) > 50) { + if (slave.devotion < 75 && random(1, 100) > 50) { r.push(`${He} is no longer as devoted to you as ${he} once was, and has <span class="relationship dec">begun to look elsewhere for emotional support.</span>`); slave.relationship = 0; } else if (slave.trust < 75 && random(1, 100) > 50) { @@ -869,7 +869,7 @@ App.SlaveAssignment.relationships = (function() { /** * @param {App.Entity.SlaveState} slave - * + * @param {App.Entity.SlaveState} relative */ function incestReactions(slave, relative) { if (areRelated(slave, relative)) {