Module:StreetBrawlItems: Difference between revisionsGive feedback
Jump to navigation
Jump to search
mNo edit summary |
Street Brawl cards: pass size=0.8 to ItemBox; add temporary max-row counter for sizing (with help from vergir-bot LLM) |
||
| Line 7: | Line 7: | ||
-- Slot display order: Weapon -> Vitality (Armor) -> Spirit (Tech) | -- Slot display order: Weapon -> Vitality (Armor) -> Spirit (Tech) | ||
local SLOT_RANK = { Weapon = 1, Armor = 2, Tech = 3 } | local SLOT_RANK = { Weapon = 1, Armor = 2, Tech = 3 } | ||
-- Card scale passed to ItemBox for favored/unfavored/counter cards. | |||
local CARD_SIZE = "0.8" | |||
local NAME_TO_KEY, KEY_TO_NAME, RELEASED = {}, {}, {} | local NAME_TO_KEY, KEY_TO_NAME, RELEASED = {}, {}, {} | ||
| Line 55: | Line 57: | ||
local name = iname(code); if not name then return nil end | local name = iname(code); if not name then return nil end | ||
if style == "icon" then return frame:expandTemplate{title = "ItemIcon", args = {name}} end | if style == "icon" then return frame:expandTemplate{title = "ItemIcon", args = {name}} end | ||
return frame:expandTemplate{title = "ItemBox", args = {name, showTierTag = "true"}} | return frame:expandTemplate{title = "ItemBox", args = {name, showTierTag = "true", size = CARD_SIZE}} | ||
end | end | ||
local function render_hero(frame, key) | local function render_hero(frame, key) | ||
| Line 196: | 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 | ||