diff --git a/src/facilities/fsPassage.js b/src/facilities/fsPassage.js index aad78c0bdfaba982f1dbf4ebd7e558476de026a5..a9cd1a1e6b6e16432b21db360c75e81dfab19a56 100644 --- a/src/facilities/fsPassage.js +++ b/src/facilities/fsPassage.js @@ -3,6 +3,7 @@ App.UI.FSPassage = function() { const arc = V.arcologies[0]; const {hisA} = getPronouns(assistant.pronouns().main).appendSuffix('A'); V.FSReminder = ""; + const _FSCredits = FutureSocieties.availCredits(); setup(); el.append(FSPerception()); @@ -17,7 +18,10 @@ App.UI.FSPassage = function() { "MOD_Edit FS Cheat" )); } + + el.append(overview()); el.append(unlocks()); + el.append(spending()); return el; @@ -415,6 +419,20 @@ App.UI.FSPassage = function() { return el; } + function overview() { + const el = new DocumentFragment(); + const r = []; + if (_FSCredits > 0) { + r.push(App.UI.DOM.makeElement("span", `${V.arcologies[0].name}'s society is ready to begin accepting a new societal direction.`, "yellow")); + } else if (V.FSGotRepCredits >= 3) { + r.push(`Your society is so radically changed that it is starting to take on a life of its own. The major decisions about its direction have been made.`); + } else { + r.push(`You must develop your reputation further for ${V.arcologies[0].name}'s society to be ready for a new societal direction.`); + } + App.Events.addNode(el, r, "div"); + return el; + } + function unlocks() { const el = new DocumentFragment(); const r = []; @@ -424,4 +442,208 @@ App.UI.FSPassage = function() { App.Events.addNode(el, r, "div"); return el; } + + function spending() { + const el = new DocumentFragment(); + let r = []; + const warn = (V.FSSpending > 10000); + V.FSSpending = Number(V.FSSpending) || 0; + V.FSSpending = Math.clamp(Math.ceil(V.FSSpending/1000)*1000, 0, 10000); + r.push(`You are spending ¤`); + r.push(App.UI.DOM.makeTextBox( + V.FSSpending, + (v) => { V.FSSpending = v; }, + true + )); + r.push(`each week to support your societal goals.`); + App.Events.addNode(el, r, "div"); + if (warn) { + App.UI.DOM.appendNewElement("div", el, `Spending more than ${cashFormat(10000)} weekly would be counterproductive`, "note"); + } + return el; + } + + function rename() { + const el = document.createElement('span'); + el.id = "mass"; + // Make title + if (V.arcologies[0].FSChattelReligionist !== "unset" + || V.arcologies[0].FSPastoralist !== "unset" + || V.arcologies[0].FSRomanRevivalist !== "unset" + || V.arcologies[0].FSNeoImperialist !== "unset" + || V.arcologies[0].FSAztecRevivalist !== "unset" + || V.arcologies[0].FSEgyptianRevivalist !== "unset" + || V.arcologies[0].FSEdoRevivalist !== "unset" + || V.arcologies[0].FSDegradationist !== "unset" + || V.arcologies[0].FSPaternalist !== "unset" + || V.arcologies[0].FSIntellectualDependency !== "unset") { + App.UI.DOM.appendNewElement("h3", el, "Names"); + } + const linkArray = []; + + if (V.arcologies[0].FSChattelReligionist !== "unset") { + linkArray.push( + App.UI.DOM.link( + "Give all your slaves devotional names", + () => { + for (const slave of V.slaves) { + slave.slaveName = setup.chattelReligionistSlaveNames.random(); + } + refresh(); + } + ) + ); + } + + if (V.arcologies[0].FSPastoralist !== "unset") { + linkArray.push( + App.UI.DOM.link( + "Give all your lactating slaves cow names", + () => { + for (const slave of V.slaves) { + slave.slaveName = setup.cowSlaveNames.random(); + } + refresh(); + } + ) + ); + } + + if (V.arcologies[0].FSIntellectualDependency !== "unset") { + linkArray.push( + App.UI.DOM.link( + "Give all your idiotic slaves stripper names", + () => { + for (const slave of V.slaves) { + slave.slaveName = setup.bimboSlaveNames.random(); + } + refresh(); + } + ) + ); + } + + if (V.arcologies[0].FSRomanRevivalist !== "unset") { + linkArray.push( + App.UI.DOM.link( + "Rename all your slaves according to Roman custom", + () => { + for (const slave of V.slaves) { + slave.slaveName = setup.romanSlaveNames.random(), + slave.slaveSurname = setup.romanSlaveSurnames.random(); + } + refresh(); + } + ) + ); + } else if (V.arcologies[0].FSAztecRevivalist !== "unset") { + linkArray.push( + App.UI.DOM.link( + "Rename all your slaves according to ancient Aztec custom", + () => { + for (const slave of V.slaves) { + slave.slaveName = setup.aztecSlaveNames.random(), + slave.slaveSurname = 0; + } + refresh(); + } + ) + ); + } else if (V.arcologies[0].FSEgyptianRevivalist !== "unset") { + linkArray.push( + App.UI.DOM.link( + "Rename all your slaves according to ancient Egyptian custom", + () => { + for (const slave of V.slaves) { + slave.slaveName = setup.ancientEgyptianSlaveNames.random(), + slave.slaveSurname = 0; + } + refresh(); + } + ) + ); + } else if (V.arcologies[0].FSEdoRevivalist !== "unset") { + linkArray.push( + App.UI.DOM.link( + "Rename all your slaves according to feudal Japanese custom", + () => { + for (const slave of V.slaves) { + slave.slaveName = setup.edoSlaveNames.random(), + slave.slaveSurname = setup.edoSlaveSurnames.random(); + } + refresh(); + } + ) + ); + } + if (V.arcologies[0].FSDegradationist !== "unset") { + linkArray.push( + App.UI.DOM.link( + "Rename all your slaves according to Degradationist custom", + () => { + for (const slave of V.slaves) { + DegradingName(slave); + } + refresh(); + } + ) + ); + } + + if (V.arcologies[0].FSPaternalist !== "unset") { + linkArray.push( + App.UI.DOM.link( + "Rename your obedient slaves according to Paternalist custom", + () => { + for (const slave of V.slaves) { + if (slave.devotion > 20 || (slave.devotion >= -20 && slave.trust < -20)) { + const _toSearch = slave.slaveName; + if (_toSearch.indexOf("Miss") === -1) { + if (_toSearch.indexOf("Ms.") === -1) { + if (_toSearch.indexOf("Mrs.") === -1) { + if (slave.relationship > 4) { + /* + <<for V.j = 0; V.j < V.slaves.length; V.j++>> + if (slave.relationshipTarget === V.slaves[V.j].ID) { + slave.slaveName = ("Mrs. " + slave.slaveName + " " + V.slaves[V.j].slaveName); + } + <</for>> + */ + slave.slaveName = ("Mrs. " + slave.slaveName); + } else if ((slave.actualAge > 24)) { + slave.slaveName = ("Ms. " + slave.slaveName); + } else { + slave.slaveName = ("Miss " + slave.slaveName); + } + } + } + } + } + } + refresh("Obedient slaves renamed."); + } + ) + ); + } + + if (V.arcologies[0].FSIntellectualDependency !== "unset") { + linkArray.push( + App.UI.DOM.link( + "Give all your slaves simple bimbo names", + () => { + for (const slave of V.slaves) { + slave.slaveName = setup.bimboSlaveNames.random(); + slave.slaveSurname = 0; + } + refresh(); + } + ) + ); + } + return el; + + function refresh(text = "Slaves renamed.") { + jQuery("#mass").empty().append(text); + } + } }; diff --git a/src/uncategorized/futureSociety.tw b/src/uncategorized/futureSociety.tw index 11f44c670eb6616838e7cb4a489b2a9c915e2355..f30b2ac185c36f6478bf836813e3930e0d755fc3 100644 --- a/src/uncategorized/futureSociety.tw +++ b/src/uncategorized/futureSociety.tw @@ -5,39 +5,6 @@ - -You have unlocked -<span class="note"> - <<= num($FSGotRepCredits, true)>> - of <<= num($FSCreditCount, true)>> -</span> -possible societal customizations. - -/* -You are spending <<print cashFormat($FSSpending)>> each week to support your societal goals. -<<if $FSSpending > 900>> - [[Decrease|Future Society][$FSSpending -= 1000]] | -<<else>> - Decrease | -<</if>> -<<if $FSSpending < 10000>> - <<link "Increase">><<set $FSSpending += 1000>><<goto "Future Society">><</link>> -<<else>> - Increase -<</if>> -*/ -<<if $FSSpending > 10000>><<set _warn = 1>><</if>> -<<set $FSSpending = Number($FSSpending) || 0>> -<<set $FSSpending = Math.clamp(Math.ceil($FSSpending/1000)*1000, 0, 10000)>> -<div> - You are spending ¤<<textbox "_newFSSpending" $FSSpending>> each week to support your societal goals. [[Save changes|Future Society][$FSSpending = Number(_newFSSpending) || 0]] -</div> -<<if _warn>> - <div class="note"> - Spending more than <<print cashFormat(10000)>> weekly would be counterproductive - </div> -<</if>> - <span id="mass"> <<if $arcologies[0].FSChattelReligionist != "unset"