diff --git a/src/005-passages/managePassages.js b/src/005-passages/managePassages.js index 9a667bd1662c2aa4201fa572ac32c21460bf2c28..721b07f9582093326c60c006264fd40c3f503df0 100644 --- a/src/005-passages/managePassages.js +++ b/src/005-passages/managePassages.js @@ -106,11 +106,19 @@ new App.DomPassage("Coursing Association", } ); +new App.DomPassage("Personal assistant options", + () => { + V.nextButton = "Back"; + V.nextLink = "Main"; + return App.UI.personalAssistantOptions(); + }, ["jump-to-safe", "jump-from-safe"] +); + new App.DomPassage("Assistant Appearance Pack Two", () => { V.nextButton = "Back"; V.nextLink = "Personal assistant options"; - return assistantAppearancePackTwo(); + return App.UI.assistantAppearancePackTwo(); } ); diff --git a/src/personalAssistant/assistantAppearancePackTwo.js b/src/personalAssistant/assistantAppearancePackTwo.js index 2e49fec5c1f903462ae7898dc674970e0beff96f..3d26407a3113fb290e9bfd4f381cb02e680f04d9 100644 --- a/src/personalAssistant/assistantAppearancePackTwo.js +++ b/src/personalAssistant/assistantAppearancePackTwo.js @@ -1,4 +1,4 @@ -globalThis.assistantAppearancePackTwo = function() { +App.UI.assistantAppearancePackTwo = function() { const node = new DocumentFragment(); App.Events.drawEventArt(node, "assistant"); diff --git a/src/personalAssistant/assistantOptions.js b/src/personalAssistant/assistantOptions.js index 90f1c7473308c241f0e62da1fa398e15531dced2..f89511ea6f99fc4471933225fd2603f9c2f4d081 100644 --- a/src/personalAssistant/assistantOptions.js +++ b/src/personalAssistant/assistantOptions.js @@ -1,21 +1,15 @@ -globalThis.personalAssistantOptions = function() { - // :: Personal assistant options [nobr jump-to-safe jump-from-safe] - - V.nextButton = "Back"; - V.nextLink = "Main"; +App.UI.personalAssistantOptions = function() { + const node = new DocumentFragment(); assistant.object(); - const node = new DocumentFragment(); - let linkArray = []; - const artFrame = V.seeImages ? App.UI.DOM.assistantArt(3) : document.createElement("span"); if (V.seeImages) { node.append(artFrame); } const { - HeA, + HeA, HisA, heA, hisA, himA, himselfA } = getPronouns(assistant.pronouns().main).appendSuffix("A"); @@ -27,7 +21,7 @@ globalThis.personalAssistantOptions = function() { )); if (V.assistant.name !== "your personal assistant") { r.push(App.UI.DOM.link( - "Stop using a custom name", + "(Stop using a custom name)", () => { V.assistant.name = "your personal assistant"; App.UI.reload(); @@ -40,11 +34,9 @@ globalThis.personalAssistantOptions = function() { r.push(`in a corner of your desk's glass top.`); App.Events.addParagraph(node, r); - r = []; App.UI.DOM.appendNewElement("p", node, PersonalAssistantAppearance()); - if (V.assistant.power > 0) { App.UI.DOM.appendNewElement("p", node, `Though ${heA} remains short of a true AI, the arcology's upgraded computer core allows ${himA} to use brute force to simulate sentient behavior quite well. ${HeA} is not truly self aware, but ${heA} is able to predict what a sentient being with a certain character might say or do in common situations. The increased power has other applications; for example, it has improved the accuracy of your estimates of economic activity in the Free City.`); } else { @@ -61,82 +53,136 @@ globalThis.personalAssistantOptions = function() { } node.append(tabBar.render()); + return node; + function upgrades() { const frag = new DocumentFragment(); - let r = []; if (V.assistant.power === 0) { - r.push(`The first upgrade needed is a switch to a holographic memory core to store the immense quantity of data ${V.assistant.name} gathers.`); - // Will cost ${cashFormat(Math.trunc(20000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier))}// - // [[Install holographic memory core|Personal assistant options][cashX(forceNeg(Math.trunc(20000*V.upgradeMultiplierArcology*V.HackingSkillMultiplier)), "capEx"), V.assistant.power += 1, V.PC.skill.engineering += 1, V.PC.skill.hacking += 1]] + const memoryCost = Math.trunc(20000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier); + App.Events.addParagraph(frag, [ + `The first upgrade needed is a switch to a holographic memory core to store the immense quantity of data ${V.assistant.name} gathers.`, + App.UI.DOM.link( + "Install holographic memory core", + () => { + cashX(forceNeg(memoryCost), "capEx"); + V.assistant.power += 1; + V.PC.skill.engineering += 1; + V.PC.skill.hacking += 1; + App.UI.reload(); + }, + [], + "", + `Will cost ${cashFormat(memoryCost)}` + ) + ]); } else if (V.assistant.power === 1) { - r.push(`The next upgrade needed is a liquid nitrogen cooling system to allow for extensive overclocking.`); - // Will cost ${cashFormat(Math.trunc(35000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier))} - r.push(`and will allow you to upgrade the smart piercings in ${V.arcologies[0].name}//`); - // [[Install upgraded cooling system|Personal assistant options][cashX(forceNeg(Math.trunc(35000*V.upgradeMultiplierArcology*V.HackingSkillMultiplier)), "capEx"), V.assistant.power += 1, V.PC.skill.engineering += 1, V.PC.skill.hacking += 1]] + const coolingCost = Math.trunc(35000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier); + App.Events.addParagraph(frag, [ + `The next upgrade needed is a liquid nitrogen cooling system to allow for extensive overclocking.`, + App.UI.DOM.link( + "Install upgraded cooling system", + () => { + cashX(forceNeg(coolingCost), "capEx"); + V.assistant.power += 1; + V.PC.skill.engineering += 1; + V.PC.skill.hacking += 1; + App.UI.reload(); + }, + [], + "", + `Will cost ${cashFormat(coolingCost)} and will allow you to upgrade the smart piercings in ${V.arcologies[0].name}` + ) + ]); } else if (V.assistant.power === 2) { - r.push(`The final upgrade needed is a transition to optical RAM.`); - // Will cost ${cashFormat(Math.trunc(50000*V.upgradeMultiplierArcology*V.HackingSkillMultiplier))//} - // [[Install optical RAM|Personal assistant options][cashX(forceNeg(Math.trunc(50000*V.upgradeMultiplierArcology*V.HackingSkillMultiplier)), "capEx"), V.assistant.power += 1, V.PC.skill.engineering += 1, V.PC.skill.hacking += 1]] + const opticalCost = Math.trunc(50000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier); + App.Events.addParagraph(frag, [ + `The final upgrade needed is a transition to optical RAM.`, + App.UI.DOM.link( + "Install optical RAM", + () => { + cashX(forceNeg(opticalCost), "capEx"); + V.assistant.power += 1; + V.PC.skill.engineering += 1; + V.PC.skill.hacking += 1; + App.UI.reload(); + }, + [], + "", + `Will cost ${cashFormat(opticalCost)}` + ) + ]); } else { - r.push(`The arcology's computer core is fully upgraded.`); + App.Events.addParagraph(frag, [`The arcology's computer core is fully upgraded.`]); } - App.Events.addParagraph(frag, r); return frag; } function settings() { const frag = new DocumentFragment(); let r = []; - // <h3>Behavior:</h3> + App.UI.DOM.appendNewElement("h3", frag, "Behavior:"); if (V.assistant.personality <= 0) { - r.push(`Your assistant is using ${hisA} default settings, and is not behaving as though ${heA} has a libido. [["Instruct " + ${himA} + " to simulate a sex drive" | Personal assistant options][${V.assistant.personality} = 1]]`); + App.Events.addParagraph(frag, [ + `Your assistant is using ${hisA} default settings, and is not behaving as though ${heA} has a libido.`, + App.UI.DOM.link( + `Instruct ${himA} to simulate a sex drive`, + () => { + V.assistant.personality = 1; + App.UI.reload(); + }, + ) + ]); } else { - r.push(`Your assistant is simulating preferences and a sex drive. [["Revert " + ${himA} + " to normal settings" | Personal assistant options][${V.assistant.personality} = 0, V.assistant.appearance = "normal"]]`); + App.Events.addParagraph(frag, [ + `Your assistant is simulating preferences and a sex drive.`, + App.UI.DOM.link( + `Revert ${himA} to normal settings`, + () => { + V.assistant.personality = 0; + V.assistant.appearance = "normal"; + App.UI.reload(); + }, + ) + ]); } if (V.assistant.market) { - // <h3>Business Assistant:</h3> + App.UI.DOM.appendNewElement("h3", frag, "Business Assistant:"); r.push(`The arcology's upgraded computers support advanced business analysis.`); if (V.assistant.appearance !== "normal") { - r.push(`These capabilities are represented by an avatar styled after ${V.assistant.name}'s, with which ${heA} simulates a ''V.assistant.market.relationship'' relationship.`); - // <br> - if (V.assistant.market.relationship !== "cute") { - // [[Cute|Personal assistant options][V.assistant.market.relationship = "cute"]] - // <br> - } - if (V.assistant.market.relationship !== "romantic") { - // [[Romantic|Personal assistant options][V.assistant.market.relationship = "romantic"]] - // <br> - } - if (V.assistant.market.relationship !== "nonconsensual") { - // [[Nonconsensual|Personal assistant options][V.assistant.market.relationship = "nonconsensual"]] - // <br> - } - if (V.assistant.market.relationship !== "incestuous") { - // [[Incestuous|Personal assistant options][V.assistant.market.relationship = "incestuous"]] - // <br> - } + App.Events.addParagraph(frag, [ + `These capabilities are represented by an avatar styled after ${V.assistant.name}'s, with which ${heA} simulates a`, + App.UI.DOM.makeElement("span", V.assistant.market.relationship, "bold"), + `relationship.` + ]); + const options = new App.UI.OptionsGroup(); + options.addOption("Relationship", "relationship", V.assistant.market) + .addValueList([ + ["Cute", "cute"], + ["Romantic", "romantic"], + ["Nonconsensual", "nonconsensual"], + ["Incestuous", "incestuous"], + ]); + frag.append(options.render()); } else { - r.push(`Although technically an expanded subroutine within the same app, ${V.assistant.name} uses a distinct icon to identify these alerts and improve your workflow.`); - // <br> + App.UI.DOM.appendNewElement("p", frag, `Although technically an expanded subroutine within the same app, ${V.assistant.name} uses a distinct icon to identify these alerts and improve your workflow.`); + r.push(); } - // <br>${HeA} is V.assistant.market.limit = Math.clamp(V.assistant.market.limit, 0, 10000000); + let options = new App.UI.OptionsGroup(); + options.addOption("Use excess liquid assets to play the menial slave market.", "limit", V.assistant.market) + .addValueList([ + ["Disallow", 0], + ["Allow", 10000], + ]).showTextBox(); if (V.assistant.market.limit) { - r.push(`''allowed'' to use excess liquid assets over ${cashFormat(V.assistant.market.limit)} to play the menial slave market. [[Disallow | Personal assistant options][${V.assistant.market.limit} = 0]]`); - // <br> - // Define custom cash limit:// - // <<textbox "V.assistant.market.limit" V.assistant.market.limit "Personal assistant options">> - // <br> - r.push(`${HeA} will be`); - if (V.assistant.market.aggressiveness) { - r.push(`''aggressive'' about buying and selling. [[Be conservative | Personal assistant options][${V.assistant.market.aggressiveness} = 0]]`); - } else { - r.push(`''conservative'' about buying and selling. [[Be aggressive | Personal assistant options][${V.assistant.market.aggressiveness} = 100]]`); - } - } else { - r.push(`''not allowed'' to use excess liquid assets to play the menial slave market. [[Allow | Personal assistant options][${V.assistant.market.limit} = 10000]]`); + options.addOption(`${HisA} investing strategy will be`, "aggressiveness", V.assistant.market) + .addValueList([ + ["Conservative", 0], + ["Aggressive", 100], + ]); } + frag.append(options.render()); } App.Events.addParagraph(frag, r); return frag; @@ -144,7 +190,7 @@ globalThis.personalAssistantOptions = function() { function appearance() { const frag = new DocumentFragment(); - let r = []; + let linkArray = []; frag.append(availableAssistantAppearances()); if (V.policies.publicPA === 1) { @@ -155,7 +201,7 @@ globalThis.personalAssistantOptions = function() { /* if (!V.assistant.Extra1) { const monsterCost = Math.trunc(10000 * V.upgradeMultiplier); - App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link( + App.UI.DOM.appendNewElement("div", frag, App.UI.DOM.link( "Purchase a set of monstergirl appearances", () => { V.event = ""; @@ -168,38 +214,42 @@ globalThis.personalAssistantOptions = function() { `Costs${cashFormat(monsterCost)}` )); } else { - App.UI.DOM.appendNewElement("div", node, `You have downloaded a set of monstergirl appearances for your avatar.`); + App.UI.DOM.appendNewElement("div", frag, `You have downloaded a set of monstergirl appearances for your avatar.`); } */ if (!V.assistant.Extra2) { - let _price = 10000 * V.upgradeMultiplierArcology; - App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link( + const price = (V.PC.skill.hacking < 75) ? 10000 * V.upgradeMultiplierArcology : 0; + App.UI.DOM.appendNewElement("div", frag, App.UI.DOM.link( `${V.PC.skill.hacking < 75 ? "Purchase" : "Acquire"} a set of heaven and hell themed appearances`, () => { V.assistant.Extra2 = 1; - if (V.PC.skill.hacking < 75) { - cashX(Math.trunc(-_price), "capEx"); - } + cashX(Math.trunc(-price), "capEx"); }, [], "Assistant Appearance Pack Two", - (V.PC.skill.hacking < 75) ? `Costs ${cashFormat(_price)}` : `Unencrypted files, ripe for the taking` + (price) ? `Costs ${cashFormat(price)}` : `Unencrypted files, ripe for the taking` )); } else { - App.UI.DOM.appendNewElement("div", node, `You have downloaded a set of heavenly and hellish appearances for your avatar.`); + App.UI.DOM.appendNewElement("div", frag, `You have downloaded a set of heavenly and hellish appearances for your avatar.`); } - /* Choose ${hisA} FS appearance */ + /* Choose his FS appearance */ if (V.assistant.fsOptions && V.assistant.appearance !== "normal") { - // <h3>Society-specific setting:</h3> + App.UI.DOM.appendNewElement("h3", frag, "Society-specific setting:"); + let r = []; r.push(`${HeA} can further refine ${hisA} avatar to match the arcology's social`); if (V.assistant.fsAppearance !== "default") { - r.push(`profile; ${hisA} current variation shows ''V.assistant.fsAppearance'' touches.`); + r.push( + `profile; ${hisA} current variation shows`, + App.UI.DOM.makeElement("span", V.assistant.fsAppearance, "bold"), + `touches.` + ); } else { r.push(`profile, though no details stand out right now.`); } + App.Events.addNode(frag, r, "div"); - /**@type {Map<fsAssistantAppearance, string>} */ + /** @type {Map<fsAssistantAppearance, string>} */ const appearanceWithFS = new Map([ ["gender radicalist", "FSGenderRadicalistDecoration"], ["gender fundamentalist", "FSGenderFundamentalistDecoration"], @@ -238,19 +288,18 @@ globalThis.personalAssistantOptions = function() { makeFSlink(selection); } } + App.UI.DOM.appendNewElement("div", frag, App.UI.DOM.generateLinksStrip(linkArray)); } - App.Events.addParagraph(frag, r); return frag; - } - - function makeFSlink(selection) { - const link = App.UI.DOM.link( - selection, - () => V.assistant.fsAppearance = selection - ); - link.style.textTransform = "capitalize"; - linkArray.push(link); + function makeFSlink(selection) { + const link = App.UI.DOM.link( + selection, + () => V.assistant.fsAppearance = selection + ); + link.style.textTransform = "capitalize"; + linkArray.push(link); + } } };