gw2e-account-statistics 3.15.1 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/gameData/arenanetEmployeeAchievements.js +15 -0
- package/build/gameData/suffusedObsidianArmors.js +15 -0
- package/build/static/walletIdMapping.js +2 -1
- package/build/statistics/items.js +2 -0
- package/build/statistics/progression.js +39 -1
- package/build/statistics/unlocks.js +17 -1
- package/package.json +3 -3
- package/tests/items.spec.js +2 -0
- package/tests/progression.spec.js +33 -0
- package/tests/unlocks.spec.js +7 -0
- package/tests/wallet.spec.js +4 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _arenanetEmployee = require('@gw2efficiency/game-data/achievements/categories/arenanet-employee');
|
|
6
|
+
|
|
7
|
+
var _arenanetEmployee2 = _interopRequireDefault(_arenanetEmployee);
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
|
|
11
|
+
var arenanetEmployeeAchievementIds = _arenanetEmployee2.default.map(function (x) {
|
|
12
|
+
return x.id;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
exports.default = arenanetEmployeeAchievementIds;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _suffusedObsidianArmors = require('@gw2efficiency/game-data/skins/categories/suffused-obsidian-armors');
|
|
6
|
+
|
|
7
|
+
var _suffusedObsidianArmors2 = _interopRequireDefault(_suffusedObsidianArmors);
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
|
|
11
|
+
var suffusedObsidianArmorSkinIds = _suffusedObsidianArmors2.default.map(function (x) {
|
|
12
|
+
return x.id;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
exports.default = suffusedObsidianArmorSkinIds;
|
|
@@ -113,6 +113,8 @@ exports.default = function (accountData) {
|
|
|
113
113
|
amnytasHerosChoice: countItems(items, 100193),
|
|
114
114
|
innerNayosEndHerosChoice: countItems(items, 101195),
|
|
115
115
|
convergenceHerosChoice: countItems(items, 101185),
|
|
116
|
+
citadelOfZakirosHerosChoice: countItems(items, 101748),
|
|
117
|
+
janthirSyntriHerosChoice: countItems(items, 102265),
|
|
116
118
|
giftsOfExploration: countItems(items, 19677),
|
|
117
119
|
giftsOfBattle: countItems(items, 19678),
|
|
118
120
|
tomesOfKnowledge: countItems(items, [43741, 43766]),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
|
|
@@ -31,11 +31,19 @@ exports.default = function (accountData) {
|
|
|
31
31
|
wvwDefendedCastles: achievementCurrent(accountData, 313),
|
|
32
32
|
pvpKilledPlayers: achievementCurrent(accountData, 239),
|
|
33
33
|
pvpKilledPlayersRanked: achievementCurrent(accountData, 240),
|
|
34
|
+
arenanetEmployeeAchievements: arenanetEmployeeAchievements(accountData),
|
|
35
|
+
convergenceCompletions: convergenceCompletions(accountData),
|
|
34
36
|
homeCats: homeCats(accountData),
|
|
35
37
|
homeNodes: homeNodes(accountData)
|
|
36
38
|
};
|
|
37
39
|
};
|
|
38
40
|
|
|
41
|
+
var _arenanetEmployeeAchievements = require('../gameData/arenanetEmployeeAchievements');
|
|
42
|
+
|
|
43
|
+
var _arenanetEmployeeAchievements2 = _interopRequireDefault(_arenanetEmployeeAchievements);
|
|
44
|
+
|
|
45
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
46
|
+
|
|
39
47
|
// How many achievements the user did
|
|
40
48
|
function achievementCount(accountData) {
|
|
41
49
|
if (!accountData.achievements) {
|
|
@@ -97,6 +105,36 @@ function winterWonderlandCompletions(accountData) {
|
|
|
97
105
|
return sum;
|
|
98
106
|
}
|
|
99
107
|
|
|
108
|
+
function arenanetEmployeeAchievements(accountData) {
|
|
109
|
+
if (!accountData.achievements) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
var sum = 0;
|
|
114
|
+
_arenanetEmployeeAchievements2.default.forEach(function (achievementId) {
|
|
115
|
+
sum += achievementCurrent(accountData, achievementId);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
return sum;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function convergenceCompletions(accountData) {
|
|
122
|
+
if (!accountData.achievements) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
var achievements = [{ id: 7668, perRepeat: 100 }, // Convergence Conquerer
|
|
127
|
+
{ id: 7720, perRepeat: 150 // Continuous Convergence Conqueror
|
|
128
|
+
}];
|
|
129
|
+
|
|
130
|
+
var sum = 0;
|
|
131
|
+
achievements.forEach(function (achievement) {
|
|
132
|
+
sum += achievementCurrent(accountData, achievement.id, achievement.perRepeat);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
return sum;
|
|
136
|
+
}
|
|
137
|
+
|
|
100
138
|
// The unlocked home instance cats
|
|
101
139
|
function homeCats(accountData) {
|
|
102
140
|
if (!accountData.home) {
|
|
@@ -35,7 +35,8 @@ exports.default = function (accountData, extraInformation) {
|
|
|
35
35
|
_fractalRelicsFromTitles: fractalRelicsFromTitles(accountData),
|
|
36
36
|
_pristineFractalRelicsFromTitles: pristineFractalRelicsFromTitles(accountData),
|
|
37
37
|
_unstableFractalEssenceFromUnlocks: unstableFractalEssenceFromUnlocks(accountData),
|
|
38
|
-
aureneLegendaryVariantSkins: aureneLegendaryVariantSkins(accountData)
|
|
38
|
+
aureneLegendaryVariantSkins: aureneLegendaryVariantSkins(accountData),
|
|
39
|
+
suffusedObsidianArmorSkins: suffusedObsidianArmorSkins(accountData)
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
42
|
|
|
@@ -59,6 +60,10 @@ var _aureneLegendaryVariants = require('../gameData/aureneLegendaryVariants');
|
|
|
59
60
|
|
|
60
61
|
var _aureneLegendaryVariants2 = _interopRequireDefault(_aureneLegendaryVariants);
|
|
61
62
|
|
|
63
|
+
var _suffusedObsidianArmors = require('../gameData/suffusedObsidianArmors');
|
|
64
|
+
|
|
65
|
+
var _suffusedObsidianArmors2 = _interopRequireDefault(_suffusedObsidianArmors);
|
|
66
|
+
|
|
62
67
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
63
68
|
|
|
64
69
|
// The unlocked dyes on the account
|
|
@@ -278,6 +283,17 @@ function aureneLegendaryVariantSkins(accountData) {
|
|
|
278
283
|
}).length;
|
|
279
284
|
}
|
|
280
285
|
|
|
286
|
+
// The suffused obsidian armor skins unlocked on the account ignoring slumbering versions
|
|
287
|
+
function suffusedObsidianArmorSkins(accountData) {
|
|
288
|
+
if (!accountData.skins) {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return accountData.skins.filter(function (x) {
|
|
293
|
+
return _suffusedObsidianArmors2.default.indexOf(x) !== -1;
|
|
294
|
+
}).length;
|
|
295
|
+
}
|
|
296
|
+
|
|
281
297
|
// Check if a skin exists on the account
|
|
282
298
|
function skinExists(accountData, id) {
|
|
283
299
|
if (!accountData.skins) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gw2e-account-statistics",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0",
|
|
4
4
|
"description": "Calculate statistics of guildwars2 accounts",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"mockdate": "^2.0.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@gw2efficiency/game-data": "^0.1.
|
|
22
|
+
"@gw2efficiency/game-data": "^0.1.50",
|
|
23
23
|
"array-unique": "^0.3.2",
|
|
24
24
|
"gw2e-account-value": "^3.13.1",
|
|
25
|
-
"gw2e-static-data": "^0.5.
|
|
25
|
+
"gw2e-static-data": "^0.5.32",
|
|
26
26
|
"round-to": "^3.0.0",
|
|
27
27
|
"sum-by": "^1.0.0"
|
|
28
28
|
}
|
package/tests/items.spec.js
CHANGED
|
@@ -68,6 +68,8 @@ describe('statistics > items', () => {
|
|
|
68
68
|
amnytasHerosChoice: null,
|
|
69
69
|
innerNayosEndHerosChoice: null,
|
|
70
70
|
convergenceHerosChoice: null,
|
|
71
|
+
citadelOfZakirosHerosChoice: null,
|
|
72
|
+
janthirSyntriHerosChoice: null,
|
|
71
73
|
uniqueTonics: null,
|
|
72
74
|
bloodRubies: null,
|
|
73
75
|
petrifiedWood: null,
|
|
@@ -283,4 +283,37 @@ describe('statistics > progression', () => {
|
|
|
283
283
|
expect(progressionStatistics({home: {}}).homeNodes).to.equal(null)
|
|
284
284
|
expect(progressionStatistics({home: {nodes}}).homeNodes).to.equal(8)
|
|
285
285
|
})
|
|
286
|
+
|
|
287
|
+
it('can calculate the completed arenanet employee achievements', () => {
|
|
288
|
+
expect(progressionStatistics({}).arenanetEmployeeAchievements).to.equal(null)
|
|
289
|
+
expect(progressionStatistics({achievements: []}).arenanetEmployeeAchievements).to.equal(0)
|
|
290
|
+
expect(progressionStatistics({
|
|
291
|
+
achievements: [
|
|
292
|
+
{ id: 2037, current: 40, max: 40, done: true },
|
|
293
|
+
{ id: 2150, current: 1, max: 1, done: true },
|
|
294
|
+
{ id: 3067, current: 1, max: 1, done: true },
|
|
295
|
+
{ id: 4501, current: 1, max: 1, done: true },
|
|
296
|
+
{ id: 4537, current: 1, max: 1, done: true },
|
|
297
|
+
{ id: 5457, current: 1, max: 1, done: true },
|
|
298
|
+
{ id: 7779, current: 0, max: 1, done: false },
|
|
299
|
+
{ id: 7853, current: 1, max: 1, done: true }
|
|
300
|
+
]
|
|
301
|
+
}).arenanetEmployeeAchievements).to.equal(4)
|
|
302
|
+
})
|
|
303
|
+
|
|
304
|
+
it('can calculate the completed convergence completions', () => {
|
|
305
|
+
expect(progressionStatistics({}).convergenceCompletions).to.equal(null)
|
|
306
|
+
expect(progressionStatistics({achievements: []}).convergenceCompletions).to.equal(0)
|
|
307
|
+
expect(progressionStatistics({
|
|
308
|
+
achievements: [
|
|
309
|
+
{ id: 7668, current: 15, max: 100, done: false }
|
|
310
|
+
]
|
|
311
|
+
}).convergenceCompletions).to.equal(15)
|
|
312
|
+
expect(progressionStatistics({
|
|
313
|
+
achievements: [
|
|
314
|
+
{ id: 7668, current: 100, max: 100, done: true },
|
|
315
|
+
{ id: 7720, current: 18, max: 150, done: false, repeated: 1 }
|
|
316
|
+
]
|
|
317
|
+
}).convergenceCompletions).to.equal(100 + 150 + 18)
|
|
318
|
+
})
|
|
286
319
|
})
|
package/tests/unlocks.spec.js
CHANGED
|
@@ -255,4 +255,11 @@ describe('statistics > unlocks', () => {
|
|
|
255
255
|
expect(unlocksStatistics({ skins: [1, 2, 7, 9, 10] }, EXTRA_INFO).aureneLegendaryVariantSkins).to.equal(0)
|
|
256
256
|
expect(unlocksStatistics({ skins: [1, 2, 10515, 10739] }, EXTRA_INFO).aureneLegendaryVariantSkins).to.equal(2)
|
|
257
257
|
})
|
|
258
|
+
|
|
259
|
+
it('can calculate suffused obsidian armor skin count', () => {
|
|
260
|
+
expect(unlocksStatistics({}, EXTRA_INFO).suffusedObsidianArmorSkins).to.equal(null)
|
|
261
|
+
expect(unlocksStatistics({ skins: [] }, EXTRA_INFO).suffusedObsidianArmorSkins).to.equal(0)
|
|
262
|
+
expect(unlocksStatistics({ skins: [1, 2, 7, 9, 10] }, EXTRA_INFO).suffusedObsidianArmorSkins).to.equal(0)
|
|
263
|
+
expect(unlocksStatistics({ skins: [1, 2, 12171, 12136] }, EXTRA_INFO).suffusedObsidianArmorSkins).to.equal(2)
|
|
264
|
+
})
|
|
258
265
|
})
|
package/tests/wallet.spec.js
CHANGED
|
@@ -74,7 +74,8 @@ describe('statistics > wallet', () => {
|
|
|
74
74
|
calcifiedGasp: null,
|
|
75
75
|
jadeMinersKeycard: null,
|
|
76
76
|
pinchOfStardust: null,
|
|
77
|
-
staticCharge: null
|
|
77
|
+
staticCharge: null,
|
|
78
|
+
ursusOblige: null
|
|
78
79
|
})
|
|
79
80
|
})
|
|
80
81
|
|
|
@@ -194,7 +195,8 @@ describe('statistics > wallet', () => {
|
|
|
194
195
|
calcifiedGasp: 0,
|
|
195
196
|
jadeMinersKeycard: 0,
|
|
196
197
|
pinchOfStardust: 0,
|
|
197
|
-
staticCharge: 0
|
|
198
|
+
staticCharge: 0,
|
|
199
|
+
ursusOblige: 0
|
|
198
200
|
})
|
|
199
201
|
})
|
|
200
202
|
|