Módulo:Gb
Revisão de 21h25min de 22 de novembro de 2025 por GhoulBlack (discussão | contribs)
A documentação para este módulo pode ser criada em Módulo:Gb/doc
local p = {}
-- caixa de texto
local textBox = main:tag("div"):css{ flex = 1 }
textBox:tag("div")
:css{ ["font-size"] = "1.25em", ["font-weight"] = "bold", color = "#e82b2b" }
:wikitext(nome)
-----------------------------------------------------------------
-- Stats
-----------------------------------------------------------------
local stats = main:tag("div")
:css{
display = "flex",
["flex-direction"] = "column",
gap = "5px",
["min-width"] = "170px"
}
local statBox = stats:tag("div")
:css{
padding = "12px 18px",
["border-radius"] = "8px",
["background-color"] = theme.variantB
}
statBox:wikitext(string.format('<span style="font-size:1.1em; color:#fb3d3d; font-weight:bold;">❤️ %s</span> ', hp))
statBox:wikitext(string.format('<span style="font-size:1.1em; color:#ffe568; font-weight:bold;">💰 %s</span> ', exp))
statBox:wikitext(string.format('<span style="font-size:1.1em; color:#6ca8fb; font-weight:bold;">⚔️ %s</span>', nivel))
stats:tag("div")
:css{ ["font-size"] = "90%" }
:wikitext(string.format(
"<b>Frescor:</b> %s • <b>Forte:</b> %s • <b>Reflete:</b> %s",
fresco, forte, reflete
))
-----------------------------------------------------------------
-- LOOT TABLE
-----------------------------------------------------------------
local loot = box:tag("div")
:css{
padding = "18px",
["margin-top"] = "25px",
["border-radius"] = "10px",
background = theme.lootBox
}
local t = loot:tag("table"):css{ width = "100%" }
local function row(label, color, value)
local tr = t:tag("tr")
tr:tag("th"):css{ ["text-align"] = "left", color = color, padding = "6px" }:wikitext(label)
tr:tag("td"):wikitext(value)
end
row("Comum:", "#f3e8bb", comum)
row("Semi-Raro:", "#aeccff", semiraro)
row("Raro:", "#e6e5ff", raro)
row("Muito Raro:", "#f9538f", muitoRaro)
-- Função principal -------------------------------------------------
function p.bossInfo(frame)
local args = frame:getParent().args
local tema = mw.text.trim(args["tema"] or "dark"):lower()
if not temas[tema] then tema = "dark" end
-- MULTIBOSS: |1= |2= |3=
local finalHtml = {}
local count = 0
for k, v in pairs(args) do
if tonumber(k) then
count = count + 1
local subArgs = mw.clone(args)
for subk, subv in mw.text.gsplit(v, ";", true) do end
subArgs.nome = v
table.insert(finalHtml, renderBoss(subArgs, temas[tema]))
end
end
if count == 0 then
table.insert(finalHtml, renderBoss(args, temas[tema]))
end
return table.concat(finalHtml, "\n\n")
end
return p