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):
  • S for Splatoon
  • S2 for Splatoon 2
  • S3 for Splatoon 3
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:
  • Annaki
  • Barazushi
  • Emberz
  • Enperry
  • Firefin
  • Forge
  • Inkline
  • Krak-On
  • Rockenberg
  • Skalop
  • Splash Mob
  • SquidForce
  • Takoroka
  • Tentatek
  • Toni Kensa
  • Z+F
  • Zekko
  • Zink
preference Unnamed, optional. The brands preference to fetch. The default value is "common". Has to be one of the following:
  • common for the x5 Ability
  • uncommon for the x.5 Ability

Values

Brand Splatoon Splatoon 2 Splatoon 3
common uncommon common uncommon common uncommon
Annaki Annaki - - Main Power Up Special Saver Ink Saver (Sub) Special Saver
Barazushi Barazushi - - - - Intensify Action Sub Power Up
Emberz Emberz - - - - Intensify Action Special Charge Up
Enperry Enperry - - Sub Power Up Ink Resistance Up Sub Power Up Ink Resistance Up
Firefin Firefin Ink Saver (Sub) Ink Recovery Up Ink Saver (Sub) Ink Recovery Up Ink Saver (Sub) Ink Recovery Up
Forge Forge Special Duration Up Ink Saver (Sub) Special Power Up Ink Saver (Sub) Special Power Up Ink Saver (Sub)
Inkline Inkline Defense Up Damage Up Bomb Defense Up DX Main Power Up Sub Resistance Up Intensify Action
Krak-On Krak-On Swim Speed Up Defense Up Swim Speed Up Bomb Defense Up DX Swim Speed Up Sub Resistance Up
Rockenberg Rockenberg Run Speed Up Swim Speed Up Run Speed Up Swim Speed Up Run Speed Up Swim Speed Up
Skalop Skalop Quick Respawn Special Saver Quick Respawn Special Saver Quick Respawn Special Saver
Splash Mob Splash Mob Ink Saver (Main) Run Speed Up Ink Saver (Main) Run Speed Up Ink Saver (Main) Run Speed Up
SquidForce SquidForce Damage Up Ink Saver (Main) Ink Resistance Up Ink Saver (Main) Ink Resistance Up Ink Saver (Main)
Takoroka Takoroka Special Charge Up Special Duration Up Special Charge Up Special Power Up Special Charge Up Special Power Up
Tentatek Tentatek Ink Recovery Up Quick Super Jump Ink Recovery Up Quick Super Jump Ink Recovery Up Quick Super Jump
Toni Kensa Toni Kensa - - Main Power Up Sub Power Up Ink Saver (Main) Sub Power Up
Z+F Z+F - - - - Special Saver Ink Recovery Up
Zekko Zekko Special Saver Special Charge Up Special Saver Special Charge Up Special Saver Special Charge Up
Zink Zink Quick Super Jump Quick Respawn Quick Super Jump Quick Respawn Quick Super Jump Quick Respawn

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