From 4038bc18fc14bcb1dbed4f095645d60a9f2df5f5 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 29 Dec 2019 09:22:43 -0600 Subject: [PATCH] Add more news. Add pronoun settings to make news-writing easier Lets you set subject/possessive/object pronouns, for maximum grammatical validity --- constants.js | 67 ++++++++++++++++++++++++++++++++++++++++++++++------ gorge.js | 5 +++- util.js | 4 ++++ 3 files changed, 68 insertions(+), 8 deletions(-) diff --git a/constants.js b/constants.js index 2a1fa91..6938b6a 100644 --- a/constants.js +++ b/constants.js @@ -1098,7 +1098,7 @@ const helperUpgradeText = { "desc": "Why bother chasing them, really?" }, { - "name": "", + "name": "Servants", "desc": "Why bother walking anywhere, really?" } ], @@ -1271,6 +1271,7 @@ const news = [ function createNews() { createNewsFoodAmount(); createNewsFoodRate(); + createNewsFoodRatePermanent(); createNewsBuildingCount(); } @@ -1303,6 +1304,23 @@ function createNewsFoodRate() { }; } +function createNewsFoodRatePermanent() { + let counter = 0; + for (let set of newsFoodRatePermanentText) { + const factor = counter; + let cond = state => { + return state.currentProductivity.food >= 5*Math.pow(10, factor) + } + + news.push({ + condition: cond, + lines: set + }); + + counter += 1; + }; +} + function createNewsBuildingCount() { Object.entries(newsBuildingCountText).forEach(([key, sets]) => { for (let [i, set] of sets.entries()) { @@ -1355,17 +1373,30 @@ const newsFoodRateText = [ ] ] +const newsFoodRatePermanentText = [ + [ + state => "Should we be concerned by " + macroDesc.name + "'s ever-growing hunger? \"No,\" says local " + macroDesc.species + "." + ], + [ + state => weekday() + " night football game cancelled due to " + macroDesc.species + " slobbering all over the field." + ], + [ + state => weekday() + " night football game cancelled due to " + macroDesc.species + " eating everyone involved." + ] +] + const newsBuildingCountText = { micro: [ [ - state => "Micro-only diet: fad or fact? Our experts weigh in." + state => "Micro-only diet: fad or fact? Our experts weigh in.", + state => "\"What's the deal with micros, anyway?\" asks local comedian." ], [ state => "\"I don't have a problem,\" says macro eating " + showBuilding("micro") + " per second", state => "\"Isn't it weird how macros eat so many micros?\" asked confused citizen. \"Like, doesn't that mean they're double micros?\"" ], [ - state => "Local macro celebrated for cleaning up the \"unending tide\" of micros" + state => "Local macro celebrated for cleaning up the \"unending tide\" of micros", ], [ state => "That's a lot of micros." @@ -1396,6 +1427,9 @@ const newsBuildingCountText = { bus: [ [ state => "Macro craze fuels explosion in bus ridership." + ], + [ + state => "Isn't it kind of weird how well-designed buses are for macros? Like, really. I saw a " + macroDesc.name + " stick one up " + macroDesc.proPossessive + " a-" ] ], house: [ @@ -1453,12 +1487,13 @@ const newsBuildingCountText = { ], planet: [ [ - state => "The Earth has been eaten. Everyone on it has been eaten." + state => "The Earth has been eaten. Everyone on it has been eaten.", + state => macroDesc.name + " has eaten the entire planet." ] ], "solar-system": [ [ - state => "Scientists propose new \"" + macroDesc.name + " unit\" to replace the outdated Astronomical Unit." + state => "Scientists propose new \"" + macroDesc.name + " Unit\" to replace the outdated Astronomical Unit." ] ], galaxy: [ @@ -1560,16 +1595,34 @@ const statTypes = { const options = { name: { - name: "Your name", + name: "Name", type: "text", set: value => macroDesc.name = value, get: () => macroDesc.name }, species: { - name: "Your species", + name: "Species", type: "text", set: value => macroDesc.species = value, get: () => macroDesc.species + }, + subject: { + name: "Subject pronoun (e.g. he/she)", + type: "text", + set: value => macroDesc.proSubject = value, + get: () => macroDesc.proSubject + }, + possessive: { + name: "Possessive pronoun (e.g. his/her)", + type: "text", + set: value => macroDesc.proPossessive = value, + get: () => macroDesc.proPossessive + }, + object: { + name: "Object pronoun (e.g. him/her)", + type: "text", + set: value => macroDesc.proObject = value, + get: () => macroDesc.proObject } } deepFreeze(prodUpgradeText); diff --git a/gorge.js b/gorge.js index 2066df8..a16d8bd 100644 --- a/gorge.js +++ b/gorge.js @@ -6,7 +6,10 @@ const stats = {}; const macroDesc = { name: "Fen", - species: "crux" + species: "crux", + proSubject: "he", + proObject: "him", + proPossessive: "his", } const ownedUpgrades = {}; diff --git a/util.js b/util.js index c7f426f..7560f92 100644 --- a/util.js +++ b/util.js @@ -49,3 +49,7 @@ function showBuilding(key) { function capitalize(string) { return string[0].toUpperCase() + string.slice(1) } + +function weekday() { + return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][(new Date()).getDay()]; +}