diff --git a/lua/wikis/pubg/NotabilityChecker/config.lua b/lua/wikis/pubg/NotabilityChecker/config.lua new file mode 100644 index 00000000000..c01fa834d1f --- /dev/null +++ b/lua/wikis/pubg/NotabilityChecker/config.lua @@ -0,0 +1,264 @@ +--- +-- @Liquipedia +-- page=Module:NotabilityChecker/config +-- +-- Please see https://github.com/Liquipedia/Lua-Modules to contribute +-- + +---@class PubgNotabilityCheckerConfig: NotabilityCheckerConfig +local Config = {} + +Config.TIER_TYPE_GENERAL = 'general' +Config.TIER_TYPE_QUALIFIER = 'qualifier' +Config.TIER_TYPE_WEEKLY = 'weekly' +Config.TIER_TYPE_MONTHLY = 'monthly' +Config.TIER_TYPE_SHOW_MATCH = 'showmatch' +Config.TIER_TYPE_MISC = 'misc' +Config.MAX_NUMBER_OF_COACHES = 6 + +-- How many placements should we retrieve from LPDB for a team/player? +Config.PLACEMENT_LIMIT = 2000 + +-- These are the notability thresholds needed by a team/player +Config.NOTABILITY_THRESHOLD_MIN = 15 +Config.NOTABILITY_THRESHOLD_NOTABLE = 15 + +-- Weights used for tournaments +Config.weights = { + { + tier = 1, + options = { + dateLossIgnored = true, + }, + tiertype = { + { + name = Config.TIER_TYPE_GENERAL, + points = 10, + }, + { + name = Config.TIER_TYPE_MONTHLY, + points = 0, + }, + { + name = Config.TIER_TYPE_WEEKLY, + points = 0, + }, + { + name = Config.TIER_TYPE_QUALIFIER, + points = 0, + }, + { + name = Config.TIER_TYPE_SHOW_MATCH, + points = 0, + }, + { + name = Config.TIER_TYPE_MISC, + points = 0, + }, + }, + }, + { + tier = 2, + options = { + dateLossIgnored = true, + }, + tiertype = { + { + name = Config.TIER_TYPE_GENERAL, + points = 7, + }, + { + name = Config.TIER_TYPE_MONTHLY, + points = 0, + }, + { + name = Config.TIER_TYPE_WEEKLY, + points = 0, + }, + { + name = Config.TIER_TYPE_QUALIFIER, + points = 0, + }, + { + name = Config.TIER_TYPE_SHOW_MATCH, + points = 0, + }, + { + name = Config.TIER_TYPE_MISC, + points = 0, + }, + }, + }, + { + tier = 3, + options = { + dateLossIgnored = true, + }, + tiertype = { + { + name = Config.TIER_TYPE_GENERAL, + points = 3, + }, + { + name = Config.TIER_TYPE_MONTHLY, + points = 0, + }, + { + name = Config.TIER_TYPE_WEEKLY, + points = 0, + }, + { + name = Config.TIER_TYPE_QUALIFIER, + points = 0, + }, + { + name = Config.TIER_TYPE_SHOW_MATCH, + points = 0, + }, + { + name = Config.TIER_TYPE_MISC, + points = 0, + }, + }, + }, + { + tier = 4, + options = { + dateLossIgnored = true, + }, + tiertype = { + { + name = Config.TIER_TYPE_GENERAL, + points = 2, + }, + { + name = Config.TIER_TYPE_MONTHLY, + points = 0, + }, + { + name = Config.TIER_TYPE_WEEKLY, + points = 0, + }, + { + name = Config.TIER_TYPE_QUALIFIER, + points = 0, + }, + { + name = Config.TIER_TYPE_SHOW_MATCH, + points = 0, + }, + { + name = Config.TIER_TYPE_MISC, + points = 0, + }, + }, + }, + { + tier = 5, + options = { + dateLossIgnored = true, + }, + tiertype = { + { + name = Config.TIER_TYPE_GENERAL, + points = 1, + }, + { + name = Config.TIER_TYPE_MONTHLY, + points = 0, + }, + { + name = Config.TIER_TYPE_WEEKLY, + points = 0, + }, + { + name = Config.TIER_TYPE_QUALIFIER, + points = 0, + }, + { + name = Config.TIER_TYPE_SHOW_MATCH, + points = 0, + }, + { + name = Config.TIER_TYPE_MISC, + points = 0, + }, + }, + }, +} + +--- This function adjusts the score for the placement, e.g. +--- a first placement should score more than a 10th placement. +---@param tier string|integer +---@param tierType string +---@return NotabilityCheckerDropOffFunction +function Config.placementDropOffFunction(tier, tierType) + return function(score, placement) + if (tierType == Config.TIER_TYPE_QUALIFIER + or tierType == Config.TIER_TYPE_MISC + or tierType == Config.TIER_TYPE_WEEKLY + or tierType == Config.TIER_TYPE_MONTHLY + or tierType == Config.TIER_TYPE_SHOW_MATCH) then + return score + else + if (tier == 1 and placement <= 3) then + return score + + elseif (tier == 1 and placement <= 8) then + return (score - 5) + + elseif (tier == 1 and placement <= 12) then + return (score - 7) + + elseif (tier == 1) then + return (score - 9) + + elseif (tier == 2 and placement <= 3) then + return (score) + + elseif (tier == 2 and placement <= 4) then + return (score - 4) + + elseif (tier == 2 and placement <= 8) then + return (score - 5) + + elseif (tier == 2) then + return (score - 7) + + elseif (tier == 3 and placement <= 3) then + return (score) + + elseif (tier == 3 and placement <= 4) then + return (score - 1) + + elseif (tier == 3) then + return (score - 3) + + elseif (tier == 4 and placement == 1) then + return (score) + + elseif (tier == 4 and placement <= 2) then + return (score - 1) + + elseif (tier == 4) then + return (score - 2) + + elseif (tier == 5 and placement == 1) then + return (score) + + elseif (tier == 5) then + return (score - 1) + end + end + + return 0 + end +end + +-- Adjusts the score to compensate for the mode, you might +-- want to decrease the points given for a certain mode +function Config.adjustScoreForMode(score, mode) + return score +end + +return Config