Module:Sandbox/Exaskliri/GearInfo
This a future Lua module to replace following gear info templates:
- Template:GearIntroText (referred to as template 1)
- Template:Infobox/Gear (template 2)
- Template:GearAbilityAndBrandInfo (template 3)
Purposes
- Since this is a Lua module, it will be faster than MediaWiki templates it replaces.
- Variables (price, star, etc.) only needs to be assigned once in each page, instead of repeating them for each template in the same page.
- DPL3 support.
- Data of each gear item only needs to be defined once in the entire wiki, in their respective page.
- Pages that collate their data (e.g., Template:Gear/S3 Clothing) then uses DPL to refer to gear pages, instead of having their own duplicate data.
- Sentence restructuring for readability, including but not limited to:
- Move gear acquisition info from template 1 to under each game header (near template 3). Since more games are added, said info starts clogging template 1.
Currently | Goal (abridged) |
---|---|
The SV925 Circle Shades are headgear in the Splatoon series. In Splatoon 2, they are a 3-star item produced by Rockenberg and come with the primary ability Swim Speed Up. They can be purchased from Headspace for 11,000 or from SplatNet 2 Gear Shop for 16,500. In Splatoon 3, they are a 2-star item produced by Rockenberg and come with the primary ability Swim Speed Up. They can be obtained through leveling up the Chill Season 2022 Catalog to level 5, or they can be purchased from Naut Couture for 11,000 from SplatNet 3 Shop for 16,500. |
The SV925 Circle Shades are headgear in the Splatoon series. Splatoon 2Acquisition
Splatoon 3Acquisition
|
- Change template 3 from a long paragraph to bullet points.
Currently (abridged) | Goal (also abridged) |
---|---|
The White Tee comes with Ink Saver (Sub) as the primary ability. As a 0-star item, the White Tee comes with one additional slot for secondary abilities. Since it is made by the SquidForce gear brand, it has a higher chance of rolling Ink Resistance Up and a lower chance of rolling Ink Saver (Main) to fill its secondary ability slots. |
|
Where to collaborate?
- First, join the Inkipedia Discord guild if you haven't already.
- This is the link to the thread.
local p = {} local numberToText = require("Module:NumberToText") local fullGameName = { s = "Splatoon", s2 = "Splatoon 2", s3 = "Splatoon 3", } local function sectionPerGame(allText, args, game) if args[game] then local argsPerGame = {} local sentenceVar = {} --If name differs from page title. Unused otherwise. argsPerGame['name'] = args[game .. "_name"] or args["name"] or mw.title.getCurrentTitle() argsPerGame['an'] = args[game .. "_an"] or args["an"] --By default, assume item can be obtained from overworld shops with cash. argsPerGame['price'] = args[game .. "_price"] argsPerGame['currency'] = args[game .. "_currency"] --splatnet price argsPerGame['sn_price'] = args[game .. "_sn_price"] argsPerGame['stars'] = args[game .. "_stars"] argsPerGame['brand'] = args[game .. "_brand"] or args["brand"] argsPerGame['ability'] = args[game .. "_ability"] --if argsPerGame['ability'] == "Recon" --Header for game title. local gameHeader = fullGameName[game] table.insert(allText, "==\'\'" .. gameHeader .. "\'\'==\n") --Infobox, 0% progress --Availability table.insert(allText, "===Availability===\n") --Gear data (stars, brand, ability) table.insert(allText, "===Data===") if game == 's' then sentenceVar[1] = " default" else sentenceVar[1] = "" end table.insert(allText, "* The" ..sentenceVar[1].. " primary [[Gear ability|ability]] is [[" .. argsPerGame['ability'] .. "]].") if not argsPerGame['stars'] or argsPerGame['stars'] == "" then table.insert(allText, "* The" ..argsPerGame['name'].. " lacks a default star power. Instead, it is assigned randomly when received.") else if game == 's' or game == 's2' then sentenceVar[1] = "" sentenceVar[2] = "" else sentenceVar[1] = " default" sentenceVar[2] = "" end table.insert(allText, "* Its" ..sentenceVar[1].." star power is " .. argsPerGame['stars'] .. ", meaning it has " ..sentenceVar[2].. " secondary ability slots by default.") end end end function p.main(frame) local args = frame:getParent().args return p.gearInfo(args) end function p.gearInfo(args) local allText = {} --local category = args['category'] or nil --local plural = args['plural'] or false sectionPerGame(allText, args, "s") sectionPerGame(allText, args, "s2") sectionPerGame(allText, args, "s3") return table.concat(allText, "\n") end return p