diff --git a/src/004-base/facilityFramework.js b/src/004-base/facilityFramework.js index eef52a7dfbadcaac6b5a0496b8c455205110e59f..7d77a8d07f7a2ef54f2394c35432a9d20de7ab17 100644 --- a/src/004-base/facilityFramework.js +++ b/src/004-base/facilityFramework.js @@ -169,16 +169,21 @@ App.Facilities.Facility = class Facility { // sum of n terms of an arithmetic series is computed as Sn = (n/2)(2a+(n-1)d), where a is the first term being considered and d is the common difference const level = expand / 5; const exCost = Math.trunc((level / 2) * (2 * cost + (level - 1) * 5 * baseCost)); - options.push( - App.UI.DOM.link(`x${expand}`, () => { expandFacility(expand, exCost); }, [], '', `An additional ${num(expand)} slots will cost ${cashFormat(exCost)}.`) - ); + const f = new DocumentFragment(); + f.append(App.UI.DOM.link(`x${expand}`, () => { + expandFacility(expand, exCost); + })); + App.Events.addNode(f, [` (${cashFormatColor(exCost)})`]); + options.push(f); } link.append(App.UI.DOM.generateLinksStrip(options)); const linkArray = []; App.UI.DOM.appendNewElement("div", div); - div.append(`Expanding ${this.facility.name} by ${num(5)} slots will cost ${cashFormat(Math.trunc(cost))}: `); - linkArray.push(App.UI.DOM.link(`x5`, () => { expandFacility(5, Math.trunc(cost)); })); + App.Events.addNode(div, [`Expanding ${this.facility.name} by ${num(5)} slots will cost ${cashFormatColor(Math.trunc(cost))}: `]); + linkArray.push(App.UI.DOM.link(`x5`, () => { + expandFacility(5, Math.trunc(cost)); + })); if (options.length > 0) { linkArray.push(App.UI.DOM.linkReplace(`Additional options`, link)); } @@ -255,7 +260,7 @@ App.Facilities.Facility = class Facility { } if ((rule.object && _.isEqual(rule.object[rule.property], o.value)) || - _.isEqual(V[rule.property], o.value)) { + _.isEqual(V[rule.property], o.value)) { App.UI.DOM.appendNewElement("div", div, o.text); } } @@ -383,7 +388,7 @@ App.Facilities.Facility = class Facility { * * @returns {string} */ - get intro() { + get intro() { return null; } @@ -392,7 +397,7 @@ App.Facilities.Facility = class Facility { * * @returns {string} */ - get decorations() { + get decorations() { return null; } @@ -468,7 +473,7 @@ App.Facilities.Facility = class Facility { * * @returns {Array<HTMLDivElement|DocumentFragment>} */ - get customNodes() { + get customNodes() { return []; } }; diff --git a/src/futureSocieties/fsPassage.js b/src/futureSocieties/fsPassage.js index a80ecb9a5ce46be04ba04cc1bdb042aa230a7ae6..e0e9be9cb304dcd115d2aa1cf79792b36810c76b 100644 --- a/src/futureSocieties/fsPassage.js +++ b/src/futureSocieties/fsPassage.js @@ -1090,7 +1090,7 @@ App.UI.fsPassage = function() { } if (FSCredits > 0) { if (arc.FSNull < V.FSLockinLevel) { - r.push(advanceRel(25)); + r.push("/", advanceRel(25)); } } } else { @@ -1107,7 +1107,7 @@ App.UI.fsPassage = function() { } if (FSCredits > 0) { if (arc.FSNull < V.FSLockinLevel) { - r.push(advanceRel(17)); + r.push("/", advanceRel(17)); } } } else { @@ -1124,7 +1124,7 @@ App.UI.fsPassage = function() { } if (FSCredits > 0) { if (arc.FSNull < V.FSLockinLevel) { - r.push(advanceRel(15)); + r.push("/", advanceRel(15)); } } } else { @@ -1141,7 +1141,7 @@ App.UI.fsPassage = function() { } if (FSCredits > 0) { if (arc.FSNull < V.FSLockinLevel) { - r.push(advanceRel(20)); + r.push("/", advanceRel(20)); } } } else { @@ -1177,36 +1177,25 @@ App.UI.fsPassage = function() { } function advanceRel(num) { - return App.UI.DOM.link( - "Advance", - () => { - if (arc.FSNull !== "unset") { - arc.FSNull += num; - } - App.UI.reload(); - }, - [], - "", - "a further commitment to allow your arcology's citizens cultural freedom" - ); + const f = new DocumentFragment(); + f.append(App.UI.DOM.link("Advance", () => { + if (arc.FSNull !== "unset") { + arc.FSNull += num; + } + App.UI.reload(); + })); + App.UI.DOM.appendNewElement("span", f, " Further your commitment to allow your arcology's citizens cultural freedom.", ["note"]); + return f; } function MulticulturalismRel(num) { - const multicultural = App.UI.DOM.makeElement( - "span", - App.UI.DOM.link( - "Multiculturalism", - () => { - arc.FSNull = num; - App.UI.reload(); - }, - [], - "", - "a commitment to allow your arcology's citizens cultural freedom." - ) - ); - multicultural.append(` is an alternative to societal advancement, and will not advance naturally.`); - return multicultural; + const f = new DocumentFragment(); + f.append(App.UI.DOM.link("Multiculturalism", () => { + arc.FSNull = num; + App.UI.reload(); + })); + f.append(` is a commitment to allow your arcology's citizens cultural freedom. It is an alternative to societal advancement, and will not advance naturally.`); + return f; } /* Revival section */ diff --git a/src/js/makePurchase.js b/src/js/makePurchase.js index e715a30d18bbf11c1cc5413d2cb1ec1b1b251a03..1a13728e694075b1e0df2586c357de2f627ebf73 100644 --- a/src/js/makePurchase.js +++ b/src/js/makePurchase.js @@ -31,8 +31,9 @@ globalThis.makePurchase = function(text, cost, what, {notes, handler, prereqs, r const price = cost !== 0 ? `${cashFormat(Math.trunc(cost))}` : `free`; const button = App.UI.DOM.makeElement("button", capFirstChar(price), ['purchase-button']); - if (V.cash >= cost && - (!prereqs || prereqs.every(prereq => prereq[0] === true))) { + const disabledReasons = isDisabled(); + + if (disabledReasons.length === 0) { button.onclick = execute; if (notes) { @@ -59,22 +60,9 @@ globalThis.makePurchase = function(text, cost, what, {notes, handler, prereqs, r } else { const span = document.createElement("span"); const ul = document.createElement("ul"); - const reasons = []; - - if (V.cash < cost) { - reasons.push(`You lack the necessary funds to make this purchase`); - } - - if (prereqs) { - prereqs.forEach(prereq => { - if (prereq[0] !== true) { - reasons.push(prereq[1]); - } - }); - } - if (reasons.length > 1) { - for (const li of reasons.map(reason => { + if (disabledReasons.length > 1) { + for (const li of disabledReasons.map(reason => { const li = document.createElement("li"); li.append(reason); return li; @@ -84,7 +72,7 @@ globalThis.makePurchase = function(text, cost, what, {notes, handler, prereqs, r span.append(ul); } else { - span.append(reasons[0]); + span.append(disabledReasons[0]); } button.classList.add("disabled"); @@ -104,35 +92,37 @@ globalThis.makePurchase = function(text, cost, what, {notes, handler, prereqs, r function renderLink() { const span = App.UI.DOM.makeElement("span", null, ['indent']); - const price = [`${cost !== 0 ? `Costs ${cashFormat(Math.trunc(cost))}` : `Free`}`]; + const price = [`${cost !== 0 ? `Costs ${cashFormatColor(Math.trunc(cost), V.cash < cost)}` : `Free`}`]; if (notes) { price.push(...notes); } - if (V.cash >= cost && - (!prereqs || prereqs.every(prereq => prereq[0] === true))) { - span.append(App.UI.DOM.link(text, execute, [], ''), " "); - } else { - const reasons = []; + const disabledReasons = isDisabled(); - if (V.cash < cost) { - reasons.push(`You cannot afford this purchase`); - } - - if (prereqs) { - prereqs.forEach(prereq => { - if (prereq[0] !== true) { - reasons.push(prereq[1]); - } - }); - } - - span.append(App.UI.DOM.disabledLink(text, reasons), " "); + if (disabledReasons.length === 0) { + span.append(App.UI.DOM.link(text, execute), " "); + } else { + span.append(App.UI.DOM.disabledLink(text, disabledReasons), " "); } - App.UI.DOM.appendNewElement("span", span, toSentence(price), ['note']); + App.Events.addNode(span, [toSentence(price)], "span", ["note"]); return span; } + + function isDisabled() { + const disabledReasons = []; + if (V.cash < cost) { + disabledReasons.push(`You cannot afford this purchase`); + } + if (prereqs) { + prereqs.forEach(prereq => { + if (prereq[0] !== true) { + disabledReasons.push(prereq[1]); + } + }); + } + return disabledReasons; + } }; diff --git a/src/npc/generate/newSlaveIntro.js b/src/npc/generate/newSlaveIntro.js index 2bf2a287ba4b605b9df7b8fb304449193fc4de99..4fc0e3a6244f15616f40ddaf56ef8b8b00b6dc3c 100644 --- a/src/npc/generate/newSlaveIntro.js +++ b/src/npc/generate/newSlaveIntro.js @@ -1084,7 +1084,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = slave.trust -= 10; return r.join(" "); }, - get requirements() { return (canDoAnal(slave)); } + get requirements() { + return (canDoAnal(slave)); + } }); choice({ linkName: `Cruelly castrate ${him}`, @@ -1111,7 +1113,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = App.Events.refreshEventArt(slave); return r.join(" "); }, - get requirements() { return ((slave.indentureRestrictions <= 0) && (V.seeExtreme === 1)); } + get requirements() { + return ((slave.indentureRestrictions <= 0) && (V.seeExtreme === 1)); + } }); break; case "$He asked to be enslaved out of naïve infatuation with you.": @@ -1150,7 +1154,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = return r.join(" "); }, - get requirements() { return (canDoAnal(slave) || canDoVaginal(slave)); } + get requirements() { + return (canDoAnal(slave) || canDoVaginal(slave)); + } }); choice({ linkName: `Make sure ${he} knows ${he} made a mistake`, @@ -1174,7 +1180,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = slave.trust -= 10; return r.join(" "); }, - get requirements() { return (canDoAnal(slave)); } + get requirements() { + return (canDoAnal(slave)); + } }); break; case "$He asked to be enslaved in the hope you'd treat a fellow woman well.": @@ -1246,7 +1254,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = slave.trust += 10; return r.join(" "); }, - get requirements() { return canDoAnal(slave); } + get requirements() { + return canDoAnal(slave); + } }); break; case "$He was transformed and enslaved after $he fell into debt to you.": @@ -1277,7 +1287,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = slave.anus = 1; return r.join(" "); }, - get requirements() { return (canDoAnal(slave)); } + get requirements() { + return (canDoAnal(slave)); + } }); break; case "$He offered $himself to you as a slave to escape a life of boredom.": @@ -1298,7 +1310,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = slave.anus = 1; return r.join(" "); }, - get requirements() { return (canDoAnal(slave)); } + get requirements() { + return (canDoAnal(slave)); + } }); break; case "$He sold $himself into slavery out of fear that life on the streets was endangering $his pregnancy.": @@ -1325,7 +1339,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = slave.anus = 1; return r.join(" "); }, - get requirements() { return (canDoAnal(slave)); } + get requirements() { + return (canDoAnal(slave)); + } }); break; case "$He offered $himself to you as a slave to escape the hard life of a free whore.": @@ -2794,7 +2810,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = if (slave.vagina === 0) { choice({ // TODO: tankBorn - get linkName() { return (tankBorn) ? `Take ${his} virginity` : `Tie ${him} up and take ${his} virginity`; }, + get linkName() { + return (tankBorn) ? `Take ${his} virginity` : `Tie ${him} up and take ${his} virginity`; + }, result(slave) { const r = []; if (tankBorn) { @@ -3362,7 +3380,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } if (PC.vagina !== -1 && slave.dick > 0 && canAchieveErection(slave)) { choice({ - get linkName() { return (tankBorn) ? `Dominate ${his} penis` : `Dominate ${his} penis and demonstrate ${his} place`; }, + get linkName() { + return (tankBorn) ? `Dominate ${his} penis` : `Dominate ${his} penis and demonstrate ${his} place`; + }, result(slave) { const el = new DocumentFragment(); let r = []; @@ -3524,7 +3544,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = if (PC.belly >= 3000 && hasAnyArms(slave)) { choice({ // TODO: tankBorn - get linkName() { return (tankBorn) ? `Permit ${him} to explore your pregnancy` : `Make ${him} worship your pregnancy`; }, + get linkName() { + return (tankBorn) ? `Permit ${him} to explore your pregnancy` : `Make ${him} worship your pregnancy`; + }, result(slave) { const r = []; if (tankBorn) { @@ -3585,7 +3607,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = if (PC.pregMood === 2 && PC.vagina > 0 && canPenetrate(slave)) { choice({ // TODO: tankBorn - get linkName() { return (tankBorn) ? `Teach ${him} how to satisfy a pregnant ${womanP}` : `${He} has a dick and you need it`; }, + get linkName() { + return (tankBorn) ? `Teach ${him} how to satisfy a pregnant ${womanP}` : `${He} has a dick and you need it`; + }, result(slave) { const r = []; if (tankBorn) { @@ -3772,7 +3796,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = if (PC.boobs >= 800 && slave.boobs <= PC.boobs - 200 && slave.boobs >= 300) { choice({ // TODO: tankBorn - get linkName() { return (tankBorn) ? `Permit ${him} to explore your expansive bust` : `Let your ample bust dominate ${his} pathetic one`; }, + get linkName() { + return (tankBorn) ? `Permit ${him} to explore your expansive bust` : `Let your ample bust dominate ${his} pathetic one`; + }, result(slave) { const el = new DocumentFragment(); let r = []; @@ -4904,7 +4930,7 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } } if (slave.boobs >= 1000 && V.arcologies[0].FSTransformationFetishistResearch === 1) { - linkArray.push( + linkArray.push(optionWithNote( App.UI.DOM.link( `Implant a heaving pair of 4000cc fillable implants in ${his} chest`, () => { @@ -4931,13 +4957,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } r.push(`${his} new ridiculous fake tits. ${He}'s <span class="hotpink">deliriously happy</span> that ${he} has ${his} own pair of giant breasts hanging from ${his} stretched chest and <span class="mediumaquamarine">hopes</span> you have plans to make them even bigger, even though ${he} is already struggling to keep upright. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`); jQuery("#introResult").empty().append(r.join(" ")); - }, - [], - "", - `This option costs ${cashFormat(V.surgeryCost)}` - ) - ); - linkArray.push( + }), `This option costs ${cashFormat(V.surgeryCost)}` + )); + linkArray.push(optionWithNote( App.UI.DOM.link( `Implant a pair of engorged 7500cc string implants in ${his} chest`, () => { @@ -4970,14 +4992,10 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } r.push(`they'll keep growing, despite ${his} near inability to stay upright. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`); jQuery("#introResult").empty().append(r.join(" ")); - }, - [], - "", - `This option costs ${cashFormat(V.surgeryCost)}` - ) - ); + }), `This option costs ${cashFormat(V.surgeryCost)}` + )); } else if (slave.boobs < 1000) { - linkArray.push( + linkArray.push(optionWithNote( App.UI.DOM.link( `Implant a pair of 1000cc fillable implants in ${his} chest`, () => { @@ -5004,14 +5022,10 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } r.push(`${his} new fake balloons. ${He}'s <span class="hotpink">deliriously happy</span> that ${he} has ${his} own pair of big breasts hanging from ${his} chest and <span class="mediumaquamarine">hopes</span> you have plans to make them even bigger. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`); jQuery("#introResult").empty().append(r.join(" ")); - }, - [], - "", - `This option costs ${cashFormat(V.surgeryCost)}` - ) - ); + }), `This option costs ${cashFormat(V.surgeryCost)}` + )); - linkArray.push( + linkArray.push(optionWithNote( App.UI.DOM.link( `Implant a heavy pair of 1500cc string implants in ${his} chest`, () => { @@ -5044,12 +5058,8 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } r.push(`they'll keep growing. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`); jQuery("#introResult").empty().append(r.join(" ")); - }, - [], - "", - `This option costs ${cashFormat(V.surgeryCost)}` - ) - ); + }), `This option costs ${cashFormat(V.surgeryCost)}` + )); } else { r.push( App.UI.DOM.makeElement("span", `${His} breasts are already so large that basic implants will not have a noticeable enough effect to sate ${his} curiosity.`) @@ -5096,7 +5106,7 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = ); } if (V.arcologies[0].FSTransformationFetishistResearch === 1) { - linkArray.push( + linkArray.push(optionWithNote( App.UI.DOM.link( `Put ${him} into a medical coma and implant a 200000cc belly implant in ${his} abdomen`, () => { @@ -5122,14 +5132,10 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } r.push(`you can make it bigger, despite the fact that it is nearly as large as ${he} is and pins ${him} to the bed ${he} lies upon. As it was an invasive surgery, <span class="health dec">${his} health has been greatly affected.</span>`); jQuery("#introResult").empty().append(r.join(" ")); - }, - [], - "", - `This option costs ${cashFormat(V.surgeryCost)}` - ) - ); + }), `This option costs ${cashFormat(V.surgeryCost)}` + )); } - linkArray.push( + linkArray.push(optionWithNote( App.UI.DOM.link( `Implant a 2000cc belly implant in ${his} abdomen`, () => { @@ -5155,12 +5161,8 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } r.push(`you can make it bigger. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`); jQuery("#introResult").empty().append(r.join(" ")); - }, - [], - "", - `This option costs ${cashFormat(V.surgeryCost)}` - ) - ); + }), `This option costs ${cashFormat(V.surgeryCost)}` + )); p.append(interestLine); p.append(App.UI.DOM.generateLinksStrip(linkArray)); } @@ -5294,7 +5296,7 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = r.push(`door jamming hips while ${he} was around them.`); interestLine.append(r.join(" ")); if (slave.hips === 2 && V.surgeryUpgrade === 1) { - linkArray.push( + linkArray.push(optionWithNote( App.UI.DOM.link( `Surgically widen ${his} hips`, () => { @@ -5314,14 +5316,10 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } r.push(`${his} wide hips, especially since ${he} can't figure out how to roll over with them. ${He}'s <span class="hotpink">deliriously happy</span> that ${he} is ridiculously wide and <span class="mediumaquamarine">wiggles ${his} door-jammers cheerfully</span> at you whenever ${he} gets the chance. Since the surgery was invasive, <span class="health dec">${his} health has been greatly affected.</span>`); jQuery("#introResult").empty().append(r.join(" ")); - }, - [], - "", - `This option costs ${cashFormat(V.surgeryCost)}` - ) - ); + }), `This option costs ${cashFormat(V.surgeryCost)}` + )); } else if (slave.hips < 2) { - linkArray.push( + linkArray.push(optionWithNote( App.UI.DOM.link( `Surgically widen ${his} hips`, () => { @@ -5341,12 +5339,8 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } r.push(`${his} wide hips. ${He}'s <span class="hotpink">deliriously happy</span> that ${he} is wider than ever and <span class="mediumaquamarine">wiggles ${his} hips cheerfully</span> at you whenever ${he} gets the chance. Since the surgery was invasive, <span class="health dec">${his} health has been greatly affected.</span>`); jQuery("#introResult").empty().append(r.join(" ")); - }, - [], - "", - `This option costs ${cashFormat(V.surgeryCost)}` - ) - ); + }), `This option costs ${cashFormat(V.surgeryCost)}` + )); } else { r.push( App.UI.DOM.makeElement("span", `Your surgery suite is not outfitted to widen ${his} hips further.`) @@ -5410,7 +5404,7 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } } if (slave.butt >= 6 && V.arcologies[0].FSTransformationFetishistResearch === 1) { - linkArray.push( + linkArray.push(optionWithNote( App.UI.DOM.link( `Implant a heaving pair of fillable implants in ${his} rear`, () => { @@ -5431,14 +5425,10 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } r.push(`${his} new ridiculous fake ass, not that ${he} has much choice, since it has ${him} pinned to the bed. ${He}'s <span class="hotpink">deliriously happy</span> that ${he} has ${his} own pair of giant butt cheeks ballooning from ${his} bottom and <span class="mediumaquamarine">hopes</span> you have plans to make them even bigger, even though ${he} is already struggling to escape from under them. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`); jQuery("#introResult").empty().append(r.join(" ")); - }, - [], - "", - `This option costs ${cashFormat(V.surgeryCost)}` - ) - ); + }), `This option costs ${cashFormat(V.surgeryCost)}` + )); } else if (slave.butt < 6) { - linkArray.push( + linkArray.push(optionWithNote( App.UI.DOM.link( `Implant a pair of fillable implants in ${his} rear`, () => { @@ -5459,13 +5449,9 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } r.push(`${his} new fake bottom. ${He}'s <span class="hotpink">deliriously happy</span> that ${he} has ${his} own pair of big butt cheeks hanging from ${his} rear and <span class="mediumaquamarine">hopes</span> you have plans to make them even bigger. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`); jQuery("#introResult").empty().append(r.join(" ")); - }, - [], - "", - `This option costs ${cashFormat(V.surgeryCost)}` - ) - ); - linkArray.push( + }), `This option costs ${cashFormat(V.surgeryCost)}` + )); + linkArray.push(optionWithNote( App.UI.DOM.link( `Implant a heavy pair of string implants in ${his} rear`, () => { @@ -5492,12 +5478,8 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } r.push(`they'll keep growing. As with all surgery <span class="health dec">${his} health has been slightly affected.</span>`); jQuery("#introResult").empty().append(r.join(" ")); - }, - [], - "", - `This option costs ${cashFormat(V.surgeryCost)}` - ) - ); + }), `This option costs ${cashFormat(V.surgeryCost)}` + )); } else { r.push( App.UI.DOM.makeElement("span", `${His} butt is already so large that basic implants will not have a noticeable enough effect to sate ${his} curiosity.`) @@ -5509,4 +5491,15 @@ App.UI.newSlaveIntro = function(slave, slave2, {tankBorn = false, momInterest = } return p; } + + /** + * @param {HTMLAnchorElement} link + * @param {string} note + */ + function optionWithNote(link, note) { + const f = new DocumentFragment(); + f.append(link, " "); + App.Events.addNode(f, [note], "span", "note"); + return f; + } }; diff --git a/src/personalAssistant/assistantOptions.js b/src/personalAssistant/assistantOptions.js index ceb48e35c2c464cbca071a8063027b51fa99ed1b..e4ba712a4b67ec78f408a7bb4bcbbe1e691d03bb 100644 --- a/src/personalAssistant/assistantOptions.js +++ b/src/personalAssistant/assistantOptions.js @@ -46,9 +46,9 @@ App.UI.personalAssistantOptions = function() { tabBar.addTab("Computer Core Upgrades", "upgrades", upgrades()); if (V.week >= 11) { tabBar.addTab("Settings", "settings", settings()); - if (V.assistant.personality !== 0 && V.assistant.options) { - tabBar.addTab("Appearance", "appearance", appearance()); - } + } + if (V.assistant.personality !== 0 && V.assistant.options) { + tabBar.addTab("Appearance", "appearance", appearance()); } node.append(tabBar.render()); @@ -200,17 +200,19 @@ App.UI.personalAssistantOptions = function() { } */ if (!V.assistant.Extra2) { - 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`, + const price = (V.PC.skill.hacking < 75) ? Math.trunc(10000 * V.upgradeMultiplierArcology) : 0; + const div = document.createElement("div"); + div.append(App.UI.DOM.link( + `${price ? "Purchase" : "Acquire"} a set of heaven and hell themed appearances`, () => { V.assistant.Extra2 = 1; - cashX(Math.trunc(-price), "capEx"); + cashX(-price, "capEx"); }, [], "Assistant Appearance Pack Two", - (price) ? `Costs ${cashFormat(price)}` : `Unencrypted files, ripe for the taking` )); + App.Events.addNode(div, [price ? ` Costs ${cashFormatColor(price)}` : ` Unencrypted files, ripe for the taking`], "span", "note"); + frag.append(div); } else { App.UI.DOM.appendNewElement("div", frag, `You have downloaded a set of heavenly and hellish appearances for your avatar.`); }