Module:AbilityTable/ComplexRenderers: Difference between revisions

RenderSpiritScaling: list every scaling prop with card labels and {{Ss}}, per-prop upgrade notes (with help from vergir-bot LLM)
RenderSpiritScaling: upgrades go to an Upgrades cell with {{Ss}} totals; drop "+" on additive deltas (with help from vergir-bot LLM)
 
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). Notes list upgrades per prop with running
-- raw key when the card lacks it). The Upgrades cell lists upgrades per prop
-- totals; Multiply upgrades multiply the current scaling, as the gadget does.
-- with running totals; Multiply upgrades multiply the current scaling, as the
-- ability-upgrade gadget does.
function p.RenderSpiritScaling(ability, cardprops)
function p.RenderSpiritScaling(ability, cardprops)
     local labels = cardprops or {}
     local labels = cardprops or {}
Line 534: Line 535:
     end
     end


     local notes = {}
     local lines = {}
     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 551: Line 552:
                 if current then
                 if current then
                     running[up.key] = current * up.value
                     running[up.key] = current * up.value
                     table.insert(group.totals, "×" .. format_spirit(running[up.key]))
                     table.insert(group.totals, format_spirit_badge(running[up.key]))
                 else
                 else
                     table.insert(group.totals, "?")
                     table.insert(group.totals, "?")
Line 557: Line 558:
             elseif current then
             elseif current then
                 running[up.key] = current + up.value
                 running[up.key] = current + up.value
                 table.insert(notes, "T" .. i .. " upgrade adds +×" .. format_spirit(up.value)
                 table.insert(lines, "T" .. i .. " adds ×" .. format_spirit(up.value) .. " " .. label
                    .. " " .. label .. " scaling (total ×" .. format_spirit(running[up.key]) .. ")")
                    .. " scaling (total " .. format_spirit_badge(running[up.key]) .. ")")
             else
             else
                 running[up.key] = up.value
                 running[up.key] = up.value
                 table.insert(notes, "T" .. i .. " upgrade grants ×" .. format_spirit(up.value)
                 table.insert(lines, "T" .. i .. " grants " .. format_spirit_badge(up.value) .. " " .. label .. " scaling")
                    .. " " .. 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(notes, "T" .. i .. " upgrade multiplies " .. join_names(group.labels)
             table.insert(lines, "T" .. i .. " 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 #notes > 0 then cells["Notes"] = table.concat(notes, ". ") end
     if #lines > 0 then cells["Upgrades"] = table.concat(lines, "<br>") end
     return cells
     return cells
end
end