From d106360c9c84161c897f79d79ceae70dbcc6a906 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 22 Jul 2018 17:33:17 -0500 Subject: [PATCH] Fixed missing prereqs for prod upgrades. Added more of them --- constants.js | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/constants.js b/constants.js index cfb48fa..9f6aa3a 100644 --- a/constants.js +++ b/constants.js @@ -195,6 +195,8 @@ function createTemplateUpgrades() { createProdAllUpgrades(); } +const prodUpgradeCounts = [1, 5, 10, 25, 50, 75, 100]; + function createProdUpgrades() { for (const [key, value] of Object.entries(prodUpgradeText)) { let counter = 1; @@ -204,7 +206,7 @@ function createProdUpgrades() { "name": contents.name, "desc": contents.desc, "cost": { - "food": buildings[key].cost * 5 * Math.pow(10,counter) + "food": buildings[key].cost * 5 * Math.pow(10,counter - 1) }, "effects": [ { @@ -215,12 +217,14 @@ function createProdUpgrades() { ] }; + upgrades[prefix + counter]["prereqs"] = {}; + upgrades[prefix + counter]["prereqs"]["buildings"] = {}; + upgrades[prefix + counter]["prereqs"]["buildings"][key] = prodUpgradeCounts[counter - 1]; + if (counter > 1) { - upgrades[prefix + counter]["prereqs"] = { - "upgrades": [ + upgrades[prefix + counter]["prereqs"]["upgrades"] = [ prefix + (counter - 1) - ] - }; + ]; } counter += 1; @@ -274,6 +278,14 @@ let prodUpgradeText = { { "name": "Delicious Micros", "desc": "Betcha' can't eat just one." + }, + { + "name": "Irresistable Micros", + "desc": "Genetically engineered to be delectable." + }, + { + "name": "Exquisite Micros", + "desc": "Dangerously delicious." } ], "anthro": [ @@ -281,9 +293,21 @@ let prodUpgradeText = { "name": "Willing Prey", "desc": "Why bother chasing down your meal?" }, + { + "name": "Fattened Prey", + "desc": "9 calories per gram!" + }, { "name": "Mesmerized Prey", "desc": "Why bother walking to your meal?" + }, + { + "name": "Food-Safe Lubricant", + "desc": "Ease them down your gullet with ease. Thanks, chemistry!" + }, + { + "name": "Mandatory Meal Training", + "desc": "Educating prey on basic food etiquette helps reduce maw congestion and speeds digestion by 27%." } ], }