diff --git a/constants.js b/constants.js index c21fcf9..d866a48 100644 --- a/constants.js +++ b/constants.js @@ -196,37 +196,14 @@ const effect_types = { } let upgrades = { - "anthro-help-micro-1": { - "name": "Servants", - "desc": "Why bother walking anywhere, really?", - "cost": { - "food": buildings.anthro.cost * 25 + buildings.micro.cost * 50 - }, - "effects": [ - { - "type": "helper", - "helper": "anthro", - "helped": "micro", - "amount": 0.01 - } - ], - "prereqs": { - "buildings": { - "anthro": 10 - }, - "upgrades": [ - "anthro-prod-1" - ] - } - } } function createTemplateUpgrades() { - console.log("qwewq"); createProdUpgrades(); createProdAllUpgrades(); createClickUpgrades(); + createHelperUpgrades(); } const prodUpgradeCounts = [1, 5, 10, 25, 50, 75, 100]; @@ -339,6 +316,57 @@ function createClickUpgrades() { } } +function createHelperUpgrades() { + const infix = "-help-"; + + Object.entries(helperUpgradeText).forEach(([helper, helpees]) => { + const prefix = helper; + + Object.entries(helpees).forEach(([helped, texts]) => { + const suffix = helped; + + let counter = 1; + + for (let text of texts) { + const key = prefix + infix + suffix + "-" + counter; + console.log(key); + upgrades[key] = { + "name": text.name, + "desc": text.desc, + "icon": "fa-hand-holding", + "cost": { + "food": buildings[helper].cost * 25 * counter + buildings[helped].cost * 50 * counter + }, + "effects": [ + { + "type": "helper", + "helper": helper, + "helped": helped, + "amount": 0.01 * counter + } + ], + "prereqs": { + "buildings": { + + }, + "upgrades": [ + helper + "-prod-1" + ] + } + }; + upgrades[key]["prereqs"]["buildings"][helper] = 10 * counter; + + if (counter > 1) { + upgrades[key]["prereqs"]["upgrades"].push(prefix + infix + suffix + "-" + (counter - 1) ) + } + counter += 1; + } + + + }); + }); +} + let prodUpgradeText = { "micro": [ { @@ -845,3 +873,19 @@ const clickUpgradeText = [ "desc": "Senses scuttles, won't relent" }, ] + +const helperUpgradeText = { + "anthro": { + "micro": [ + { + "name": "Gatherers", + "desc": "Why bother chasing them, really?" + }, + { + "name": "Servants", + "desc": "Why bother walking anywhere, really?" + }, + + ] + } +} \ No newline at end of file