Module:AbilityTable/ComplexRenderers: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m knockback => displacement |
simplify RenderDebuff to just find earliest upgrade tier, remove debuff_short_name table (with help from vergir-bot LLM) |
||
| Line 86: | Line 86: | ||
return nil | return nil | ||
end | end | ||
-- ============================================================ | -- ============================================================ | ||
| Line 398: | Line 367: | ||
end | end | ||
-- Shows a note if an ability acquires a debuff via upgrades. | -- Shows a note if an ability only acquires a dispellable debuff via upgrades. | ||
-- Shared by debuffresist and dispelmagic. | -- Shared by debuffresist and dispelmagic. | ||
function p.RenderDebuff(ability, stat) | function p.RenderDebuff(ability, stat) | ||
| Line 411: | Line 380: | ||
end | end | ||
-- Find the earliest upgrade tier with a matching prop. | |||
local upgrades = ability["Upgrades"] | local upgrades = ability["Upgrades"] | ||
if type(upgrades) ~= "table" then return cells end | if type(upgrades) ~= "table" then return cells end | ||
for i, tier in ipairs(upgrades) do | for i, tier in ipairs(upgrades) do | ||
if type(tier) == "table" then | if type(tier) == "table" then | ||
for _, prop in ipairs(stat_props) do | for _, prop in ipairs(stat_props) do | ||
local v = tier[prop] | local v = tier[prop] | ||
| Line 426: | Line 391: | ||
if type(v) == "table" then v = v["Value"] end | if type(v) == "table" then v = v["Value"] end | ||
if v ~= nil and v ~= 0 and v ~= "" and v ~= "0" and v ~= "0m" then | if v ~= nil and v ~= 0 and v ~= "" and v ~= "0" and v ~= "0m" then | ||
cells["Notes"] = "After T" .. i | |||
return cells | |||
end | end | ||
end | end | ||
end | end | ||
end | end | ||
end | end | ||
return cells | return cells | ||
end | end | ||