diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cleaners/skyblock/stats.ts | 1 | ||||
-rw-r--r-- | src/database.ts | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/cleaners/skyblock/stats.ts b/src/cleaners/skyblock/stats.ts index 645f879..44ca1c4 100644 --- a/src/cleaners/skyblock/stats.ts +++ b/src/cleaners/skyblock/stats.ts @@ -12,6 +12,7 @@ const statCategories: { [key: string]: string[] | null } = { // sorted in order 'collection': ['collection_'], 'skills': ['skill_'], 'slayer': ['slayer_'], + 'harp': ['harp_'], 'misc': null // everything else goes here } diff --git a/src/database.ts b/src/database.ts index a822112..887facb 100644 --- a/src/database.ts +++ b/src/database.ts @@ -172,6 +172,17 @@ function getMemberSlayerAttributes(member: CleanMember): StringNumber { return slayerAttributes } +function getMemberHarpAttributes(member: CleanMember): StringNumber { + const harpAttributes: StringNumber = {} + + for (const song of member.harp.songs) { + harpAttributes[`harp_${song.completions}_completions`] = song.completions + harpAttributes[`harp_${song.perfectCompletions}_perfect_completions`] = song.perfectCompletions + } + + return harpAttributes +} + function getMemberLeaderboardAttributes(member: CleanMember): StringNumber { // if you want to add a new leaderboard for member attributes, add it here (and getAllLeaderboardAttributes) return { @@ -187,6 +198,9 @@ function getMemberLeaderboardAttributes(member: CleanMember): StringNumber { // slayer leaderboards ...getMemberSlayerAttributes(member), + // harp leaderboards + ...getMemberHarpAttributes(member), + fairy_souls: member.fairySouls.total, first_join: member.firstJoin, purse: member.purse, |