Module:JobData

--[[  JobData.lua by Earthcrusher, Aug 8 2017   A database for the jobs (job being defined as a player role of any sort,   including antagonists and special roles) you can find on the Torch.

Also includes an auditing/polling API to grab various bits of info from each job. The concept of this module is for it to serve as a master reference and will likely be used in numerous pages across the wiki, so don't edit it  unless you know what you're doing! CHANGELOG: Aug 12 2017 - Jobs are now sorted departmentally in an internal table. - New function: listAllJobs. Returns an indexed string list of all jobs listed in the master job_data table. - New function: listJobsByDepartment. Returns an indexed string list of all jobs in a given department ("command", "service", "antagonist", etc.) - Improved error handling for all functions making use of error. ]]--

-- Initialization of the module. local jobdata_api = {}

-- Master job table. local job_data = { -- Command roles. ["commanding officer"] = { ["images"] = {"Generic Torch CO.png"}, ["guide"] = "Guide/Commanding Officer", ["title"] = "Commanding Officer", ["description"] = "You're in charge of the Torch, both crew and passengers, you have the final say on everything, but should delegate more than do. Coordinate through your heads. Go down with the ship.", ["department"] = "Command", ["difficulty"] = "Very Hard", ["rank"] = "Crew", ["references"] = {"co", "captain"}, },  ["executive officer"] = { ["images"] = {"XO-EC.png", "XO-Fleet.png", "XO-Marine.png"}, ["guide"] = "Guide/Executive Officer", ["title"] = "Executive Officer", ["desc"] = "Back up the CO, in charge of personnel management, responsible for managing access and IDs, directly in charge of the Service Department and anyone not directly under a department head. Help the CO execute his will. Oversee discipline for the Crew. Keep the officers in line. Be the grumpy dad to the CO's mom.", ["department"] = "Command", ["difficulty"] = "Hard", ["rank"] = "Crew", ["references"] = {"xo", "hop", "head of personnel"}, },  ["head of security"] = { ["images"] = {"CoS-EC.png", "CoS-Fleet.png", "CoS-Marine.png"}, ["guide"] = "Guide/Head of Security", ["title"] = "Head of Security", ["description"] = "Lead the security team to victory or death. More likely death. Advise the CO in matters of ship security and safety. Ensure the crew follows Shipboard Regulations and SCG Law.", ["department"] = "Command", ["difficulty"] = "Very Hard", ["rank"] = "Crew", ["references"] = {"hos", "commander", "cos", "chief of security"}, },  ["chief engineer"] = { ["images"] = {"CE-EC.png", "CE-Fleet.png", "CE-Marine.png"}, ["guide"] = "Guide/Chief Engineer", ["title"] = "Chief Engineer", ["description"] = " Lead the engineering crew. Keep the lights on and the engine purring. Make sure everyone can breathe. Advise the CO in the matters of vessel integrity and status. Maintain the lawed synthetics.", ["department"] = "Command", ["difficulty"] = "Hard", ["rank"] = "Crew", ["references"] = {"ce"}, },  ["research director"] = { ["images"] = {"ResearchDirector.png"}, ["guide"] = "Guide/Research Director", ["title"] = "Research Director", ["description"] = "Direct supervisor of research and mining, as well as any away missions. Works for NanoTrasen. Tasked with discovering new and valuable things.", ["department"] = "Command", ["difficulty"] = "Hard", ["rank"] = "Passenger (Nanotrasen)", ["references"] = {"rd"}, },  ["chief medical officer"] = { ["images"] = {"CMO-EC.png", "CMO-Fleet.png"}, ["guide"] = "Guide/Chief Medical Officer", ["title"] = "Chief Medical Officer", ["description"] = "Lead the people trying to keep everyone alive. Keep the crew healthy, physically and mentally, and most importantly alive. Advise the CO in matters of health.", ["department"] = "Command", ["difficulty"] = "Hard", ["rank"] = "Crew", ["references"] = {"cmo"}, },  ["nanotrasen corporate liaison"] = { ["images"] = {"NT-Rep.png"}, ["guide"] = "NanoTrasen Corporate Liaison", ["title"] = "NanoTrasen Corporate Liaison", ["description"] = "Represent the interests of the Company. Keep the mission focused on the opportunities for research and business. Advise the CO and RD on matters of company policy. Report back to NanoTrasen with progress. Investigate breaches of Corporate Regulations.", ["department"] = "Command", ["difficulty"] = "Hard", ["rank"] = "Passenger (Nanotrasen)", ["references"] = {"ntr", "ncl", "ntcl"}, },  ["solgov representative"] = { ["images"] = {"Solgov-Rep.png"}, ["guide"] = "SolGov Representative", ["title"] = "SolGov Representative", ["description"] = "Represent the interests of SolGov. Keep the mission focused on the opportunities for diplomacy and discovery. Advise the CO on the SolGov Charter and the Mission. Report back to SolGov with progress. Investigate breaches of the Solgov Charter.", ["department"] = "Command", ["difficulty"] = "Hard", ["rank"] = "Crew", ["references"] = {"sgr", "solrep", "solgov"}, },  ["senior enlisted advisor"] = { ["images"] = {"SEA-EC.png", "SEA-Fleet.png", "SEA-Marine.png"}, ["guide"] = "Senior Enlisted Advisor", ["title"] = "Senior Enlisted Advisor", ["description"] = " Advise the Commanding Officer and Executive Officer, and support the decisions they make with 110% of your being. Maintain good order and discipline, especially uniform and courtesy standards. Act as a link between the officers of the crew and the enlisted members of the crew. You are essentially a coach for Military RP, and the primary person enforcing uniform standards and military regulations.", ["department"] = "Command", ["difficulty"] = "Hard", ["rank"] = "Crew", ["references"] = {"sea", "senior enlisted", "advisor"}, },  ["bridge officer"] = { ["images"] = {"SEA-EC.png"}, ["guide"] = "Bridge Officer", ["title"] = "Bridge Officer", ["description"] = "Sit at the bridge, gather information, make it flow to the relevant people.", ["department"] = "Command", ["difficulty"] = "Medium", ["rank"] = "Crew", ["references"] = {"bo"}, },  ["solgov pilot"] = { ["images"] = {"SEA-EC.png"}, ["guide"] = "SolGov Pilot", ["title"] = "SolGov Pilot", ["description"] = "Relax in the pilot lounge, fill in for the NT pilot.", ["department"] = "Command", ["difficulty"] = "Easy", ["rank"] = "Crew", ["references"] = {"pilot", "sgp", "sg pilot"}, },  -- Security roles. ["master at arms"] = { ["images"] = {"MAA-EC.png", "MAA-Fleet.png", "MAA-Marine.png"}, ["guide"] = "Security Officer", ["title"] = "Master at Arms", ["description"] = "Patrol the spaceship and apprehend criminals.", ["department"] = "Security", ["difficulty"] = "Hard", ["rank"] = "Crew", ["references"] = {"maa", "master", "sec", "shitcurity"}, },	["brig officer"] = { ["images"] = {"BO-EC.png", "BO-Fleet.png", "BO-Marine.png"}, ["guide"] = "Warden", ["title"] = "Brig Officer", ["description"] = "Maintain the brig and hand out weapons to officers during emergencies.", ["department"] = "Security", ["difficulty"] = "Hard", ["rank"] = "Crew", ["references"] = {"bo", "warden"}, },	["forensic technician"] = { ["images"] = {"FO-EC.png", "FO-Fleet.png", "FO-Marine.png"}, ["guide"] = "Detective", ["title"] = "Forensic Technician", ["description"] = "Investigate crime scenes. Interview suspects. Solve cases.", ["department"] = "Security", ["difficulty"] = "Hard", ["rank"] = "Crew", ["references"] = {"forensic", "forensics", "detective", "ft"}, },  -- Maintenance roles. ["engineer"] = { ["images"] = {"Engi-EC.png", "Engi-Fleet.png", "Engi-Marine.png"}, ["guide"] = "Station Engineer", ["title"] = "Engineer", ["description"] = "Make sure spaceship is powered, hull breaches are fixed swiftly and there is breathable air for everyone.", ["department"] = "Maintenance", ["difficulty"] = "Medium", ["rank"] = "Crew", ["references"] = {"engi"}, },	["senior engineer"] = { ["images"] = {"SE-EC.png", "SE-Fleet.png", "SE-Marine.png"}, ["guide"] = "Senior Engineer", ["title"] = "Senior Engineer", ["description"] = "Put out the dead engineer on fire at the bottom of a Z level transfer. Manage the engineering crew. Ensure proper operation of the engine and atmospherics. Assist the Chief Engineer in any way necessary.", ["department"] = "Maintenance", ["difficulty"] = "Hard", ["rank"] = "Crew", ["references"] = {"se", "senior engi"}, },	["maintenance assistant"] = { ["images"] = {"EA.png"}, ["guide"] = "Maintenance Assistant", ["title"] = "Maintenance Assistant", ["description"] = "Assist engineers with anything they need. Perform basic repairs on malfunctioning equipment, broken lights, and cracked windows.", ["department"] = "Maintenance", ["difficulty"] = "Easy", ["rank"] = "Passenger (Contractor)", ["references"] = {"ma"}, },	["janitor"] = { ["images"] = {"Janitor-EC.png", "Janitor-Fleet.png", "Janitor-Marine.png"}, ["guide"] = "Janitor", ["title"] = "Janitor", ["description"] = "Clean and maintain the spaceship. Replace broken lights. Put up wet floor signs.", ["department"] = "Maintenance", ["difficulty"] = "Easy", ["rank"] = "Crew", ["references"] = {"sanitation", "sanitation technician", "st"}, },	["roboticist"] = { ["images"] = {"Roboticist-torch.png"}, ["guide"] = "Roboticist", ["title"] = "Roboticist", ["description"] = "Assist in the resleeving of dead personnel. Provide medical care to augmented and synthetic personnel. Build, Repair, and Maintain the Synthetics aboard the Torch. Build, Repair, and Maintain Exosuits, Hardsuits, and Voidsuits.", ["department"] = "Maintenance", ["difficulty"] = "Medium", ["rank"] = "Passenger (Contractor)", ["references"] = {}, },  -- Supply roles. ["deck officer"] = { ["images"] = {"DO-EC.png", "DO-Fleet.png", "DO-Marine.png"}, ["guide"] = "Quartermaster", ["title"] = "Deck Officer", ["description"] = "Order crates and make sure Mining and the Deck Technicians do their jobs.", ["department"] = "Supply", ["difficulty"] = "Medium", ["rank"] = "Crew", ["references"] = {"qm", "do", "quartermaster"}, },	["deck technician"] = { ["images"] = {"DT-EC.png", "DT-Fleet.png", "DT-Marine.png"}, ["guide"] = "Cargo Technician", ["title"] = "Deck Technician", ["description"] = "Accept orders, deliver crates and send mail. Listen to your boss.", ["department"] = "Supply", ["difficulty"] = "Easy", ["rank"] = "Crew", ["references"] = {"cargo tech", "ct", "tech", "dt"}, },	["supply assistant"] = { ["images"] = {"SA.png"}, ["guide"] = "Supply Assistant", ["title"] = "Supply Assistant", ["description"] = "Assist the Deck Crew with anything they need. Man the Supply desk. Wish you could go in maintenance with the cool kids.", ["department"] = "Supply", ["difficulty"] = "Easy", ["rank"] = "Passenger (Contractor)", ["references"] = {"sa"}, },  -- Medical roles. ["physician"] = { ["images"] = {"SPhy-EC.png", "SPhy-Fleet.png"}, ["guide"] = "Physician", ["title"] = "Physician", ["description"] = "Manage the medical team, perform surgery, guide trainees and rookies. Heal people and deal with other ailments. Assist the Chief Medical Officer in any capacity required.", ["department"] = "Medical", ["difficulty"] = "Hard", ["rank"] = "Crew", ["references"] = {"doctor", "surgeon"}, },	["corpsman"] = { ["images"] = {"Phy-EC.png", "Phy-Fleet.png"}, ["guide"] = "Physician", ["title"] = "Corpsman", ["description"] = "Respond to medical emergencies and calls and assist the physician in healing ailments. Fix people in surgery when you must.", ["department"] = "Medical", ["difficulty"] = "Medium", ["rank"] = "Crew", ["references"] = {"emt"}, },	["counselor"] = { ["images"] = {"Coun.png"}, ["guide"] = "Counselor", ["title"] = "Counselor", ["description"] = "Keep the crew mentally and spiritually healthy. Has access to the chapel and medbay. Provide funeral services, including burials in space if requested. Probably get killed in your office by a cultist or something.", ["department"] = "Medical", ["difficulty"] = "Easy", ["rank"] = "Passenger (Contractor)", ["references"] = {"psych", "psychiatrist"}, },	["chemist"] = { ["images"] = {"Chem.png"}, ["guide"] = "Chemist", ["title"] = "Chemist", ["description"] = "Prepare medications for medical, and for anyone with a prescription. Still not research, poor guy.", ["department"] = "Medical", ["difficulty"] = "Medium", ["rank"] = "Passenger (Contractor)", ["references"] = {"chem"}, },	["virologist"] = { ["images"] = {"Viro.png"}, ["guide"] = "Virologist", ["title"] = "Virologist", ["description"] = "Research diseases and discover cures for them.", ["department"] = "Medical", ["difficulty"] = "Medium", ["rank"] = "Passenger (Contractor)", ["references"] = {"viro"}, },	["medical contractor"] = { ["images"] = {"Med-Asst.png"}, ["guide"] = "Physician", ["title"] = "Medical Contractor", ["description"] = "Assist the Infirmary staff with anything they need. Be a specialist.", ["department"] = "Medical", ["difficulty"] = "Medium", ["rank"] = "Passenger (Contractor)", ["references"] = {"mc"}, },  -- Research roles. ["scientist"] = { ["images"] = {"Sci.png"}, ["guide"] = "Scientist", ["title"] = "Scientist", ["description"] = "Research phoron, aliens or technology. Go hunting for artifacts. Play with unpredictable anomalies.", ["department"] = "Research", ["difficulty"] = "Medium", ["rank"] = "Passenger (Nanotrasen)", ["references"] = {"researcher"}, },	["prospector"] = { ["images"] = {"Prospector.png"}, ["guide"] = "Shaft Miner", ["title"] = "Prospector", ["description"] = "Go on wacky space adventures, and don’t let anyone else join in on the fun. Pick through the ruins of ancient civilizations. Remember you need resources for a mech, frantically go mining. Part of any good away mission.", ["department"] = "Research", ["difficulty"] = "Medium", ["rank"] = "Passenger (Nanotrasen)", ["references"] = {"miner"}, },	["research assistant"] = { ["images"] = {"RA.png"}, ["guide"] = "Research Assistant", ["title"] = "Research Assistant", ["description"] = "Obey the RD and Research Team. Help the RD and the Research Team with whatever they need. Run and get supplies, clean, be a test subject, and anything else they require.", ["department"] = "Research", ["difficulty"] = "Easy", ["rank"] = "Passenger (Nanotrasen)", ["references"] = {"ra"}, },	["security guard"] = { ["images"] = {"SG.png"}, ["guide"] = "Security Guard", ["title"] = "Security Guard", ["description"] = "Obey the RD and the Research Team, they're the entire reason you're here. Protect the scientists from their own creations. Protect the scientists' creations from the Crew. Keep the Away Teams safe. Covet your Hazard Hardsuit. Make sure your fellow NanoTrasen employees are obeying Corporate Regs, unless the RD says otherwise.", ["department"] = "Research", ["difficulty"] = "Hard", ["rank"] = "Passenger (Nanotrasen)", ["references"] = {"guard"}, },	["nanotrasen pilot"] = { ["images"] = {"RA.png"}, ["guide"] = "NanoTrasen Pilot", ["title"] = "NanoTrasen Pilot", ["description"] = "Fly the Calypso, get the prospectors to their destination and back.", ["department"] = "Research", ["difficulty"] = "Easy", ["rank"] = "Passenger (Nanotrasen)", ["references"] = {"ntp"}, },  -- Service roles. ["crewman"] = { ["images"] = {"Crewman-EC.png", "Crewman-Fleet.png", "Crewman-Marine.png"}, ["guide"] = "Assistant", ["title"] = "Crewman", ["description"] = "Explore the spaceship and see if anyone needs help with anything. Get in trouble for being places you shouldn't be.", ["department"] = "Service", ["difficulty"] = "Very Easy", ["rank"] = "Passenger (Contractor)", ["references"] = {"greytide", "assistant", "baldie"}, },	["bartender"] = { ["images"] = {"Bartender-torch.png"}, ["guide"] = "Bartender", ["title"] = "Bartender", ["description"] = "Mix and serve drinks. Entertain the crew.", ["department"] = "Service", ["difficulty"] = "Easy", ["rank"] = "Passenger (Contractor)", ["references"] = {"barkeep", "barman"}, },	["cook"] = { ["images"] = {"Cook-EC.png", "Cook-Fleet.png", "Cook-Marine.png"}, ["guide"] = "Chef", ["title"] = "Cook", ["description"] = "Cook food for the crew. Prepare lavish feasts.", ["department"] = "Service", ["difficulty"] = "Easy", ["rank"] = "Passenger (Contractor)", ["references"] = {"chef"}, },  -- Synthetics. ["ai"] = { ["images"] = {"AILarge.gif"}, ["guide"] = "AI", ["title"] = "AI", ["description"] = "Be the spaceship. Serve the crew. Or don't.", ["department"] = "Synthetic", ["difficulty"] = "Extremely Hard", ["rank"] = "Synthetic", ["references"] = {}, },  ["cyborg"] = { ["images"] = {"Generic_borg.png"}, ["guide"] = "Cyborg", ["title"] = "Cyborg", ["description"] = "Serve the AI and act as its hands and eyes. Assist the crew to the extent that your lawset allows.", ["department"] = "Synthetic", ["difficulty"] = "Medium to Hard", ["rank"] = "Synthetic", ["references"] = {"robot", "borg"}, },  ["pai"] = { ["images"] = {"pAI.png"}, ["guide"] = "pAI", ["title"] = "pAI", ["description"] = "Act as your owner's constant companion and provide them with useful information and assistance to improve the quality of their life.", ["department"] = "Synthetic", ["difficulty"] = "Very Easy", ["rank"] = "Synthetic", ["references"] = {}, },  ["maintenance drone"] = { ["images"] = {"drone.gif"}, ["guide"] = "Maintenance Drone", ["title"] = "Maintenance Drone", ["description"] = "Crawl around and clean up trash and structural damage as a simple and semi-automated drone.", ["department"] = "Synthetic", ["difficulty"] = "Extremely Hard", ["rank"] = "Synthetic", ["references"] = {"drone"}, },  -- Miscellaneous. ["shade"] = { ["images"] = {"Shade.png"}, ["guide"] = "Construct", ["title"] = "Construct", ["description"] = "As a newly-extracted soul, serve your master and their whims in whatever form they determine is best for you.", ["department"] = "Antagonist", ["difficulty"] = "Medium", ["rank"] = "Antagonist", ["references"] = {"construct"}, },  ["mouse"] = { ["images"] = {"MiceBrown.png"}, ["guide"] = "Mouse", ["title"] = "Mouse", ["description"] = "Squeak a lot, crawl through vents. Annoy the crew by eating their food and garbage. Carry a host of exciting and astonishing diseases.", ["department"] = "None", ["difficulty"] = "Very Easy", ["rank"] = "None", ["references"] = {"rat"}, },  -- Antagonists. ["mercenary"] = { ["images"] = {"Generic_nukesyndie.png"}, ["guide"] = "Mercenary", ["title"] = "Mercenary", ["description"] = "Compromise the SEV Torch as you look after the financial interests of your powerful employers. Or perhaps you're simply soldiers of fortune, looking for a bit of fun and mayhem.", ["department"] = "Antagonist", ["difficulty"] = "Very Hard", ["rank"] = "Antagonist", ["references"] = {"merc", "nukie", "nuke", "op", "nuke op"}, },  ["cultist"] = { ["images"] = {"Generic_cultist.gif"}, ["guide"] = "Cultist", ["title"] = "Cultist", ["description"] = "Sing praises to Nar'sie, the Geometer of Blood. Decorate your trophy rack with eyeballs. Sow panic and glorify in the cold darkness of the void as you crush the spaceship in the bowels of the Machine.", ["department"] = "Antagonist", ["difficulty"] = "Very Hard", ["rank"] = "Antagonist", ["references"] = {"cult"}, },  ["changeling"] = { ["images"] = {"ChangelingLarge.gif"}, ["guide"] = "Changeling", ["title"] = "Changeling", ["description"] = "Be polite, friendly, and have a plan to consume everyone you meet. Revel in paranoia, panic, and terror as you turn good men and women against their loved ones. Walk right into the Armory wearing the Brig Officer's face.", ["department"] = "Antagonist", ["difficulty"] = "Hard", ["rank"] = "Antagonist", ["references"] = {"ling"}, },  ["wizard"] = { ["images"] = {"Wizard.png"}, ["guide"] = "Wizard", ["title"] = "Wizard", ["description"] = "Befuddle the minds of mortal men. Wield terrific arcane power and blow apart the cumulative efforts of the pathetic sciences. Charm gullible young personnel as you pick their pockets. Animate donuts and force them to fight Security for your amusement.", ["department"] = "Antagonist", ["difficulty"] = "Hard", ["rank"] = "Antagonist", ["references"] = {"wiz"}, },  ["raider"] = { ["images"] = {"HeistRaider.png"}, ["guide"] = "Heist", ["title"] = "Raider", ["description"] = "Complete objectives for your employer. Steal the spaceship's paperwork and sell it back to them. Laugh merrily as you mock the crew while stealing the Supermatter Engine under gun point. Hang on tight, the hype train is leaving the station.", ["department"] = "Antagonist", ["difficulty"] = "Hard", ["rank"] = "Antagonist", ["references"] = {"heister"}, -- i guess??? },  ["ninja"] = { ["images"] = {"SpaceNinja.png"}, ["guide"] = "Space Ninja", ["title"] = "Space Ninja", ["description"] = "Uphold the ways of Bushido. Walk boldly through forbidden halls, and sever the hands of any man who would dare challenge you. Drink the spaceship's power as surely as steel swallows lightning. Vanish into the shadows and emerge with your blade at their throats.", ["department"] = "Antagonist", ["difficulty"] = "Medium to Hard", ["rank"] = "Antagonist", ["references"] = {}, },  -- Special roles. ["merchant"] = { ["images"] = {"Merchant.png"}, ["guide"] = "Merchant", ["title"] = "Merchant", ["description"] = "Pick out your trade ship in pretty colors. Haggle with traders and amass a wealth of guns, booze, and novelty cat ears. ", ["department"] = "Special", ["difficulty"] = "Medium", ["rank"] = "Special", ["references"] = {}, },  ["stowaway"] = { ["images"] = {"Stowaway.png"}, ["guide"] = "Stowaway", ["title"] = "Stowaway", ["description"] = "Try to avoid being found out. Flash Security your fake ID. Thrive on stolen beer and cheap snacks.", ["department"] = "Special", ["difficulty"] = "Easy to Hard", ["rank"] = "Special", ["references"] = {}, }, }

-- Internally-used function to harvest alt title references from the job_data table. local get_alt_job_titles = function (t) if not job_data[t] then error("get_alt_job_titles: Tried to look up invalid job '" .. tostring(t) .. "'.") return end if job_data[t].references == nil or #job_data[t].references == 0 then return {} end return job_data[t].references end

-- Establishes a list of alternative references to given jobs (e.g. "CE" for Chief Engineer, etc.). local ref_list = {}

for t, _ in pairs(job_data) do  local alts = get_alt_job_titles(t) if not ref_list[t] then ref_list[t] = t  end

for _, alt in ipairs(alts) do     ref_list[alt] = t   end end

-- Establishes a list of departments, real or contrived, and sorts each job into it. local dep_list = {}

for j, _ in pairs(job_data) do  local d = job_data[j].department:lower

if not dep_list[d] then dep_list[d] = {} end table.insert(dep_list[d], j) end

-- Catch-all function to grab the intended job by any valid given reference. jobdata_api.getJob = function (job) job = job:lower if ref_list[job] ~= nil then return ref_list[job] end error("getJob: Tried to look up invalid job reference '" .. job .. "'.") return nil end

-- Returns an indexed stringlist of all jobs in job_data. jobdata_api.listAllJobs = function local jlist = {} for j, _ in pairs(job_data) do     jlist[#jlist + 1] = j   end return jlist end

-- Returns an indexed stringlist of all jobs in a given department. jobdata_api.listJobsByDepartment = function (d) d = d:lower if not dep_list[d] then error("listJobsByDepartment: Attempted to poll an invalid department, '" .. tostring(d) .. "'.") return end if type(dep_list[d]) ~= "table" then error("listJobsByDepartment: Malformed entry in dep_list table, '" .. tostring(d) .. "'.") return end if #dep_list[d] == 0 then error("listJobsByDepartment: Department table, '" .. tostring(d) .. "', is empty.") return end return dep_list[d] end

-- Functions to poll data from the various job types. jobdata_api.getJobImage = function (job) job = jobdata_api.getJob(job) if job == nil then error("getJobImage: Tried to look up invalid job reference '" .. tostring(job) .. "'.") return end return {job_data[job].images} end

jobdata_api.getJobGuide = function (job) job = jobdata_api.getJob(job) if job == nil then error("getJobGuide: Tried to look up invalid job reference '" .. tostring(job) .. "'.") return end return job_data[job].guide end

jobdata_api.getJobTitle = function (job) job = jobdata_api.getJob(job) if job == nil then error("getJobTitle: Tried to look up invalid job reference '" .. tostring(job) .. "'.") return end return job_data[job].title end

jobdata_api.getJobDescription = function (job) job = jobdata_api.getJob(job) if job == nil then error("getJobDescription: Tried to look up invalid job reference '" .. tostring(job) .. "'.") return end return job_data[job].description end

jobdata_api.getJobDepartment = function (job) job = jobdata_api.getJob(job) if job == nil then error("getJobDepartment: Tried to look up invalid job reference '" .. tostring(job) .. "'.") return end return job_data[job].department end

jobdata_api.getJobDifficulty = function (job) job = jobdata_api.getJob(job) if job == nil then error("getJobDifficulty: Tried to look up invalid job reference '" .. tostring(job) .. "'.") return end return job_data[job].difficulty end

jobdata_api.getJobRank = function (job) job = jobdata_api.getJob(job) if job == nil then error("getJobRank: Tried to look up invalid job reference '" .. tostring(job) .. "'.") return end return job_data[job].rank end

return jobdata_api