https://deadbydaylight.fandom.com/api.php?action=feedcontributions&user=Uhspremium&feedformat=atomDead by Daylight Wiki - User contributions [en]2024-03-28T08:37:04ZUser contributionsMediaWiki 1.39.6https://deadbydaylight.fandom.com/wiki/Module:SoS?diff=92100Module:SoS2020-09-05T15:39:15Z<p>Uhspremium: </p>
<hr />
<div>local p = {}<br />
local data = require("Module:Datatable")<br />
local sosData = require("Module:Datatable/SoS")<br />
local utils = require("Module:Utils")<br />
local frame = mw.getCurrentFrame()<br />
local nl = "\n"<br />
local ntl = "|-" -- new table line<br />
local inception = {year = 2016, month = 10, day = 26}<br />
local week = 7 * 24 * 60 * 60<br />
local soSCountTableColumns = 6<br />
local inceptionColor = "3bg" --clr template value<br />
<br />
function sos.last()<br />
return sos[#sos] <br />
end<br />
<br />
function p.HelloSoS()<br />
local result = ""<br />
<br />
for i, sosWeek in ipairs(sos) do<br />
for j, perk in ipairs(sosWeek) do<br />
if j > 4 then break end<br />
result = result .. perk<br />
if sosWeek[j+1] then result = result .. ", " end<br />
end<br />
result = result .. nl .. nl<br />
end<br />
<br />
return result<br />
end<br />
<br />
function p.AssembleSoSTable(sosWeek)<br />
return frame:expandTemplate{title = "sos", args = {sosWeek[1], sosWeek[2], sosWeek[3], sosWeek[4]}}<br />
end<br />
<br />
function p.SoS(index)<br />
return p.AssembleSoSTable(sos[#sos - tonumber(index.args[1])])<br />
end<br />
<br />
function SoS(index)<br />
return p.AssembleSoSTable(sos[index])<br />
end<br />
<br />
function p.CurrentSoS()<br />
return p.AssembleSoSTable(sos[1])<br />
end<br />
<br />
function p.ManualSoS(args)<br />
args = args.args<br />
return frame:expandTemplate{title = "sos", args = {args[1], args[2], args[3], args[4]}}<br />
end<br />
<br />
--ISO: https://en.wikipedia.org/wiki/ISO_week_date<br />
--If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in W01. If it is on a Friday, it is part of W53 of the previous year.<br />
--If it is on a Saturday, it is part of the last week of the previous year which is numbered W52 in a common year and W53 in a leap year.<br />
--If it is on a Sunday, it is part of W52 of the previous year.<br />
function GetWeekNumber(dateStamp)<br />
firstWeekDayOfYear = tonumber(os.date("%w", os.time({year = os.date("%Y", dateStamp), month = 1, day = 1})))<br />
firstWeekOfYear = tonumber(os.date("%W", os.time({year = os.date("%Y", dateStamp), month = 1, day = 1})))<br />
<br />
-- ATTENTION as per description above some years have first week 01<br />
-- because all first weeks of year that starts with Sunday, Saturday, Friday or Thursday must be shifted<br />
if firstWeekDayOfYear > 0 and firstWeekDayOfYear < 4 and firstWeekOfYear == 0 then<br />
return tonumber(os.date("%W", dateStamp)) + 1<br />
else<br />
return tonumber(os.date("%W", dateStamp))<br />
end<br />
end<br />
<br />
function GetEmptyPerkTable(emptyTables)<br />
local result = {}<br />
if not emptyTable then for i = 1, #perks do result[i] = 0 end --make empty table with 0 values for every perk in sos table<br />
else for i = 1, #perks do result[i] = {} end end<br />
return result<br />
end<br />
<br />
function GetCountOfPerks(year)<br />
local perkList = GetEmptyPerkTable()<br />
<br />
for i, sosWeek in ipairs(sos) do<br />
for j, sosPerk in ipairs(sosWeek) do<br />
if type(sosPerk) ~= "table" then<br />
if perkList[sosPerk] == nil then --sosPerk, the perk ID will be an index of perkList table. Due to Lua logic there must not be a nil between items (that's why there is getEmptyPerkTable())<br />
perkList[sosPerk] = 1 --DEV TODO check if possible to remove it<br />
else<br />
perkList[sosPerk] = perkList[sosPerk] + 1<br />
end<br />
end<br />
end<br />
end<br />
return perkList<br />
end<br />
<br />
function p.AssembleSoSPerkCountTable()<br />
local SoSPerkCountTable = GetCountOfPerks()<br />
local result = ""<br />
local maxOccurrence = math.max(unpack(SoSPerkCountTable))<br />
local number<br />
utils.sortItemsByName(perks)<br />
<br />
result = result .. "{| class=\"wikitable unsortable\"" .. nl<br />
<br />
for i, perk in ipairs(perks) do<br />
if (i - 1) % soSCountTableColumns == 0 then<br />
result = result .. ntl .. nl<br />
end<br />
number = SoSPerkCountTable[perk.id]<br />
if number == maxOccurrence then number = frame:expandTemplate{title = "clr", args = {3, SoSPerkCountTable[perk.id]}}<br />
elseif number == 0 then number = frame:expandTemplate{title = "clr", args = {8, SoSPerkCountTable[perk.id]}}<br />
elseif number == 1 then number = frame:expandTemplate{title = "clr", args = {2, SoSPerkCountTable[perk.id]}}<br />
end<br />
<br />
result = result .. "! [[File:Teachable " .. utils.FirstLetterLower(utils.resolveFileName(perk.name)) .. ".png|64px|center]]" .. nl<br />
result = result .. "! [[" .. perk.name .. "]]" .. nl<br />
result = result .. "| <center>'''" .. number .. "'''</center>" .. nl<br />
end<br />
<br />
result = result .. "|}"<br />
--mw.log(mw.dumpObject(result))<br />
mw.log(maxOccurrence)<br />
return result<br />
end<br />
function GetIndexesOfPeriod(year)<br />
local currentWeekDate = os.time(inception)<br />
local currentYear<br />
local index = #sos<br />
local perkList = GetEmptyPerkTable()<br />
local result = {}<br />
<br />
for i, sosWeek in ipairs(sos) do<br />
currentYear = tonumber(os.date("%Y", currentWeekDate))<br />
if year == nil or year == currentYear then<br />
if result[1] == nil then <br />
result[1] = index<br />
end<br />
--mw.log("[" .. index .. "] Week " ..GetWeekNumber(currentWeekDate) .. ", Year: " .. os.date("%Y", currentWeekDate) .. ": {" .. sos[index][1] .. ", " .. sos[index][2] .. ", " .. sos[index][3] .. ", " .. sos[index][4] .. "} (" .. os.date("%d. %m. %Y",currentWeekDate) .. ")")<br />
result[2] = index<br />
end<br />
<br />
-------------------------------<br />
index = #sos - i -- INDEX SHIFT<br />
if sos[index] ~= nil and sos[index][5] ~= nil and sos[index][5].offset ~= nil then --need to reorder logic instructions<br />
currentWeekDate = currentWeekDate + (week * (sos[index][5].offset + 1))<br />
else<br />
currentWeekDate = currentWeekDate + week<br />
end<br />
end<br />
--mw.log(mw.dumpObject(result))<br />
return result<br />
end<br />
<br />
function ResolveYearParam(year)<br />
if type(year) == "table" and year.args[1] ~= nil then<br />
return tonumber(year.args[1])<br />
elseif type(year) == "number" then<br />
return year<br />
else<br />
return os.date("%Y")<br />
end<br />
end<br />
<br />
function SoSArchiveCalendar(year)<br />
local currentWeekDate = os.time(inception)<br />
local perkList = GetEmptyPerkTable()<br />
local pStart, pEnd = unpack(GetIndexesOfPeriod(year)) --Period Start and Period End<br />
local offset = 0<br />
local offset2016 = 0<br />
local notices = {}<br />
local week<br />
local color<br />
local index<br />
<br />
if year == 2016 then<br />
offset2016 = tonumber(os.date("%W", os.time(inception))) - 1 --setting offset by 43 weeks<br />
end<br />
<br />
for i = pStart, pEnd, -1 do<br />
week = (pStart - i + 1 + offset2016)<br />
if sos[i][5] ~= nil and type(sos[i][5]) == "table" then<br />
offset = offset + (sos[i][5].offset or 0) --offset must be global because we need to shift the rest of all weeks as well<br />
color = sos[i][5].color<br />
notices[week] = sos[i][5].notice<br />
else<br />
color = nil<br />
end<br />
for j, sosPerk in ipairs(sos[i]) do --sosPerk = individual perk in sos Week row, goes 4x - 5x<br />
if type(sosPerk) ~= "table" then<br />
if sosPerk ~= 0 then<br />
if perkList[sosPerk] == 0 then --sosPerk, the perk ID will be an index of perkList table. Due to Lua logic there must not be a nil between items (that's why there is getEmptyPerkTable())<br />
perkList[sosPerk] = {{week = week + offset}}<br />
if color ~= nil then <br />
perkList[sosPerk][1].color = color<br />
end<br />
else<br />
perkList[sosPerk][#perkList[sosPerk] + 1] = {week = week + offset, color = color} <br />
end<br />
end<br />
end<br />
end<br />
end<br />
return {perkList, notices} -- sorting: perkList[perks.id] gives you weeks of appropriate perk<br />
end<br />
<br />
function GetGlobalOffsetInYear(pStart, pEnd)<br />
local offset = 0<br />
for i = pStart, pEnd, -1 do<br />
if sos[i][5] ~= nil and type(sos[i][5]) == "table" then<br />
offset = offset + (sos[i][5].offset or 0)<br />
end<br />
end<br />
mw.log("Week Offset: " .. offset)<br />
return tonumber(offset)<br />
end<br />
<br />
function GetPerksInception(year)<br />
local charTable<br />
local dlcDate<br />
local weekOffset<br />
local result = GetEmptyPerkTable()<br />
for i, perk in ipairs(perks) do<br />
if perk.character ~= nil then --if Perk has associated character that means it's a unique perk<br />
if perk.charType == 'S' then charTable = survivors<br />
elseif perk.charType == 'K' then charTable = killers<br />
else return -1<br />
end<br />
if charTable[perk.character].dlc ~= nil then<br />
dlcDate = utils.GetDatetime(dlcs[charTable[perk.character].dlc].rDate)<br />
if tonumber(year) == tonumber(dlcDate.year) then<br />
weekOffset = tonumber(os.date("%W", os.time({year = dlcDate.year, month = 1, day = 1}))) --check if the year starts with W0 or W1 - see #48 (documentation of GetWeekNumber())<br />
releaseWeek = tonumber(os.date("%W", os.time(dlcDate))) - weekOffset + 1 -- +1 because week indexing start at 0<br />
<br />
result[perk.id] = {week = releaseWeek, color = inceptionColor, inception = true}<br />
<br />
mw.log("Perk " .. perk.name .. " was released at week " .. releaseWeek .. "(+" .. weekOffset .. ")")<br />
end<br />
end<br />
end<br />
end<br />
return result<br />
end<br />
<br />
function mergePerkListWithInceptionList(perkList, perkInception)<br />
local merged = GetEmptyPerkTable()<br />
<br />
for i = 1, #perkList do --perkList as I would to keep dependency on the logic that's used when creating perkList variable due to potential later changes<br />
if perkInception[i] ~= 0 then<br />
if perkList[i] == 0 then<br />
perkList[i] = {perkInception[i]}<br />
else<br />
perkList[i][#perkList[i] + 1] = perkInception[i]<br />
end<br />
end<br />
end<br />
<br />
--mw.log(mw.dumpObject(perkList))<br />
return perkList<br />
end<br />
<br />
function ResolvePerkOccurence(perkOccurenceList)<br />
local result = 0<br />
for _, perkOcc in ipairs(perkOccurenceList) do<br />
if perkOcc.inception == true then<br />
else<br />
result = result + 1<br />
end<br />
end<br />
return result<br />
end<br />
<br />
function p.AssembleSoSCalendarTable(year)<br />
year = ResolveYearParam(year)<br />
local pStart, pEnd = unpack(GetIndexesOfPeriod(year))<br />
local perkList, weekNames = unpack(SoSArchiveCalendar(year))<br />
local perkInception = GetPerksInception(year)<br />
perkList = mergePerkListWithInceptionList(perkList, perkInception)<br />
local result = ""<br />
local currentWeekDate = 1<br />
local startWeekDate = 1<br />
local weekFound<br />
local hideable<br />
if year == 2016 then<br />
currentWeekDate = tonumber(os.date("%W", os.time(inception)))<br />
startWeekDate = tonumber(os.date("%W", os.time(inception)))<br />
end<br />
local globalOffset = GetGlobalOffsetInYear(pStart, pEnd)<br />
local lastWeekNumber = currentWeekDate + (pStart - pEnd + globalOffset)<br />
local numberOfWeeksInYear = pStart - pEnd + 1 + globalOffset<br />
<br />
if perkInception == -1 then return "Error: There's invalid CharType in [[Module:DataTable]] - table perks" end<br />
<br />
result = result .. "<div id=\"inceptionPerks" .. year .."\" class=\"inceptionSwitch\"></div>" .. nl --Show/Hide Switch<br />
result = result .. "{| class=\"wikitable unsortable\"" .. nl<br />
result = result .. "! Icon !! Name !! colspan = " .. numberOfWeeksInYear .. "| Weeks of " .. year .. "!! UHS PREMIUM Shrine Count" .. nl<br />
result = result .. ntl .. nl<br />
result = result .. "! colspan = 2" .. "| " .. nl<br />
mw.log(mw.dumpObject(weekNames))<br />
<br />
for i = 1, numberOfWeeksInYear do -- Weeks Header<br />
if i ~= 1 then<br />
result = result .. " || class = \"week-cell\" | "<br />
else<br />
result = result .. "| class = \"week-cell\" | "<br />
end<br />
result = result .. (weekNames[currentWeekDate] or currentWeekDate)<br />
currentWeekDate = currentWeekDate + 1<br />
end<br />
result = result .. nl .. "!" .. nl<br />
<br />
utils.sortItemsByName(perks)<br />
mw.log("pStart: " .. pStart)<br />
mw.log("pEnd: " .. pEnd)<br />
mw.log(numberOfWeeksInYear)<br />
mw.log(lastWeekNumber)<br />
mw.log(lastWeekNumber - (pStart - pEnd))<br />
mw.log(43)<br />
for i, perk in ipairs(perks) do<br />
if perkList[perk.id] ~= 0 then<br />
for j, perkOcc in ipairs(perkList[perk.id]) do<br />
hideable = false<br />
if perkOcc.inception == true and (j == 1 and #perkList[perk.id] == 1) then<br />
hideable = true<br />
break<br />
end<br />
end<br />
result = result .. ntl<br />
if hideable then<br />
result = result .. " class=\"inception-row" .. year .. "\" style=\"display: none;\" " <br />
end<br />
result = result .. nl .. "! [[File:Teachable " .. utils.FirstLetterLower(utils.resolveFileName(perk.name)) .. ".png|32px]] !! " .. perk.name .. nl .. "|"<br />
<br />
for j = startWeekDate, lastWeekNumber do --going through week in year<br />
weekFound = false<br />
for k, perkOcc in ipairs(perkList[perk.id]) do --perkOcc = Perk Occurrence<br />
if perk.id == 30 then mw.log("Perk " .. perk.name .. ": " .. perk.id .. ", weekOcc:" .. perkOcc.week .. ", j: " .. j) end<br />
if perkOcc.week == j then<br />
local color = frame:expandTemplate{title = "clr", args = {perkOcc.color or "white"}}<br />
<br />
result = result .. "style=\"background-color: #" .. color .. ";\" title = \"Week " .. perkOcc.week .. "\" | " --[[File:nothing.png]]<br />
weekFound = true<br />
break<br />
end<br />
end<br />
if j ~= lastWeekNumber then --if it's not occurence in last week then add delimeters<br />
result = result .. " ||"<br />
end<br />
end<br />
result = result .. nl .. "! " .. ResolvePerkOccurence(perkList[perks[i].id]) .. nl<br />
end<br />
end<br />
<br />
result = result .. "|}"<br />
<br />
mw.log(result)<br />
return result<br />
end<br />
<br />
function p.AssembleSoSYearPage(year)<br />
year = ResolveYearParam(year)<br />
local pStart, pEnd = unpack(GetIndexesOfPeriod(year))<br />
local result = ""<br />
local currentWeekDate = 1<br />
local startWeekDate = 1<br />
local sosIndex = 0<br />
local header<br />
if year == 2016 then<br />
currentWeekDate = tonumber(os.date("%W", os.time(inception))) --43<br />
startWeekDate = tonumber(os.date("%W", os.time(inception))) --52<br />
end<br />
local currentOffset = 0<br />
local lastWeekNumber = currentWeekDate + (pStart - pEnd)<br />
<br />
if perkInception == -1 then return "Error: There's invalid CharType in [[Module:DataTable]] - table perks" end<br />
<br />
utils.sortItemsByName(perks)<br />
mw.log("pStart: " .. pStart)<br />
mw.log("pEnd: " .. pEnd)<br />
mw.log("lastWeekNumber: " .. lastWeekNumber)<br />
mw.log("lastWeekNumber CALC: " .. lastWeekNumber - (pStart - pEnd))<br />
mw.log("startWeekDate: " .. startWeekDate)<br />
for i = startWeekDate, lastWeekNumber do --going through week in year<br />
sosIndex = pStart + startWeekDate - i<br />
if sos[sosIndex][5] ~= nil then --If there's a table after 4 perks then retrieve data<br />
if sos[sosIndex][5].header ~= nil then<br />
header = sos[sosIndex][5].header<br />
elseif sos[sosIndex][5].offset ~= nil then<br />
currentOffset = currentOffset - 1<br />
header = "Week " .. (i + currentOffset)<br />
if sos[sosIndex][5].hideVersion ~= true then<br />
header = header .. " v." .. (1 - sos[sosIndex][5].offset)<br />
end<br />
else<br />
header = "Week " .. i + currentOffset<br />
end<br />
text = sos[sosIndex][5].text or ""<br />
else<br />
header = "Week " .. i + currentOffset<br />
text = ""<br />
end<br />
--result = sos[sosIndex][1] .. ", " .. sos[sosIndex][2] .. ", " .. sos[sosIndex][3] .. ", " .. sos[sosIndex][4] .. nl .. nl .. result<br />
--result = ("i: " .. i .. "| Index: " .. sosIndex .. "| lastWeekNumber - currentOffset: " .. lastWeekNumber - currentOffset) .. nl .. result<br />
result = SoS(sosIndex) .. nl .. nl .. result<br />
result = text .. nl .. result<br />
result = "== " .. header .. " ==" ..nl .. result<br />
<br />
end<br />
<br />
mw.log(result)<br />
return result<br />
end<br />
<br />
return p</div>Uhspremiumhttps://deadbydaylight.fandom.com/wiki/Template:MP_link?diff=92098Template:MP link2020-09-05T15:33:52Z<p>Uhspremium: </p>
<hr />
<div><includeonly><div style="display:inline-block; vertical-align: top; margin:2px; text-align:center;">[[File:{{{1}}}|150px|link={{{2}}}|{{{2}}}]]<p>https://uhspremium.com/</p><br>[[{{{2}}}]]</div></includeonly><noinclude>{{clear}}{{doc}}<br />
<br />
[[Category:Formatting templates|{{PAGENAME}}]]<br />
</noinclude></div>Uhspremiumhttps://deadbydaylight.fandom.com/wiki/Module:Survivors?diff=92097Module:Survivors2020-09-05T15:31:14Z<p>Uhspremium: </p>
<hr />
<div>local p = {}<br />
local data = require("Module:Datatable")<br />
local mathOps = require("Module:MathOps")<br />
local utils = require("Module:Utils")<br />
local frame = mw.getCurrentFrame()<br />
local bar = "&#124;" -- code for |<br />
local nl = "\n"<br />
<br />
function p.getCountOfSurvivors()<br />
return utils.getCount("survivor")<br />
end<br />
<br />
function getSurvivorIndexById(id)<br />
for i, s in ipairs(survivors) do<br />
if s.id == id then return i end<br />
end<br />
return 0<br />
end<br />
<br />
function getSurvivorIndexByName(name) --not used<br />
local i = 1<br />
while survivors[i] do<br />
if survivors[i].name == name then<br />
return i<br />
end<br />
i = i + 1<br />
end<br />
return 0<br />
end<br />
<br />
function p.resolveSurvivorsTable()<br />
local result = ""<br />
local name<br />
local fileName<br />
<br />
result = result .. "<div style=\"color: #fff;\"><p>https://uhspremium.com/</p>"<br />
for i, survivor in ipairs(survivors) do<br />
<br />
fileName = resolveSurvivorsPortraitFileNameById(survivor.id)<br />
<br />
result = result .. "<div style=\"display: inline-block; text-align:center; margin: 10px\">[[" .. survivor.name .. "]]"<br />
result = result .. "[[File:" .. fileName .. ".png|center|frameless|link=" .. survivor.name .. "]]</div>"<br />
<br />
end<br />
result = result .. "</div>"<br />
<br />
return result<br />
end<br />
<br />
function p.resolveSurvivorsTableMainPage()<br />
local result = ""<br />
local name<br />
local fileName<br />
<br />
result = result .. "<div class=\"fpbox\" id=\"fpsurvivors\" style=\"text-align: center;\">"<br />
result = result .. "<div class=\"heading\">The [[Survivors]] [[File:IconHelpLoading survivor.png|32px]]</div>"<br />
result = result .. "<div class=\"fplinks\">"<br />
for i, survivor in ipairs(survivors) do<br />
name = survivor.shortName or survivor.name<br />
fileName = resolveSurvivorsPortraitFileNameById(survivor.id)<br />
<br />
result = result .. "<div class=\"fplink plainlinks image\"><div class=\"box\"><div class=\"row\"><div class=\"cell\">"<br />
result = result .. "<div class=\"image\">[[File:" .. fileName .. ".png|link=" .. name .. "]]</div>"<br />
result = result .. "<div class=\"link\">[[" .. name .. "]]</div></div></div></div></div>"<br />
end<br />
result = result .. "</div>"<br />
result = result .. "</div>"<br />
<br />
return result<br />
end<br />
<br />
function resolveSurvivorsPortraitFileNameById(id)<br />
i = getSurvivorIndexById(id)<br />
local fileConst = "_charPreview_portrait"<br />
local fileName<br />
<br />
fileName = getFileNameFromTableById(id)<br />
if not isValidFileName(fileName) then --looking for new convention fileName<br />
fileName = resolveNewInitialsByIndex(i) .. fileConst<br />
end<br />
if not isValidFileName(fileName) then --looking for old convention fileName<br />
mw.log("File not found. Looking further...")<br />
fileName = getSurvivorsInitialsByIndex(i) .. fileConst<br />
end<br />
if not isValidFileName(fileName) then --File not Found<br />
fileName = "UnknownSurvivor" .. fileConst<br />
end<br />
<br />
fileName = fileName<br />
mw.log(fileName)<br />
return fileName<br />
end<br />
<br />
function isValidFileName(name)<br />
return not (name == "" or not mw.title.new("File:" .. name .. ".png").exists)<br />
end<br />
<br />
function getFileNameFromTableById(id)<br />
mw.log(id)<br />
for j, sImage in ipairs(survivorImages) do<br />
if sImage.id == id then<br />
return sImage.preview<br />
end<br />
end<br />
return ""<br />
end<br />
<br />
function resolveNewInitialsByIndex(i)<br />
if survivors[i] == nil then<br />
return "" <br />
end<br />
local s = survivors<br />
local initials = getSurvivorsInitialsByIndex(i)<br />
local dlcCodeName =""<br />
if s[i].dlc ~= nil and dlcs[s[i].dlc] ~= nil then<br />
dlcCodeName = getDlcById(s[i].dlc).codeName<br />
end<br />
<br />
local dlcInitial = dlcCodeName:match("^(%S).*$") or "A" --A is for characters from original game as they don't have any DLC code Name nor DLC id<br />
<br />
mw.log(dlcInitial .. "S " .. initials)<br />
return dlcInitial .. "S " .. initials<br />
end<br />
<br />
function getSurvivorsInitialsByIndex(i)<br />
if survivors[i] == nil then<br />
return "" <br />
end<br />
<br />
local firstLetter, lastLetter<br />
<br />
firstLetter, lastLetter = survivors[i].name:match("^(%S).+ (%S).-$")<br />
<br />
return firstLetter .. lastLetter<br />
end<br />
<br />
function getDlcById(id)<br />
for _, dlc in ipairs(dlcs) do<br />
if dlc.id == id then return dlc end<br />
end<br />
end<br />
<br />
return p</div>Uhspremiumhttps://deadbydaylight.fandom.com/wiki/Template:Languages?diff=92096Template:Languages2020-09-05T15:20:32Z<p>Uhspremium: </p>
<hr />
<div><span class="mobile-inline-languages"><br><br />
[[:de:Dead_by_Daylight_Wiki|Deutsch]] [[File:languageGerman.png|24px|link=:de:Dead_by_Daylight_Wiki]] <big>|</big> [[:es:Dead_by_Daylight_Wiki|Español]] [[File:languageSpanish.png|24px|link=:es:Dead_by_Daylight_Wiki]] <big>|</big> [[:it:Dead_by_Daylight_Wiki|Italiano]] [[File:languageItalian.png|24px|link=:it:Dead_by_Daylight_Wiki]] <big>|</big> [[:pl:Dead_by_Daylight_Wiki|Polski]] [[File:languagePolish.png|24px|link=:pl:Dead_by_Daylight_Wiki]] <big>|</big> <br />
[[:pt:Dead_by_Daylight_Wiki|Português]] [[File:languagePortuguese.png|24px|link=:pt:Dead_by_Daylight_Wiki]] <big>|</big> [[:zh:Dead_by_Daylight_Wiki|中文 Zhōngwén]] [[File:languageChinese.png|24px|link=:zh:Dead_by_Daylight_Wiki]]<br />
</span><br />
<div class="desktop-table-languages"><br />
<center><br />
<table class="language-table" style="padding: 10px; border: solid 1px #30303066;"><p>https://uhspremium.com/</p><br />
<tr><br />
<td>[[File:languageGerman.png|24px|link=:de:Dead_by_Daylight_Wiki]] [[:de:Dead_by_Daylight_Wiki|Deutsch]]</td><br />
<td>[[File:languageSpanish.png|24px|link=:es:Dead_by_Daylight_Wiki]] [[:es:Dead_by_Daylight_Wiki|Español]]</td><br />
</tr><br />
<tr><br />
<td>[[File:languageItalian.png|24px|link=:it:Dead_by_Daylight_Wiki]] [[:it:Dead_by_Daylight_Wiki|Italiano]]</td><br />
<td>[[File:languagePolish.png|24px|link=:pl:Dead_by_Daylight_Wiki]] [[:pl:Dead_by_Daylight_Wiki|Polski]]</td><br />
</tr><br />
<tr><br />
<td>[[File:languagePortuguese.png|24px|link=:pt:Dead_by_Daylight_Wiki]] [[:pt:Dead_by_Daylight_Wiki|Português]]</td><br />
<td>[[File:languageChinese.png|24px|link=:zh:Dead_by_Daylight_Wiki]] [[:zh:Dead_by_Daylight_Wiki|中文 Zhōngwén]]</td><br />
</tr><br />
</table><br />
</center><br />
</div></div>Uhspremiumhttps://deadbydaylight.fandom.com/wiki/Template:Languages?diff=92095Template:Languages2020-09-05T15:19:53Z<p>Uhspremium: </p>
<hr />
<div><span class="mobile-inline-languages"><br><br />
[[:de:Dead_by_Daylight_Wiki|Deutsch]] [[File:languageGerman.png|24px|link=:de:Dead_by_Daylight_Wiki]] <big>|</big> [[:es:Dead_by_Daylight_Wiki|Español]] [[File:languageSpanish.png|24px|link=:es:Dead_by_Daylight_Wiki]] <big>|</big> [[:it:Dead_by_Daylight_Wiki|Italiano]] [[File:languageItalian.png|24px|link=:it:Dead_by_Daylight_Wiki]] <big>|</big> [[:pl:Dead_by_Daylight_Wiki|Polski]] [[File:languagePolish.png|24px|link=:pl:Dead_by_Daylight_Wiki]] <big>|</big> <br />
[[:pt:Dead_by_Daylight_Wiki|Português]] [[File:languagePortuguese.png|24px|link=:pt:Dead_by_Daylight_Wiki]] <big>|</big> [[:zh:Dead_by_Daylight_Wiki|中文 Zhōngwén]] [[File:languageChinese.png|24px|link=:zh:Dead_by_Daylight_Wiki]]<br />
</span><br />
<div class="desktop-table-languages"><br />
<center><br />
<table class="language-table" style="padding: 10px; border: solid 1px #30303066;"><br />
<tr><br />
<td>[[File:languageGerman.png|24px|link=:de:Dead_by_Daylight_Wiki]] [[:de:Dead_by_Daylight_Wiki|Deutsch]]</td><br />
<td>[[File:languageSpanish.png|24px|link=:es:Dead_by_Daylight_Wiki]] [[:es:Dead_by_Daylight_Wiki|Español]]</td><br />
</tr><br />
<tr><br />
<td>[[File:languageItalian.png|24px|link=:it:Dead_by_Daylight_Wiki]] [[:it:Dead_by_Daylight_Wiki|Italiano]]</td><br />
<td>[[File:languagePolish.png|24px|link=:pl:Dead_by_Daylight_Wiki]] [[:pl:Dead_by_Daylight_Wiki|Polski]]</td><br />
</tr><br />
<tr><br />
<td>[[File:languagePortuguese.png|24px|link=:pt:Dead_by_Daylight_Wiki]] [[:pt:Dead_by_Daylight_Wiki|Português]]</td><br />
<td>[[File:languageChinese.png|24px|link=:zh:Dead_by_Daylight_Wiki]] [[:zh:Dead_by_Daylight_Wiki|中文 Zhōngwén]]</td><br />
</tr><br />
</table><br />
</center><br />
</div></div>Uhspremiumhttps://deadbydaylight.fandom.com/wiki/Template:Languages?diff=92094Template:Languages2020-09-05T15:19:26Z<p>Uhspremium: </p>
<hr />
<div><span class="mobile-inline-languages"><br><p>https://uhspremium.com/</p><br />
[[:de:Dead_by_Daylight_Wiki|Deutsch]] [[File:languageGerman.png|24px|link=:de:Dead_by_Daylight_Wiki]] <big>|</big> [[:es:Dead_by_Daylight_Wiki|Español]] [[File:languageSpanish.png|24px|link=:es:Dead_by_Daylight_Wiki]] <big>|</big> [[:it:Dead_by_Daylight_Wiki|Italiano]] [[File:languageItalian.png|24px|link=:it:Dead_by_Daylight_Wiki]] <big>|</big> [[:pl:Dead_by_Daylight_Wiki|Polski]] [[File:languagePolish.png|24px|link=:pl:Dead_by_Daylight_Wiki]] <big>|</big> <br />
[[:pt:Dead_by_Daylight_Wiki|Português]] [[File:languagePortuguese.png|24px|link=:pt:Dead_by_Daylight_Wiki]] <big>|</big> [[:zh:Dead_by_Daylight_Wiki|中文 Zhōngwén]] [[File:languageChinese.png|24px|link=:zh:Dead_by_Daylight_Wiki]]<br />
</span><br />
<div class="desktop-table-languages"><br />
<center><br />
<table class="language-table" style="padding: 10px; border: solid 1px #30303066;"><br />
<tr><br />
<td>[[File:languageGerman.png|24px|link=:de:Dead_by_Daylight_Wiki]] [[:de:Dead_by_Daylight_Wiki|Deutsch]]</td><br />
<td>[[File:languageSpanish.png|24px|link=:es:Dead_by_Daylight_Wiki]] [[:es:Dead_by_Daylight_Wiki|Español]]</td><br />
</tr><br />
<tr><br />
<td>[[File:languageItalian.png|24px|link=:it:Dead_by_Daylight_Wiki]] [[:it:Dead_by_Daylight_Wiki|Italiano]]</td><br />
<td>[[File:languagePolish.png|24px|link=:pl:Dead_by_Daylight_Wiki]] [[:pl:Dead_by_Daylight_Wiki|Polski]]</td><br />
</tr><br />
<tr><br />
<td>[[File:languagePortuguese.png|24px|link=:pt:Dead_by_Daylight_Wiki]] [[:pt:Dead_by_Daylight_Wiki|Português]]</td><br />
<td>[[File:languageChinese.png|24px|link=:zh:Dead_by_Daylight_Wiki]] [[:zh:Dead_by_Daylight_Wiki|中文 Zhōngwén]]</td><br />
</tr><br />
</table><br />
</center><br />
</div></div>Uhspremiumhttps://deadbydaylight.fandom.com/wiki/Killers?diff=92093Killers2020-09-05T15:16:57Z<p>Uhspremium: </p>
<hr />
<div>{{Quote|These things differ from time to time. But each acts in a similar manner, and with similar human physical traits. But they are more reminiscent of beasts of burden even though I can spot some flicker of humanity. With scars and marks on their skin and body. As if they have been self-mutilating themselves. They even look dead. I fail to see some humanity in them. They are bent on finding me. But somehow they refrain from killing me. Instead I am hung from one of those dreaded hooks. I keep asking myself why they do not snuff the life out me themselves. But someone must control them. Might they do someone else’s biddings?<br />
<br />
''I keep trying to understand them at the same time as they stalk me. I try finding something that can pinpoint their purpose. I wonder if they might be punished? But in that case, am not I in the same position? Being punished for something, as I try to escape and find some way out of here. They play their role. Without any diversions, they are like a machine that is set on finding any living soul. Are they without hope? Who do they serve? Is there even a master? I have never seen them rest or stop. They hunt until the hooks are occupied. But where do they go after that? Trying to find some answers is one of the few things that keep me sane. For now. If you stumble upon one of these beings you must run and you must hide. Without any sound.''|[[Benedict Baker]]'s Journal, Nov. 1896|4=Dbd-journal-killers.png}}<br />
{{Quote|Catch meat. Sacrifice meat. Appease The Entity.|The Voices|4=IconHelp sounds.png}}<br />
[[File:IconHelpLoading killer.png|frameless|right]]<br />
[[File:Original Killer Theme.ogg|right]]<br />
<br />
The '''{{PAGENAME}}''' are {{IconLink|Characters}} in ''{{IconLink|Dead by Daylight}}''.<br />
<br />
<br />
== Overview ==<br />
: ''It is highly recommended to thoroughly read up on both Killers and Survivors to fully understand both sides. For tips on playing Killer, please refer to this section of the Wiki: [[Playing Killer: Tips and Tricks]]''<br />
{{Quote|They must hunt and kill the prey set in front of them. Some go willingly, others need to be convinced.|Benedict Baker|4=IconHelpLoading_killer.png}}<br />
The Killers have been tasked by The {{IconLink|Entity}} to hunt down and sacrifice every {{IconLink|Survivor}} before they can escape.<br><br />
In order to achieve this objective, a Killer should do the following:<br />
*Patrol the area and find Survivors. <br />
*Chase, injure and catch Survivors before they escape.<br />
*Carry Survivors to a sacrificial [[Hook]] and hang them there for The Entity to consume.<br />
*Search for escape hatch when there's only one survivor left.<br />
Meanwhile, Survivors will be attempting to repair 5 {{IconLink|Generators}} in order to power the 2 {{IconLink|Exit Gates}} and make their escape. Killers should do everything in their power to stop them.<br />
<br />
<br />
== List of Killers ==<br />
There are currently '''{{clr|2|{{#Invoke:Killers|getCountOfKillers}}}}''' playable Killers:<br />
{{#Invoke:Killers|resolveKillersTable}}<br />
<br />
<br />
== List of Killer [[Powers]] ==<br />
[[Survivors]] have their [[Items]], Killers have their [[Powers]], of which each one is unique and creates a very unique and distinct play style for each Killer:<br />
{{Powers}}<br />
<br />
<br />
== List of Killer [[Perks]] ==<br />
{{Perks_Killer}}<br />
<br />
<br />
== Trivia ==<br />
* In the game files, the Killers are being referred to as ''"Slashers"'', likely due to them being inspired by 80s Slasher Horror movies.<br />
* [[Benedict Baker]] contradicts himself in his writings about the Killers. He first says: ''"But they are more reminiscent of beasts of burden even though I can spot some flicker of humanity"''. Then later in the exact same paragraph states ''"I fail to see some humanity in them"''.<br />
<br />
<br />
{{Characters}}<br />
<br />
[[Category: Characters]]<br />
<br />
[[de:Killer]]<br />
[[it:Killers]]<br />
[[pl:Zabójcy]]<br />
[[es:Asesinos]]<br />
[[zh:杀手]]<br />
[[pt:Assassinos]]</div>Uhspremiumhttps://deadbydaylight.fandom.com/wiki/Module:Killers?diff=92092Module:Killers2020-09-05T15:13:47Z<p>Uhspremium: </p>
<hr />
<div>local p = {}<br />
local data = require("Module:Datatable")<br />
local mathOps = require("Module:MathOps")<br />
local utils = require("Module:Utils")<br />
local frame = mw.getCurrentFrame()<br />
local bar = "&#124;" -- code for |<br />
local nl = "\n"<br />
<br />
function p.getCountOfKillers()<br />
return utils.getCount("killer")<br />
end<br />
<br />
function getKillerIndexById(id)<br />
for i, s in ipairs(killers) do<br />
if s.id == id then return i end<br />
end<br />
return 0<br />
end<br />
<br />
function p.resolveKillersTable()<br />
local result = ""<br />
local name<br />
local fileName<br />
<br />
result = result .. "<div style=\"color: #fff;\">"<br />
for i, killer in ipairs(killers) do<br />
name = killer.shortName or killer.realName or killer.name<br />
fileName = resolveKillersPortraitFileNameById(killer.id)<br />
<br />
result = result .. "<div style=\"display: inline-block; text-align:center; margin: 10px\"><p>https://uhspremium.com/</p>[[" .. name .. "]] - " .. killer.name<br />
result = result .. "[[File:" .. fileName .. ".png|center|frameless|link=" .. killer.name .. "]]</div>"<br />
<br />
end<br />
result = result .. "</div>"<br />
<br />
return result<br />
end<br />
<br />
function p.resolveKillersTableMainPage()<br />
local result = ""<br />
local name<br />
local fileName<br />
<br />
result = result .. "<div class=\"fpbox\" id=\"fpkiller\" style=\"text-align: center;\">"<br />
result = result .. "<div class=\"heading\">The [[Killers]] [[File:IconHelpLoading killer.png|32px]]</div>"<br />
result = result .. "<div class=\"fplinks\">"<br />
for i, killer in ipairs(killers) do<br />
<br />
fileName = resolveKillersPortraitFileNameById(killer.id)<br />
<br />
result = result .. "<div class=\"fplink plainlinks image\"><div class=\"box\"><div class=\"row\"><div class=\"cell\">"<br />
result = result .. "<div class=\"image\">[[File:" .. fileName .. ".png|link=" .. killer.name .. "]]</div>"<br />
result = result .. "<div class=\"link\">[[The " .. killer.name .. "]]</div></div></div></div></div>"<br />
end<br />
result = result .. "</div>"<br />
result = result .. "</div>"<br />
<br />
return result<br />
end<br />
<br />
function resolveKillersPortraitFileNameById(id)<br />
i = getKillerIndexById(id)<br />
local fileConst = "_charPreview_portrait"<br />
local fileName<br />
<br />
fileName = getFileNameFromTableById(id)<br />
if not isValidFileName(fileName) then --looking for new convention fileName<br />
fileName = resolveNewInitialsByIndex(i) .. fileConst<br />
end<br />
if not isValidFileName(fileName) then --looking for old convention fileName<br />
mw.log("File not found. Looking further...")<br />
fileName = getKillersInitialsByIndex(i) .. fileConst<br />
end<br />
if not isValidFileName(fileName) then --File not Found<br />
fileName = "UnknownKiller" .. fileConst<br />
end<br />
<br />
fileName = fileName<br />
mw.log(fileName)<br />
return fileName<br />
end<br />
<br />
function isValidFileName(name)<br />
return not (name == "" or not mw.title.new("File:" .. name .. ".png").exists)<br />
end<br />
<br />
function getFileNameFromTableById(id)<br />
mw.log(id)<br />
for j, sImage in ipairs(killerImages) do<br />
if sImage.id == id then<br />
return sImage.preview<br />
end<br />
end<br />
return ""<br />
end<br />
<br />
function resolveNewInitialsByIndex(i)<br />
if killers[i] == nil then<br />
return "" <br />
end<br />
local k = killers<br />
local initials = getKillersInitialsByIndex(i)<br />
local dlcCodeName =""<br />
if k[i].dlc ~= nil and dlcs[k[i].dlc] ~= nil then<br />
dlcCodeName = getDlcById(k[i].dlc).codeName<br />
end<br />
<br />
local dlcInitial = dlcCodeName:match("^(%S).*$") or "A" --A is for characters from original game as they don't have any DLC code Name nor DLC id<br />
<br />
mw.log(dlcInitial .. "K " .. initials)<br />
return dlcInitial .. "K " .. initials<br />
end<br />
<br />
function getKillersInitialsByIndex(i)<br />
if killers[i] == nil then<br />
return "" <br />
end<br />
<br />
local firstLetter, secondLetter<br />
<br />
firstLetter, secondLetter = killers[i].name:match("^(%S)(%S).*$") --could be merged but I keep it separated for case of need<br />
<br />
return string.upper(firstLetter .. secondLetter)<br />
end<br />
<br />
function getDlcById(id)<br />
for _, dlc in ipairs(dlcs) do<br />
if dlc.id == id then return dlc end<br />
end<br />
end<br />
<br />
return p</div>Uhspremium