Module:AbilityTable: Difference between revisions

Vergir (talk | contribs)
m ninjafix
compact view: include auto-notes alongside human notes; change note concatenation separator to semicolon (with help from vergir-bot LLM)
Line 564: Line 564:
     if channel_slow and channel_slow ~= 0 then
     if channel_slow and channel_slow ~= 0 then
         local note = "Also slows the caster for " .. math.abs(channel_slow) .. "%."
         local note = "Also slows the caster for " .. math.abs(channel_slow) .. "%."
         cells["Notes"] = cells["Notes"] and (cells["Notes"] .. " " .. note) or note
         cells["Notes"] = cells["Notes"] and (cells["Notes"] .. "; " .. note) or note
     end
     end


Line 615: Line 615:
     if caster_dash_slow then
     if caster_dash_slow then
         local note = "Gives " .. caster_dash_slow .. "% dash slow for the caster."
         local note = "Gives " .. caster_dash_slow .. "% dash slow for the caster."
         cells["Notes"] = cells["Notes"] and (cells["Notes"] .. " " .. note) or note
         cells["Notes"] = cells["Notes"] and (cells["Notes"] .. "; " .. note) or note
     end
     end


Line 762: Line 762:
                 hero_abilities[hero] = {}
                 hero_abilities[hero] = {}
             end
             end
             table.insert(hero_abilities[hero], ability["Name"])
             table.insert(hero_abilities[hero], ability)
         end
         end


Line 769: Line 769:
             local hero_cell = frame:expandTemplate{ title = "HeroIcon", args = { hero } }
             local hero_cell = frame:expandTemplate{ title = "HeroIcon", args = { hero } }
             local ability_parts = {}
             local ability_parts = {}
             for _, name in ipairs(hero_abilities[hero]) do
             for _, ability in ipairs(hero_abilities[hero]) do
                local name = ability["Name"]
                 local ability_cell = frame:expandTemplate{ title = "AbilityIcon", args = { name } }
                 local ability_cell = frame:expandTemplate{ title = "AbilityIcon", args = { name } }
                 local note = stat_notes and stat_notes[name]
 
                 local extra = get_cells(ability)
                if stat_notes and stat_notes[name] then
                    local human = stat_notes[name]
                    extra["Notes"] = extra["Notes"] and (extra["Notes"] .. "; " .. human) or human
                end
 
                local note = extra["Notes"]
                 if note then
                 if note then
                     table.insert(ability_parts, ability_cell .. " (" .. note .. ")")
                     table.insert(ability_parts, ability_cell .. " (" .. note .. ")")
Line 823: Line 831:
         if stat_notes and stat_notes[ability["Name"]] then
         if stat_notes and stat_notes[ability["Name"]] then
             local human = stat_notes[ability["Name"]]
             local human = stat_notes[ability["Name"]]
             extra["Notes"] = extra["Notes"] and (extra["Notes"] .. " " .. human) or human
             extra["Notes"] = extra["Notes"] and (extra["Notes"] .. "; " .. human) or human
         end
         end