diff --git a/src/data/backwardsCompatibility/datatypeCleanup.js b/src/data/backwardsCompatibility/datatypeCleanup.js index 1460d5e94e68f977c267ebd0d98aff3121d7f9c8..d1d1a16566635e5cc27699de10643a12cdac525c 100644 --- a/src/data/backwardsCompatibility/datatypeCleanup.js +++ b/src/data/backwardsCompatibility/datatypeCleanup.js @@ -1497,26 +1497,10 @@ globalThis.ArcologyDatatypeCleanup = function() { V.surgeryCost = Math.trunc(30000 / (V.localEcon * (V.PC.career === "medicine" ? 2 : 1))); V.facilityCost = +V.facilityCost || 100; - V.TSS.studentsBought = Math.max(+V.TSS.studentsBought, 0) || 0; - V.TSS.schoolProsperity = Math.clamp(+V.TSS.schoolProsperity, -10, 10) || 0; - V.TUO.studentsBought = Math.max(+V.TUO.studentsBought, 0) || 0; - V.TUO.schoolProsperity = Math.clamp(+V.TUO.schoolProsperity, -10, 10) || 0; - V.GRI.studentsBought = Math.max(+V.GRI.studentsBought, 0) || 0; - V.GRI.schoolProsperity = Math.clamp(+V.GRI.schoolProsperity, -10, 10) || 0; - V.SCP.studentsBought = Math.max(+V.SCP.studentsBought, 0) || 0; - V.SCP.schoolProsperity = Math.clamp(+V.SCP.schoolProsperity, -10, 10) || 0; - V.LDE.studentsBought = Math.max(+V.LDE.studentsBought, 0) || 0; - V.LDE.schoolProsperity = Math.clamp(+V.LDE.schoolProsperity, -10, 10) || 0; - V.TGA.studentsBought = Math.max(+V.TGA.studentsBought, 0) || 0; - V.TGA.schoolProsperity = Math.clamp(+V.TGA.schoolProsperity, -10, 10) || 0; - V.HA.studentsBought = Math.max(+V.HA.studentsBought, 0) || 0; - V.HA.schoolProsperity = Math.clamp(+V.HA.schoolProsperity, -10, 10) || 0; - V.TCR.studentsBought = Math.max(+V.TCR.studentsBought, 0) || 0; - V.TCR.schoolProsperity = Math.clamp(+V.TCR.schoolProsperity, -10, 10) || 0; - V.TFS.studentsBought = Math.max(+V.TFS.studentsBought, 0) || 0; - V.TFS.schoolProsperity = Math.clamp(+V.TFS.schoolProsperity, -10, 10) || 0; - V.NUL.studentsBought = Math.max(+V.NUL.studentsBought, 0) || 0; - V.NUL.schoolProsperity = Math.clamp(+V.NUL.schoolProsperity, -10, 10) || 0; + for (const school of App.Data.misc.schools.keys()) { + V[school].studentsBought = Math.max(+V[school].studentsBought, 0) || 0; + V[school].schoolProsperity = Math.clamp(+V[school].schoolProsperity, -10, 10) || 0; + } }; globalThis.FacilityDatatypeCleanup = (function() { diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 09715cd6a34ed937621eda0489dded4be611f6a5..f783843a6a16834531b998c214e69e01ee0a6d3a 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -718,62 +718,16 @@ globalThis.calculateCosts = (function() { function getSchoolCosts() { let costs = 0; - if (V.TSS.schoolPresent === 1) { - costs += 1000; - } - if (V.TUO.schoolPresent === 1) { - costs += 1000; - } - if (V.GRI.schoolPresent === 1) { - costs += 1000; - } - if (V.SCP.schoolPresent === 1) { - costs += 1000; - } - if (V.LDE.schoolPresent === 1) { - costs += 1000; - } - if (V.TGA.schoolPresent === 1) { - costs += 1000; - } - if (V.HA.schoolPresent === 1) { - costs += 1000; - } - if (V.TCR.schoolPresent === 1) { - costs += 1000; - } - if (V.NUL.schoolPresent === 1) { - costs += 1000; - } - if ((V.TFS.schoolPresent === 1) && ((V.PC.dick === 0) || (V.PC.vagina === -1) || (V.PC.boobs < 300))) { - costs += 1000; - } - if (V.TSS.subsidize !== 0) { - costs += 1000; - } - if (V.GRI.subsidize !== 0) { - costs += 1000; - } - if (V.SCP.subsidize !== 0) { - costs += 1000; - } - if (V.LDE.subsidize !== 0) { - costs += 1000; - } - if (V.TGA.subsidize !== 0) { - costs += 1000; - } - if (V.HA.subsidize !== 0) { - costs += 1000; - } - if (V.TCR.subsidize !== 0) { - costs += 1000; - } - if (V.NUL.subsidize !== 0) { - costs += 1000; - } - if (V.TFS.subsidize !== 0) { - costs += 1000; + for (const school of App.Data.misc.schools.keys()) { + if (school === 'TFS') { + if (V[school].subsidize === 1 && ((V.PC.dick === 0) || (V.PC.vagina === -1) || (V.PC.boobs < 300))) { + costs += 1000; + } + } else { + if (V[school].subsidize === 1) { + costs += 1000; + } + } } return costs; } diff --git a/src/player/js/playerJS.js b/src/player/js/playerJS.js index de126699e775af9428dbbfc4eef0595ea045c78b..4dbc708634f601b31928b04f9f5c6dc9414a58b0 100644 --- a/src/player/js/playerJS.js +++ b/src/player/js/playerJS.js @@ -507,58 +507,17 @@ globalThis.PCTitle = function() { const schoolsPresent = []; const schoolsPerfected = []; - let schoolTitle = ""; - if (V.TSS.schoolProsperity >= 10) { - schoolsPerfected.push("The Slave School"); - } else if (V.TSS.schoolPresent === 1) { - schoolsPresent.push("The Slave School"); - } - if (V.TUO.schoolProsperity >= 10) { - schoolsPerfected.push("The Utopian Orphanage"); - } else if (V.TUO.schoolPresent === 1) { - schoolsPresent.push("The Utopian Orphanage"); - } - if (V.GRI.schoolProsperity >= 10) { - schoolsPerfected.push("The Growth Research Institute"); - } else if (V.GRI.schoolPresent === 1) { - schoolsPresent.push("The Growth Research Institute"); - } - if (V.SCP.schoolProsperity >= 10) { - schoolsPerfected.push("St. Claver Preparatory"); - } else if (V.SCP.schoolPresent === 1) { - schoolsPresent.push("St. Claver Preparatory"); - } - if (V.LDE.schoolProsperity >= 10) { - schoolsPerfected.push("L'École des Enculées"); - } else if (V.LDE.schoolPresent === 1) { - schoolsPresent.push("L'École des Enculées"); - } - if (V.TGA.schoolProsperity >= 10) { - schoolsPerfected.push("The Gymnasium-Academy"); - } else if (V.TGA.schoolPresent === 1) { - schoolsPresent.push("The Gymnasium-Academy"); - } - if (V.HA.schoolProsperity >= 10) { - schoolsPerfected.push("The Hippolyta Academy"); - } else if (V.HA.schoolPresent === 1) { - schoolsPresent.push("The Hippolyta Academy"); - } - if (V.TCR.schoolProsperity >= 10) { - schoolsPerfected.push("The Cattle Ranch"); - } else if (V.TCR.schoolPresent === 1) { - schoolsPresent.push("The Cattle Ranch"); - } - if (V.NUL.schoolProsperity >= 10) { - schoolsPerfected.push("Nueva Universidad de Libertad"); - } else if (V.NUL.schoolPresent === 1) { - schoolsPresent.push("Nueva Universidad de Libertad"); + let schoolTitle; + for (const school of App.Data.misc.schools.keys()) { + if (V[school].schoolProsperity >= 10) { + schoolsPerfected.push(school.title); + } else if (V[school].schoolPresent === 1) { + schoolsPresent.push(school.title); + } } + if (schoolsPerfected.length > 0) { - if (V.PC.title === 1) { - schoolTitle = "Benefactor of "; - } else { - schoolTitle = "Benefactrix of "; - } + schoolTitle = `${V.PC.title === 1 ? 'Benefactor' : 'Benefactrix'} of `; if (schoolsPerfected.length === 1) { schoolTitle += schoolsPerfected[0]; } else if (schoolsPerfected.length === 2) { @@ -569,7 +528,6 @@ globalThis.PCTitle = function() { } titles.push(schoolTitle); } - if (schoolsPresent.length > 0) { schoolTitle = "Supporter of "; if (schoolsPresent.length === 1) {