Module:Grind/common

From Fallen London Wiki

Documentation for this module may be created at Module:Grind/common/doc

local p = {}

-- == Common data ==

p.mainstats = {
	'Watchful',
	'Shadowy',
	'Dangerous',
	'Persuasive'
}

p.advstats = {
	'Kataleptic Toxicology',
	'Monstrous Anatomy',
	'A Player of Chess',
	'Glasswork',
	'Shapeling Arts',
	'Artisan of the Red Science',
	'Mithridacy',
	'Steward of the Discordance',
	'Zeefaring'
}

p.menaces = {
	'Wounds',
	'Scandal',
	'Suspicion',
	'Nightmares',
	'A Turncoat',
	'Irrigo',
	'Plagued by a Popular Song',
	'Unaccountably Peckish',
	'Ravages of Parabolan Warfare'
}

-- Required fields: class, default.
-- Optional fields: title, ranges.
p.misc = {
	['Zailing Speed'] = {
		class='buttonselect',
		default='0',
		ranges='0,45,55,75'
	},
	['Snake General'] = {
		class='buttonselect',
		default='0',
		ranges='0,5,10,15'
	},
	['Cat General'] = {
		class='buttonselect',
		default='0',
		ranges='0,5,10,15'
	},
	['Chess General'] = {
		class='buttonselect',
		default='0',
		ranges='0,5,10,15'
	},
	['A Power in Waiting -'] = {
		class='buttonselect',
		default='1',
		ranges='1,2'
	}
}

-- Assigns a category to a quality.
function p.identify(quality)
	for _, q in ipairs(p.mainstats) do
		if quality == q then
			return 'mainstat'
		end
	end
	for _, q in ipairs(p.advstats) do
		if quality == q then
			return 'advstat'
		end
	end
	for _, q in ipairs(p.menaces) do
		if quality == q then
			return 'menace'
		end
	end
	return 'unknown'
end

return p