Module:GamePassives: Difference between revisions
From SpiritVale Wiki
More actions
No edit summary |
No edit summary |
||
| Line 55: | Line 55: | ||
row:tag("th"):wikitext(label):done() | row:tag("th"):wikitext(label):done() | ||
row:tag("td"):wikitext(value):done() | row:tag("td"):wikitext(value):done() | ||
end | end | ||
| Line 109: | Line 98: | ||
return nil | return nil | ||
end | end | ||
local parts = {} | local parts = {} | ||
if block.Base ~= nil then | if block.Base ~= nil then | ||
table.insert(parts, string.format("Base %s", tostring(block.Base))) | table.insert(parts, string.format("Base %s", tostring(block.Base))) | ||
| Line 116: | Line 107: | ||
table.insert(parts, string.format("%s / Lv", tostring(block["Per Level"]))) | table.insert(parts, string.format("%s / Lv", tostring(block["Per Level"]))) | ||
end | end | ||
if #parts == 0 then | if #parts == 0 then | ||
return nil | return nil | ||
end | end | ||
return table.concat(parts, ", ") | return table.concat(parts, ", ") | ||
end | end | ||
| Line 149: | Line 142: | ||
-- Optional qualifiers (weapon/stance/etc.), if present in data | -- Optional qualifiers (weapon/stance/etc.), if present in data | ||
local qual = eff.Weapon or eff["Weapon"] or eff["Weapon Type"] | local qual = | ||
eff.Weapon or eff["Weapon"] or eff["Weapon Type"] or | |||
eff.Stance or eff["Stance"] or eff["Stance Type"] | |||
if type(qual) == "string" and qual ~= "" then | if type(qual) == "string" and qual ~= "" then | ||
| Line 179: | Line 173: | ||
local detail = {} | local detail = {} | ||
if type(s.Duration) == "table" then | |||
local t = formatBasePer(s.Duration) | |||
local t = formatBasePer( | |||
if t then | if t then | ||
table.insert(detail, "Duration " .. t) | table.insert(detail, "Duration " .. t) | ||
| Line 187: | Line 180: | ||
end | end | ||
if type(s.Chance) == "table" then | |||
local t = formatBasePer(s.Chance) | |||
local t = formatBasePer( | |||
if t then | if t then | ||
table.insert(detail, "Chance " .. t) | table.insert(detail, "Chance " .. t) | ||
| Line 221: | Line 213: | ||
local names = r["Status Name"] | local names = r["Status Name"] | ||
local label | local label | ||
if type(names) == "table" then | if type(names) == "table" then | ||
label = table.concat(names, ", ") | label = table.concat(names, ", ") | ||
| Line 231: | Line 224: | ||
local bp = formatBasePer(r) | local bp = formatBasePer(r) | ||
local seg = label | local seg = label | ||
if bp then | if bp then | ||
seg = seg .. " – " .. bp | seg = seg .. " – " .. bp | ||
end | end | ||
table.insert(parts, seg) | table.insert(parts, seg) | ||
end | end | ||
| Line 247: | Line 242: | ||
local parts = {} | local parts = {} | ||
for _, ev in ipairs(list) do | for _, ev in ipairs(list) do | ||
if type(ev) == "table" then | if type(ev) == "table" then | ||
| Line 269: | Line 265: | ||
return | return | ||
end | end | ||
local flags = {} | local flags = {} | ||
for k, v in pairs(sub) do | for k, v in pairs(sub) do | ||
| Line 275: | Line 272: | ||
end | end | ||
end | end | ||
table.sort(flags) | table.sort(flags) | ||
if #flags > 0 then | if #flags > 0 then | ||
table.insert(parts, string.format("%s: %s", label, table.concat(flags, ", "))) | table.insert(parts, string.format("%s: %s", label, table.concat(flags, ", "))) | ||
| Line 394: | Line 393: | ||
or (req["Required Weapons"] and #req["Required Weapons"] > 0) | or (req["Required Weapons"] and #req["Required Weapons"] > 0) | ||
or (req["Required Stances"] and #req["Required Stances"] > 0) then | or (req["Required Stances"] and #req["Required Stances"] > 0) then | ||
if type(req["Required Skills"]) == "table" and #req["Required Skills"] > 0 then | if type(req["Required Skills"]) == "table" and #req["Required Skills"] > 0 then | ||
| Line 400: | Line 398: | ||
for _, rs in ipairs(req["Required Skills"]) do | for _, rs in ipairs(req["Required Skills"]) do | ||
local sname = rs["Skill Name"] or rs["Skill ID"] or "Unknown" | local sname = rs["Skill Name"] or rs["Skill ID"] or "Unknown" | ||
local | local rlv = rs["Required Level"] | ||
if | if rlv then | ||
table.insert(skillParts, string.format("%s (Lv.%s)", sname, | table.insert(skillParts, string.format("%s (Lv.%s)", sname, rlv)) | ||
else | else | ||
table.insert(skillParts, sname) | table.insert(skillParts, sname) | ||
| Line 418: | Line 416: | ||
------------------------------------------------------------------ | ------------------------------------------------------------------ | ||
local peRows = passiveEffectRows(rec["Passive Effects"]) | local peRows = passiveEffectRows(rec["Passive Effects"]) | ||
for _, r in ipairs(peRows) do | |||
addRow(root, r.label, r.value) | |||
end | end | ||