Skip to content
Snippets Groups Projects
Commit b853d946 authored by lowercasedonkey's avatar lowercasedonkey
Browse files

hook up and polish

parent 7add2e19
No related branches found
No related tags found
1 merge request!10001Assistant options
...@@ -106,11 +106,19 @@ new App.DomPassage("Coursing Association", ...@@ -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", new App.DomPassage("Assistant Appearance Pack Two",
() => { () => {
V.nextButton = "Back"; V.nextButton = "Back";
V.nextLink = "Personal assistant options"; V.nextLink = "Personal assistant options";
return assistantAppearancePackTwo(); return App.UI.assistantAppearancePackTwo();
} }
); );
......
globalThis.assistantAppearancePackTwo = function() { App.UI.assistantAppearancePackTwo = function() {
const node = new DocumentFragment(); const node = new DocumentFragment();
App.Events.drawEventArt(node, "assistant"); App.Events.drawEventArt(node, "assistant");
......
globalThis.personalAssistantOptions = function() { App.UI.personalAssistantOptions = function() {
// :: Personal assistant options [nobr jump-to-safe jump-from-safe] const node = new DocumentFragment();
V.nextButton = "Back";
V.nextLink = "Main";
assistant.object(); assistant.object();
const node = new DocumentFragment();
let linkArray = [];
const artFrame = V.seeImages ? App.UI.DOM.assistantArt(3) : document.createElement("span"); const artFrame = V.seeImages ? App.UI.DOM.assistantArt(3) : document.createElement("span");
if (V.seeImages) { if (V.seeImages) {
node.append(artFrame); node.append(artFrame);
} }
const { const {
HeA, HeA, HisA,
heA, hisA, himA, himselfA heA, hisA, himA, himselfA
} = getPronouns(assistant.pronouns().main).appendSuffix("A"); } = getPronouns(assistant.pronouns().main).appendSuffix("A");
...@@ -27,7 +21,7 @@ globalThis.personalAssistantOptions = function() { ...@@ -27,7 +21,7 @@ globalThis.personalAssistantOptions = function() {
)); ));
if (V.assistant.name !== "your personal assistant") { if (V.assistant.name !== "your personal assistant") {
r.push(App.UI.DOM.link( r.push(App.UI.DOM.link(
"Stop using a custom name", "(Stop using a custom name)",
() => { () => {
V.assistant.name = "your personal assistant"; V.assistant.name = "your personal assistant";
App.UI.reload(); App.UI.reload();
...@@ -40,11 +34,9 @@ globalThis.personalAssistantOptions = function() { ...@@ -40,11 +34,9 @@ globalThis.personalAssistantOptions = function() {
r.push(`in a corner of your desk's glass top.`); r.push(`in a corner of your desk's glass top.`);
App.Events.addParagraph(node, r); App.Events.addParagraph(node, r);
r = [];
App.UI.DOM.appendNewElement("p", node, PersonalAssistantAppearance()); App.UI.DOM.appendNewElement("p", node, PersonalAssistantAppearance());
if (V.assistant.power > 0) { 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.`); 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 { } else {
...@@ -61,82 +53,136 @@ globalThis.personalAssistantOptions = function() { ...@@ -61,82 +53,136 @@ globalThis.personalAssistantOptions = function() {
} }
node.append(tabBar.render()); node.append(tabBar.render());
return node;
function upgrades() { function upgrades() {
const frag = new DocumentFragment(); const frag = new DocumentFragment();
let r = [];
if (V.assistant.power === 0) { 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.`); const memoryCost = Math.trunc(20000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier);
// Will cost ${cashFormat(Math.trunc(20000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier))}// App.Events.addParagraph(frag, [
// [[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]] `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) { } else if (V.assistant.power === 1) {
r.push(`The next upgrade needed is a liquid nitrogen cooling system to allow for extensive overclocking.`); const coolingCost = Math.trunc(35000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier);
// Will cost ${cashFormat(Math.trunc(35000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier))} App.Events.addParagraph(frag, [
r.push(`and will allow you to upgrade the smart piercings in ${V.arcologies[0].name}//`); `The next upgrade needed is a liquid nitrogen cooling system to allow for extensive overclocking.`,
// [[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]] 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) { } else if (V.assistant.power === 2) {
r.push(`The final upgrade needed is a transition to optical RAM.`); const opticalCost = Math.trunc(50000 * V.upgradeMultiplierArcology * V.HackingSkillMultiplier);
// Will cost ${cashFormat(Math.trunc(50000*V.upgradeMultiplierArcology*V.HackingSkillMultiplier))//} App.Events.addParagraph(frag, [
// [[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]] `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 { } 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; return frag;
} }
function settings() { function settings() {
const frag = new DocumentFragment(); const frag = new DocumentFragment();
let r = []; let r = [];
// <h3>Behavior:</h3> App.UI.DOM.appendNewElement("h3", frag, "Behavior:");
if (V.assistant.personality <= 0) { 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 { } 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) { 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.`); r.push(`The arcology's upgraded computers support advanced business analysis.`);
if (V.assistant.appearance !== "normal") { 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.`); App.Events.addParagraph(frag, [
// <br> `These capabilities are represented by an avatar styled after ${V.assistant.name}'s, with which ${heA} simulates a`,
if (V.assistant.market.relationship !== "cute") { App.UI.DOM.makeElement("span", V.assistant.market.relationship, "bold"),
// [[Cute|Personal assistant options][V.assistant.market.relationship = "cute"]] `relationship.`
// <br> ]);
} const options = new App.UI.OptionsGroup();
if (V.assistant.market.relationship !== "romantic") { options.addOption("Relationship", "relationship", V.assistant.market)
// [[Romantic|Personal assistant options][V.assistant.market.relationship = "romantic"]] .addValueList([
// <br> ["Cute", "cute"],
} ["Romantic", "romantic"],
if (V.assistant.market.relationship !== "nonconsensual") { ["Nonconsensual", "nonconsensual"],
// [[Nonconsensual|Personal assistant options][V.assistant.market.relationship = "nonconsensual"]] ["Incestuous", "incestuous"],
// <br> ]);
} frag.append(options.render());
if (V.assistant.market.relationship !== "incestuous") {
// [[Incestuous|Personal assistant options][V.assistant.market.relationship = "incestuous"]]
// <br>
}
} else { } 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.`); 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.`);
// <br> r.push();
} }
// <br>${HeA} is
V.assistant.market.limit = Math.clamp(V.assistant.market.limit, 0, 10000000); 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) { 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]]`); options.addOption(`${HisA} investing strategy will be`, "aggressiveness", V.assistant.market)
// <br>&nbsp;&nbsp;&nbsp;&nbsp; .addValueList([
// Define custom cash limit:// ["Conservative", 0],
// <<textbox "V.assistant.market.limit" V.assistant.market.limit "Personal assistant options">> ["Aggressive", 100],
// <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]]`);
} }
frag.append(options.render());
} }
App.Events.addParagraph(frag, r); App.Events.addParagraph(frag, r);
return frag; return frag;
...@@ -144,7 +190,7 @@ globalThis.personalAssistantOptions = function() { ...@@ -144,7 +190,7 @@ globalThis.personalAssistantOptions = function() {
function appearance() { function appearance() {
const frag = new DocumentFragment(); const frag = new DocumentFragment();
let r = []; let linkArray = [];
frag.append(availableAssistantAppearances()); frag.append(availableAssistantAppearances());
if (V.policies.publicPA === 1) { if (V.policies.publicPA === 1) {
...@@ -155,7 +201,7 @@ globalThis.personalAssistantOptions = function() { ...@@ -155,7 +201,7 @@ globalThis.personalAssistantOptions = function() {
/* /*
if (!V.assistant.Extra1) { if (!V.assistant.Extra1) {
const monsterCost = Math.trunc(10000 * V.upgradeMultiplier); 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", "Purchase a set of monstergirl appearances",
() => { () => {
V.event = ""; V.event = "";
...@@ -168,38 +214,42 @@ globalThis.personalAssistantOptions = function() { ...@@ -168,38 +214,42 @@ globalThis.personalAssistantOptions = function() {
`Costs${cashFormat(monsterCost)}` `Costs${cashFormat(monsterCost)}`
)); ));
} else { } 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) { if (!V.assistant.Extra2) {
let _price = 10000 * V.upgradeMultiplierArcology; const price = (V.PC.skill.hacking < 75) ? 10000 * V.upgradeMultiplierArcology : 0;
App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link( 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.PC.skill.hacking < 75 ? "Purchase" : "Acquire"} a set of heaven and hell themed appearances`,
() => { () => {
V.assistant.Extra2 = 1; V.assistant.Extra2 = 1;
if (V.PC.skill.hacking < 75) { cashX(Math.trunc(-price), "capEx");
cashX(Math.trunc(-_price), "capEx");
}
}, },
[], [],
"Assistant Appearance Pack Two", "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 { } 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") { 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`); r.push(`${HeA} can further refine ${hisA} avatar to match the arcology's social`);
if (V.assistant.fsAppearance !== "default") { 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 { } else {
r.push(`profile, though no details stand out right now.`); 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([ const appearanceWithFS = new Map([
["gender radicalist", "FSGenderRadicalistDecoration"], ["gender radicalist", "FSGenderRadicalistDecoration"],
["gender fundamentalist", "FSGenderFundamentalistDecoration"], ["gender fundamentalist", "FSGenderFundamentalistDecoration"],
...@@ -238,19 +288,18 @@ globalThis.personalAssistantOptions = function() { ...@@ -238,19 +288,18 @@ globalThis.personalAssistantOptions = function() {
makeFSlink(selection); makeFSlink(selection);
} }
} }
App.UI.DOM.appendNewElement("div", frag, App.UI.DOM.generateLinksStrip(linkArray));
} }
App.Events.addParagraph(frag, r);
return frag; return frag;
}
function makeFSlink(selection) { function makeFSlink(selection) {
const link = App.UI.DOM.link( const link = App.UI.DOM.link(
selection, selection,
() => V.assistant.fsAppearance = selection () => V.assistant.fsAppearance = selection
); );
link.style.textTransform = "capitalize"; link.style.textTransform = "capitalize";
linkArray.push(link); linkArray.push(link);
}
} }
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment