Nonograms Katana Wiki

Are you new to wikis?
Do you have trouble navigating the wiki?
Check this page.

READ MORE

Nonograms Katana Wiki
Advertisement

This module consist of 3 parts:

  1. Order of items in warehouse.
  2. Item names, file names and page links.
  3. Item's image generation function.

Order of items[]

This is the order of items as seen in warehouse (not the building). It is very important to not forget to update this section when adding new items. This section is most notably used in Module:Item grid, but it is also used in other modules, where item order might be important. Names of items that are used in this part of the module are explained in the next section.

Database of items[]

This part of the module serves as a database of item's names, file names and page links. This part (combined with the last part) of the module is very often used in other modules. Explanation of variables:

Let's take Battering ram as an example:

btram = { name = 'Battering ram', file = 'Battering ram (Kikkosha)', link = 'Battering_ram' },


The btram is the shortened name of the item. This name is only used internally ("behind the scenes") by other modules and it is not seen by the average user. These names are also used in the "order of items" part of the module.

  • name - this is the name of item. Note that this is not the full name of the item, because the '(Kikkosha)' part might clutter the page to much and it's not commonly used by the community.
  • file - this is the name of the file of the item. This is the full name of the item, which makes it also useful when the full name is needed (e.g. on item's pages). It might also be useful when this module will be translated into different languages.
  • link - this is a link to the item's page. Links are only used, if the name variable doesn't link to the wanted page (e.g. name = 'Mosaic (Fragment)' links to link = 'Mosaic').

Image generation[]

This is a module for the template, which displays images of items with a link to the items' pages (via function p.item) and for other modules, that need item images (via function p.itemdirect). This function is very often used in other modules, so be careful when changing it. The function accepts 3 parameters; the last 2 are optional.

  1. parameter: < name of the item > - this is a shortened name of the item (e.g. instead of "Mental power", write "mp"). All item names can be seen in the Item module. They are all lower case. This parameter is required.
  2. parameter: < size of the image > - this parameter is optional and sets the size of the item's image. If this parameter is omitted, the default is 40x40px (most commonly used image size on this wiki). This parameter must be a number.
  3. parameter: < name of the item > - this parameter is optional. If this parameter is true (any number or character, as long as it's not empty is considered as true), the name of the item is displayed after the image.

If the name of the item is misspelled or spelled with one or more capital letters, the function will return the string of first parameter. This can also be used as an advantage.

See also[]

Code[]

Below is the code of the module. The variables on the left (coin, ruby, crypto, etc.) are the variables that are written in the template to display the image instead of writing the whole name of the item.


local p = {}

-- When adding new items to this module, please do not forget to put them in the
-- Module:Data/item as well. Also just pasting the "placeholder" will do.
-- (To avoid any script errors.)

-- The order of items is in a list, because it will be much easier to update it,
-- when new items are introduced to the game (as oppose to adding
-- "order = order_of_the_item" to each item).

p.item_order = {
		'coin', 'dinar', 'crypto', 'ruby', 'mp', 'elixir', 'fan', 'arrows', 'katana',
		'shuriken', 'spikes', 'boomerang', 'petard', 'bomb', 'firework', 'mortar',
		'drum', 'btram', 'anchor', 'steamobile', 'kimono', 'ninja', 'samurai',
		'sword1', 'sword2', 'sword3', 'sword4', 'armor1', 'armor2', 'armor3', 'armor4', 'shield1',
		'shield2', 'shield3', 'shield4', 'ring1', 'ring2', 'ring3', 'ring4', 'ring4p', 'kunai',
		'greek', 'madgrenade', 'net', 'mspider', 'horn', 'clew', 'bedroll', 'wood', 
		'beam', 'plank', 'stone', 'steel', 'miron', 'msteel', 'gears', 'mechanism',
		'titanium', 'tparts', 'mercury', 'charcoal', 'gunpowder',
		'isand', 'chemicals', 'fertilizer', 'cinnabar', 'apy', 'thread', 'paper', 'silk',
		'glass', 'ebottles', 'ingot', 'treasure', 'pearl', 'rice', 'wheat', 'flour', 'egg', 'beans',
		'spices', 'dates', 'soy', 'oil', 'honey', 'jam', 'mayo', 'avocado', 'salmon', 'tuna', 'cherry',
		'strawberry', 'mushrooms', 'porcini', 'herbs', 'ginkgo', 'mandrake', 'sushi', 'cup',  
		'fried', 'smoothie', 'smoothie2', 'cake', 'ramen', 'curry', 'mcola', 'onigiri', 'flatbread',
		'cherrybun', 'muffin', 'bento', 'pasta', 'baklava', 'poke', 'marinated', 'teriyaki', 'balm',
		'poh', 'poh2', 'poe', 'pomp', 'pbr', 'pa', 'reagent', 'catalyst',
		'map1', 'mapf1', 'map2', 'mapf2', 'map3', 'mapf3', 'mapsmug', 'map4', 'mapf4',
		'catam', 'cataf', 'blueprint', 'page', 'grimoire', 'scroll', 'emeralds', 'malu', 'pcard', 'teeth',
		'hide', 'velour', 'gegg', 'pog', 'artifacts'}

p.items = {
	coin = { name = 'Coin', file = 'Coin' },
	dinar = { name = 'Dinar', file = 'Dinar' },
	crypto = { name = 'Crypto-coin', file = 'Crypto-coin' },
	ruby = { name = 'Ruby', file = 'Ruby' },
	mp = { name = 'Mental power', file = 'Mental power' },
	elixir = { name = 'Elixir of insight', file = 'Elixir of insight' },
	fan = { name = 'Fan', file = 'Fan' },
	arrows = { name = 'Arrows', file = 'Arrows' },
	katana = { name = 'Katana', file = 'Katana' },
	shuriken = { name = 'Shuriken', file = 'Shuriken' },
	spikes = { name = 'Spikes', file = 'Spikes (Makibishi)' },
	boomerang = { name = 'Boomerang', file = 'Boomerang' },
	petard = { name = 'Petard', file = 'Petard' },
	bomb = { name = 'Bomb', file = 'Bomb (Horoku)' },
	firework = { name = 'Firework', file = 'Firework' },
	mortar = { name = 'Mortar', file = 'Mortar' },
	drum = { name = 'Drum', file = 'Drum' },
	btram = { name = 'Battering ram', file = 'Battering ram (Kikkosha)' },
	anchor = { name = 'Anchor', file = 'Anchor' },
	steamobile = { name = 'Steamobile', file = 'Steamobile' },
	kimono = { name = 'Kimono', file = 'Kimono' },
	ninja = { name = 'Ninja suit', file = 'Ninja suit' },
	samurai = { name = 'Samurai armor', file = 'Samurai armor' },
	sword1 = { name = 'Sword for a hero lvl. 1', file = 'Sword for a hero lvl. 1' },
	sword2 = { name = 'Sword for a hero lvl. 2', file = 'Sword for a hero lvl. 2' },
	sword3 = { name = 'Sword for a hero lvl. 3', file = 'Sword for a hero lvl. 3' },
	sword4 = { name = 'Sword for a hero lvl. 4', file = 'Sword for a hero lvl. 4' },
	armor1 = { name = 'Armor for a hero lvl. 1', file = 'Armor for a hero lvl. 1' },
	armor2 = { name = 'Armor for a hero lvl. 2', file = 'Armor for a hero lvl. 2' },
	armor3 = { name = 'Armor for a hero lvl. 3', file = 'Armor for a hero lvl. 3' },
	shield1 = { name = 'Shield for a hero lvl. 1', file = 'Shield for a hero lvl. 1' },
	shield2 = { name = 'Shield for a hero lvl. 2', file = 'Shield for a hero lvl. 2' },
	shield3 = { name = 'Shield for a hero lvl. 3', file = 'Shield for a hero lvl. 3' },
	shield4 = { name = 'Shield for a hero lvl. 4', file = 'Shield for a hero lvl. 4' },
	ring1 = { name = 'Ring for a hero lvl. 1', file = 'Ring for a hero lvl. 1' },
	ring2 = { name = 'Ring for a hero lvl. 2', file = 'Ring for a hero lvl. 2' },
	ring3 = { name = 'Ring for a hero lvl. 3', file = 'Ring for a hero lvl. 3' },
	ring4 = { name = 'Ring for a hero lvl. 4', file = 'Ring for a hero lvl. 4' },
	kunai = { name = 'Throwing knife', file = 'Throwing knife (Kunai)' },
	net = { name = 'Throwing net', file = 'Throwing net' },
	greek = { name = 'Greek grenade', file = 'Greek grenade' },
	mspider = { name = 'Mechanical spider', file = 'Mechanical spider' },
	wood = { name = 'Wood', file = 'Wood' },
	beam = { name = 'Wooden beam', file = 'Wooden beam' },
	plank = { name = 'Wooden plank', file = 'Wooden plank' },
	stone = { name = 'Stone', file = 'Stone' },
	steel = { name = 'Steel', file = 'Steel' },
	miron = { name = 'Meteoric Iron', file = 'Meteoric Iron' },
	msteel = { name = 'Meteoric Steel', file = 'Meteoric Steel' },
	gears = { name = 'Gears', file = 'Gears' },
	mechanism = { name = 'Mechanism', file = 'Mechanism' },
	charcoal = { name = 'Charcoal', file = 'Charcoal' },
	gunpowder = { name = 'Gunpowder', file = 'Gunpowder' },
	isand = { name = 'Iron sand', file = 'Iron sand' },
	chemicals = { name = 'Chemicals', file = 'Chemicals' },
	fertilizer = { name = 'Synthetic fertilizer', file = 'Synthetic fertilizer' },
	thread = { name = 'Thread', file = 'Thread' },
	clew = { name = "Ariadne's thread", file = "Ariadne's thread" },
	paper = { name = 'Paper', file = 'Paper' },
	silk = { name = 'Silk', file = 'Silk' },
	glass = { name = 'Glass', file = 'Glass' },
	ingot = { name = 'Gold ingot', file = 'Gold ingot' },
	treasure = { name = 'Treasure', file = 'Treasure' },
	pearl = { name = 'Pearl', file = 'Pearl' },
	rice = { name = 'Rice', file = 'Rice' },
	wheat = { name = 'Wheat', file = 'Wheat' },
	flour = { name = 'Flour', file = 'Flour' },
	beans = { name = 'Coffee beans', file = 'Coffee beans' },
	spices = { name = 'Spices', file = 'Spices' },
	dates = { name = 'Dates', file = 'Dates' },
	oil = { name = 'Olive oil', file = 'Olive oil' },
	honey = { name = 'Honey', file = 'Honey' },
	avocado = { name = 'Avocado', file = 'Avocado' },
	salmon = { name = 'Salmon', file = 'Salmon' },
	tuna = { name = 'Tuna', file = 'Tuna' },
	cherry = { name = 'Ultraviolet Cherry', file = 'Ultraviolet Cherry' },
	mushrooms = { name = 'Mushrooms', file = 'Mushrooms' },
	mandrake = { name = 'Mandrake root', file = 'Mandrake root' },
	sushi = { name = 'Sushi', file = 'Sushi' },
	ramen = { name = 'Ramen', file = 'Ramen' },
	curry = { name = 'Curry', file = 'Curry' },
	cup = { name = 'Cup of coffee', file = 'Cup of coffee' },
	smoothie = { name = 'Smoothie', file = 'Smoothie' },
	cake = { name = 'Date cake', file = 'Date cake' },
	onigiri = { name = 'Onigiri', file = 'Onigiri' },
	flatbread = { name = 'Flatbread', file = 'Flatbread' },
	cherrybun = { name = 'Cherry bun', file = 'Cherry bun' },
	bento = { name = 'Mushroom rice', file = 'Mushroom rice (Bento)' },
	baklava = { name = 'Baklava', file = 'Baklava' },
	poke = { name = 'Poke', file = 'Poke' },
	poh = { name = 'Potion of healing', file = 'Potion of healing' },
	poh2 = { name = 'Potion of healing lvl. 2', file = 'Potion of healing lvl. 2' },
	poe = { name = 'Potion of energy', file = 'Potion of energy' },
	pbr = { name = 'Potion "Berserker rage"', file = 'Potion Berserker rage' },
	pa = { name = 'Potion "Ambrosia"', file = 'Potion Ambrosia' },
	reagent = { name = 'Reagent', file = 'Reagent' },
	catalyst = { name = 'Catalyst', file = 'Catalyst' },
	map1 = { name = 'Treasure map lvl. 1', file = 'Treasure map lvl. 1' },
	mapf1 = { name = 'Treasure map fragment lvl. 1', file = 'Treasure map fragment lvl. 1' },
	map2 = { name = 'Treasure map lvl. 2', file = 'Treasure map lvl. 2' },
	mapf2 = { name = 'Treasure map fragment lvl. 2', file = 'Treasure map fragment lvl. 2' },
	map3 = { name = 'Treasure map lvl. 3', file = 'Treasure map lvl. 3' },
	mapf3 = { name = 'Treasure map fragment lvl. 3', file = 'Treasure map fragment lvl. 3' },
	map4 = { name = 'Treasure map lvl. 4', file = 'Treasure map lvl. 4' },
	mapf4 = { name = 'Treasure map fragment lvl. 4', file = 'Treasure map fragment lvl. 4' },
	mapsmug = { name = "Smuggler's map", file = "Treasure map lvl. 4" }, --not actually in use
	mapsmug3 = { name = "Smuggler's map Chapter III", file = "Treasure map lvl. 4" },
	mapsmug4 = { name = "Smuggler's map Chapter IV", file = "Treasure map lvl. 4" },
	mapsmug5 = { name = "Smuggler's map Chapter V", file = "Treasure map lvl. 4" },
	catam = { name = 'Catacombs map', file = 'Catacombs map' },
	cataf = { name = 'Catacombs map fragment', file = 'Catacombs map fragment' },
	blueprint = { name = 'Blueprint', file = 'Blueprint' },
	page = { name = 'Ancient page', file = 'Ancient page' },
	scroll = { name = 'Very old scroll', file = 'Very old scroll' },
	emeralds = { name = 'Emerald tablet shard', file = 'Emerald tablet shard' },
	egg = { name = 'Egg', file = 'Egg' },
	soy = { name = 'Soy sauce', file = 'Soy sauce' },
	fried = { name = 'Fried eggs', file = 'Fried eggs' },
	mayo = { name = 'Mayonnaise', file = 'Mayonnaise' },
	horn = { name = 'Horn', file = 'Horn' },
	marinated = { name = 'Marinated eggs', file = 'Marinated eggs' },
	teriyaki = { name = 'Teriyaki salmon', file = 'Teriyaki salmon' },
	teeth = { name = 'Dragon teeth', file = 'Dragon teeth' },
	mcola = { name = 'Mandra-Cola', file = 'Mandra-Cola' },
	gegg = { name = 'Golden egg', file = 'Golden egg' },
	-- Dungeon stats
	-- TODO: Add these pages.
	health = { name = 'Health', file = 'Dungeon - Health', link = 'Dungeon:_Health' },
	energy = { name = 'Energy', file = 'Dungeon - Energy', link = 'Dungeon:_Energy' },
	mental = { name = 'Mental power', file = 'Dungeon - Mental power', link = 'Dungeon:_Mental_power' },
	damage = { name = 'Damage', file = 'Dungeon - Damage', link = 'Dungeon:_Damage' },
	defense = { name = 'Defense', file = 'Dungeon - Defense', link = 'Dungeon:_Defense' },
	action = { name = 'Action points', file = 'Dungeon - Action points', link = 'Dungeon:_Action_points' },
	xp2 = { name = 'Experience points', file = 'Dungeon - experience points', link = 'Dungeon:_Experience' },
	next_level = { name = 'To next level', file = 'Dungeon - to next level', link = '' },
	-- Artifact duplicates (warehouse valuable).
	artifact = { name = 'Artifacts', file = 'Artifacts' },
	artifacts = { name = 'Artifacts', file = 'Artifacts', link = 'Artifacts#Extra_artifacts' },
	artifact1 = { name = 'Artifact lvl. 1', file = 'Artifacts', link = '' },
	artifact2 = { name = 'Artifact lvl. 2', file = 'Artifacts', link = '' },
	artifact3 = { name = 'Artifact lvl. 3', file = 'Artifacts', link = '' },
	artifact4 = { name = 'Artifact lvl. 4', file = 'Artifacts', link = '' },
	a_backpack = { name = 'Backpack', file = 'A11-backpack', link = 'Artifacts#Explanation_of_artifacts' },
	a_axe = { name = 'Axe', file = 'A12-axe', link = 'Artifacts#Explanation_of_artifacts' },
	a_pickaxe = { name = 'Pickaxe', file = 'A13-pickaxe', link = 'Artifacts#Explanation_of_artifacts' },
	a_torch = { name = 'Torch', file = 'A14-torch', link = 'Artifacts#Explanation_of_artifacts' },
	a_magnifier = { name = 'Magnifier', file = 'A15-magnifier', link = 'Artifacts#Explanation_of_artifacts' },
	a_scarab = { name = 'Scarab', file = 'A21-scarab', link = 'Artifacts#Explanation_of_artifacts' },
	a_cat = { name = 'Maneki-neko', file = 'A22-cat', link = 'Artifacts#Explanation_of_artifacts' },
	a_compass = { name = 'Pirate\'s compass', file = 'A23-compass', link = "Artifacts#Explanation_of_artifacts" },
	a_lamp = { name = 'Oil lamp', file = 'A24-lamp', link = 'Artifacts#Explanation_of_artifacts' },
	a_vase = { name = 'Porcelain vase', file = 'A25-vase', link = 'Artifacts#Explanation_of_artifacts' },
	a_horus = { name = 'Eye of Horus', file = 'A31-horus', link = 'Artifacts#Explanation_of_artifacts' },
	a_mask = { name = 'Hannya mask', file = 'A32-mask', link = 'Artifacts#Explanation_of_artifacts' },
	a_helmet = { name = 'Templar helm', file = 'A33-helmet', link = 'Artifacts#Explanation_of_artifacts' },
	a_skull = { name = 'Turquoise skull', file = 'A34-skull', link = 'Artifacts#Explanation_of_artifacts' },
	a_shiva = { name = 'Dancing Shiva', file = 'A35-shiva', link = 'Artifacts#Explanation_of_artifacts' },
	a_hat = { name = 'Pirate hat', file = 'A41-hat', link = 'Artifacts#Explanation_of_artifacts' },
	a_ship = { name = 'Ship in a bottle', file = 'A42-ship', link = 'Artifacts#Explanation_of_artifacts' },
	a_pearl = { name = 'Black pearl', file = 'A43-pearl', link = 'Artifacts#Explanation_of_artifacts' },
	a_mortar = { name = 'Shogun\'s mortar (Sho-gun)', file = 'A44-mortar', link = "Artifacts#Explanation_of_artifacts" },
	a_katana = { name = 'Shogun\'s katana', file = 'A45-katana', link = "Artifacts#Explanation_of_artifacts" },
	
	-- Not actual items.
	xp = { name = 'Experience', file = 'Experience', link = 'Levelling#Experience' },
	mosaic = { name = 'Mosaic (Fragment)', file = 'Mosaic (Fragment)', link = 'Mosaic' },
	mapbottle = { name = 'Message in a bottle', file = 'Message in a bottle', link = 'Treasure map fragment lvl. 4' },
	pirateflag = { name = 'Pirate flag', file = 'Pirate flag', link = 'Ship#Treasure Island' },
	emeraldkey = { name = 'Emerald key', file = 'Emerald key', link = 'Dungeon: forest' },
	valor = { name = 'Valor', file = 'Valor', link = 'Gong#Hall_of_Fame' },
	
	-- New items in version 18.0.
	jam = { name = 'Jam', file = 'Jam' },
	grimoire = { name = 'Grimoire', file = 'Grimoire' },
	smoothie2 = { name = 'Smoothie #2', file = 'Smoothie_-2', link = 'Smoothie 2' },
	malu = { name = 'Mechanical arithmetic logic unit (MALU)', file = 'Mechanical arithmetic logic unit (MALU)' },
	muffin = { name = 'Muffin', file = 'Muffin' },
	herbs = { name = 'Herbs', file = 'Herbs' },
	ebottles = { name = 'Empty bottles', file = 'Empty bottles' },
	bedroll = { name = 'Bedroll', file = 'Bedroll' },
	cinnabar = { name = 'Cinnabar', file = 'Cinnabar' },
	apy = { name = 'Arsenopyrite', file = 'Arsenopyrite' },
	strawberry = { name = 'Woodland strawberry', file = 'Woodland strawberry' },
	porcini = { name = 'Porcini mushroom', file = 'Porcini mushroom' },
	ginkgo = { name = 'Ginkgo biloba', file = 'Ginkgo biloba' },
	pasta = { name = 'Porcini pasta', file = 'Porcini pasta' },
	ring4p = { name = 'Ring for a hero lvl. 4+', file = 'Ring for a hero lvl. 4+' },
	tparts = { name = 'Titanium parts', file = 'Titanium parts' },
	pcard = { name = 'Punched card', file = 'Punched card' },
	balm = { name = 'Balm', file = 'Balm' },
	mercury = { name = 'Mercury', file = 'Mercury' },
	madgrenade = { name = 'Madness grenade', file = 'Madness grenade' },
	pomp = { name = 'Potion of mental power', file = 'Potion of mental power' },
	armor4 = { name = 'Armor for a hero lvl. 4', file = 'Armor for a hero lvl. 4' },
	hide = { name = 'Salamander hide', file = 'Salamander hide' },
	velour = { name = 'Salamander velour', file = 'Salamander velour' },
	titanium = { name = 'Titanium', file = 'Titanium' },
	pog = { name = 'Pot of gold', file = 'Pot of gold' },
}

function p.item(frame)
	local i = frame.args[1]
	local px = frame.args[2]
	local showname = frame.args[3]
	return p.item_image(i,px,showname)
end

function p.item_image(i,px,showname)
	local items = p.items
	if items[i] then
		local text = ''
		local item_link = ''
		if not (showname == nil or showname == '') then
			text = ' ' .. items[i].name
		end
		if px == '' or px == nil then
			px = 40
		end
		if items[i].link then
			item_link = items[i].link
		else
			item_link = items[i].name:gsub(' ', '_')
		end
		return '[[File:' .. items[i].file .. '.png|' .. px .. 'px|link=' .. item_link .. ']]' .. text
	else
		return i
	end
end
 
return p
Advertisement