Rename properties for clarity, add formatted names

This commit is contained in:
maxswa
2020-01-05 17:47:13 -05:00
parent ae73fef5ed
commit f1730d44ec
9 changed files with 426 additions and 511 deletions

View File

@@ -1,16 +1,28 @@
import { SkillName, ClueType, BHType, Gamemode, Boss } from '../types';
import {
BHType,
Boss,
ClueType,
Gamemode,
SkillName,
ActivityName,
} from '../types';
export const BASE_URL = 'http://services.runescape.com/m=hiscore_oldschool';
export const STATS_URL = 'index_lite.ws?player=';
export const SCORES_URL = 'overall.ws?';
export const GAMEMODE_URL = {
dmm: '_deadman/',
dmmt: '_tournament/',
hc: '_hardcore_ironman/',
iron: '_ironman/',
main: '/',
leagues: '_seasonal/',
ult: '_ultimate/',
export type GamemodeUrl = {
[key in Gamemode]: string;
};
export const GAMEMODE_URL: GamemodeUrl = {
main: `${BASE_URL}/`,
ironman: `${BASE_URL}_ironman`,
hardcore: `${BASE_URL}_hardcore_ironman`,
ultimate: `${BASE_URL}_ultimate`,
deadman: `${BASE_URL}_deadman`,
seasonal: `${BASE_URL}_seasonal`,
tournament: `${BASE_URL}_tournament`,
};
export const SKILLS: SkillName[] = [
'overall',
@@ -48,65 +60,65 @@ export const CLUES: ClueType[] = [
'master',
];
export const BH_MODES: BHType[] = ['rogue', 'hunter'];
export const ACTIVITIES = [
'hunterbh',
'roguebh',
'lms',
'allclues',
'beginnerclues',
'easyclues',
'mediumclues',
'hardclues',
'eliteclues',
'masterclues',
export const ACTIVITIES: ActivityName[] = [
'hunterBH',
'rogueBH',
'lastManStanding',
'allClues',
'beginnerClues',
'easyClues',
'mediumClues',
'hardClues',
'eliteClues',
'masterClues',
];
export const GAMEMODES: Gamemode[] = [
'main',
'iron',
'hc',
'ult',
'dmm',
'dmmt',
'leagues',
'ironman',
'hardcore',
'ultimate',
'deadman',
'seasonal',
'tournament',
];
export const BOSSES: Boss[] = [
'abyssalsire',
'alchemicalhydra',
'barrowschests',
'abyssalSire',
'alchemicalHydra',
'barrows',
'bryophyta',
'chambersofxeric',
'chambersofxericchallengemode',
'callisto',
'cerberus',
'chaoselemental',
'chaosfanatic',
'commanderzilyana',
'corporealbeast',
'crazyarchaeologist',
'dagannothprime',
'dagannothrex',
'dagannothsupreme',
'derangedarchaeologist',
'generalgraardor',
'giantmole',
'grotesqueguardians',
'chambersOfXeric',
'chambersOfXericChallengeMode',
'chaosElemental',
'chaosFanatic',
'commanderZilyana',
'corporealBeast',
'crazyArchaeologist',
'dagannothPrime',
'dagannothRex',
'dagannothSupreme',
'derangedArchaeologist',
'generalGraardor',
'giantMole',
'grotesqueGuardians',
'hespori',
'kalphitequeen',
'kingblackdragon',
'kalphiteQueen',
'kingBlackDragon',
'kraken',
'kreearra',
'kriltsutsaroth',
'kreeArra',
'krilTsutsaroth',
'mimic',
'obor',
'sarachnis',
'scorpia',
'skotizo',
'gauntlet',
'corruptedgauntlet',
'theatreofblood',
'thermonuclearsmokedevil',
'tzkalzuk',
'tztokjad',
'corruptedGauntlet',
'theatreOfBlood',
'thermonuclearSmokeDevil',
'tzKalZuk',
'tzTokJad',
'venenatis',
'vetion',
'vorkath',
@@ -114,3 +126,110 @@ export const BOSSES: Boss[] = [
'zalcano',
'zulrah',
];
export type FormattedBossNames = {
[key in Boss]: string;
};
export const FORMATTED_BOSS_NAMES: FormattedBossNames = {
abyssalSire: 'Abyssal Sire',
alchemicalHydra: 'Alchemical Hydra',
barrows: 'Barrows Chests',
bryophyta: 'Bryophyta',
callisto: 'Callisto',
cerberus: 'Cerberus',
chambersOfXeric: 'Chambers of Xeric',
chambersOfXericChallengeMode: 'Chambers of Xeric: Challenge Mode',
chaosElemental: 'Chaos Elemental',
chaosFanatic: 'Chaos Fanatic',
commanderZilyana: 'Commander Zilyana',
corporealBeast: 'Corporeal Beast',
crazyArchaeologist: 'Crazy Archaeologist',
dagannothPrime: 'Dagannoth Prime',
dagannothRex: 'Dagannoth Rex',
dagannothSupreme: 'Dagannoth Supreme',
derangedArchaeologist: 'Deranged Archaeologist',
generalGraardor: 'General Graardor',
giantMole: 'Giant Mole',
grotesqueGuardians: 'Grotesque Guardians',
hespori: 'Hespori',
kalphiteQueen: 'Kalphite Queen',
kingBlackDragon: 'King Black Dragon',
kraken: 'Kraken',
kreeArra: "Kree'Arra",
krilTsutsaroth: "K'ril Tsutsaroth",
mimic: 'Mimic',
obor: 'Obor',
sarachnis: 'Sarachnis',
scorpia: 'Scorpia',
skotizo: 'Skotizo',
gauntlet: 'The Gauntlet',
corruptedGauntlet: 'The Corrupted Gauntlet',
theatreOfBlood: 'Theatre of Blood',
thermonuclearSmokeDevil: 'Thermonuclear Smoke Devil',
tzKalZuk: 'TzKal-Zuk',
tzTokJad: 'TzTok-Jad',
venenatis: 'Venenatis',
vetion: "Vet'ion",
vorkath: 'Vorkath',
wintertodt: 'Wintertodt',
zalcano: 'Zalcano',
zulrah: 'Zulrah',
};
export type FormattedSkillNames = {
[key in SkillName]: string;
};
export const FORMATTED_SKILL_NAMES: FormattedSkillNames = {
overall: 'Overall',
attack: 'Attack',
defence: 'Defence',
strength: 'Strength',
hitpoints: 'Hitpoints',
ranged: 'Ranged',
prayer: 'Prayer',
magic: 'Magic',
cooking: 'Cooking',
woodcutting: 'Woodcutting',
fletching: 'Fletching',
fishing: 'Fishing',
firemaking: 'Firemaking',
crafting: 'Crafting',
smithing: 'Smithing',
mining: 'Mining',
herblore: 'Herblore',
agility: 'Agility',
thieving: 'Thieving',
slayer: 'Slayer',
farming: 'Farming',
runecraft: 'Runecraft',
hunter: 'Hunter',
construction: 'Construction',
};
export type FormattedClueNames = {
[key in ClueType]: string;
};
export const FORMATTED_CLUE_NAMES: FormattedClueNames = {
all: 'Clue Scrolls (all)',
beginner: 'Clue Scrolls (beginner)',
easy: 'Clue Scrolls (easy)',
medium: 'Clue Scrolls (medium)',
hard: 'Clue Scrolls (hard)',
elite: 'Clue Scrolls (elite)',
master: 'Clue Scrolls (master)',
};
export type FormattedBHNames = {
[key in BHType]: string;
};
export const FORMATTED_BH_NAMES: FormattedBHNames = {
rogue: 'Bounty Hunter - Rogue',
hunter: 'Bounty Hunter - Hunter',
};
export const FORMATTED_LMS = 'Last Man Standing';
export const FORMATTED_LEAGUE_POINTS = 'League Points';