Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/ranks/bubblegum.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ranks/chocolate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ranks/milk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ranks/mint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ranks/strawberry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 37 additions & 1 deletion src/shared/ranks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ export const RANK_IMAGES = {
pyrite: '/ranks/pyrite.png',
jade: '/ranks/jade.png',
crystal: '/ranks/crystal.png',
milk: '/ranks/milk.png',
strawberry: '/ranks/strawberry.png',
chocolate: '/ranks/chocolate.png',
mint: '/ranks/mint.png',
bubblegum: '/ranks/bubblegum.png',
}

export const EDITION_THRESHOLD = {
FOIL: 50,
HOLOGRAPHIC: 10,
POLYCHROME: 3,
NEGATIVE: 1,
ANTIMATTER: 1,
}

export const ENHANCEMENT_THRESHOLD = {
Expand All @@ -37,11 +43,41 @@ export const SMALLWORLD_THRESHOLD = {
CRYSTAL: 550,
}

export const LEGACY_THRESHOLD = {
MILK: 0,
STRAWBERRY: 225,
CHOCOLATE: 325,
MINT: 425,
BUBBLEGUM: 550,
}

export const getRankData = (mmr: number, queueType?: string) => {
if (queueType === 'vanilla' || queueType === 'legacy') {
if (queueType === 'vanilla') {
return null
}

if (queueType === 'legacy') {
let enhancement = RANK_IMAGES.milk
let tooltip = 'Milk'
if (mmr >= LEGACY_THRESHOLD.STRAWBERRY) {
enhancement = RANK_IMAGES.strawberry
tooltip = 'Strawberry'
}
if (mmr >= LEGACY_THRESHOLD.CHOCOLATE) {
enhancement = RANK_IMAGES.chocolate
tooltip = 'Chocolate'
}
if (mmr >= LEGACY_THRESHOLD.MINT) {
enhancement = RANK_IMAGES.mint
tooltip = 'Mint'
}
if (mmr >= LEGACY_THRESHOLD.BUBBLEGUM) {
enhancement = RANK_IMAGES.bubblegum
tooltip = 'Bubblegum'
}
return { enhancement, tooltip }
}

if (queueType === 'smallworld') {
let enhancement = RANK_IMAGES.pebble
let tooltip = 'Pebble'
Expand Down