Module:Ability from brand
From Inkipedia, the Splatoon wiki
For use with Template:AbilityFromBrand.
Prints out the ability a specific gear brand favors or unfavors.
Parameters
{{AbilityFromBrand|<game>|<brand>|<preference>}}
game |
Unnamed, required. | The game abbreviation that the ability and brand belong to. Must be one of the following (case insensitive):
|
brand |
Unnamed, required. | The brand from which to draw the ability. Note it has to be one of the brands that favors specific abilities — if an invalid value is given, the module returns nil (which looks like an empty string). Has to be one of the following:
|
preference |
Unnamed, optional. | The brands preference to fetch. The default value is "common". Has to be one of the following:
|
Values
Examples
Markup
{{AbilityFromBrand|S|Krak-On|uncommon}}<br /> {{AbilityFromBrand|S2|Krak-On|uncommon}}<br /> {{Ability|S2|{{AbilityFromBrand|S2|Toni Kensa}}}}<br /> "{{AbilityFromBrand|S2|Grizzco|common}}"
Output
Defense Up
Bomb Defense Up DX
Main Power Up
""
local p = {} local abilityFromBrandTable = { ["Annaki"] = { ["common"] = { ["S2"] = "Main Power Up", ["S3"] = "Ink Saver (Sub)", }, ["uncommon"] = "Special Saver", }, ["Barazushi"] = { ["common"] = "Intensify Action", ["uncommon"] = "Sub Power Up", }, ["Emberz"] = { ["common"] = "Intensify Action", ["uncommon"] = "Special Charge Up", }, ["Enperry"] = { ["common"] = "Sub Power Up", ["uncommon"] = "Ink Resistance Up", }, ["Firefin"] = { ["common"] = "Ink Saver (Sub)", ["uncommon"] = "Ink Recovery Up", }, ["Forge"] = { ["common"] = { ["S"] = "Special Duration Up", ["S2"] = "Special Power Up", ["S3"] = "Special Power Up", }, ["uncommon"] = "Ink Saver (Sub)", }, ["Inkline"] = { ["common"] = { ["S"] = "Defense Up", ["S2"] = "Bomb Defense Up DX", ["S3"] = "Sub Resistance Up", }, ["uncommon"] = { ["S"] = "Damage Up", ["S2"] = "Main Power Up", ["S3"] = "Intensify Action", }, }, ["Krak-On"] = { ["common"] = "Swim Speed Up", ["uncommon"] = { ["S"] = "Defense Up", ["S2"] = "Bomb Defense Up DX", ["S3"] = "Sub Resistance Up", }, }, ["Rockenberg"] = { ["common"] = "Run Speed Up", ["uncommon"] = "Swim Speed Up", }, ["Skalop"] = { ["common"] = "Quick Respawn", ["uncommon"] = "Special Saver", }, ["Splash Mob"] = { ["common"] = "Ink Saver (Main)", ["uncommon"] = "Run Speed Up", }, ["SquidForce"] = { ["common"] = { ["S"] = "Damage Up", ["S2"] = "Ink Resistance Up", ["S3"] = "Ink Resistance Up", }, ["uncommon"] = "Ink Saver (Main)", }, ["Takoroka"] = { ["common"] = "Special Charge Up", ["uncommon"] = { ["S"] = "Special Duration Up", ["S2"] = "Special Power Up", ["S3"] = "Special Power Up", }, }, ["Tentatek"] = { ["common"] = "Ink Recovery Up", ["uncommon"] = "Quick Super Jump", }, ["Toni Kensa"] = { ["common"] = { ["S2"] = "Main Power Up", ["S3"] = "Ink Saver (Main)", }, ["uncommon"] = "Sub Power Up", }, ["Z+F"] = { ["common"] = "Special Saver", ["uncommon"] = "Ink Recovery Up", }, ["Zekko"] = { ["common"] = "Special Saver", ["uncommon"] = "Special Charge Up", }, ["Zink"] = { ["common"] = "Quick Super Jump", ["uncommon"] = "Quick Respawn", }, } function p.main(frame) local args = frame:getParent().args game = args[1] brand = args[2] preference = args[3] return p.getAbility(game, brand, preference) end function p.getAbility(game, brand, preference) game = string.upper(game) if preference ~= "uncommon" then preference = "common" end --Neutral brand if abilityFromBrandTable[brand] == nil then return nil --Branch check for different ability between games elseif type(abilityFromBrandTable[brand][preference]) == "table" then return abilityFromBrandTable[brand][preference][game] --Same across all games (so far) else return abilityFromBrandTable[brand][preference] end end return p