Module:BATTD costs: Difference between revisions

No edit summary
mNo edit summary
Line 136: Line 136:
for i, upgrade in ipairs(upgrades) do
for i, upgrade in ipairs(upgrades) do
upgradesById[upgrade.id] = upgrade
upgradesById[upgrade.id] = upgrade
if upgrade.name == upgradeName then upgradeId = upgrade.id end
upgradeLocksById[upgrade.id] = {}
upgradeLocksById[upgrade.id] = {}
end
end
Line 179: Line 177:
end
end


local function Upgrade(towerName, upgradeName, Y, N)
local function Upgrade(towerName, upgradeId, Y, N)
local upgradesById, upgradeLocksById, upgradePrereqsById, upgradePrereqsOfById, baseCost = SetUpTables(towerName)
local upgradesById, upgradeLocksById, upgradePrereqsById, upgradePrereqsOfById, baseCost = SetUpTables(towerName)
local upgradeId = ""
local purchasedUpgrades = {} -- this upgrade and any other upgrades that had to already be purchased to get it
local purchasedUpgrades = {} -- this upgrade and any other upgrades that had to already be purchased to get it