Editing Module:HeroDataArrays

Jump to navigation Jump to search
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 23: Line 23:


     table.sort(rows, function(a, b)
     table.sort(rows, function(a, b)
         local nameA = getSortName(a.sortName or a.name or "")
         local nameA = getSortName(a.name or "")
         local nameB = getSortName(b.sortName or b.name or "")
         local nameB = getSortName(b.name or "")
         return nameA:lower() < nameB:lower()
         return nameA:lower() < nameB:lower()
     end)
     end)
Line 101: Line 101:
             cells = cells .. " || " .. (r[col.field] or 0)
             cells = cells .. " || " .. (r[col.field] or 0)
         end
         end
        -- A row may carry an alternate sort key and a label suffix, used by
        -- secondary fire rows so they stay underneath their hero's main row
        local nameCell = "| style=\"text-align:left;\""
        if r.sortName then
            nameCell = nameCell .. " data-sort-value=\"" .. r.sortName .. "\""
        end
        nameCell = nameCell .. " | " ..
            frame:expandTemplate{ title = "PageRef", args = { r.name } } ..
            (r.nameSuffix or "")


         t = t ..
         t = t ..
             "|- \n" ..
             "|- \n" ..
             nameCell ..
             "| style=\"text-align:left;\" | " ..
            frame:expandTemplate{ title = "PageRef", args = { r.name } } ..
             cells .. " \n"
             cells .. " \n"
     end
     end
Line 516: Line 507:
             spiritScalingDamage = "+" .. (data["SpiritScaling>BulletDamage"] or 0),
             spiritScalingDamage = "+" .. (data["SpiritScaling>BulletDamage"] or 0),
         })
         })
        -- Secondary fire is listed as its own row, right under the hero's main row
        local altDamage = data["Weapon>AltFire>BulletDamage"]
        if altDamage and altDamage ~= 0 then
            local altScaling = data["LevelScaling>BulletDamageAltFire"] or 0
            table.insert(rows, {
                name = name,
                sortName = name .. " (alt fire)",
                nameSuffix = " (alt fire)",
                bulletDamage = altDamage,
                scalingDamage = "+" .. altScaling,
                maxScalingDamage = roundValue(altDamage + altScaling * soul_unlock.get_max("PowerIncrease")),
                spiritScalingDamage = "+0",
            })
        end
     end
     end
     sortHeroes(rows)
     sortHeroes(rows)
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: