diff --git a/js/003-data/miscData.js b/js/003-data/miscData.js index 565fd78032f1c87ce7de4642478bbf659fccd647..5e42aeab00369c49777f64b4105788227b674c84 100644 --- a/js/003-data/miscData.js +++ b/js/003-data/miscData.js @@ -2011,7 +2011,7 @@ App.Data.misc.lawlessMarkets = [ "neighbor", "wetware", "white collar", - ...Object.keys(App.Data.misc.schools) + ...Array.from(App.Data.misc.schools.keys()) ]; App.Data.weather = { diff --git a/src/endWeek/economics/arcmgmt.js b/src/endWeek/economics/arcmgmt.js index e38b33e3b75d24eedb480a45b382e1b889abecc2..ce822fb271c356e0679eec63da23dcfc42c73207 100644 --- a/src/endWeek/economics/arcmgmt.js +++ b/src/endWeek/economics/arcmgmt.js @@ -64,7 +64,7 @@ globalThis.arcmgmt = function() { let _arcadeUpgradeInjectors; let _AWeekGrowth; - const {HeM, heM} = (V.assistant.market) ? getPronouns(assistant.pronouns().market).appendSuffix('M') : getPronouns(assistant.pronouns().main).appendSuffix('M'); // TODO not sure how to set this is market is not defined, using main as fallback for now for testing. + const { HeM, heM } = (V.assistant.market) ? getPronouns(assistant.pronouns().market).appendSuffix('M') : getPronouns(assistant.pronouns().main).appendSuffix('M'); // TODO not sure how to set this is market is not defined, using main as fallback for now for testing. if (V.useTabs === 0) { @@ -119,7 +119,7 @@ globalThis.arcmgmt = function() { el.append(fsImpact()); el.append(policiesImpact()); - const schoolSubsidy = Object.keys(App.Data.misc.schools).reduce((acc, current) => acc + V[current].subsidize, 0); + const schoolSubsidy = Array.from(App.Data.misc.schools.keys()).reduce((acc, current) => acc + V[current].subsidize, 0); _middleClass += (schoolSubsidy) * 40; _middleClass *= 1 + (schoolSubsidy) * 0.005; @@ -369,9 +369,9 @@ globalThis.arcmgmt = function() { Math.trunc(_menialEarnings *= 1.5); } if (V.menials > 1) { - r.push(`${num(V.menials)} menial slaves${((V.menialBioreactors > 0) && (V.fuckdolls === 0)) ? ` and`:`,`}`); + r.push(`${num(V.menials)} menial slaves${((V.menialBioreactors > 0) && (V.fuckdolls === 0)) ? ` and` : `,`}`); } else { - r.push(`one menial slave${((V.menialBioreactors > 0) && (V.fuckdolls === 0)) ? ` and`:`,`}`); + r.push(`one menial slave${((V.menialBioreactors > 0) && (V.fuckdolls === 0)) ? ` and` : `,`}`); } cashX(_menialEarnings, "menialTrades"); } @@ -768,7 +768,7 @@ globalThis.arcmgmt = function() { function fsImpact() { const el = new DocumentFragment(); - const r =[]; + const r = []; if (V.arcologies[0].FSSupremacist !== "unset") { _FSScore += Math.min(V.arcologies[0].FSSupremacist, 100); @@ -1114,7 +1114,7 @@ globalThis.arcmgmt = function() { function policiesImpact() { const el = new DocumentFragment(); - const r =[]; + const r = []; if (V.policies.retirement.menial2Citizen === 1) { _slaveDemandU *= 0.8; _slaveDemandT *= 0.75; @@ -1414,331 +1414,54 @@ globalThis.arcmgmt = function() { function schools() { const el = document.createElement("p"); - let r; - if (V.TSS.schoolPresent === 1) { - r = []; - r.push(`The Slave School has a`); - if (V.TSS.schoolProsperity > 4) { - r.push(`very prosperous`); - } else if (V.TSS.schoolProsperity < -4) { - r.push(`struggling`); - } else { - r.push(`thriving`); - } - r.push(`branch campus in ${V.arcologies[0].name}.`); - if (V.TSS.schoolProsperity >= 10) { - r.push(`It is one of the finest slave schools in the world`); - if (V.rep > 19000) { - r.push(`.`); - } else { - r.push(`, <span class="green">improving your reputation.</span>`); - repX(200, "policies"); - } - V.TSS.subsidize = 0; - V.TSS.schoolProsperity = 10; - } - if (V.TSS.subsidize === 1) { - r.push(`You have a policy of subsidizing them.`); - V.TSS.schoolProsperity++; - } else if (V.TSS.subsidize === -1) { - r.push(`You have a policy of covertly undermining them.`); - V.TSS.schoolProsperity--; - } - App.Events.addNode(el, r, "div"); - } - - if (V.TUO.schoolPresent === 1) { - r = []; - r.push(`The Utopian Orphanage has a`); - if (V.TUO.schoolProsperity > 4) { - r.push(`very prosperous`); - } else if (V.TUO.schoolProsperity < -4) { - r.push(`struggling`); - } else { - r.push(`thriving`); - } - r.push(`branch campus in ${V.arcologies[0].name}.`); - if (V.TUO.schoolProsperity >= 10) { - r.push(`It is one of the finest slave schools in the world`); - if (V.rep > 19000) { - r.push(`.`); - } else { - r.push(`, <span class="green">improving your reputation.</span>`); - repX(200, "policies"); - } - V.TUO.subsidize = 0; - V.TUO.schoolProsperity = 10; - } - if (V.TUO.subsidize === 1) { - r.push(`You have a policy of subsidizing them.`); - V.TUO.schoolProsperity++; - } else if (V.TUO.subsidize === -1) { - r.push(`You have a policy of covertly undermining them.`); - V.TUO.schoolProsperity--; - } - App.Events.addNode(el, r, "div"); - } - - if (V.GRI.schoolPresent === 1) { - r = []; - r.push(`The Growth Research Institute has a`); - if (V.GRI.schoolProsperity > 4) { - r.push(`very prosperous`); - } else if (V.GRI.schoolProsperity < -4) { - r.push(`struggling`); - } else { - r.push(`thriving`); - } - r.push(`subsidiary lab in ${V.arcologies[0].name}.`); - if (V.GRI.schoolProsperity >= 10) { - r.push(`It is one of the finest research facilities in the world`); - if (V.rep > 19000) { - r.push(`.`); - } else { - r.push(`, <span class="green">improving your reputation.</span>`); - repX(200, "policies"); - } - V.GRI.subsidize = 0; - V.GRI.schoolProsperity = 10; - } - if (V.GRI.subsidize === 1) { - r.push(`You have a policy of subsidizing them.`); - V.GRI.schoolProsperity++; - } else if (V.GRI.subsidize === -1) { - r.push(`You have a policy of covertly undermining them.`); - V.GRI.schoolProsperity--; - } - App.Events.addNode(el, r, "div"); - } - - if (V.TCR.schoolPresent === 1) { - r = []; - r.push(`The Cattle Ranch has a`); - if (V.TCR.schoolProsperity > 4) { - r.push(`very prosperous`); - } else if (V.TCR.schoolProsperity < -4) { - r.push(`struggling`); - } else { - r.push(`thriving`); - } - r.push(`local pasture in ${V.arcologies[0].name}.`); - if (V.TCR.schoolProsperity >= 10) { - r.push(`It is one of the finest slave schools in the world`); - if (V.rep > 19000) { - r.push(`.`); - } else { - r.push(`, <span class="green">improving your reputation.</span>`); - repX(200, "policies"); - } - V.TCR.subsidize = 0; - V.TCR.schoolProsperity = 10; - } - if (V.TCR.subsidize === 1) { - r.push(`You have a policy of subsidizing them.`); - V.TCR.schoolProsperity++; - } else if (V.TCR.subsidize === -1) { - r.push(`You have a policy of covertly undermining them.`); - V.TCR.schoolProsperity--; - } - App.Events.addNode(el, r, "div"); - } - - if (V.SCP.schoolPresent === 1) { - r = []; - r.push(`St. Claver Preparatory has a`); - if (V.SCP.schoolProsperity > 4) { - r.push(`very prosperous`); - } else if (V.SCP.schoolProsperity < -4) { - r.push(`struggling`); - } else { - r.push(`thriving`); - } - r.push(`branch campus in ${V.arcologies[0].name}.`); - if (V.SCP.schoolProsperity >= 10) { - r.push(`It is one of the finest slave schools in the world`); - if (V.rep > 19000) { - r.push(`.`); - } else { - r.push(`, <span class="green">improving your reputation.</span>`); - repX(200, "policies"); - } - V.SCP.subsidize = 0; - V.SCP.schoolProsperity = 10; - } - if (V.SCP.subsidize === 1) { - r.push(`You have a policy of subsidizing them.`); - V.SCP.schoolProsperity++; - } else if (V.SCP.subsidize === -1) { - r.push(`You have a policy of covertly undermining them.`); - V.SCP.schoolProsperity--; + for (const [SCH, schObj] of App.Data.misc.schools) { + if (V[SCH].schoolPresent !== 1) { + continue; } - App.Events.addNode(el, r, "div"); - } - - if (V.LDE.schoolPresent === 1) { - r = []; - r.push(`L'École des Enculées has a`); - if (V.LDE.schoolProsperity > 4) { + const r = []; + r.push(`${capFirstChar(schObj.title)} has a`); + if (V[SCH].schoolProsperity > 4) { r.push(`very prosperous`); - } else if (V.LDE.schoolProsperity < -4) { + } else if (V[SCH].schoolProsperity < -4) { r.push(`struggling`); } else { r.push(`thriving`); } - r.push(`branch campus in ${V.arcologies[0].name}.`); - if (V.LDE.schoolProsperity >= 10) { - r.push(`It is one of the finest slave schools in the world`); - if (V.rep > 19000) { - r.push(`.`); - } else { - r.push(`, <span class="green">improving your reputation.</span>`); - repX(200, "policies"); + r.push(`${schObj.title} in ${V.arcologies[0].name}.`); + if (V[SCH].schoolProsperity >= 10) { + switch (SCH) { + case "GRI": + r.push(`It is one of the finest research facilities in the world`); + break; + case "TFS": + r.push(`They are one of the most renowned futa societies in the world`); + break; + case "HA": + r.push(`It is one of the most famous schools in the world`); + break; + default: + r.push(`It is one of the finest slave schools in the world`); } - V.LDE.subsidize = 0; - V.LDE.schoolProsperity = 10; - } - if (V.LDE.subsidize === 1) { - r.push(`You have a policy of subsidizing them.`); - V.LDE.schoolProsperity++; - } else if (V.LDE.subsidize === -1) { - r.push(`You have a policy of covertly undermining them.`); - V.LDE.schoolProsperity--; - } - App.Events.addNode(el, r, "div"); - } - - if (V.TGA.schoolPresent === 1) { - r = []; - r.push(`The Gymnasium-Academy has a`); - if (V.TGA.schoolProsperity > 4) { - r.push(`very prosperous`); - } else if (V.TGA.schoolProsperity < -4) { - r.push(`struggling`); - } else { - r.push(`thriving`); - } - r.push(`branch campus in ${V.arcologies[0].name}.`); - if (V.TGA.schoolProsperity >= 10) { - r.push(`It is one of the finest slave schools in the world`); if (V.rep > 19000) { - r.push(`.`); + r.push(r.pop() + `.`); } else { - r.push(`, <span class="green">improving your reputation.</span>`); + r.push(r.pop() + `, <span class="green">improving your reputation.</span>`); repX(200, "policies"); } - V.TGA.subsidize = 0; - V.TGA.schoolProsperity = 10; + V[SCH].subsidize = 0; + V[SCH].schoolProsperity = 10; } - if (V.TGA.subsidize === 1) { + if (V[SCH].subsidize === 1) { r.push(`You have a policy of subsidizing them.`); - V.TGA.schoolProsperity++; - } else if (V.TGA.subsidize === -1) { + V[SCH].schoolProsperity++; + } else if (V[SCH].subsidize === -1) { r.push(`You have a policy of covertly undermining them.`); - V.TGA.schoolProsperity--; + V[SCH].schoolProsperity--; } App.Events.addNode(el, r, "div"); + console.log(r); } - if (V.TFS.schoolPresent === 1) { - r = []; - r.push(`The Futanari Sisters have a`); - if (V.TFS.schoolProsperity > 4) { - r.push(`very prosperous`); - } else if (V.TFS.schoolProsperity < -4) { - r.push(`struggling`); - } else { - r.push(`thriving`); - } - r.push(`community in ${V.arcologies[0].name}.`); - if (V.TFS.schoolProsperity >= 10) { - r.push(`They are one of the most renowned futa societies in the world`); - if (V.rep > 19000) { - r.push(`.`); - } else { - r.push(`, <span class="green">improving your reputation.</span>`); - repX(200, "policies"); - } - V.TFS.subsidize = 0; - V.TFS.schoolProsperity = 10; - } - if (V.TFS.subsidize === 1) { - r.push(`You have a policy of subsidizing them`); - if ((V.PC.dick !== 0) && (V.PC.vagina !== -1) && (V.PC.boobs >= 300)) { - r.push(`, which is more effective due to your close relationship with them and your physical resemblance to them`); - V.TFS.schoolProsperity++; - } - r.push(`.`); - V.TFS.schoolProsperity++; - } else if (V.TFS.subsidize === -1) { - r.push(`You have a policy of covertly undermining them.`); - V.TFS.schoolProsperity--; - } - App.Events.addNode(el, r, "div"); - } - - if (V.HA.schoolPresent === 1) { - r = []; - r.push(`The Hippolyta Academy has a`); - if (V.HA.schoolProsperity > 4) { - r.push(`very prosperous`); - } else if (V.HA.schoolProsperity < -4) { - r.push(`struggling`); - } else { - r.push(`thriving`); - } - r.push(`branch in ${V.arcologies[0].name}.`); - if (V.HA.schoolProsperity >= 10) { - r.push(`It is one of the most famous schools in the world`); - if (V.rep > 19000) { - r.push(`.`); - } else { - r.push(`, <span class="green">improving your reputation.</span>`); - repX(200, "policies"); - } - V.HA.subsidize = 0; - V.HA.schoolProsperity = 10; - } - if (V.HA.subsidize === 1) { - r.push(`You have a policy of subsidizing them.`); - V.HA.schoolProsperity++; - } else if (V.HA.subsidize === -1) { - r.push(`You have a policy of covertly undermining them.`); - V.HA.schoolProsperity--; - } - App.Events.addNode(el, r, "div"); - } - - if (V.NUL.schoolPresent === 1) { - r = []; - r.push(`Nueva Universidad de Libertad has a`); - if (V.NUL.schoolProsperity > 4) { - r.push(`very prosperous`); - } else if (V.NUL.schoolProsperity < -4) { - r.push(`struggling`); - } else { - r.push(`thriving`); - } - r.push(`branch campus in ${V.arcologies[0].name}.`); - if (V.NUL.schoolProsperity >= 10) { - r.push(`It is one of the finest slave schools in the world`); - if (V.rep > 19000) { - r.push(`.`); - } else { - r.push(`, <span class="green">improving your reputation.</span>`); - repX(200, "policies"); - } - V.NUL.subsidize = 0; - V.NUL.schoolProsperity = 10; - } - if (V.NUL.subsidize === 1) { - r.push(`You have a policy of subsidizing them.`); - V.NUL.schoolProsperity++; - } else if (V.NUL.subsidize === -1) { - r.push(`You have a policy of covertly undermining them.`); - V.NUL.schoolProsperity--; - } - App.Events.addNode(el, r, "div"); - } return el; } @@ -2157,7 +1880,7 @@ globalThis.arcmgmt = function() { } function slaveRetirement() { - const r =[]; + const r = []; /* Slave retirement trigger pulled (one time only)*/ if (V.citizenRetirementTrigger === 1) { if (V.customMenialRetirementAge >= 65) { diff --git a/src/endWeek/endWeek.js b/src/endWeek/endWeek.js index 5547dcc92c30169d013d967b254d77d8a34a870f..6860303ded433336247f2add6769f897e6e651a2 100644 --- a/src/endWeek/endWeek.js +++ b/src/endWeek/endWeek.js @@ -32,7 +32,7 @@ globalThis.endWeek = (function() { function resetSlaveMarkets() { V.gingering = 0; V.market = null; - for (const school of Object.keys(App.Data.misc.schools)) { + for (const school of Array.from(App.Data.misc.schools.keys())) { V[school].schoolSale = 0; } } diff --git a/src/js/utilsFC.js b/src/js/utilsFC.js index b1defaeec5346d688f593c25131f7d4ad590b43c..29ba225e22d26007a924d45e076fa3b3e0711b24 100644 --- a/src/js/utilsFC.js +++ b/src/js/utilsFC.js @@ -3045,9 +3045,9 @@ App.Utils.masterSuiteAverages = (function() { })(); App.Utils.schoolCounter = function() { - return Object.keys(App.Data.misc.schools).filter(s => V[s].schoolPresent).length; + return Array.from(App.Data.misc.schools.keys()).filter(s => V[s].schoolPresent).length; }; App.Utils.schoolFailure = function() { - return Object.keys(App.Data.misc.schools).find(s => V[s].schoolPresent && V[s].schoolProsperity <= -10); + return Array.from(App.Data.misc.schools.keys()).find(s => V[s].schoolPresent && V[s].schoolProsperity <= -10); }; diff --git a/src/markets/bulkSlave/bulkSlaveIntro.js b/src/markets/bulkSlave/bulkSlaveIntro.js index 7842335faf3ad2894aebf8f1d22157e7ff92c650..bcaa0cf599d63d8489792c22c57357002ca8a1c1 100644 --- a/src/markets/bulkSlave/bulkSlaveIntro.js +++ b/src/markets/bulkSlave/bulkSlaveIntro.js @@ -177,7 +177,7 @@ App.Markets.bulkSlaveIntro = function() { } /* increment Slave school purchase counts if needed */ - if (Object.keys(App.Data.misc.schools).includes(V.market.slaveMarket)) { + if (Array.from(App.Data.misc.schools.keys()).includes(V.market.slaveMarket)) { V[V.market.slaveMarket].studentsBought += V.market.newSlaves.length; } } @@ -204,7 +204,7 @@ App.Markets.bulkSlaveIntro = function() { opinion = App.Neighbor.opinion(0, V.market.numArcology); opinion = Math.clamp(Math.trunc(opinion/20), -10, 10); discount -= (opinion * 25); - } else if (Object.keys(App.Data.misc.schools).includes(V.market.slaveMarket)) { + } else if (Array.from(App.Data.misc.schools.keys()).includes(V.market.slaveMarket)) { if (V[V.market.slaveMarket].schoolUpgrade !== 0) { discount = 375; } diff --git a/src/markets/marketUI.js b/src/markets/marketUI.js index adec042eef087eab2dd834eabe879128e8771317..e21bb45adfd10f145b3060b7b7333fbeef8d2028 100644 --- a/src/markets/marketUI.js +++ b/src/markets/marketUI.js @@ -141,7 +141,7 @@ App.Markets.purchaseFramework = function(slaveMarket, {sTitleSingular = "slave", return el; function student() { - if (Object.keys(App.Data.misc.schools).includes(slaveMarket)) { + if (Array.from(App.Data.misc.schools.keys()).includes(slaveMarket)) { V[slaveMarket].schoolSale = 0; V[slaveMarket].studentsBought += 1; } diff --git a/src/markets/theMarket/buySlaves.js b/src/markets/theMarket/buySlaves.js index e3baae1eaa0fe6f3e92b09026e0aa1b6c874a944..e2f3a1c09bde64ed1fe75a59731b8c2ca1778b7c 100644 --- a/src/markets/theMarket/buySlaves.js +++ b/src/markets/theMarket/buySlaves.js @@ -192,7 +192,7 @@ App.UI.buySlaves = function() { if (store.note) { App.UI.DOM.appendNewElement("span", el, ` ${store.note}`, "note"); } - if (Object.keys(App.Data.misc.schools).includes(store.marketType)) { + if (Array.from(App.Data.misc.schools.keys()).includes(store.marketType)) { if (V[store.marketType].schoolSale === 1) { App.UI.DOM.appendNewElement("span", el, `Offering your first purchase at half price this week. `, "yellow"); }