Editing Module:StreetBrawlAbilities

Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 20: Line 20:
if type(card) == "table" and hero and hero.Name and hero.IsDisabled ~= true then
if type(card) == "table" and hero and hero.Name and hero.IsDisabled ~= true then
for slot = 1, 8 do
for slot = 1, 8 do
-- The card's slot keys decode as numbers, so index with one.
local ability = card[tostring(slot)]
local ability = card[slot] or card[tostring(slot)]
if type(ability) == "table" and ability.Key then
if type(ability) == "table" and ability.Key then
map[ability.Key] = { hero = hero.Name, slot = slot, name = ability.Name }
map[ability.Key] = { hero = hero.Name, slot = slot, name = ability.Name }
Line 47: Line 46:
local na, nb = tonumber(a), tonumber(b)
local na, nb = tonumber(a), tonumber(b)
if na and nb then return na < nb end
if na and nb then return na < nb end
-- Upgrade tiers arrive as numbers, so never compare a number with a string.
return a < b
return tostring(a) < tostring(b)
end)
end)
return keys
return keys
Line 57: Line 55:
for _, key in ipairs(sorted_keys(node, top)) do
for _, key in ipairs(sorted_keys(node, top)) do
local value = node[key]
local value = node[key]
local path = prefix and (prefix .. "." .. key) or tostring(key)
local path = prefix and (prefix .. "." .. key) or key
if type(value) == "table" then
if type(value) == "table" then
flatten(value, path, out, false)
flatten(value, path, out, false)
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template

Page included on this page: