diff --git a/js/utils.js b/js/utils.js index d3c93175282d38bc4a5fc511c76b2baee1e69728..3b863894535094313d412bbfb74b2829e759b583 100644 --- a/js/utils.js +++ b/js/utils.js @@ -365,25 +365,7 @@ function sortArrayByArray(sorted, unsorted, key) { * @param {object} source */ function deepAssign(target, source) { - function isObject(o) { - return (o !== undefined && o !== null && typeof o === 'object' && !Array.isArray(o)); - } - - if (isObject(target) && isObject(source)) { - for (const key in source) { - if (!source.hasOwnProperty(key)) { continue; } - if (isObject(source[key])) { - if (!target.hasOwnProperty(key) || !isObject(target[key])) { - target[key] = {}; - } - deepAssign(target[key], source[key]); - } else { - Object.assign(target, { - [key]: source[key] - }); - } - } - } + _.assign(target, _.cloneDeep(source)); } /** diff --git a/src/art/webgl/ui.js b/src/art/webgl/ui.js index 194607bf37ef98c0aaea0d54dd1a8824e0112f16..dc05e3d74ce13541843a2d20b7185a47323927b9 100644 --- a/src/art/webgl/ui.js +++ b/src/art/webgl/ui.js @@ -280,7 +280,7 @@ App.Art.createWebglUI = function(container, slave, artSize, scene, p) { } else { // default updateLinkedButtons(); - if (artSize < 3) { + if (!V.seeAnimation || artSize < 3) { render(); } } diff --git a/src/descriptions/familySummaries.js b/src/descriptions/familySummaries.js index 0841bdcd04b6795c4e04579d0622e75a0f385fe1..3f3082a8cea168cc284eea94dc82ec663e5baa8e 100644 --- a/src/descriptions/familySummaries.js +++ b/src/descriptions/familySummaries.js @@ -170,12 +170,12 @@ App.Desc.family = (function() { } else { // two grandparents if (mgmom && mgmom.ID === V.PC.ID) { r.push(`${He} is <span class="lightgreen">your grandchild. You gave birth to ${his} sole biological parent.</span>`); - } else { + } else if (mgmom) { r.push(`${His} sole`, familySpan(`grandmother is `, conditionalSlaveLink(mgmom, allowLinks), `,`), `who gave birth to ${his} sole biological parent.`); } if (mgdad && mgdad.ID === V.PC.ID) { r.push(`${He} is <span class="lightgreen">your grandchild. You fathered ${his} sole biological parent.</span>`); - } else { + } else if (mgdad) { r.push(`${His} sole`, familySpan(`grandfather is `, conditionalSlaveLink(mgdad, allowLinks), `,`), `who fathered ${his} sole biological parent.`); } } @@ -503,7 +503,7 @@ App.Desc.family = (function() { } else if (twins.length > 1) { r.push(`is `, familySpan(`one of a set of triplets; `, slaveListToText(twins, allowLinks)), ` complete the trio.`); } else { - r.push(`is `, familySpan(`twins with `, conditionalSlaveLink(twins[0], allowLinks), `.`), ``); + r.push(`is `, familySpan(`twins with `, conditionalSlaveLink(twins[0], allowLinks), `.`)); } } @@ -513,7 +513,7 @@ App.Desc.family = (function() { if (sisters.length > 1) { r.push(familySpan(slaveListToText(sisters, allowLinks), ` are ${his} ${sister2}s.`)); } else { - r.push(``, familySpan(``, conditionalSlaveLink(sisters[0], allowLinks), ` is ${his} ${sister2}.`), ``); + r.push(familySpan(conditionalSlaveLink(sisters[0], allowLinks), ` is ${his} ${sister2}.`)); } } @@ -523,7 +523,7 @@ App.Desc.family = (function() { if (brothers.length > 1) { r.push(familySpan(slaveListToText(brothers, allowLinks), ` are ${his} ${sister2}s.`)); } else { - r.push(``, familySpan(``, conditionalSlaveLink(brothers[0], allowLinks), ` is ${his} ${sister2}.`), ``); + r.push(familySpan(conditionalSlaveLink(brothers[0], allowLinks), ` is ${his} ${sister2}.`)); } } @@ -533,7 +533,7 @@ App.Desc.family = (function() { if (halfSisters.length > 1) { r.push(familySpan(slaveListToText(halfSisters, allowLinks), ` are half-${sister2}s to ${him}.`)); } else { - r.push(``, familySpan(``, conditionalSlaveLink(halfSisters[0], allowLinks), ` is a half-${sister2} to ${him}.`), ``); + r.push(familySpan(conditionalSlaveLink(halfSisters[0], allowLinks), ` is a half-${sister2} to ${him}.`)); } } @@ -543,7 +543,7 @@ App.Desc.family = (function() { if (halfBrothers.length > 1) { r.push(familySpan(slaveListToText(halfBrothers, allowLinks), ` are half-${sister2}s to ${him}.`)); } else if (halfBrothers.length > 0) { - r.push(``, familySpan(``, conditionalSlaveLink(halfBrothers[0], allowLinks), ` is a half-${sister2} to ${him}.`), ``); + r.push(familySpan(conditionalSlaveLink(halfBrothers[0], allowLinks), ` is a half-${sister2} to ${him}.`)); } } @@ -563,7 +563,7 @@ App.Desc.family = (function() { if (cousins.length > 1) { r.push(familySpan(slaveListToText(cousins, allowLinks), ` are cousins to ${him}.`)); } else if (cousins.length > 0) { - r.push(``, familySpan(``, conditionalSlaveLink(cousins[0], allowLinks), ` is a cousin to ${him}.`), ``); + r.push(familySpan(conditionalSlaveLink(cousins[0], allowLinks), ` is a cousin to ${him}.`)); } } @@ -686,42 +686,42 @@ App.Desc.family = (function() { if (twins.length > 1) { r.push(`<br>You are `, familySpan(`twins with `, slaveListToText(twins, allowLinks), `.`)); } else if (twins.length > 0) { - r.push(`<br>Your twin is `, familySpan(``, conditionalSlaveLink(twins[0], allowLinks), `.`), ``); + r.push(`<br>Your twin is `, familySpan(conditionalSlaveLink(twins[0], allowLinks), `.`)); } if (sisters.length > 1) { r.push(`<br>`, slaveListToText(sisters, allowLinks), ` are your sisters.`); } else if (sisters.length > 0) { const {sister} = getPronouns(sisters[0]); - r.push(`<br>Your ${sister} is `, familySpan(``, conditionalSlaveLink(sisters[0], allowLinks), `.`), ``); + r.push(`<br>Your ${sister} is `, familySpan(conditionalSlaveLink(sisters[0], allowLinks), `.`)); } if (brothers.length > 1) { r.push(`<br>`, slaveListToText(brothers, allowLinks), ` are your brothers.`); } else if (brothers.length > 0) { const {sister} = getPronouns(brothers[0]); - r.push(`<br>Your ${sister} is `, familySpan(``, conditionalSlaveLink(brothers[0], allowLinks), `.`), ``); + r.push(`<br>Your ${sister} is `, familySpan(conditionalSlaveLink(brothers[0], allowLinks), `.`)); } if (halfSisters.length > 1) { r.push(`<br>`, slaveListToText(halfSisters, allowLinks), ` are your half-sisters.`); } else if (halfSisters.length > 0) { const {sister} = getPronouns(halfSisters[0]); - r.push(`<br>You have one half-${sister}, `, familySpan(``, conditionalSlaveLink(halfSisters[0], allowLinks), `.`), ``); + r.push(`<br>You have one half-${sister}, `, familySpan(conditionalSlaveLink(halfSisters[0], allowLinks), `.`)); } if (halfBrothers.length > 1) { r.push(`<br>`, slaveListToText(halfBrothers, allowLinks), ` are your half-brothers.`); } else if (halfBrothers.length > 0) { const {sister} = getPronouns(halfBrothers[0]); - r.push(`<br>You have one half-${sister}, `, familySpan(``, conditionalSlaveLink(halfBrothers[0], allowLinks), `.`), ``); + r.push(`<br>You have one half-${sister}, `, familySpan(conditionalSlaveLink(halfBrothers[0], allowLinks), `.`)); } if (V.showDistantRelatives) { if (cousins.length > 1) { r.push(`<br>`, slaveListToText(cousins, allowLinks), ` are your cousins.`); } else if (cousins.length > 0) { - r.push(`<br>You have one cousin, `, familySpan(``, conditionalSlaveLink(cousins[0], allowLinks), `.`), ``); + r.push(`<br>You have one cousin, `, familySpan(conditionalSlaveLink(cousins[0], allowLinks), `.`)); } } diff --git a/src/descriptions/officeDescription.js b/src/descriptions/officeDescription.js index d0b578e8c0b6378e5d10a2eb906362e793f052f6..8e5555860bb5ada1a69fe814146bc5f4498272e3 100644 --- a/src/descriptions/officeDescription.js +++ b/src/descriptions/officeDescription.js @@ -464,35 +464,47 @@ App.Desc.officeDescription = function(lastElement) { function printTrinkets() { const frag = new DocumentFragment(); - /** @type {Array<string|HTMLElement>} */ - let trinketElements = []; - let plurals = false; + frag.append( + `There's a display case behind your desk, with `, + App.UI.DOM.linkReplace(`${num(V.trinkets.size)} items`, trinkets()), + ` in it.`, + ); - for (const [trinketDesc, value] of V.trinkets) { - if ((typeof value === "number" && value === 1) || (Array.isArray(value) && value.length === 0)) { - trinketElements.push(capFirstChar(trinketDesc)); - } else { - trinketElements.push(trinketPluralReplacer(trinketDesc, value)); - plurals = true; + return frag; + + function trinkets() { + const frag = new DocumentFragment(); + + /** @type {Array<string|HTMLElement>} */ + let trinketElements = []; + let plurals = false; + + for (const [trinketDesc, value] of V.trinkets) { + if ((typeof value === "number" && value === 1) || (Array.isArray(value) && value.length === 0)) { + trinketElements.push(capFirstChar(trinketDesc)); + } else { + trinketElements.push(trinketPluralReplacer(trinketDesc, value)); + plurals = true; + } } - } - trinketElements.sort((a, b) => a > b ? 1 : -1); + trinketElements.sort((a, b) => a > b ? 1 : -1); - // depending on length of trinketString, add necessary conjunctions - frag.append(`There's a display case behind your desk, with `); - if (trinketElements.length === 1) { - if (V.trinkets.size === 1) { - frag.append(`a single item:`); - } else { - frag.append(`:`); + if (trinketElements.length === 1) { + if (V.trinkets.size === 1) { + frag.append(`a single item:`); + } else { + frag.append(`:`); + } + } else if (trinketElements.length === 2 && plurals === false) { + frag.append(`a couple of items:`); } - } else if (trinketElements.length === 2 && plurals === false) { - frag.append(`a couple of items:`); + const list = App.UI.DOM.appendNewElement("ul", frag); + + list.style.textIndent = "0"; + trinketElements.forEach(ts => App.UI.DOM.appendNewElement("li", list, ts)); + + return frag; } - const list = App.UI.DOM.appendNewElement("ul", frag); - list.style.textIndent = "0"; - trinketElements.forEach(ts => App.UI.DOM.appendNewElement("li", list, ts)); - return frag; } /** diff --git a/src/endWeek/player/prMobility.js b/src/endWeek/player/prMobility.js index 36e2ab8e7bf346bb9b96f205eb06d2222c27b7e0..a982cdca9ee423882ccde79745f2c2f9727b0e69 100644 --- a/src/endWeek/player/prMobility.js +++ b/src/endWeek/player/prMobility.js @@ -486,7 +486,7 @@ App.EndWeek.Player.mobility = function(PC = V.PC) { if (V.ballsAccessibility === 1) { r.push(`You never have to deal with that in the penthouse after having refitted for the comfort of those with sizable testicles.`); } else if (PC.balls >= 50) { - r.push(`The latter issue follows you back to the penthouse, giving you no real place to relax and unwind; the number of rotations you need to do in the bathroom is irratating.`); + r.push(`The latter issue follows you back to the penthouse, giving you no real place to relax and unwind; the number of rotations you need to do in the bathroom is irritating.`); if (V.buttAccessibility === 1 || V.pregAccessibility === 1 || V.boobAccessibility === 1) { r.push(`At least there is plenty of room to maneuver, due to the other structural renovations you've had done.`); } else { diff --git a/src/events/intro/arcologySelection.js b/src/events/intro/arcologySelection.js index f7961f734b38428aeff6fc9e1e40fd4ad61a9e4f..245e3d1493019e5f63b5098ed962710b0e72b8e7 100644 --- a/src/events/intro/arcologySelection.js +++ b/src/events/intro/arcologySelection.js @@ -179,10 +179,13 @@ App.Intro.generateEstablishedArcologies = function(inIntro = false) { if (!inIntro) { // for some reason we put the acquisition link at the bottom instead of the top when moving arcologies const sectionPrice = { + "spire": 2_500_000, "penthouse": 10_000_000, "shops": 1_000_000, + "fountain": 5_000_000, "apartments": 500_000, "markets": 250_000, + "ravine-markets": 250_000, "manufacturing": 100_000, }; const rows = (/** @type {App.Arcology.Section} */ section) => section.rows diff --git a/src/events/intro/introSummary.js b/src/events/intro/introSummary.js index 3cf9f435126ba698cc77ec5671ba57d8f1eef60f..9528b40b147f3120d8c83f09b144721740a54090 100644 --- a/src/events/intro/introSummary.js +++ b/src/events/intro/introSummary.js @@ -17,11 +17,10 @@ App.Intro.summary = function() { let minAge = V.minimumSlaveAge; let maxAge = V.retirementAge - 1 > 60 ? 60 : V.retirementAge - 1; let defaultAge = 18; - if(V.targetArcology.fs === "FSMaturityPreferentialist") { + if (V.targetArcology.fs === "FSMaturityPreferentialist") { minAge = 30; defaultAge = 30; - } - else if(V.targetArcology.fs === "FSYouthPreferentialist") { + } else if (V.targetArcology.fs === "FSYouthPreferentialist") { maxAge = 29; } V.idealAge = variableAsNumber(V.idealAge, minAge, maxAge, defaultAge); @@ -317,7 +316,6 @@ App.Intro.summary = function() { V.PC.skill.medicine = -100; V.PC.skill.hacking = -100; V.PC.muscles = 0; - V.PC.digestiveSystem = "atrophied"; break; case "handmaiden": diff --git a/src/events/nonRandom/pInvasion.js b/src/events/nonRandom/pInvasion.js index 0aa592ac02b2043400908087ea378b4e4d7ff7b5..79786343ba72deb84f78e55b6a105d921def84f2 100644 --- a/src/events/nonRandom/pInvasion.js +++ b/src/events/nonRandom/pInvasion.js @@ -2,18 +2,18 @@ App.Events.PInvasion = class PInvasion extends App.Events.BaseEvent { execute(node) { let r = []; V.nextButton = "Continue"; - const newSlaves = []; V.invasionVictory = 1; const { HeA, HisA, heA, hisA, womanA } = getPronouns(assistant.pronouns().main).appendSuffix("A"); + const newSlaves = []; + const ravineArc = V.terrain === "ravine"; r.push(`The day that wasn't supposed to come is here. The troubled little country next door is falling apart. Last month, its stock market collapsed. Last week, its government fell. Yesterday, there was open looting in its cities. And today, a faction of disaffected citizens that blames the Free Cities for siphoning off business and causing the collapse seized weapons from unguarded army depots${(V.terrain === "marine" || V.terrain === "oceanic") ? ", armed merchant ships and private vessels, and are approaching the Free City over the water." : " and advanced towards your home."}`); - App.Events.addParagraph(node, r); - r = []; + r = []; r.push(`Sirens are blaring; there is a crump far above as ${V.arcologies[0].name}'s defensive systems knock down one of the first mortar rounds fired into the Free City. The lights in your office changed to a harsh emergency scheme as soon as the attack became a certainty.`); if (V.assistant.personality <= 0) { r.push(`Your personal assistant offers terse reports on the efficiency of the point defense fire.`); @@ -82,15 +82,13 @@ App.Events.PInvasion = class PInvasion extends App.Events.BaseEvent { } } r.push(`It's going well. Whoever's in command of the attackers sees that their fire is having no effect, and orders an advance. The mortars and other artillery systems maintain their fire, trying to occupy as many guns as possible.`); - App.Events.addParagraph(node, r); + r = []; - r.push(`The loose militia lately organized by the arcology owners has been called out to defend the city. Its commander, seeing that the attackers have more passion than tactical skill, orders an immediate counterattack by anyone able${(V.terrain === "marine" || V.terrain === "oceanic") ? " to push the invaders landing in the dock areas back into the sea" : ""}. Technology has advanced to the point that rich militiamen who buy their own gear can form a powerful fighting force. With luck, the counterattack should shatter the enemy.`); - App.Events.addParagraph(node, r); + r = []; - if (V.personalArms === 0) { r.push(`Since you are not well armed or armored, you stay back and oversee the defense of your own arcology.`); } else if (V.personalArms === 1) { @@ -98,44 +96,36 @@ App.Events.PInvasion = class PInvasion extends App.Events.BaseEvent { } else { r.push(`Since you are well armed and armored and your drones are combat ready, you take part in the counterattack. You are preceded into combat by a wedge of your drones, which lack the intelligence to take good cover but are remorseless and highly accurate. Your exoskeleton mounts a smart mortar system that independently targets and eliminates enemy groups even as you lay down fire from the guns mounted on your forearms.`); } - App.Events.addParagraph(node, r); + r = []; - if (V.mercenaries === 0) { r.push(`You are alone in contributing to the defense of your home.`); - } else if (V.mercenaries === 1) { + } else if (V.mercenaries >= 1) { r.push(`Your mercenaries see to the defense of ${V.arcologies[0].name}, ensuring that nothing that gets through will do truly serious damage.`); - } else { - r.push(`Your mercenaries see to the defense of ${V.arcologies[0].name}, ensuring that nothing that gets through will do truly serious damage. There are enough of them that they can even spare a squad to accompany the counterattack. They're mostly old veterans of many bitter brush wars, and they go about the bloody business with the air of men and women who saw their first battlefield long before their hair was shot with grey.`); + if (V.mercenaries > 1) { + r.push(`There are enough of them that they can even spare a squad to accompany the counterattack. They're mostly old veterans of many bitter brush wars, and they go about the bloody business with the air of men and women who saw their first battlefield long before their hair was shot with grey.`); + } } - App.Events.addParagraph(node, r); + r = []; - if (V.mercenaries + V.personalArms < 2) { r.push(`<span class="red">The counterattack fails.</span> The enemy is eventually defeated, but only after they get mired in urban combat in the streets of the Free City. <span class="red">${V.arcologies[0].name} takes considerable damage from`); - if (V.terrain === "ravine") { - r.push(`cliffside fire,`); - } else { - r.push(`stray fire,`); - } - r.push(`and many supplies have been lost or stolen.</span> The repairs will be extremely costly.`); - if (V.terrain === "ravine") { - cashX(forceNeg(Math.trunc(V.cash * 0.8)), "war"); - cashX(-50000, "war"); - } else { - cashX(forceNeg(Math.trunc(V.cash * 0.9)), "war"); - cashX(-10000, "war"); - } + r.push(`${ravineArc ? 'cliffside' : 'stray'} fire, and many supplies have been lost or stolen.</span> The repairs will be extremely costly.`); + App.Events.addParagraph(node, r); + cashX(forceNeg(Math.trunc(V.cash * (ravineArc ? 0.8 : 0.9))), "war"); + cashX(ravineArc ? -50000 : -10000, "war"); } else if (V.mercenaries + V.personalArms < 6) { r.push(`<span class="yellow">The counterattack succeeds.</span> <span class="red">${V.arcologies[0].name} takes minor damage from stray fire,</span> but the repairs are not too costly. Your participation in the counterattack that saved the Free City was noted, and <span class="green">you are acclaimed as a protector of its people.</span>`); + App.Events.addParagraph(node, r); V.invasionVictory = 2; cashX(forceNeg(Math.trunc(V.cash * 0.2)), "war"); cashX(-5000, "war"); repX(5000, "event"); } else { r.push(`<span class="green">The counterattack is a crushing success.</span> Your mercenary squad and your drones form an irresistible phalanx around you that smashes everything it touches. The enemy is put to flight, and you send your drones racing ahead to take captives. By law these are shared among the militia. There is talk that your contributions deserve more than a few wretched slaves in reward. A public subscription pays for the damage ${V.arcologies[0].name} took from stray fire, and <span class="green">you are acclaimed a hero.</span>`); + App.Events.addParagraph(node, r); V.invasionVictory = 3; repX(10000, "event"); @@ -144,12 +134,9 @@ App.Events.PInvasion = class PInvasion extends App.Events.BaseEvent { slave.origin = "$He is an enslaved prisoner of war."; newSlaves.push(slave); } - V.menials += 5; addTrinket("a shot-torn flag of the failed nation whose militants attacked the Free City"); - App.Events.addParagraph(node, r); - App.Events.addResponses(node, [ new App.Events.Result(`Sell your prisoners immediately`, sell), new App.Events.Result(`Give your prisoners to citizens who displayed bravery during the counterattack`, give), @@ -157,23 +144,17 @@ App.Events.PInvasion = class PInvasion extends App.Events.BaseEvent { ]); } function sell() { - for (const s of newSlaves) { - cashX(slaveCost(s), "slaveTransfer"); - } + newSlaves.forEach(s => cashX(slaveCost(s), "slaveTransfer")); return `Prisoners sold.`; } function give() { - for (const s of newSlaves) { - repX(Math.trunc(slaveCost(s) / 2), "event"); - } + newSlaves.forEach(s => repX(Math.trunc(slaveCost(s) / 2), "event")); return `Prisoners <span class="green">given away.</span>`; } function enslave() { - for (const s of newSlaves) { - newSlave(s); /* skip New Slave Intro */ - } + newSlaves.forEach(s => newSlave(s)); // skip New Slave Intro return `You simply enslave all of your prisoners yourself. These slaves will regret attacking your arcology.`; } } diff --git a/src/events/scheduled/seNicaeaCouncil.js b/src/events/scheduled/seNicaeaCouncil.js index a84db3a84a94f58bed996f0fb317460d7bfd7fdc..5b8af802a69930e7563daf6c7d691a0edb4e60a1 100644 --- a/src/events/scheduled/seNicaeaCouncil.js +++ b/src/events/scheduled/seNicaeaCouncil.js @@ -66,6 +66,7 @@ App.Events.SENicaeaCouncil = class SENicaeaCouncil extends App.Events.BaseEvent r.push(`but the weak Council may lead to a weak creed.`); } App.Events.addParagraph(node, r); + r = []; } const container = App.UI.DOM.appendNewElement("div", node); diff --git a/src/js/utilsPC.js b/src/js/utilsPC.js index e6218301924b530adefab2a772300b0bf49a293c..66bbead3a8e4a104e7fe0b30bfe1a139a9f7e9e9 100644 --- a/src/js/utilsPC.js +++ b/src/js/utilsPC.js @@ -698,7 +698,7 @@ globalThis.isTrapped = function(actor) { /** How badly hindered is the player? Stacks from various sources up until a 75% reduction in your ability to do business. * You have to seriously try to fuck yourself up that badly; just stacking basic hindrances will only get you to 50%. - * This probably still needs more ajustments. + * This probably still needs more adjustments. * @param {FC.HumanState} actor * @param {boolean} sexyTime * @returns {number} @@ -706,9 +706,10 @@ globalThis.isTrapped = function(actor) { globalThis.isHinderedDegree = function(actor, sexyTime = false) { let mult = 1; const averageHeight = Height.mean(actor); - const estimatedSackSag= ballsToCM(actor.balls) * .8 * (1 + ((actor.scrotum - actor.balls) * .5)); + const estimatedSackSag = ballsToCM(actor.balls) * .8 * (1 + ((actor.scrotum - actor.balls) * .5)); // player exclusives - if (!actor || actor.ID !== -1) { + actor = asPlayer(actor); + if (!actor) { return mult; } // PC on bedrest plans to work from home. @@ -769,7 +770,7 @@ globalThis.isHinderedDegree = function(actor, sexyTime = false) { if (actor.boobs > 5000) { mult -= .1; } - if (V.boobsAccessibility === 1) { + if (V.boobAccessibility === 1) { if (actor.boobs > 75000) { mult -= .1; } @@ -850,7 +851,7 @@ globalThis.isHinderedDegree = function(actor, sexyTime = false) { if (actor.boobs > 5000) { mult -= .1; } - if (V.boobsAccessibility === 1) { + if (V.boobAccessibility === 1) { if (actor.boobs > 75000) { mult -= .15; } else if (actor.boobs > 50000) { diff --git a/src/npc/descriptions/sceneIntro.js b/src/npc/descriptions/sceneIntro.js index eb82857c12c3894d5d27abad4446193974e9e0c4..3783ed6beff816f70d402a82dde8477b87079ca2 100644 --- a/src/npc/descriptions/sceneIntro.js +++ b/src/npc/descriptions/sceneIntro.js @@ -10,6 +10,7 @@ App.Desc.sceneIntro = function(slave, descType, links) { const { he, him, his, He, His, himself, wife } = getPronouns(slave); + const relTarget = slave.relationship > 0 ? getSlave(slave.relationshipTarget) : null; if (descType === DescType.EVENT) { r.push(`${He} is currently involved in an event, but is assigned to ${slave.assignment}.`); @@ -214,52 +215,49 @@ App.Desc.sceneIntro = function(slave, descType, links) { r.push(`${He} is an <span class="relationship">emotional slut,</span> happy to remain officially single and free to treat everyone equally.`); } else if (slave.relationship === -2) { r.push(`${He} is <span class="relationship">emotionally bound to you;</span> ${his} feelings for you are comparable to those in a healthy, loving relationship.`); - } else if (slave.relationship !== 0) { - let lsd = getSlave(slave.relationshipTarget); - if (lsd) { - r.push(`${He} is`); - // TODO: update this with the new relationship rules - if (slave.relationship <= 1) { - r.push(slaveRelationshipSpan(`friends with `, slaveReference(lsd), `;`), `the rules`); - if (slave.rules.relationship !== "restrictive") { - r.push(`encourage`); - } else { - r.push(`discourage`); - } - r.push(`their relationship.`); - } else if (slave.relationship <= 2) { - r.push(slaveRelationshipSpan(`best friends with `, slaveReference(lsd), `;`), `the rules`); - if (slave.rules.relationship !== "restrictive") { - r.push(`encourage`); - } else { - r.push(`discourage`); - } - r.push(`their close relationship.`); - } else if (slave.relationship <= 3) { - r.push(slaveRelationshipSpan(slaveReference(lsd), `'s friend with benefits;`), `the rules`); - if (slave.rules.relationship === "permissive") { - r.push(`encourage`); - } else { - r.push(`discourage`); - } - r.push(`their sexual relationship.`); - } else if (slave.relationship <= 4) { - r.push(slaveRelationshipSpan(slaveReference(lsd), `'s lover;`), `the rules`); - if (slave.rules.relationship === "permissive") { - r.push(`encourage`); - } else { - r.push(`discourage`); - } - r.push(`their passionate relationship.`); - } else if (slave.relationship > 4) { - r.push(slaveRelationshipSpan(slaveReference(lsd), `'s slave ${wife};`), `the rules`); - if (slave.rules.relationship === "permissive") { - r.push(`encourage`); - } else { - r.push(`discourage`); - } - r.push(`marital bliss.`); + } else if (slave.relationship !== 0 && relTarget) { + r.push(`${He} is`); + // TODO: update this with the new relationship rules + if (slave.relationship <= 1) { + r.push(slaveRelationshipSpan(`friends with `, slaveReference(relTarget), `;`), `the rules`); + if (slave.rules.relationship !== "restrictive") { + r.push(`encourage`); + } else { + r.push(`discourage`); + } + r.push(`their relationship.`); + } else if (slave.relationship <= 2) { + r.push(slaveRelationshipSpan(`best friends with `, slaveReference(relTarget), `;`), `the rules`); + if (slave.rules.relationship !== "restrictive") { + r.push(`encourage`); + } else { + r.push(`discourage`); + } + r.push(`their close relationship.`); + } else if (slave.relationship <= 3) { + r.push(slaveRelationshipSpan(slaveReference(relTarget), `'s friend with benefits;`), `the rules`); + if (slave.rules.relationship === "permissive") { + r.push(`encourage`); + } else { + r.push(`discourage`); + } + r.push(`their sexual relationship.`); + } else if (slave.relationship <= 4) { + r.push(slaveRelationshipSpan(slaveReference(relTarget), `'s lover;`), `the rules`); + if (slave.rules.relationship === "permissive") { + r.push(`encourage`); + } else { + r.push(`discourage`); + } + r.push(`their passionate relationship.`); + } else if (slave.relationship > 4) { + r.push(slaveRelationshipSpan(slaveReference(relTarget), `'s slave ${wife};`), `the rules`); + if (slave.rules.relationship === "permissive") { + r.push(`encourage`); + } else { + r.push(`discourage`); } + r.push(`marital bliss.`); } } else if (slave.fuckdoll === 0) { if (slave.rules.relationship === "restrictive") { @@ -302,12 +300,13 @@ App.Desc.sceneIntro = function(slave, descType, links) { r.push(`${He} sleeps on a bedroll,`); } else if (slave.rules.living === "normal") { r.push(`${He} sleeps on a cot,`); - } else if (slave.relationship >= 4) { + } else if (slave.relationship >= 4 && relTarget) { + const {wife2, girl2} = getPronouns(relTarget).appendSuffix('2'); r.push(`${He} has ${his} own room, which ${he} shares with ${his}`); if (slave.relationship === 5) { - r.push(wife); + r.push(wife2); } else { - r.push(`${getPronouns(slave).girl}friend`); + r.push(`${girl2}friend`); } r.push(`whenever they can manage it,`); } else { diff --git a/src/npc/interaction/killSlave.js b/src/npc/interaction/killSlave.js index bcaa62fd172c0213a9abd3ea5ba96d40207f46f3..18d8b209f17ac69fa35faa28d546b15481695112 100644 --- a/src/npc/interaction/killSlave.js +++ b/src/npc/interaction/killSlave.js @@ -439,19 +439,12 @@ App.UI.SlaveInteract.killSlave = function(slave) { } else { const subDiv = document.createElement("div"); - const daughters = []; const mother = getPronouns(slave).mother; - if (arr.length > 2) { - daughters.push(toSentence(arr)); - } else { - daughters.push(`${getSlave(arr[0]).slaveName} and ${getSlave(arr[1]).slaveName}`); - } - arr.forEach(i => getSlave(i).devotion -= 25); App.Events.addParagraph(subDiv, [ - `${His} children, ${daughters}, are <span class="devotion dec">horrified</span> that you would take their ${mother} from them.` + `${His} children, ${toSentence(arr.map(i => getSlave(i).slaveName))}, are <span class="devotion dec">horrified</span> that you would take their ${mother} from them.` ]); return subDiv; @@ -475,29 +468,12 @@ App.UI.SlaveInteract.killSlave = function(slave) { return subDiv; } else { const subDiv = document.createElement("div"); - - const twins = []; - const sister = getPronouns(slave).sister; - if (arr.length > 2) { - let lastTwin = arr.pop(); - - for (const twin of arr) { - twins.push(`${getSlave(twin).slaveName},`); - - getSlave(twin).devotion -= 30; - } - - twins.push(`and ${getSlave(lastTwin).slaveName}`); - } else { - twins.push(`${getSlave(arr[0]).slaveName} and ${getSlave(arr[1]).slaveName}`); - } - arr.forEach(i => getSlave(i).devotion -= 30); App.Events.addParagraph(subDiv, [ - `${His} twins, ${twins.join(' ')} are <span class="devotion dec">devastated</span> that you would take their ${sister} from them.` + `${His} twins, ${toSentence(arr.map(i => getSlave(i).slaveName))} are <span class="devotion dec">devastated</span> that you would take their ${sister} from them.` ]); return subDiv; @@ -522,26 +498,12 @@ App.UI.SlaveInteract.killSlave = function(slave) { } else { const subDiv = document.createElement("div"); - const sisters = []; - const sister = getPronouns(slave).sister; - if (arr.length > 2) { - let lastSister = arr.pop(); - - for (const sister of arr) { - sisters.push(`${getSlave(sister).slaveName},`); - } - - sisters.push(`and ${getSlave(lastSister).slaveName}`); - } else { - sisters.push(`${getSlave(arr[0]).slaveName} and ${getSlave(arr[1]).slaveName}`); - } - arr.forEach(i => getSlave(i).devotion -= 25); App.Events.addParagraph(subDiv, [ - `${His} sister, ${sisters.join(' ')} are <span class="devotion dec">grief-stricken</span> that you would take their ${sister} from them.` + `${His} sisters, ${toSentence(arr.map(i => getSlave(i).slaveName))} are <span class="devotion dec">grief-stricken</span> that you would take their ${sister} from them.` ]); return subDiv; @@ -566,26 +528,12 @@ App.UI.SlaveInteract.killSlave = function(slave) { } else { const subDiv = document.createElement("div"); - const halfSisters = []; - const sister = getPronouns(slave).sister; - if (arr.length > 2) { - let lastHalfSister = arr.pop(); - - for (const sister of arr) { - halfSisters.push(`${getSlave(sister).slaveName},`); - } - - halfSisters.push(`and ${getSlave(lastHalfSister).slaveName}`); - } else { - halfSisters.push(`${getSlave(arr[0]).slaveName} and ${getSlave(arr[1]).slaveName}`); - } - arr.forEach(i => getSlave(i).devotion -= 20); App.Events.addParagraph(subDiv, [ - `${His} half-sisters, ${halfSisters.join(' ')}, are <span class="devotion dec">saddened</span> that you would take their ${sister} from them.` + `${His} half-sisters, ${toSentence(arr.map(i => getSlave(i).slaveName))}, are <span class="devotion dec">saddened</span> that you would take their ${sister} from them.` ]); return subDiv; @@ -593,11 +541,10 @@ App.UI.SlaveInteract.killSlave = function(slave) { } function getRelationshipEffects(ID) { - if (getSlave(ID).fetish !== "mindbroken") { + const target = getSlave(ID); + if (target.fetish !== "mindbroken") { const subDiv = document.createElement("div"); - const target = getSlave(ID); - App.Events.addParagraph(subDiv, [ `${target.slaveName} is <span class="devotion dec">grief-stricken</span> that you have killed ${getPronouns(target).his} best source of comfort and companionship in a life of bondage.` ]); diff --git a/src/player/desc/pLongBoobs.js b/src/player/desc/pLongBoobs.js index 9ab7f0b6e88b0e83f6b5ad57b11784dab8f6fbd2..1653f90696ebe9a1b613c16d8af60a7cc3161450 100644 --- a/src/player/desc/pLongBoobs.js +++ b/src/player/desc/pLongBoobs.js @@ -371,7 +371,7 @@ App.Desc.Player.boobs = function(PC = V.PC) { if (V.boobAccessibility === 1) { r.push(`On the bright side, you've had the penthouse remodeled for ${girlP}s with such substantial bosoms already, so fitting through doors and using furniture isn't a concern.`); } else if (V.pregAccessibility === 1 || V.ballsAccessibility === 1 || V.buttAccessibility === 1) { - r.push(`Still, the halls and doors of the penthouse have been remodeled to accommodate other enormous assets, so there's plenty of room for your substatial busom. Too bad everything is still at the perfect height to jab you in the tits.`); + r.push(`Still, the halls and doors of the penthouse have been remodeled to accommodate other enormous assets, so there's plenty of room for your substantial busom. Too bad everything is still at the perfect height to jab you in the tits.`); } else { r.push(`Even worse, the penthouse was not designed to handle ${girlP}s with bosoms as substantial as yours; you crowd whichever halls or doors you use and find an uncomfortable number of objects poking and prodding your tits.`); if (PC.boobsImplant >= 600000) {