FANDOM


local p = {}
local comb = require('Module:Revolution AADPT/combinatorics')
local bardb = mw.loadData('Module:Revolution AADPT/bardb/data')
local row = require('Module:Revolution AADPT')._row
 
local map = {
	["A"] = "Backhand",
	["B"] = "Havoc",
	["C"] = "Sever",
	["D"] = "Slice",
	["E"] = "Smash",
	["F"] = "Cleave",
	["G"] = "Decimate",
	["H"] = "Dismember",
	["I"] = "Fury",
	["J"] = "Punish",
	["K"] = "Chain",
	["L"] = "Combust",
	["M"] = "Concentrated Blast",
	["N"] = "Corruption Blast",
	["O"] = "Dragon Breath",
	["P"] = "Impact",
	["Q"] = "Sonic Wave",
	["R"] = "Wrack",
	["S"] = "Binding Shot",
	["T"] = "Corruption Shot",
	["U"] = "Dazing Shot",
	["V"] = "Fragmentation Shot",
	["W"] = "Needle Strike",
	["X"] = "Ricochet",
	["Y"] = "Snipe",
	["Z"] = "Bash",
	["a"] = "Sacrifice",
	["b"] = "Tuska's Wrath",
	["c"] = "Bash defender",
	["d"] = "null",
	["e"] = "null",
	["f"] = "null",
	["g"] = "null",
	["h"] = "null",
	["i"] = "null",
}
 
function toAbils(bar)
    local ret = {}
    if type(bar) == 'string' then
        bar = mw.text.split(bar,'')
    end
 
    for i,v in ipairs(bar) do
        local mapped = map[v]
        if mapped and mapped ~= "null" then
            table.insert(ret, mapped)
        end
    end
    return ret
end
 
 
 
function p.main(test)
    local bars = {}
    local ret = {}
    local i
    if bardb[test] then
        bars[bardb[test]] = true
    end
    for i = #test - 1, 2, -1 do
        comb.setup(i, mw.text.split(test,''))
        while comb.hasNext() do
            local v = bardb[table.concat(comb.getNext())]
            if v then
                bars[v] = toAbils(v)
            end
        end
    end
 
    return bars
end
 
function p.rows(bars, conditions)
    local rows = {}
    local args = conditions or {}
 
    for i,v in pairs(bars) do
        args.bar = table.concat(v,',')
        table.insert(rows, tostring(row(args)))
    end
 
    return table.concat(rows,'\n')
end
 
 
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.