Dead by Daylight Wiki
Advertisement

--DO NOT CHANGE
require("Module:Extensions")
bar = "|" -- code for |
br = "<br>" --break
brnl = "<br>\n" --break new line
space = " "
dot = "."
comma = ", "
colon = ":"
bullet = "\n* " --deprecated, do not use!
nbullet = "*" --newBullet -> please use this version, the old will be removed eventually
dbullet = "\n** " --deprecated
ndbullet = "**"
nl = "\n" --new line
dnl = "\n\n" -- double new line
tnl = "\n\n\n" --tripple new line
nlp = "\n<p>" --new line paragraph
pg = "<p>" --paragraph
ntl = "|-" -- new table line
hl = "!" -- header line
tl = "|" --table line
dtl = "||" -- double table line

--common strings
cstr = {
	file = "File:", --[[File: ...]]
	media = "Media:",
	empty = "",
	the = "The",
	contact = "Please Contact [[User:Jouki|Jouki]]",
	
	--File Formats
	ogg = 'ogg',
	mp3 = 'mp3',
	mp4 = 'mp4',
	jpg = 'jpg',
	jpeg= 'jpeg',
	png = 'png',
	gif = 'gif',
}

types = {
	number = "number",
	string = "string",
	table = "table"
}

--iconLinkStrings
ils = {
	-- Interaction
	basementHooks	  = "Basement Hooks",
	blastMine         = "Blast Mine",
	blastMines		  = "Blast Mines",
	breakableWall	  = "Breakable Wall",
	breakableWalls	  = "Breakable Walls",
	boonTotem		  = "Boon Totem",
	boonTotems        = "Boon Totems",
	chest			  = "Chest",
	chests			  = "Chests",
	dullTotem		  = "Dull Totem",
	dullTotems        = "Dull Totems",
	emergencyMedKit	  = "Emergency Med-Kit",
	exitGate		  = "Exit Gate",
	exitGates		  = "Exit Gates",
	exitGateSwitch    = "Exit Gate Switch",
	exitGateSwitches  = "Exit Gate Switches",
	failedSkillCheck  = "Failed Skill Check",
	failedSkillChecks = "Failed Skill Checks",
	firecracker       = "Firecracker",
	firecrackers	  = "Firecrackers",
	flashlight        = "Flashlight",
	flashlights		  = "Flashlights",
	flashbang         = "Flashbang",
	flashbangs		  = "Flashbangs",
	flashGrenade	  = "Flash Grenade",
	generator		  = "Generator",
	generators		  = "Generators",
	goodSkillCheck	  = "Good Skill Check",
	goodSkillChecks	  = "Good Skill Checks",
	hatch			  = "Hatch",
	hexTotem		  = "Hex Totem",
	hexTotems		  = "Hex Totems",
	hook			  = "Hook",
	hooks			  = "Hooks",
	item			  = "Item",
	items			  = "Items",
	locker			  = "Locker",
	lockers			  = "Lockers",
	map				  = "Map",
	maps			  = "Maps",
	medKit			  = "Med-Kit",
	medKits			  = "Med-Kits",
	pallet			  = "Pallet",
	pallets			  = "Pallets",
	survivor		  = "Survivor",
	survivors		  = "Survivors",
	skillCheck		  = "Skill Check",
	skillChecks		  = "Skill Checks",
	toolbox			  = "Toolbox",
	toolboxes		  = "Toolboxes",
	totem			  = "Totem",
	totems			  = "Totems",
	greatSkillCheck   = "Great Skill Check",
	greatSkillChecks  = "Great Skill Checks",
	window			  = "Window",
	windows			  = "Windows",
	
	-- UI (Status Effects, Auras)
	adrenaline		= "Adrenaline",
	aura			= "Aura",
	auras			= "Auras",
	bleeding		= "Bleeding",
	blessed         = "Blessed",
	blindness		= "Blindness",
	bloodlust		= "Bloodlust",
	broken			= "Broken",
	chance          = "Chance",
	cursed			= "Cursed",
	deepWound		= "Deep Wound",
	efficiency      = "Efficiency",
	endurance		= "Endurance",
	exhausted		= "Exhausted",
	exhaustion		= "Exhaustion",
	exposed			= "Exposed",
	haemorrhage		= "Haemorrhage",
	haste			= "Haste",
	hearing         = "Hearing",
	hindered		= "Hindered",
	incapacitated	= "Incapacitated",
	luck			= "Luck",
	madness         = "Madness",
	mangled			= "Mangled",
	obsession		= "Obsession",
	oblivious		= "Oblivious",
	sleepPenalty    = "Sleep Penalty",
	undetectable	= "Undetectable",
	vision          = "Vision",
	
	-- Killers
	killer			= "Killer",
	nightmare		= "Nightmare",
	
	-- Misc.
	addon			= "Add-on",
	altruism		= "Altruism",
	basement		= "Basement",
	bloodpoints		= "Bloodpoints",
	boldness        = "Boldness",
	brutality       = "Brutality",
	crows			= "Crows",
	deviousness		= "Deviousness",
	dyingState		= "Dying State",
	entity			= "Entity",
	healthState		= "Health State",
	healthy			= "Healthy",
	hunter			= "Hunter",
	injuredState    = "Injured State",
	objectives      = "Objectives",
	poolsOfBlood	= "Pools of Blood",
	sacrifice       = "Sacrifice",
	scratchMarks	= "Scratch Marks",
	stillnessCrows  = "Stillness Crows",
	survival        = "Survival",
	terrorRadius	= "Terror Radius",
}

function clr(color, text)
	local utils = require("Module:Utils")
	return utils.clr(text, color)
end

function bclr(color, text)
	local utils = require("Module:Utils")
	return b(utils.clr(text, color))
end

function iclr(color, text)
	local utils = require("Module:Utils")
	return i(utils.clr(text, color))
end

function link(text)
	return '[[' .. text .. ']]'
end

function file(text)
	return link(cstr.file .. text)
end

function brackets(text)
	return '(' .. text .. ')'
end

--bold function
function b(text)
	return "'''" .. text .. "'''"
end

--italic function
function i(text)
	return "''" .. text .. "''"
end

function join(...)
	local values
	local result = cstr.empty
	local sep = ", "
	if type(...) == "string" then
		values = {...}
		sep = table.remove(values)
	else 
		values = {...}
		sep = table.remove(values)
		values = table.remove(values)
	end
	
	for i, value in ipairs(values) do
		result = result .. value .. ((i < #values and sep) or cstr.empty)
	end
	return result
end

function the(alter)
	return (type(alter) == "table" and alter.the) or alter or cstr.the
end

function ptb(content)
	return '<div class = "ptb">' .. content .. '</div>'
end

--table line => creates a basic table line so it can be easily stacked
function tLine(attrs, ...)
	local values = (type(...) == "string" and {...}) or ...
	local result = cstr.empty
	local separator = (values[#values] == hl and table.remove(values)) or tl --if the last item is header separator then set it to var
	--if separator == hl then table.remove(values) end --if the last item was a separator, then remove it from the list. It's not needed anymore
	result = result .. ntl .. nl .. separator .. ((attrs and space .. attrs .. space .. tl) or cstr.empty) .. space .. table.remove(values, 1)
	for _, value in ipairs(values) do
		result = result .. space .. separator .. separator .. space .. value
	end
	return result .. nl
end

--table header line => same as table line, just for header version
function thLine(attrs, ...)
	local values = {...}
	table.insert(values, hl)
	return tLine(attrs, values)
end
Advertisement