Module:HeroDataArrays: Difference between revisions

added hero sorting function
gravity scale
Line 854: Line 854:
                 { label = "Spirit Per Boon", field = "spiritScaling"  },
                 { label = "Spirit Per Boon", field = "spiritScaling"  },
                 { label = "At Max Boon", field = "maxSpiritScaling"  },
                 { label = "At Max Boon", field = "maxSpiritScaling"  },
            }
        }   
    }
    local output = {}
    for _, def in ipairs(tableDefs) do
        local t = buildTable(frame, rows, def, def.options)
        if t ~= "" then
            table.insert(output, t)
        end
    end
    return table.concat(output, "\n\n")
end
p.heroGravityTable = function(frame)
    local heroGravityData = heroDataArray({"Name", "GravityChange"})
    local rows = {}
    for name, data in pairs(heroGravityData) do
        table.insert(rows, {
            name = name,
            gravityScale  = "+".. data["GravityChange"] or 0,
        })
    end
    sortHeroes(rows)
    local tableDefs = {
    {
            title  = "Base Gravity Scale Stats",
            columns = {
                { label = "Gravity Scale (%)", field = "gravityScale"  },
             }
             }
         }     
         }