Module:Weapon

local mGameShortened = require('Module:GameShortened') local p = {}

local function getFullName(name) local bomb_rush = "Bomb Rush" local burst = "Burst Bomb" local splat = "Splat Bomb" local suction = "Suction Bomb" local seeker = "Seeker" local bomb_rush_burst = bomb_rush .. " " .. burst local bomb_rush_splat = bomb_rush .. " " .. splat local bomb_rush_suction = bomb_rush .. " " .. suction local bomb_rush_seeker = bomb_rush .. " " .. seeker local result = { [bomb_rush_burst] = bomb_rush_burst, [bomb_rush_splat] = bomb_rush_splat, [bomb_rush_suction] = bomb_rush_suction, [bomb_rush_seeker] = bomb_rush_seeker, [bomb_rush] = bomb_rush_splat, [bomb_rush .. " (" .. burst .. ")"] = bomb_rush_burst, [bomb_rush .. " (" .. splat .. ")"] = bomb_rush_splat, [bomb_rush .. " (" .. suction .. ")"] = bomb_rush_suction, [bomb_rush .. " (" .. seeker .. ")"] = bomb_rush_seeker, ["Bomb Launcher"] = "Splat-Bomb Launcher", ["Hero Gear"] = "Hero Shot Level 1", ["?"] = "Random", ["??"] = "Random 2", }   return result[name] or name end

local function getLink(name, game_abbrev) local bomb_rush = "Bomb Rush" local burst = "Burst Bomb" local splat = "Splat Bomb" local suction = "Suction Bomb" local seeker = "Seeker" local bomb_rush_burst = bomb_rush .. " " .. burst local bomb_rush_splat = bomb_rush .. " " .. splat local bomb_rush_suction = bomb_rush .. " " .. suction local bomb_rush_seeker = bomb_rush .. " " .. seeker local result = { [bomb_rush] = bomb_rush, [bomb_rush_burst] = bomb_rush, [bomb_rush_splat] = bomb_rush, [bomb_rush_suction] = bomb_rush, [bomb_rush_seeker] = bomb_rush, [bomb_rush .. " (" .. burst .. ")"] = bomb_rush, [bomb_rush .. " (" .. splat .. ")"] = bomb_rush, [bomb_rush .. " (" .. suction .. ")"] = bomb_rush, [bomb_rush .. " (" .. seeker .. ")"] = bomb_rush, ["Unarmed"] = "List of unarmed missions", ["Smallfry"] = "Smallfry (character)|Smallfry" }   if game_abbrev == 'S3' then result['?'] = "Salmon Run Next Wave#Wildcard rotation|Random" result['??'] = "Salmon Run Next Wave#Wildcard rotation|Random Rare" else result['?'] = "Salmon Run#Wildcard rotation|Random" result['??'] = "Salmon Run#Rare weapon-only rotation|Random Rare" end return result[name] or name end

function p.main(frame) local game = frame:getParent.args[1] or frame:getParent.args['game'] local category = frame:getParent.args[2] or frame:getParent.args['category'] local name = frame:getParent.args[3] or frame:getParent.args['name'] local size = frame:getParent.args[4] or frame:getParent.args['size'] or "24px" local icononly = frame:getParent.args[5] or frame:getParent.args['icononly'] or false local variant = frame:getParent.args[6] or frame:getParent.args['var'] local abbrev = mGameShortened.main(frame, game) local full_name = getFullName(name) local weapon_file = "[[File:" .. abbrev .. " Weapon " .. category .. " " .. full_name   if variant then    	weapon_file = weapon_file .. "_" .. variant    	end	weapon_file = weapon_file .. ".png|" .. size	if not name == "None" then 		weapon_file = weapon_file .. "|link=" .. getLink(name, abbrev)		end	weapon_file = weapon_file .. "]]" if not icononly then weapon_file = weapon_file .. " " .. getLink(name, abbrev) .. "" end return weapon_file end

return p