Module:Icons

local p = {} local iconTip = { ["ability"]        = "Ability", ["ac"]             = "Armor class", ["acid"]           = "Acid", ["action"]         = "Action points", ["amber"]          = "Uncorroborrated fact", ["ammo"]           = "Ammunition", ["android"]        = "Android OS|platform", ["ap"]             = "Action points", ["apple"]          = "Apple iOS|platform", ["AR"]             = "All Roads", ["armorwb"]        = "Armor workbench", ["atom"]           = "Atom", ["attack"]         = "Attack", ["big gun"]        = "Big Gun, direct fire", ["bigger gun"]     = "Big Gun, area of effect", ["blade"]          = "Bladed melee weapon", ["bleed"]          = "Bleed", ["blunt"]          = "Blunt melee weapon", ["bonus effect"]   = "Bonus effect", ["boss"]           = "High level character", ["bronze"]         = "Bronze", ["caravan"]        = "Plays caravan", ["cards"]          = "Cards", ["chance"]         = "Armor class", ["check"]          = "Armor class", ["checkbrown"]     = "Armor class", ["chemst"]         = "Chemistry station", ["companion"]      = "Companion", ["confidence"]     = "Confidence", ["cookst"]         = "Cooking station", ["craft"]          = "Crafting", ["crit dmg"]       = "Critical damage", ["crit effect"]    = "Critical effect", ["crit"]           = "Critical damage", ["cross"]          = "No", ["crosshair"]      = "Attack", ["cut"]            = "Cut content", ["D20"]            = "Fallout Pen and Paper d20", ["dam/ap"]         = "Damage per action point", ["damage"]         = "Damage", ["dap"]            = "Armor class", ["dead"]           = "Dead", ["defense"]        = "Defense", ["detect"]         = "Detection", ["detection"]      = "Detection", ["dial"]           = "Dialogue", ["dialogue"]       = "Dialogue", ["dislike"]        = "Dislike", ["distance"]       = "Distance", ["doctor"]         = "Doctor", ["dps"]            = "Damage per second", ["dr"]             = "Damage resistance", ["dt"]             = "Damage threshold", ["effect"]         = "Effect", ["electrical"]     = "Electrical", ["emp"]            = "EMP", ["energy"]         = "Energy", ["enslave"]        = "Can be enslaved", ["essential"]      = "Essential", ["experience"]     = "Experience points", ["explmill"]       = "Explosives mill", ["explosion"]      = "Explosion", ["eye"]            = "Detection", ["facebook"]       = "Facebook", ["FB"]             = "Fallout Bible", ["FBG"]            = "Fallout: The Board Game", ["FBGNC"]          = "Fallout: New California", ["FILM"]           = "Fallout (film)", ["fire"]           = "Fire", ["fist"]           = "Fist", ["FNV"]            = "Fallout: New Vegas", ["FNVCS"]          = "Courier's Stash", ["FNVDM"]          = "Dead Money", ["FNVGRA"]         = "Gun Runners' Arsenal", ["FNVHH"]          = "Honest Hearts", ["FNVLR"]          = "Lonesome Road (add-on)", ["FNVOWB"]         = "Old World Blues (add-on)", ["fnvww"]          = "Wild Wasteland", ["FO1"]            = "Fallout", ["FO2"]            = "Fallout 2", ["FO3"]            = "Fallout 3", ["FO3BS"]          = "Broken Steel", ["FO3MZ"]          = "Mothership Zeta (add-on)", ["FO3OA"]          = "Operation: Anchorage (add-on)", ["FO3PL"]          = "Point Lookout (add-on)", ["FO3TP"]          = "The Pitt (add-on)", ["FO4"]            = "Fallout 4", ["FO4AUT"]         = "Automatron (add-on)", ["FO4CC"]          = "Creation Club", ["fo4chain01"]     = "Four key chain", ["fo4chain02"]     = "Five key chain", ["fo4chain03"]     = "Five key chain", ["FO4CW"]          = "Contraptions Workshop", ["FO4FH"]          = "Far Harbor (add-on)", ["fo4gencard"]     = "Generic keycard", ["fo4holo"]        = "Holotape", ["fo4key01"]       = "Quantum key", ["fo4key02"]       = "Toy rocketship key", ["fo4key03"]       = "Vault Boy key", ["fo4note"]        = "Note", ["FO4NW"]          = "Nuka-World (add-on)", ["fo4vaultid"]     = "Vault ID card", ["FO4VR"]          = "Fallout 4 VR", ["FO4VW"]          = "Vault-Tec Workshop", ["FO4WW"]          = "Wasteland Workshop", ["FO76"]           = "Fallout 76", ["FO76WA"]         = "Wild Appalachia", ["FO76NW"]         = "Nuclear Winter", ["FO76WL"]         = "Wastelanders", ["FOBOS"]          = "Fallout: Brotherhood of Steel", ["FOBOS2"]         = "Fallout: Brotherhood of Steel 2", ["foodpr"]         = "Food processor", ["FOS"]            = "Fallout Shelter", ["FOT"]            = "Fallout Tactics", ["FOT2"]           = "Fallout Tactics 2", ["FOX"]            = "Fallout Extreme", ["frost"]          = "Frost", ["FWW"]            = "Fallout: Wasteland Warfare", ["gamerscore"]     = "Gamerscore", ["gas"]            = "Gas", ["gold"]           = "Gold", ["green"]          = "Reliable fact", ["grenade"]        = "Grenade", ["group"]          = "Group", ["gun"]            = "Gun", ["hate"]           = "Hate", ["healing rate"]   = "Healing rate", ["healing"]        = "Healing rate", ["health"]         = "Health points", ["heart"]          = "Health points", ["hp"]             = "Health points", ["image"]          = "Image", ["info"]           = "Information", ["instagram"]      = "Instagram", ["ios"]            = "Apple iOS|platform", ["JES"]            = "J.E. Sawyer's Fallout RPG", ["jury"]           = "Jury Rigging", ["laser"]          = "Laser", ["level"]          = "Level", ["LH"]             = "Lionheart", ["like"]           = "Like", ["link"]           = "Food processor", ["linkedin"]       = "Linkedin", ["love"]           = "Love", ["mac"]            = "Macintosh Classic or Mac OS X|platform", ["macclassic"]     = "Macintosh Classic (≤ MacOS 9)|platform", ["mag"]            = "Magazine capacity", ["melee"]          = "Melee", ["mentioned"]      = "Mentioned", ["merchant"]       = "Merchant", ["mine"]           = "Mine", ["mod"]            = "With mods", ["myspace"]        = "Myspace", ["neutral"]        = "Neutral", ["neutralface"]    = "Neutral", ["no"]             = "No", ["nukamix"]        = "Nuka-mixer station", ["optional"]       = "Optional", ["PA"]             = "One Man, and a Crate of Puppets", ["parmorst"]       = "Power armor station", ["pbgame"]         = "Pip-Boy game", ["pc"]             = "PC|platform", ["percent"]        = "Chance", ["pistol"]         = "Gun", ["plasma"]         = "Plasma", ["platinum"]       = "Platinum", ["poison"]         = "Poison", ["ps3"]            = "Playstation 3|platform", ["ps4"]            = "Playstation 4|platform", ["PV13"]           = "Project V13", ["question"]       = "Question mark", ["radiation"]      = "Radiation", ["range"]          = "Range", ["rarity"]         = "Rarity", ["ratio"]          = "Ratio", ["red"]            = "Unreliable or incorrect statement", ["repair"]         = "Repair", ["repeat"]         = "Repeat", ["required"]       = "Required", ["rifle"]          = "Rifle", ["robotwb"]        = "Robot workbench", ["semi-required"]  = "Sometimes required or at least one required", ["semi"]           = "Sometimes required or at least one required", ["sequence"]       = "Sequence", ["shieldbronze"]   = "Armor class", ["shieldgold"]     = "Damage threshold", ["shieldsilver"]   = "Damage resistance", ["shotgun"]        = "Shotgun", ["sic"]            = "In-game spelling, punctuation and/or grammar", ["silver"]         = "Silver", ["smg"]            = "Submachine gun", ["sound"]          = "Sound", ["spawn"]          = "Spawned", ["spread"]         = "Spread", ["switch"]         = "Nintendo Switch|platform", ["TAR"]            = "Project V13", ["temp"]           = "Temporary", ["text"]           = "Text", ["TORN"]           = "TORN", ["tumblr"]         = "Tumblr", ["twitch"]         = "Twitch", ["twitter"]        = "Twitter", ["unarmed"]        = "Unarmed", ["VB"]             = "Van Buren", ["weapwb"]         = "Weapons workbench", ["weight"]         = "Weight", ["wild wasteland"] = "Wild Wasteland", ["WIKI"]           = "Nukapedia", ["windows"]        = "Windows Phone|platform", ["workshop"]       = "Workshop", ["ww"]             = "Wild Wasteland", ["xbox360"]        = "Xbox 360|platform", ["xboxone"]        = "Xbox One|platform", ["xp"]             = "Experience points", ["yes"]            = "Yes", } local gameIcon = { ["ability"]        = "Icon ability.png", ["ac"]             = "Icon shield bronze.png", ["acid"]           = "Icon acid.png", ["action"]         = "Icon action.png", ["amber"]          = "Icon amber.png", ["ammo"]           = "icon ammo.png", ["android"]        = "icon android.png", ["ap"]             = "Icon action.png", ["apple"]          = "icon appleios.png", ["ios"]            = "icon appleios.png", ["AR"]             = "gametitle-AR.png", ["armorwb"]        = "Fo4_Armor_Work_Icon.png", ["atom"]           = "Icon Fo76 Atom.png", ["attack"]         = "Icon attack.png", ["big gun"]        = "Icon heavy weapon.png", ["bigger gun"]     = "Icon big gun.png", ["blade"]          = "Icon blade.png", ["bleed"]          = "Icon bleed.png", ["blunt"]          = "Icon blunt.png", ["bonus effect"]   = "Icon bonus effect.png", ["boss"]           = "FoS Boss.png", ["bronze"]         = "Bronze.png", ["caravan"]        = "Icon cards.png", ["cards"]          = "Icon cards.png", ["chance"]         = "Icon chance.png", ["check"]          = "Icon check.png", ["checkbrown"]     = "Icon check temp.png", ["chemst"]         = "Fo4_Chem_Work_Icon.png", ["companion"]      = "Icon companion.png", ["confidence"]     = "Icon confidence.png", ["cookst"]         = "Fo4_Cook_Work_Icon.png", ["craft"]          = "Icon crafting.png", ["crit effect"]    = "Icon crit effect.png", ["crit"]           = "Icon critical damage.png", ["cross"]          = "Icon cross.png", ["crosshair"]      = "Icon attack.png", ["cut"]            = "Icon cut.png", ["D20"]            = "gametitle-D20.png", ["damage"]         = "Icon damage.png", ["dap"]            = "Icon dap.png", ["dead"]           = "Icon dead.png", ["defense"]        = "Icon shield silver.png", ["detect"]         = "Icon eye.png", ["detection"]      = "Icon eye.png", ["dial"]           = "Icon dialogue.png", ["dialogue"]       = "Icon dialogue.png", ["dislike"]        = "Dislike.svg", ["distance"]       = "Icon range.png", ["doctor"]         = "Icon doctor.png", ["dps"]            = "Icon dps.png", ["dr"]             = "Icon shield silver.png", ["dt"]             = "Icon shield gold.png", ["effect"]         = "Icon effect.png", ["electrical"]     = "Icon electrical.png", ["emp"]            = "Icon EMP.png", ["energy"]         = "Icon electrical.png", ["enslave"]        = "Icon cage.png", ["essential"]      = "Icon essential.png", ["experience"]     = "Icon XP.png", ["explmill"]       = "Icon fo4cw builder.png", ["explosion"]      = "Icon explosion.png", ["eye"]            = "Icon eye.png", ["facebook"]       = "FacebookIcon.png", ["FB"]             = "gametitle-FB.png", ["FBG"]            = "gametitle-FBG.png", ["FBGNC"]          = "gametitle-FBGNC.png", ["FBGWW"]          = "gametitle-FBGWW.png", ["FILM"]           = "Film.png", ["fire"]           = "Icon fire.png", ["fist"]           = "Icon fist.png", ["FNV"]            = "gametitle-FNV.png", ["FNVCS"]          = "Gametitle-FNV CS.png", ["FNVDM"]          = "gametitle-FNV DM.png", ["FNVGRA"]         = "gametitle-FNV GRA.png", ["FNVHH"]          = "gametitle-FNV HH.png", ["FNVLR"]          = "gametitle-FNV LR.png", ["FNVOWB"]         = "gametitle-FNV OWB.png", ["fnvww"]          = "Perk wild wasteland.png", ["FO"]             = "gametitle-FO1.png", ["FO1"]            = "gametitle-FO1.png", ["FO2"]            = "gametitle-FO2.png", ["FO3"]            = "gametitle-FO3.png", ["FO3BS"]          = "gametitle-FO3 BS.png", ["FO3MZ"]          = "gametitle-FO3 MZ.png", ["FO3OA"]          = "gametitle-FO3 OA.png", ["FO3PL"]          = "gametitle-FO3 PL.png", ["FO3TP"]          = "gametitle-FO3 TP.png", ["FO4"]            = "gametitle-FO4.png", ["FO4AUT"]         = "gametitle-FO4 AUT.png", ["FO4CC"]          = "gametitle-FO4 CC.png", ["fo4chain01"]     = "icon Fo4 chain01.png", ["fo4chain02"]     = "icon Fo4 chain02.png", ["fo4chain03"]     = "icon Fo4 chain03.png", ["FO4CW"]          = "gametitle-FO4_CW.png", ["FO4FH"]          = "gametitle-FO4_FH.png", ["fo4gencard"]     = "icon Fo4 gen keycard.png", ["fo4holo"]        = "icon Fo4 holotape.png", ["fo4key01"]       = "icon Fo4 key01.png", ["fo4key02"]       = "icon Fo4 key02.png", ["fo4key03"]       = "icon Fo4 key03.png", ["fo4note"]        = "icon Fo4 note.png", ["FO4NW"]          = "gametitle-FO4_NW.png", ["fo4vaultid"]     = "icon Fo4 vaultid.png", ["FO4VR"]          = "gametitle-FO4VR.png", ["FO4VW"]          = "gametitle-FO4 VW.png", ["FO4WW"]          = "gametitle-FO4 WW.png", ["FO76"]           = "gametitle-FO76.png", ["FO76WA"]         = "gametitle-FO76 WA.png", ["FO76NW"]         = "gametitle-FO76 NW.png", ["FO76WL"]         = "gametitle-FO76 WL.png", ["FOBOS"]          = "gametitle-FOBOS.png", ["FOBOS2"]         = "gametitle-FOBOS2.png", ["foodpr"]         = "Icon fo4cw builder.png", ["FOOL"]           = "PV13.png", ["FOS"]            = "gametitle-FOS.png", ["FOT"]            = "gametitle-FOT.png", ["FOT2"]           = "gametitle-FOT2.png", ["FOW"]            = "gametitle-FOW.png", ["FOX"]            = "gametitle-FOX.png", ["FPB"]            = "gametitle-FPB.png", ["frost"]          = "Icon effect.png", ["FWW"]            = "gametitle-FWW.png", ["gamerscore"]     = "Gamerscore.svg", ["gas"]            = "Icon gas.png", ["gold"]           = "Gold.png", ["green"]          = "Icon green.png", ["grenade"]        = "Icon grenade.png", ["group"]          = "Icon group.png", ["gun"]            = "Icon gun.png", ["hate"]           = "Hate.svg", ["healing rate"]   = "Icon healing.png", ["healing"]        = "Icon healing.png", ["health"]         = "Icon heart.png", ["heart"]          = "Icon heart.png", ["hp"]             = "Icon heart.png", ["image"]          = "Icon image.png", ["info"]           = "Icon info.png", ["instagram"]      = "Instagram icon.jpg", ["JES"]            = "gametitle-JES.png", ["jury"]           = "JuryRigging.png", ["laser"]          = "Icon laser.png", ["level"]          = "Icon level.png", ["LH"]             = "gametitle-LH.png", ["like"]           = "Like.svg", ["linkedin"]       = "Linkedin icon.png", ["love"]           = "Love.svg", ["mac"]            = "Icon mac.png", ["macclassic"]     = "Icon mac.png", ["mag"]            = "Assault carbine extended magazines.png", ["melee"]          = "Icon melee.png", ["mentioned"]      = "Icon mentioned.png", ["merchant"]       = "Icon merchant.png", ["mine"]           = "Icon mine.png", ["mod"]            = "Icon plus.png", ["myspace"]        = "Myspace icon.png", ["neutral"]        = "Icon neutral.png", ["neutralface"]    = "Neutral.svg", ["no"]             = "Icon cross.png", ["nukamix"]        = "Icon Nuka-mixer station.png", ["optional"]       = "Icon optional.png", ["PA"]             = "Penny Arcade.gif", ["parmorst"]       = "Fo4_Power_Work_Icon.png", ["pbgame"]         = "Fo4_Pip-Boy game.png", ["pc"]             = "Icon pc.png", ["percent"]        = "Icon chance.png", ["pistol"]         = "Icon gun.png", ["plasma"]         = "Icon plasma.png", ["platinum"]       = "Plat.png", ["poison"]         = "Icon poison.png", ["ps3"]            = "Icon ps3.png", ["ps4"]            = "Icon ps4.png", ["PV13"]           = "PV13.png", ["question"]       = "Icon question.png", ["radiation"]      = "Icon radiation.png", ["range"]          = "Icon range.png", ["rarity"]         = "Icon rarity.png", ["ratio"]          = "Icon ratio.png", ["red"]            = "Icon red.png", ["repair"]         = "Icon repair.png", ["repeat"]         = "Icon repeat.png", ["required"]       = "Icon required.png", ["rifle"]          = "Icon rifle.png", ["robotwb"]        = "Icon robot workbench.png", ["semi-required"]  = "Icon semi-required.png", ["semi"]           = "Icon semi-required.png", ["sequence"]       = "Icon sequence.png", ["shieldbronze"]   = "Icon shield bronze.png", ["shieldgold"]     = "Icon shield gold.png", ["shieldsilver"]   = "Icon shield silver.png", ["shotgun"]        = "Icon shotgun.png", ["sic"]            = "Icon sic.png", ["silver"]         = "Silver.png", ["smg"]            = "Icon smg.png", ["sound"]          = "Icon sound.png", ["spawn"]          = "Icon spawn.png", ["spread"]         = "Icon spread.png", ["switch"]         = "Nintendo Switch icon.png", ["TAR"]            = "gametitle-TAR.jpg", ["temp"]           = "Icon check temp.png", ["text"]           = "Icon text.png", ["TORN"]           = "gametitle-TORN.png", ["tumblr"]         = "Tumblr Icon.png", ["twitch"]         = "Twitch icon.png", ["twitter"]        = "Twitter icon.png", ["unarmed"]        = "Icon unarmed.png", ["VB"]             = "gametitle-VB.png", ["weapwb"]         = "Fo4_Weapon_Work_Icon.png", ["weight"]         = "Icon weight.png", ["WIKI"]           = "gametitle-Wiki.png", ["wild wasteland"] = "Perk wild wasteland.png", ["windows"]        = "Icon windows.png", ["workshop"]       = "Icon workshop.png", ["ww"]             = "Perk wild wasteland.png", ["xbox360"]        = "Icon xbox360.png", ["xboxone"]        = "Icon xboxone.png", ["xp"]             = "Icon XP.png", ["yes"]            = "Icon check.png", } local iconSize = { ["small"]          = "x10px", ["medium"]         = "x14px", ["normal"]         = "x14px", ["big"]            = "x20px", } function p.Icons(frame) local iconList = mw.text.split(frame.args[1], ",") local parserError = "" local iconSetting if frame.args[2] ~= nil and string.len(frame.args[2]) > 0 then iconSetting = tostring(frame.args[2]) if iconSize[iconSetting] ~= nil then iconSetting = iconSize[iconSetting] end else iconSetting = iconSize["medium"] end local iconLinks if frame.args[3] ~= nil then iconLinks = mw.text.split(frame.args[3], ",") end local tipOverride if frame.args[4] ~= nil then tipOverride = mw.text.split(frame.args[4], ",") end local n = 1 local result = ""

while n <= table.getn(iconList) do       newIcon = iconList[n] if gameIcon[newIcon] ~= nil then currentIcon = gameIcon[newIcon] if tipOverride ~= nil and tipOverride[n] ~= nil and string.len(tipOverride[n]) > 0 then currentTip = tipOverride[n] else if iconLinks ~= nil and iconLinks[n] ~= nil and string.len(iconLinks[n]) > 0 then currentTip = iconLinks[n] else splitTip = mw.text.split(iconTip[newIcon], "|") currentTip = splitTip[1] end end else currentIcon = "Icon question.png" currentTip = "Unrecognized icon name" result = result .. ""       end

result = result .. ' '       result = result .. '[' .. '[File:' .. currentIcon .. '|' .. iconSetting if iconLinks ~= nil and iconLinks[n] ~= nil and iconLinks[n] ~= "" then result = result .. '|link=' .. iconLinks[n] else result = result .. '|link=' end if currentTip ~= nil then result = result .. '|' .. currentTip end

result = result .. ']] '       if n < table.getn(iconList) then result = result .. " "       end n = n + 1 end return result .. parserError end

function p.platforms(frame) local icons = mw.text.split(frame.args[1], ",") local iconCount = 1 local platformCheck = "" local result = "" while iconCount <= table.getn(icons) do       currentIcon = iconTip[icons[iconCount]] platformCheck = mw.text.split(currentIcon, "|") if platformCheck[2] ~= nil then result = result .. ' ' .. "Has platform::"           result = result .. platformCheck[1] .. ' ' result = result .. '' result = result .. ""           result = result .. ' '           if iconCount < table.getn(icons) then result = result .. " "           end end iconCount = iconCount + 1 end if result == "" then result = '[Platforms needed]' end return result end

function p.Test(frame) local iconList = mw.text.split(frame.args[1], ",") local parserError = "" local iconSetting if frame.args[2] ~= nil and string.len(frame.args[2]) > 0 then iconSetting = tostring(frame.args[2]) if iconSize[iconSetting] ~= nil then iconSetting = iconSize[iconSetting] end else iconSetting = iconSize["medium"] end local iconLinks if frame.args[3] ~= nil then iconLinks = mw.text.split(frame.args[3], ",") end local tipOverride if frame.args[4] ~= nil then tipOverride = mw.text.split(frame.args[4], ",") end local n = 1 local result = ""

while n <= table.getn(iconList) do       newIcon = iconList[n] if gameIcon[newIcon] ~= nil then currentIcon = gameIcon[newIcon] if tipOverride ~= nil and tipOverride[n] ~= nil and string.len(tipOverride[n]) > 0 then currentTip = tipOverride[n] else if iconLinks ~= nil and iconLinks[n] ~= nil and string.len(iconLinks[n]) > 0 then currentTip = iconLinks[n] else splitTip = mw.text.split(iconTip[newIcon], "|") currentTip = splitTip[1] end end else currentIcon = "Icon question.png" currentTip = "Unrecognized icon name" result = result .. ""       end

result = result .. 'Current tip: ' .. currentTip .. " : " .. string.len(currentTip) .. '\n'

result = result .. ']] '       if n < table.getn(iconList) then result = result .. " "       end n = n + 1 end return result .. parserError end

return p