diff --git a/js/003-data/policiesData.js b/js/003-data/policiesData.js index 3103a34f6727406c055f96c2246aeeffa4dbb989..eb620cf4537cb35ee0cab1dd35cd73a785d57e87 100644 --- a/js/003-data/policiesData.js +++ b/js/003-data/policiesData.js @@ -339,14 +339,14 @@ App.Data.Policies.Selection = { title: "Covert Upstart Enslavement", text: "you will offer prominent citizens your tacit assistance in enslaving rivals.", activatedText: "you are offering prominent citizens your tacit assistance in enslaving rivals.", - policy: "enslavementRep", + policy: "policies.enslavementRep", note: "Will produce a small amount of reputation weekly, and reduce the population of citizens" }, { title: "Charity Promotion Efforts", text: "you will use your personal influence to discourage enslavement of citizens.", activatedText: "you are using your personal influence to discourage enslavement of citizens.", - policy: "enslavementRep", + policy: "policies.enslavementRep", note: "Will annoy some prominent citizens, and slow population movement from citizens to slaves" } ] diff --git a/src/interaction/policies/policies.js b/src/interaction/policies/policies.js index 7378e021a76b6d94e1d62bf30aa392814142f77a..5fd4d0b324afbda94adda2fe91fd14e198075e95 100644 --- a/src/interaction/policies/policies.js +++ b/src/interaction/policies/policies.js @@ -127,7 +127,6 @@ globalThis.policy = function(category) { // apply for (let i = 0; i < selectedPolicy.length; i++) { const p = selectedPolicy[i]; - testArray(p); div = document.createElement("div"); span = document.createElement("span"); @@ -141,7 +140,6 @@ globalThis.policy = function(category) { // Description text div.append(p.text); div.append(` `); - //console.log(`selectedPolicy is `, p.policy, `and policyValue is: `, policyValue, `i: `, i); // link if (policyValue === 0) { let enable; @@ -172,12 +170,13 @@ globalThis.policy = function(category) { i = 0; // first element of array } else if (policyValue === -1) { i = 1; + } else { + throw `error found in: ${selectedPolicy[0].title}, policyValue is ${policyValue}. Policy "V.${selectedPolicy[0].policy}" may be malformed in the policy object`; } } else { i = policyValue - 1; } const p = selectedPolicy[i]; - testArray(p); div = document.createElement("div"); span = document.createElement("span"); @@ -195,7 +194,7 @@ globalThis.policy = function(category) { div.append(p.text); } div.append(` `); - //console.log(`selectedPolicy is `, p.policy, `and policyValue is: `, policyValue, `i: `, i); + // link repeal(p); } @@ -245,7 +244,7 @@ globalThis.policy = function(category) { break; } case "activated entertainments": { - text = `Will cost ${cashFormat(policies.cost())} weekly`; + text = `Will cost weekly`; if (V.rep > 18000) { text += `, and prevent damage to your reputation`; } @@ -300,10 +299,9 @@ globalThis.policy = function(category) { text += "geld "; } } - text += note[1]; - break; } } + text += p.note[1]; div.append(App.UI.DOM.makeElement("div", text, ["note", "indent"])); } }