diff options
author | mat <github@matdoes.dev> | 2022-03-27 17:59:12 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-03-27 17:59:12 -0500 |
commit | 8e17029d648d9f7aa285f8a35581cf28444caaa6 (patch) | |
tree | 3c617f5fb33906fd8e12563b8162f51295fb7b04 /src/database.ts | |
parent | a789330d340b55c0f4e00ea33045b32d84ee4d35 (diff) | |
download | skyblock-api-8e17029d648d9f7aa285f8a35581cf28444caaa6.tar.gz skyblock-api-8e17029d648d9f7aa285f8a35581cf28444caaa6.tar.bz2 skyblock-api-8e17029d648d9f7aa285f8a35581cf28444caaa6.zip |
Add harp leaderboards
Diffstat (limited to 'src/database.ts')
-rw-r--r-- | src/database.ts | 14 |
1 files changed, 14 insertions, 0 deletions
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, |