Module:AbilityTable: Difference between revisionsGive feedback
collect_effects falls back to prop name for unmapped props instead of skipping (with help from vergir-bot LLM) |
Drop Duration column from debuff table (with help from vergir-bot LLM) |
||
| Line 29: | Line 29: | ||
-- The hero is resolved automatically from AbilityCards.json via the ability name. | -- The hero is resolved automatically from AbilityCards.json via the ability name. | ||
-- Each entry requires: | -- Each entry requires: | ||
-- effects | -- effects = { "EffectName", ... } (supports "Effect (TN)" for upgrade-only) | ||
local manual_entries = { | local manual_entries = { | ||
["debuff"] = { | ["debuff"] = { | ||
["Combo"] = { | ["Combo"] = { | ||
effects | effects = { "Stun" }, | ||
}, | }, | ||
["Sand Blast"] = { | ["Sand Blast"] = { | ||
effects | effects = { "Disarm" }, | ||
}, | }, | ||
["Spirit Lasso"] = { | ["Spirit Lasso"] = { | ||
effects | effects = { "Stun" }, | ||
}, | }, | ||
}, | }, | ||
| Line 308: | Line 304: | ||
if manual.effects and #manual.effects > 0 then | if manual.effects and #manual.effects > 0 then | ||
cells["Effects"] = table.concat(manual.effects, ", ") | cells["Effects"] = table.concat(manual.effects, ", ") | ||
end | end | ||
return cells | return cells | ||
| Line 318: | Line 311: | ||
local effects_set = {} -- effect name -> true, for dedup | local effects_set = {} -- effect name -> true, for dedup | ||
-- Iterate stat_to_props["debuff"], skipping DebuffDuration ( | -- Iterate stat_to_props["debuff"], skipping DebuffDuration (it has no named effect). | ||
-- Use debuff_prop_to_effect for the display name; fall back to the prop name itself. | -- Use debuff_prop_to_effect for the display name; fall back to the prop name itself. | ||
local function collect_effects(obj, tier) | local function collect_effects(obj, tier) | ||
| Line 339: | Line 332: | ||
if type(upgrades) == "table" then | if type(upgrades) == "table" then | ||
for i, tier in ipairs(upgrades) do | for i, tier in ipairs(upgrades) do | ||
if type(tier) == "table" then | if type(tier) == "table" then collect_effects(tier, i) end | ||
end | end | ||
end | end | ||
local effect_parts = {} | local effect_parts = {} | ||
for _, e in ipairs(effects_seen) do | for _, e in ipairs(effects_seen) do | ||
| Line 363: | Line 342: | ||
if #effect_parts > 0 then | if #effect_parts > 0 then | ||
cells["Effects"] = table.concat(effect_parts, ", ") | cells["Effects"] = table.concat(effect_parts, ", ") | ||
end | end | ||
| Line 415: | Line 361: | ||
}, | }, | ||
["debuff"] = { | ["debuff"] = { | ||
headers = { "Effects | headers = { "Effects" }, | ||
get_cells = debuff_cells, | get_cells = debuff_cells, | ||
}, | }, | ||