diff options
author | mat <github@matdoes.dev> | 2022-03-31 21:58:54 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-03-31 21:58:54 -0500 |
commit | 4b706d309e30d92b7b143d1879d9298fdba53141 (patch) | |
tree | 12794ef1791dad68ddbe5c468011181cc1967a0b /src/cleaners/skyblock | |
parent | c3f939df6f95fa92862628102f6278f3de72e3ba (diff) | |
download | skyblock-api-4b706d309e30d92b7b143d1879d9298fdba53141.tar.gz skyblock-api-4b706d309e30d92b7b143d1879d9298fdba53141.tar.bz2 skyblock-api-4b706d309e30d92b7b143d1879d9298fdba53141.zip |
don't show slayer tier 5 for nonexistent bosses
Diffstat (limited to 'src/cleaners/skyblock')
-rw-r--r-- | src/cleaners/skyblock/slayers.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cleaners/skyblock/slayers.ts b/src/cleaners/skyblock/slayers.ts index 782ec95..b5dda0b 100644 --- a/src/cleaners/skyblock/slayers.ts +++ b/src/cleaners/skyblock/slayers.ts @@ -1,6 +1,5 @@ import typedHypixelApi from 'typed-hypixel-api' -export const slayerLevels = 5 const SLAYER_NAMES = { spider: 'tarantula', @@ -9,6 +8,14 @@ const SLAYER_NAMES = { enderman: 'voidgloom_seraph' } as const +// todo: put this in skyblock-constants since it can be determined from other people's profiles +export const SLAYER_TIERS: Record<keyof typeof SLAYER_NAMES, number> = { + spider: 4, + zombie: 5, + enderman: 4, + wolf: 4 +} + type SlayerName = (typeof SLAYER_NAMES)[keyof typeof SLAYER_NAMES] interface SlayerTier { @@ -75,7 +82,7 @@ export function cleanSlayers(data: typedHypixelApi.SkyBlockProfileMember): Slaye } // if the slayer tier length is less than the max, add more empty ones - while (slayerTiers.length < slayerLevels) + while (slayerTiers.length < SLAYER_TIERS[slayerName]) slayerTiers.push({ tier: slayerTiers.length + 1, kills: 0 |