FANDOM


--This module is invoked by Template:WeaponStat/Forging
 
local p = {}
local getArgs = require('Module:Arguments').getArgs
local getColor = require('Module:Color').colorByGame
local common = require('Module:Common')
 
function p.main(frame)
	local args = getArgs(frame)
	if(pcall(p._main, args)) then
        return p._main(args)
    else
        return '<span style="color:red">Something went wrong, please see [[Template:WeaponStat/Forging]].</span>'
    end
end
 
local function pttnHandler(arg, spans)
    local res = ''
    local rows = mw.text.split(arg, '%.\n')
    for i = 1, #rows do
        local cols = string.gsub(rows[i], ',', ' ||')
        if(spans ~= nil) then
            cols = string.gsub(rows[i], ',', '||', 2)
            cols = string.gsub(cols, ',', '\n|colspan=4| ')
        end
        res = (i == #rows) and res..cols or res..cols..'\n|-\n| '
    end
 
    return res
end
 
function p._main(args)
    local game = 'fe15'
    local class = common.colorLinks(game)
    local color = getColor[game]
    local out = '{|class="statbox"'
 
    if(args.forge ~= nil) then
        out = out..
            '\n! colspan=7 bgcolor='..color..' class='..class..'|Forging'..
            '\n|-'..
            '\n!style="color: #ffe36f"|★'..
            '\n![[File:Silver mark icon.png|24px|link=Silver Mark]]'..
            '\n![[File:Golden mark icon.png|24px|link=Gold Mark]]'..
            '\n![[Might|Mt]] !![[Hit%|Hit]] !![[Critical rate|Crt]] !![[Weight (weapon stat)|Wt]]'..
            '\n|-'..
            '\n| '..pttnHandler(args.forge)
    end
 
    if(args.evo ~= nil) then
        out = out..
            '\n|-'..
            '\n! colspan=7 bgcolor='..color..' class='..class..'|Evolution'..
            '\n|-'..
            '\n!style="color: #ffe36f"|★'..
            '\n![[File:Silver mark icon.png|24px|link=Silver Mark]]'..
            '\n![[File:Golden mark icon.png|24px|link=Gold Mark]]'..
            '\n!colspan=4| New weapon'..
            '\n|-'..
            '\n| '..pttnHandler(args.evo, '')
    end
 
    return out..'\n|}'
end
 
return p
 
--[[Category:Modules]]

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.