From c5a483b81f2ad4fb6bbc7ff369b64744c7a3f0ae Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 28 Dec 2019 13:18:46 -0600 Subject: [PATCH] Add more helper upgrades --- constants.js | 67 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 5 deletions(-) diff --git a/constants.js b/constants.js index 78be13f..f418a24 100644 --- a/constants.js +++ b/constants.js @@ -442,9 +442,13 @@ function createClickUpgrades() { } } +const helperUpgradeColors = range.colors(3); + function createHelperUpgrades() { const infix = "-help-"; + let previousHelped = undefined; + Object.entries(helperUpgradeText).forEach(([helper, helpees]) => { const prefix = helper; @@ -460,7 +464,7 @@ function createHelperUpgrades() { "desc": text.desc, "icon": [ { icon: "fa-hand-holding", color: "black" }, - { icon: buildings[helped].icon, color: "red", transform: "scale(0.5, 0.5) translate(0, -30px)" } + { icon: buildings[helped].icon, color: helperUpgradeColors[counter - 1], transform: "scale(0.5, 0.5) translate(0, -30px)" } ], "cost": { "food": buildings[helper].cost.food * 25 * counter + buildings[helped].cost.food * 50 * counter @@ -483,13 +487,19 @@ function createHelperUpgrades() { } }; upgrades[key]["prereqs"]["buildings"][helper] = 10 * counter; + upgrades[key]["prereqs"]["buildings"][helped] = 1; if (counter > 1) { upgrades[key]["prereqs"]["upgrades"].push(prefix + infix + suffix + "-" + (counter - 1)) } + + if (previousHelped !== undefined && counter == 1) { + upgrades[key]["prereqs"]["upgrades"].push(prefix + infix + previousHelped + "-" + "1") + } counter += 1; } + previousHelped = helped; }); }); @@ -1082,11 +1092,58 @@ const helperUpgradeText = { "desc": "Why bother chasing them, really?" }, { - "name": "Servants", + "name": "", "desc": "Why bother walking anywhere, really?" - }, - - ] + } + ], + "car": [ + { + name: "Drivers", + desc: "Better than a baby driver" + } + ], + bus: [ + { + name: "Thank the bus driver", + desc: "Thank the bus driver" + } + ], + house: [ + { + name: "Carpenters", + desc: "It's tool time!" + } + ], + apartment: [ + { + name: "Landlords", + desc: "Eat 'em" + } + ], + block: [ + { + name: "Inspectors", + desc: "Bringing everything up to code" + } + ], + town: [ + { + name: "Mayors", + desc: "Vote!" + } + ], + city: [ + { + name: "Councils", + desc: "Pass those ordinances" + } + ], + metro: [ + { + name: "Urban Planners", + desc: "Blueprints? Chewprints." + } + ], } }