diff --git a/js/003-data/policiesData.js b/js/003-data/policiesData.js index 0aaf6b49494c7361a27c5bbce7b04428a0848ffb..6477489d5eeb37fc5895436125d7c232f41dae6a 100644 --- a/js/003-data/policiesData.js +++ b/js/003-data/policiesData.js @@ -17,7 +17,7 @@ App.Data.Policies.Selection = { * @param {object} [hide] Object controling special hide settings that can hide parts of the policy if needed. * @param {number} [hide.button] Hides the appeal/repeal button if 1 * @param {number} [hide.ifActivated] Hides the entire policy if the policy is applied. 1 to enable. - * @param {string|Array} [note] Note that appears at the end of the policy display in italics to present further information. If an array is used, the string will partially be created in the function and must be handled there in a switch. This is mostly a convenience for complicated notes that repeat a lot between policies. + * @param {string} [note] Note that appears at the end of the policy display in italics to present further information. */ { title: "Basic SMR", @@ -54,7 +54,27 @@ App.Data.Policies.Selection = { { title: "Intelligence Eugenics SMR", text: "in order to be sold in the slave market, chattel must either pass a challenging intelligence test or be sterilized", - note: ["geld", "all market slaves below the maximum intelligence level"] + get note() { + let text = "Will "; + if (V.seeDicks === 0) { + text += "sterilize "; + } else if (V.seeDicks === 100) { + if (V.seeExtreme === 0) { + text += "chemically castrate "; + } else { + text += "geld "; + } + } else { + text += "sterilize or "; + if (V.seeExtreme === 0) { + text += "chemically castrate "; + } else { + text += "geld "; + } + } + text += " all market slaves below the maximum intelligence level"; + return text; + } } ], @@ -62,7 +82,27 @@ App.Data.Policies.Selection = { { title: "Height Eugenics SMR", text: "in order to be sold in the slave market, chattel must either be taller than a very tall minimum height or be sterilized.", - note: ["geld", "all market slaves below the maximum height"] + get note() { + let text = "Will "; + if (V.seeDicks === 0) { + text += "sterilize "; + } else if (V.seeDicks === 100) { + if (V.seeExtreme === 0) { + text += "chemically castrate "; + } else { + text += "geld "; + } + } else { + text += "sterilize or "; + if (V.seeExtreme === 0) { + text += "chemically castrate "; + } else { + text += "geld "; + } + } + text += " all market slaves below the maximum height"; + return text; + } } ], @@ -70,7 +110,27 @@ App.Data.Policies.Selection = { { title: "Facial Eugenics SMR", text: "in order to be sold in the slave market, chattel must either pass a rigorous facial exam or be sterilized.", - note: ["geld", "all market slaves below the maximum facial beauty"] + get note() { + let text = "Will "; + if (V.seeDicks === 0) { + text += "sterilize "; + } else if (V.seeDicks === 100) { + if (V.seeExtreme === 0) { + text += "chemically castrate "; + } else { + text += "geld "; + } + } else { + text += "sterilize or "; + if (V.seeExtreme === 0) { + text += "chemically castrate "; + } else { + text += "geld "; + } + } + text += " all market slaves below the maximum facial beauty" + return text; + } } ], @@ -457,14 +517,14 @@ App.Data.Policies.Selection = { text: "you will subsidize this school's branch campus in your arcology.", activatedText: "you are subsidizing this school's", requirements: function() { if (V.TSS.schoolProsperity < 10 && V.TSS.schoolProsperity < 10) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, }, { title: "Undermine The Slave School", text: "you will covertly hurt this school's branch campus in your arcology.", activatedText: "you are covertly hurting this school's branch campus in your arcology.", requirements: function() { if (V.TSS.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, } ], "GRI.subsidize": [ @@ -473,14 +533,14 @@ App.Data.Policies.Selection = { text: "you will subsidize this school's branch campus in your arcology.", activatedText: "you are subsidizing this school's", requirements: function() { if (V.GRI.schoolProsperity < 10 && V.GRI.schoolProsperity < 10) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, }, { title: "Undermine the Growth Research Institute", text: "you will covertly hurt this school's branch campus in your arcology.", activatedText: "you are covertly hurting this school's branch campus in your arcology.", requirements: function() { if (V.GRI.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, } ], "SCP.subsidize": [ @@ -489,14 +549,14 @@ App.Data.Policies.Selection = { text: "you will subsidize this school's branch campus in your arcology.", activatedText: "you are subsidizing this school's", requirements: function() { if (V.SCP.schoolProsperity < 10 && V.SCP.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, }, { title: "Undermine St. Claver Preparatory", text: "you will covertly hurt this school's branch campus in your arcology.", activatedText: "you are covertly hurting this school's branch campus in your arcology.", requirements: function() { if (V.SCP.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, } ], "LDE.subsidize": [ @@ -505,14 +565,14 @@ App.Data.Policies.Selection = { text: "you will subsidize this school's branch campus in your arcology.", activatedText: "you are subsidizing this school's", requirements: function() { if (V.LDE.schoolProsperity < 10 && V.LDE.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, }, { title: "Undermine L'École des Enculées", text: "you will covertly hurt this school's branch campus in your arcology.", activatedText: "you are covertly hurting this school's branch campus in your arcology.", requirements: function() { if (V.LDE.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, } ], "TGA.subsidize": [ @@ -521,14 +581,14 @@ App.Data.Policies.Selection = { text: "you will subsidize this school's branch campus in your arcology.", activatedText: "you are subsidizing this school's", requirements: function() { if (V.TGA.schoolProsperity < 10 && V.TGA.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, }, { title: "Undermine the Gymnasium-Academy", text: "you will covertly hurt this school's branch campus in your arcology.", activatedText: "you are covertly hurting this school's branch campus in your arcology.", requirements: function() { if (V.TGA.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, } ], "TCR.subsidize": [ @@ -537,14 +597,14 @@ App.Data.Policies.Selection = { text: "you will subsidize this school's branch campus in your arcology.", activatedText: "you are subsidizing this school's", requirements: function() { if (V.TCR.schoolProsperity < 10 && V.TCR.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, }, { title: "Undermine The Cattle Ranch", text: "you will covertly hurt this school's branch campus in your arcology.", activatedText: "you are covertly hurting this school's branch campus in your arcology.", requirements: function() { if (V.TCR.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, } ], "TFS.subsidize": [ @@ -553,14 +613,14 @@ App.Data.Policies.Selection = { text: "you will subsidize this school's branch campus in your arcology.", activatedText: "you are subsidizing this school's", requirements: function() { if (V.TFS.schoolProsperity < 10 && V.TFS.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, }, { title: "Undermine the Futanari Sisters", text: "you will covertly hurt this school's branch campus in your arcology.", activatedText: "you are covertly hurting this school's branch campus in your arcology.", requirements: function() { if (V.TFS.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, } ], "HA.subsidize": [ @@ -569,14 +629,14 @@ App.Data.Policies.Selection = { text: "you will subsidize this school's branch campus in your arcology.", activatedText: "you are subsidizing this school's", requirements: function() { if (V.HA.schoolProsperity < 10 && V.HA.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, }, { title: "Undermine the Hippolyta Academy", text: "you will covertly hurt this school's branch campus in your arcology.", activatedText: "you are covertly hurting this school's branch campus in your arcology.", requirements: function() { if (V.HA.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, } ], "NUL.subsidize": [ @@ -585,14 +645,14 @@ App.Data.Policies.Selection = { text: "you will subsidize this school's branch campus in your arcology.", activatedText: "you are subsidizing this school's", requirements: function() { if (V.NUL.schoolProsperity < 10 && V.NUL.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, }, { title: "Undermine Nueva Universidad de Libertad", text: "you will covertly hurt this school's branch campus in your arcology.", activatedText: "you are covertly hurting this school's branch campus in your arcology.", requirements: function() { if (V.NUL.schoolPresent === 1) { return true; } else { return false; } }, - note: ["school cost"] + get note() { return `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; }, } ], }, diff --git a/src/interaction/policies/policies.js b/src/interaction/policies/policies.js index 3a35429d4e002e5e01a7e4d7056dbeaea3c40804..81b4ba3fc9efcf0bfd37d851554bf756c6c4f861 100644 --- a/src/interaction/policies/policies.js +++ b/src/interaction/policies/policies.js @@ -267,38 +267,7 @@ globalThis.policy = function(category) { } div.append(link); if (p.hasOwnProperty("note")) { - if (typeof p.note === "string") { - div.append(App.UI.DOM.makeElement("div", p.note, ["note", "indent"])); - } else if (Array.isArray(p.note)) { - let text; - switch (p.note[0]) { - case "geld": { - text = "Will "; - if (V.seeDicks === 0) { - text += "sterilize "; - } else if (V.seeDicks === 100) { - if (V.seeExtreme === 0) { - text += "chemically castrate "; - } else { - text += "geld "; - } - } else { - text += "sterilize or "; - if (V.seeExtreme === 0) { - text += "chemically castrate "; - } else { - text += "geld "; - } - } - text += p.note[1]; - break; - } - case "school cost": { - text = `Will cost ${cashFormat(1000)} weekly to maintain; does not cost reputation to start`; - } - } - div.append(App.UI.DOM.makeElement("div", text, ["note", "indent"])); - } + div.append(App.UI.DOM.makeElement("div", p.note, ["note", "indent"])); } el.append(div); }