diff --git a/src/005-passages/facilitiesPassages.js b/src/005-passages/facilitiesPassages.js index 095beed8ac18cfb7f25bce4f2eeba2aa39f89cd5..546d9423f836afa680c4156991eb7e1ac5743d42 100644 --- a/src/005-passages/facilitiesPassages.js +++ b/src/005-passages/facilitiesPassages.js @@ -77,7 +77,7 @@ new App.DomPassage("Toy Shop", return App.UI.toyShop(); }, ["jump-to-safe", "jump-from-safe"] ); - +/* new App.DomPassage("Manage Penthouse", () => { V.nextButton = "Back"; @@ -86,3 +86,4 @@ new App.DomPassage("Manage Penthouse", return App.UI.managePenthouse(); }, ["jump-to-safe", "jump-from-safe"] ); +*/ \ No newline at end of file diff --git a/src/facilities/penthouse/managePenthouse.tw b/src/facilities/penthouse/managePenthouse.tw index 433fc91ecbafdca45094175632ff18d77dd95f59..0173649ed66bcfaf1de9bf5be214965a612b4248 100644 --- a/src/facilities/penthouse/managePenthouse.tw +++ b/src/facilities/penthouse/managePenthouse.tw @@ -1,7 +1,9 @@ :: Manage Penthouse [nobr jump-to-safe jump-from-safe] <<set $nextButton = "Back", $nextLink = "Main", $encyclopedia = "What the Upgrades Do">> - +<h1>DOM</h1> + <<includeDOM App.UI.managePenthouse()>> +<h1>SC</h1> <<if $cheatMode == 1>> <div class="cheat-menu">[[Cheat Edit Arcology|MOD_Edit Arcology Cheat][$cheater = 1]]</div> <</if>> @@ -48,6 +50,15 @@ <h2>Penthouse Facilities</h2> <p> + <div> + <<if $masterSuite == 0>> + [[Improve your master bedroom to house a harem of personal toys|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $masterSuite = 1, $PC.skill.engineering += 1]] + <span class="detail">Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>></span> + <<else>> + Your penthouse is capped by a master suite with room for an entire harem of personal toys. + <</if>> + </div> + <div> <<if $servantsQuarters == 0>> [[Build a dormitory to house large numbers of house servants|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $servantsQuarters = 5, $PC.skill.engineering += 1]] @@ -125,14 +136,6 @@ <h2>Minor Facilities</h2> <p> - <div> - <<if $masterSuite == 0>> - [[Improve your master bedroom to house a harem of personal toys|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $masterSuite = 1, $PC.skill.engineering += 1]] - <span class="detail">Costs <<print cashFormat(Math.trunc(5000*$upgradeMultiplierArcology))>></span> - <<else>> - Your penthouse is capped by a master suite with room for an entire harem of personal toys. - <</if>> - </div> <div> <<if $HGSuite != 1>> [[Build a small suite for a Head Girl to live in|Manage Penthouse][cashX(forceNeg(Math.trunc(5000*$upgradeMultiplierArcology)), "capEx"), $HGSuite = 1, $PC.skill.engineering += 1]] diff --git a/src/facilities/penthouse/penthousePassage.js b/src/facilities/penthouse/penthousePassage.js index 07383d10a21144d8793b4ea8fb2b4592f11483a9..dda1a9f2565469e6dd92fa3d9384db9c1aee2007 100644 --- a/src/facilities/penthouse/penthousePassage.js +++ b/src/facilities/penthouse/penthousePassage.js @@ -1,18 +1,14 @@ /** * UI for managing Penthouse Refreshes without refreshing the passage. */ -App.UI.managePenthouse = function(slave, cheat = false) { - const frag = new DocumentFragment(); - frag.append(intro()); - +App.UI.managePenthouse = function() { const container = document.createElement("span"); container.append(createPage()); - - frag.append(container); - return frag; + return container; function createPage() { const el = new DocumentFragment(); + el.append(intro()); el.append(capacity()); el.append(facilities()); el.append(surgery()); @@ -20,47 +16,84 @@ App.UI.managePenthouse = function(slave, cheat = false) { return el; } + function intro() { + const el = new DocumentFragment(); + if (V.cheatMode) { + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link( + "Cheat Edit Arcology", + () => { + V.cheater = 1; + }, + [], + "MOD_Edit Arcology Cheat" + )); + } + App.UI.DOM.appendNewElement("h1", el, "Penthouse"); + App.UI.DOM.appendNewElement("div", el, App.Desc.officeDescription(V.PC.career === "mercenary" ? "You look back at the rifle. It could never hold a zero, and would fail to feed if it wasn't given just the right amount of lubricant. But sometimes, you'd give anything for one more mission with that shitty old rifle." : ""), "scene-intro"); + if (V.SF.Toggle && V.SF.Active >= 1) { + App.UI.DOM.appendNewElement("div", el, + App.UI.DOM.passageLink( + `Take your express elevator down to ${V.SF.Lower}`, + "Firebase" + ) + ); + } else if (V.SF.FS.Tension > 100) { + App.UI.DOM.appendNewElement("div", el, App.SF.fsIntegration.badOutcome_Firebase()); + } + return el; + } + function capacity() { const el = new DocumentFragment(); + const cost = Math.trunc(V.dormitory * 1000 * V.upgradeMultiplierArcology); + const options = new App.UI.OptionsGroup(); + options.addOption(`The main penthouse dormitory has a capacity of ${V.dormitory} slaves.`) + .customButton( + "Expand the dormitory", + () => { + cashX(forceNeg(cost), "capEx"); + V.dormitory += 10; + V.PC.skill.engineering += .1; + }, + "Manage Penthouse" + ) + .addComment(`${cashFormat(cost)}. Houses slaves who aren't living in a facility and aren't granted a luxurious standard of living. Exceeding the dorm limit is bad for slaves' health, devotion and trust.`); + options.addOption(`Luxury rooms: capacity for ${V.rooms} slaves.`) + .customButton( + "Expand the rooms", + () => { + cashX(forceNeg(cost), "capEx"); + V.rooms += 5; + V.PC.skill.engineering += .1; + }, + "Manage Penthouse" + ) + .addComment(`${cashFormat(cost)}. The penthouse also features little individual rooms, which house slaves who enjoy a luxurious standard of living. The number of rooms determines the number of slaves that can be granted luxury.`); + + + el.append(options.render()); return el; } function facilities() { const el = new DocumentFragment(); - + const options = new App.UI.OptionsGroup(); return el; } function surgery() { const el = new DocumentFragment(); - + const options = new App.UI.OptionsGroup(); return el; } function upgrades() { const el = new DocumentFragment(); - + const options = new App.UI.OptionsGroup(); return el; } function refresh() { jQuery(container).empty().append(createPage()); } - - function intro() { - const el = new DocumentFragment(); - if (V.cheatMode) { - App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link( - "Cheat Edit Arcology", - () => { - V.cheater = 1; - }, - [], - "MOD_Edit Arcology Cheat" - )); - } - App.UI.DOM.appendNewElement("h1", el, "Penthouse"); - App.UI.DOM.appendNewElement("div", el, App.Desc.officeDescription(V.PC.career === "mercenary" ? "You look back at the rifle. It could never hold a zero, and would fail to feed if it wasn't given just the right amount of lubricant. But sometimes, you'd give anything for one more mission with that shitty old rifle." :""), "scene-intro"); - return el; - } };