Toggle menu
15
236
70
27.5K
Kenshi Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 20:28, 26 May 2025 by Prd (talk | contribs) (Created page with "local p = {} local factions = mw.loadData('Module:Faction/data') local armour_names = { ['armors 0'] = 'Prototype', ['armors 1'] = 'Shoddy', ['armors 2'] = 'Standard', ['armors 3'] = 'High', ['armors 4'] = 'Specialist', ['armors 5'] = 'Masterwork' } function p.main() -- Nothing to see here at the moment end function p._translate(armour_grades) local results = {} for i, _ in ipairs(armour_grades) do local key = armour_grades...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


From https://kenshi.fandom.com/wiki/Module:Faction


local p = {}
local factions = mw.loadData('Module:Faction/data')

local armour_names = {
    ['armors 0'] = 'Prototype',
    ['armors 1'] = 'Shoddy',
    ['armors 2'] = 'Standard',
    ['armors 3'] = 'High',
    ['armors 4'] = 'Specialist',
    ['armors 5'] = 'Masterwork'
}

function p.main()
    -- Nothing to see here at the moment
end

function p._translate(armour_grades)
    local results = {}

    for i, _ in ipairs(armour_grades) do
        local key = armour_grades[i][1]
        local value = armour_grades[i][2]
        table.insert(results, {armour_names[key], value})
    end

    return results
end

function p.get_armour_grades(faction)
    return p._translate(factions[faction]['base']['armour vendor quality chance'])
end

return p