Module:Sandbox/LVL: Difference between revisions

Jump to navigation Jump to search
LVL (talk | contribs)
No edit summary
LVL (talk | contribs)
No edit summary
Line 219: Line 219:
         if scaling_data ~= nil then
         if scaling_data ~= nil then
             for scaling_val, scaling_type in pairs(scaling_data) do
             for scaling_val, scaling_type in pairs(scaling_data) do
                local scaling_str = hero_data_module.write_scalar_str(scaling_val, scaling_type, true)
    local scaling_str
                if scaling_str ~= "" then scaling_str = " " .. scaling_str end
    -- For alt‑fire DPS/SustainedDPS with computed scaling, use a simple text indicator
                if scaling_str ~= nil then
    if is_alt_fire and (attr_key == "DPS" or attr_key == "SustainedDPS") then
                    scaling_strs = scaling_strs .. scaling_str
        local icon = (scaling_type == "Spirit") and "★" or "▲"
                end
        local rounded = math.floor(scaling_val * 1000 + 0.5) / 1000  -- 3 decimals
                if scaling_type == "Spirit" then
        scaling_str = " " .. icon .. "+" .. rounded
                    spirit_scale = scaling_val
    else
                    stat_value  = stat_value + (spirit_power * scaling_val)
        -- Use the normal template/icon function
                elseif scaling_type == "Level" then
        scaling_str = hero_data_module.write_scalar_str(scaling_val, scaling_type, true)
                    level_scale = scaling_val
        if scaling_str ~= "" then scaling_str = " " .. scaling_str end
                    stat_value  = stat_value + (power_increases * scaling_val)
    end
                end
            end
    if scaling_str ~= nil then
        scaling_strs = scaling_strs .. scaling_str
    end
    if scaling_type == "Spirit" then
        spirit_scale = scaling_val
        stat_value  = stat_value + (spirit_power * scaling_val)
    elseif scaling_type == "Level" then
        level_scale = scaling_val
        stat_value  = stat_value + (power_increases * scaling_val)
    end
end
         end
         end