Editing Module:AbilityTable/ComplexRenderers

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 482: Line 482:
-- Renders Spirit Power scaling: one {{Ss}} badge per scaling prop, labelled from
-- Renders Spirit Power scaling: one {{Ss}} badge per scaling prop, labelled from
-- the card ("x0.55 (Base Damage)"; "Damage: Cost of Stay" when names collide;
-- the card ("x0.55 (Base Damage)"; "Damage: Cost of Stay" when names collide;
-- raw key when the card lacks it). The Upgrades cell lists upgrades per prop
-- raw key when the card lacks it). Notes list upgrades per prop with running
-- with running totals; Multiply upgrades multiply the current scaling, as the
-- totals; Multiply upgrades multiply the current scaling, as the gadget does.
-- ability-upgrade gadget does.
function p.RenderSpiritScaling(ability, cardprops)
function p.RenderSpiritScaling(ability, cardprops)
     local labels = cardprops or {}
     local labels = cardprops or {}
Line 535: Line 534:
     end
     end


     local lines = {}
     local notes = {}
     for _, t in ipairs(tiers) do
     for _, t in ipairs(tiers) do
         local i, list = t.tier, t.list
         local i, list = t.tier, t.list
Line 552: Line 551:
                 if current then
                 if current then
                     running[up.key] = current * up.value
                     running[up.key] = current * up.value
                     table.insert(group.totals, format_spirit_badge(running[up.key]))
                     table.insert(group.totals, "×" .. format_spirit(running[up.key]))
                 else
                 else
                     table.insert(group.totals, "?")
                     table.insert(group.totals, "?")
Line 558: Line 557:
             elseif current then
             elseif current then
                 running[up.key] = current + up.value
                 running[up.key] = current + up.value
                 table.insert(lines, "T" .. i .. " adds ×" .. format_spirit(up.value) .. " " .. label
                 table.insert(notes, "T" .. i .. " upgrade adds +×" .. format_spirit(up.value)
                    .. " scaling (total " .. format_spirit_badge(running[up.key]) .. ")")
                    .. " " .. label .. " scaling (total ×" .. format_spirit(running[up.key]) .. ")")
             else
             else
                 running[up.key] = up.value
                 running[up.key] = up.value
                 table.insert(lines, "T" .. i .. " grants " .. format_spirit_badge(up.value) .. " " .. label .. " scaling")
                 table.insert(notes, "T" .. i .. " upgrade grants ×" .. format_spirit(up.value)
                    .. " " .. label .. " scaling")
             end
             end
         end
         end
         for _, m in ipairs(group_order) do
         for _, m in ipairs(group_order) do
             local group = groups[m]
             local group = groups[m]
             table.insert(lines, "T" .. i .. " multiplies " .. join_names(group.labels)
             table.insert(notes, "T" .. i .. " upgrade multiplies " .. join_names(group.labels)
                 .. " scaling by " .. format_spirit(m)
                 .. " scaling by " .. format_spirit(m)
                 .. " (total " .. table.concat(group.totals, ", ") .. ")")
                 .. " (total " .. table.concat(group.totals, ", ") .. ")")
Line 573: Line 573:
     end
     end


     if #lines > 0 then cells["Upgrades"] = table.concat(lines, "<br>") end
     if #notes > 0 then cells["Notes"] = table.concat(notes, ". ") end
     return cells
     return cells
end
end
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