Module:Abilities/icon: Difference between revisions

Vergir (talk | contribs)
m add greater expansion's icon as a temp.substitue for ability range scaling
Expose isDisplayedScale so callers can tell hidden stat-category scalings from real coefficients (with help from vergir-bot LLM)
 
(2 intermediate revisions by 2 users not shown)
Line 52: Line 52:
     ["melee"] = { class = "melee", icon = "File:Melee scaling.png", link = "Melee Damage#Abilities", size = "28px" },
     ["melee"] = { class = "melee", icon = "File:Melee scaling.png", link = "Melee Damage#Abilities", size = "28px" },
     ["heavy_melee"] = { class = "melee", icon = "File:Melee scaling.png", link = "Melee Damage#Abilities", size = "28px" },
     ["heavy_melee"] = { class = "melee", icon = "File:Melee scaling.png", link = "Melee Damage#Abilities", size = "28px" },
    ["range"] = { class = "spirit", icon = "File:Greater_Expansion.png", link = "Ability Range" },
     ["power_increase"] = { class = "boon", icon = "File:Boon scaling.png", link = "Boon", size = "16px" }, -- Boon icon has to be smaller than others
     ["power_increase"] = { class = "boon", icon = "File:Boon scaling.png", link = "Boon", size = "16px" }, -- Boon icon has to be smaller than others
     ["duration"] = { class = "default" }, -- Use "default" if the scaling is unused
    -- Use "default" if the scaling is unused.
    -- The types below are stat-category markers rather than coefficients: they
    -- always carry a value of 1 and only flag which ability stats are affected
    -- by Ability Duration, Ability Cooldown, Ability Range, Healing and charge
    -- bonuses. There is no meaningful number to show, so they stay hidden.
     ["duration"] = { class = "default" },
    ["range"] = { class = "default" },
    ["radius"] = { class = "default" },
    ["cooldown"] = { class = "default" },
    ["charge_cooldown"] = { class = "default" },
    ["max_charges"] = { class = "default" },
    ["healing"] = { class = "default" },
}
}


function getScalarIcon(scaleType)
function getScalarIcon(scaleType)
return SCALING_ICON_MAP[scaleType]
return SCALING_ICON_MAP[scaleType]
end
-- Whether a scale type produces a visible badge.
-- False only for types explicitly mapped as "default". Unknown types count as
-- displayed, so they still surface through the missing-icon warning below
-- instead of being silently dropped.
function p.isDisplayedScale(scaleType)
local icon = getScalarIcon(scaleType)
return icon == nil or icon.class ~= "default"
end
end