Module:StreetBrawlItems: Difference between revisions

Street Brawl cards: pass size=0.8 to ItemBox; add temporary max-row counter for sizing (with help from vergir-bot LLM)
Remove temporary max-row counter (with help from vergir-bot LLM)
Line 198: Line 198:
for _, c in ipairs(sb.AvailableItems) do if c == code then return "1" end end
for _, c in ipairs(sb.AvailableItems) do if c == code then return "1" end end
return ""
return ""
end
-- TEMPORARY: report the largest favored / unfavored group across released heroes.
function p.debug_counts(frame)
local maxfav, favwho = 0, ""
local maxunf, unfwho = 0, ""
for hkey in pairs(RELEASED) do
local favored, unfavored = hero_sets(hkey)
for tier = 1, 5 do
local fc, uc = 0, 0
for _, c in ipairs(sb.AvailableItems) do
if iok(c) and itier(c) == tier then
if favored[c] then fc = fc + 1 end
if unfavored[c] then uc = uc + 1 end
end
end
if fc > maxfav then maxfav = fc; favwho = (KEY_TO_NAME[hkey] or hkey) .. " T" .. tier end
if uc > maxunf then maxunf = uc; unfwho = (KEY_TO_NAME[hkey] or hkey) .. " T" .. tier end
end
end
return "maxFavored=" .. maxfav .. " (" .. favwho .. "); maxUnfavored=" .. maxunf .. " (" .. unfwho .. ")"
end
end


return p
return p