Add support for PvP Arena activity

This commit is contained in:
David Vorona
2022-07-15 14:11:02 -07:00
parent eebf76a34c
commit 2877b9c8a1
7 changed files with 16 additions and 2 deletions

View File

@@ -109,6 +109,7 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses
| Bounty Hunter (Rogue) | `rogueBH` |
| Bounty Hunter (Hunter) | `hunterBH` |
| Last Man Standing | `lastManStanding` |
| PvP Arena | `pvpArena` |
| Soul Wars Zeal | `soulWarsZeal` |
| Rifts Closed | `riftsClosed` |
@@ -193,6 +194,7 @@ Activities consist of all levels of clue scrolls as well as minigames and bosses
leaguePoints: {},
bountyHunter: {},
lastManStanding: {},
pvpArena: {},
soulWarsZeal: {},
riftsClosed: {},
bosses: {}

View File

@@ -87,6 +87,7 @@ test('Parse CSV to json', () => {
392,250
1,6143
4814,898
13,4057
37,225
25,1110
382,2780
@@ -171,6 +172,7 @@ test('Parse CSV to json', () => {
rogue: { rank: 89912, score: 37 }
},
lastManStanding: { rank: 4814, score: 898 },
pvpArena: { rank: 13, score: 4057 },
soulWarsZeal: { rank: 37, score: 225 },
riftsClosed: { rank: 25, score: 1110 },
clues: {

View File

@@ -75,6 +75,10 @@
.lmsrank:before {
content: url('https://www.runescape.com/img/rsp777/game_icon_lmsrank.png?2');
}
.pvparenarank:before {
content: url('https://www.runescape.com/img/rsp777/game_icon_pvparenarank.png?2');
}
.soulwarszeal:before {
content: url('https://www.runescape.com/img/rsp777/game_icon_soulwarszeal.png?2');

View File

@@ -82,4 +82,5 @@
-1,-1
-1,-1
-1,-1
-1,-1
-1,-1
Can't render this file because it has a wrong number of fields in line 25.

View File

@@ -75,7 +75,7 @@ export function parseStats(csv: string): Stats {
.filter((entry) => !!entry)
.map((stat) => stat.split(','));
if (splitCSV.length !== SKILLS.length + BH_MODES.length + CLUES.length + BOSSES.length + 4) {
if (splitCSV.length !== SKILLS.length + BH_MODES.length + CLUES.length + BOSSES.length + 5) {
throw Error(INVALID_FORMAT_ERROR);
}
@@ -105,7 +105,7 @@ export function parseStats(csv: string): Stats {
const [leaguePoints] = activityObjects.splice(0, 1);
const bhObjects = activityObjects.splice(0, BH_MODES.length);
const clueObjects = activityObjects.splice(0, CLUES.length);
const [lastManStanding, soulWarsZeal, riftsClosed] = activityObjects.splice(0, 3);
const [lastManStanding, pvpArena, soulWarsZeal, riftsClosed] = activityObjects.splice(0, 4);
const bossObjects = activityObjects.splice(0, BOSSES.length);
const skills: Skills = skillObjects.reduce<Skills>((prev, curr, index) => {
@@ -137,6 +137,7 @@ export function parseStats(csv: string): Stats {
leaguePoints,
bountyHunter,
lastManStanding,
pvpArena,
soulWarsZeal,
riftsClosed,
clues,

View File

@@ -118,6 +118,7 @@ export type ActivityName =
| 'hunterBH'
| 'rogueBH'
| 'lastManStanding'
| 'pvpArena'
| 'soulWarsZeal'
| 'riftsClosed'
| 'allClues'
@@ -135,6 +136,7 @@ export interface Stats {
leaguePoints: Activity;
bountyHunter: BH;
lastManStanding: Activity;
pvpArena: Activity;
soulWarsZeal: Activity;
riftsClosed: Activity;
bosses: Bosses;

View File

@@ -131,6 +131,7 @@ export const ACTIVITIES: ActivityName[] = [
'eliteClues',
'masterClues',
'lastManStanding',
'pvpArena',
'soulWarsZeal',
'riftsClosed',
...BOSSES
@@ -246,6 +247,7 @@ export const FORMATTED_BH_NAMES: FormattedBHNames = {
};
export const FORMATTED_LMS = 'Last Man Standing';
export const FORMATTED_PVP_ARENA = 'PvP Arena';
export const FORMATTED_SOUL_WARS = 'Soul Wars Zeal';
export const FORMATTED_LEAGUE_POINTS = 'League Points';
export const FORMATTED_RIFTS_CLOSED = 'Rifts Closed';