Module:BATTD costs: Difference between revisions

mNo edit summary
mNo edit summary
Line 9: Line 9:
local sGsub = string.gsub
local sGsub = string.gsub
local restrictedUpgrades = {}
local headerRow = {"{|class=\"wikitable sortable\" style=\"text-align:center\"\n!Total cost!!Sell value"}
local headerRow = {"{|class=\"wikitable sortable\" style=\"text-align:center\"\n!Total cost!!Sell value"}
Line 54: Line 55:
if upgradePrereqsOfById[purchasedUpgradeId] then
if upgradePrereqsOfById[purchasedUpgradeId] then
for _, nextUpgradeId in ipairs(upgradePrereqsOfById[purchasedUpgradeId]) do
for _, nextUpgradeId in ipairs(upgradePrereqsOfById[purchasedUpgradeId]) do
if accessibleUpgrades[nextUpgradeId] and not purchasedUpgrades[nextUpgradeId] then availableUpgradesNext[nextUpgradeId] = true end
if accessibleUpgrades[nextUpgradeId] and not restrictedUpgrades[nextUpgradeId] and not purchasedUpgrades[nextUpgradeId] then availableUpgradesNext[nextUpgradeId] = true end
end
end
end
end
Line 82: Line 83:
if purchasedUpgradesNext and availableUpgradesNext then
if purchasedUpgradesNext and availableUpgradesNext then
purchasedUpgradesNext[availableUpgradeId] = true
purchasedUpgradesNext[availableUpgradeId] = true
availableUpgradesNext[availableUpgradeId] = nil
restrictedUpgrades[availableUpgradeId] = true
--if #outputTable == 20 then return end
--if #outputTable == 20 then return end