Module:Bomber's Notebook

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search

Documentation for this module may be created at Module:Bomber's Notebook/Documentation

-- This module serves as the code for Template:Bomber's Notebook
local p = {}

-- Template:Bomber's Notebook/Header
function p.Header(frame)
	local header = "<table class='wikitable' style='text-align:center; width:100%; max-width:57.5em;'>"
	header = header .. "<tr>"
	header = header .. "<th>Character</th>"
	header = header .. "<th>Description</th>"
	header = header .. "</tr>"
	return header
end

-- Template:Bomber's Notebook
function p.Main(frame)
	local args = frame:getParent().args
	local row = "<tr>"
	row = row .. "<td>[[File:" .. args["game"] .. " "
	if args["name"] == "??? (Majora's Mask)" then
		row = row .. "??? "
	elseif args["name"] == "Bombers" then
		row = row .. "Jim "
	elseif args["name"] == "Mr. Dotour" then
		row = row .. "Mayor Dotour "
	elseif args["name"] == "Old Lady from Bomb Shop" then
		row = row .. "Old Lady from the Bomb Shop "
	else
		row = row .. args["name"] .. " "
	end
	row = row .. " Icon.png|45px]]<br/>"
	if args["name"] == "Bombers" then
		row = row .. "[[Bombers Secret Society of Justice|Bombers]]</td>"
	elseif args["name"] == "??? (Majora's Mask)" then
		row = row .. "[[??? (Majora's Mask)|???]]</td>"
	elseif args["game"] == "MM3D" and args["name"] == "Gorman" then
			row = row .. "[[Gorman|Gorman the Troupe Leader]]</td>"
	elseif args["name"] == "Honey and Darling" then
		row = row .. "[[Honey & Darling]]</td>"
	elseif args["name"] == "Lottery Shop" then
		row = row .. "[[Lottery Shop Attendant]]</td>"
	elseif args["name"] == "Business Scrub" then
		row = row .. "[[Deku Scrubs from Playground]]</td>"
	elseif args["name"] == "Zora" then
		row = row .. "[[Oceanside Zoras]]</td>"
	elseif args["name"] == "Stalchild" then
		row = row .. "[[Stalchild]]ren</td>"
	else
		row = row .. "[[" .. args["name"] .. "]]</td>"
	end
	row = row .. "<td style='text-align:left'>" .. args["description"] .. "</td>"
	row = row .. "</tr>"
	return row
end

-- Template:Bomber's Notebook/Footer
function p.Footer(frame)
	local args = frame:getParent().args
	local footer = ""
	if args["game"] == "MM3D" then
		local icons = {"Jim", "Professor Shikashi", "Banker", "Swordsman", "Keaton", "Koume", "Cursed Rich Man", "Deku Butler", "Deku Princess", "Gabora", "Elder's Son", "Goron Shrine", "Medigoron", "Seahorse", "Marine Research Lab Fish", "Man Seeking Shelter", "Beaver Bros.", "Evan", "Japas", "Shiro", "Poe Collector", "Secret Shrine", "Cold Goron", "Gray Frog", "Blue Frog", "Cyan Frog", "Yellow Frog", "Red Frog", "Great Fairy of Magic", "Great Fairy of Power", "Great Fairy of Wisdom", "Great Fairy of Courage", "Great Fairy of Kindness", "Moon Child Odolwa", "Moon Child Goht", "Moon Child Gyorg", "Moon Child Twinmold", "Moon Child Majora", "Gossip Stone", "Book", "Mikau's Diary", "Unknown", "Unknown Skulltula Man"}
		footer = footer .. "<tr>"
		footer = footer .. "<th colspan=2><b>Icons without Schedules:</b><br>"
		for key, value in ipairs(icons) do
			if value == "Deku Princess" then
				footer = footer .. "[[File:MM3D  " .. value .. " Bombers' Notebook Icon.png|x32px]] &middot; "
			elseif value == "Seahorse" then
				footer = footer .. "[[File:MM3D  " .. value .. " Bombers' Notebook Icon.png|x32px]] &middot; "
			else footer = footer .. "[[File:MM3D " .. value .. " Icon.png|x32px]] &middot; "
			end
		end
		footer = footer .. "</tr>"
	end
	footer =  footer .. "</table>"
	return footer
end

return p