Editing Module:AbilityTable/ComplexRenderersGive feedback
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). | -- raw key when the card lacks it). Notes list upgrades per prop with running | ||
-- | -- totals; Multiply upgrades multiply the current scaling, as the 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 | 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, | 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( | table.insert(notes, "T" .. i .. " upgrade adds +×" .. format_spirit(up.value) | ||
.. " " .. label .. " scaling (total ×" .. format_spirit(running[up.key]) .. ")") | |||
else | else | ||
running[up.key] = up.value | running[up.key] = up.value | ||
table.insert( | 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( | 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 # | if #notes > 0 then cells["Notes"] = table.concat(notes, ". ") end | ||
return cells | return cells | ||
end | end | ||