gw2e-account-statistics 3.15.2 → 3.16.1
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/static/walletIdMapping.js +2 -1
- package/build/statistics/items.js +19 -4
- package/build/statistics/progression.js +39 -1
- package/package.json +2 -2
- package/tests/index.spec.js +4 -1
- package/tests/items.spec.js +83 -65
- package/tests/progression.spec.js +33 -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;
|
|
@@ -4,14 +4,27 @@ exports.__esModule = true;
|
|
|
4
4
|
|
|
5
5
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
6
6
|
|
|
7
|
-
exports.default = function (accountData) {
|
|
7
|
+
exports.default = function (accountData, extraInformation) {
|
|
8
8
|
var items = allItems(accountData);
|
|
9
|
+
var noveltyIdMap = extraInformation.novelties.idMap;
|
|
10
|
+
var accountNoveltyIds = accountData.novelties || [];
|
|
11
|
+
Object.entries(noveltyIdMap).forEach(function (_ref) {
|
|
12
|
+
var noveltyId = _ref[0],
|
|
13
|
+
unlockItemId = _ref[1];
|
|
14
|
+
|
|
15
|
+
if (accountNoveltyIds.includes(Number(noveltyId))) {
|
|
16
|
+
var existingItem = items.find(function (item) {
|
|
17
|
+
return item.id === unlockItemId[0];
|
|
18
|
+
});
|
|
19
|
+
existingItem ? existingItem.count++ : items.push({ id: unlockItemId[0], count: 1 });
|
|
20
|
+
}
|
|
21
|
+
});
|
|
9
22
|
|
|
10
23
|
var auraItems = Object.entries(_cosmeticAuras2.default).map(function (entry) {
|
|
11
24
|
return [entry[0], countItems(items, entry[1])];
|
|
12
|
-
}).reduce(function (object,
|
|
13
|
-
var key =
|
|
14
|
-
value =
|
|
25
|
+
}).reduce(function (object, _ref2) {
|
|
26
|
+
var key = _ref2[0],
|
|
27
|
+
value = _ref2[1];
|
|
15
28
|
|
|
16
29
|
object[key] = value;
|
|
17
30
|
return object;
|
|
@@ -113,6 +126,8 @@ exports.default = function (accountData) {
|
|
|
113
126
|
amnytasHerosChoice: countItems(items, 100193),
|
|
114
127
|
innerNayosEndHerosChoice: countItems(items, 101195),
|
|
115
128
|
convergenceHerosChoice: countItems(items, 101185),
|
|
129
|
+
citadelOfZakirosHerosChoice: countItems(items, 101748),
|
|
130
|
+
janthirSyntriHerosChoice: countItems(items, 102265),
|
|
116
131
|
giftsOfExploration: countItems(items, 19677),
|
|
117
132
|
giftsOfBattle: countItems(items, 19678),
|
|
118
133
|
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) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gw2e-account-statistics",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.1",
|
|
4
4
|
"description": "Calculate statistics of guildwars2 accounts",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,7 +19,7 @@
|
|
|
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
25
|
"gw2e-static-data": "^0.5.32",
|
package/tests/index.spec.js
CHANGED
|
@@ -6,7 +6,10 @@ describe('statistics', () => {
|
|
|
6
6
|
it('can calculate all statistics', () => {
|
|
7
7
|
const statistics = accountStatistics(
|
|
8
8
|
{},
|
|
9
|
-
{
|
|
9
|
+
{
|
|
10
|
+
skins: { typeMap: { Armor: [], Weapon: [], Back: [] } },
|
|
11
|
+
novelties: { idMap: {} }
|
|
12
|
+
}
|
|
10
13
|
)
|
|
11
14
|
|
|
12
15
|
expect(statistics).to.contain.all.keys([
|
package/tests/items.spec.js
CHANGED
|
@@ -11,7 +11,23 @@ const generateAccount = (items) => {
|
|
|
11
11
|
bags: [
|
|
12
12
|
{inventory: items.slice(1)}
|
|
13
13
|
]
|
|
14
|
-
}]
|
|
14
|
+
}],
|
|
15
|
+
novelties: [1]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const EXTRA_INFO = {
|
|
20
|
+
novelties: {
|
|
21
|
+
idMap: {
|
|
22
|
+
1: [88124],
|
|
23
|
+
2: [36174]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const EMPTY_EXTRA_INFO = {
|
|
29
|
+
novelties: {
|
|
30
|
+
idMap: {}
|
|
15
31
|
}
|
|
16
32
|
}
|
|
17
33
|
|
|
@@ -68,6 +84,8 @@ describe('statistics > items', () => {
|
|
|
68
84
|
amnytasHerosChoice: null,
|
|
69
85
|
innerNayosEndHerosChoice: null,
|
|
70
86
|
convergenceHerosChoice: null,
|
|
87
|
+
citadelOfZakirosHerosChoice: null,
|
|
88
|
+
janthirSyntriHerosChoice: null,
|
|
71
89
|
uniqueTonics: null,
|
|
72
90
|
bloodRubies: null,
|
|
73
91
|
petrifiedWood: null,
|
|
@@ -162,13 +180,13 @@ describe('statistics > items', () => {
|
|
|
162
180
|
}
|
|
163
181
|
|
|
164
182
|
const bothPermissions = {bank: null, characters: null}
|
|
165
|
-
expect(itemsStatistics(bothPermissions)).to.deep.equal(emptyObject)
|
|
183
|
+
expect(itemsStatistics(bothPermissions, EMPTY_EXTRA_INFO)).to.deep.equal(emptyObject)
|
|
166
184
|
|
|
167
185
|
const inventoriesPermission = {bank: null, characters: [{name: 'Yo'}]}
|
|
168
|
-
expect(itemsStatistics(inventoriesPermission)).to.deep.equal(emptyObject)
|
|
186
|
+
expect(itemsStatistics(inventoriesPermission, EMPTY_EXTRA_INFO)).to.deep.equal(emptyObject)
|
|
169
187
|
|
|
170
188
|
const charactersPermission = {bank: [{id: 30687}], characters: null}
|
|
171
|
-
expect(itemsStatistics(charactersPermission)).to.deep.equal(emptyObject)
|
|
189
|
+
expect(itemsStatistics(charactersPermission, EMPTY_EXTRA_INFO)).to.deep.equal(emptyObject)
|
|
172
190
|
})
|
|
173
191
|
|
|
174
192
|
it('can calculate legendary count', () => {
|
|
@@ -189,7 +207,7 @@ describe('statistics > items', () => {
|
|
|
189
207
|
|
|
190
208
|
account.legendaryarmory = [{id: 80205, count: 2}] // 5 + 6
|
|
191
209
|
|
|
192
|
-
expect(itemsStatistics(account).legendaryItems).to.equal(6)
|
|
210
|
+
expect(itemsStatistics(account, EXTRA_INFO).legendaryItems).to.equal(6)
|
|
193
211
|
})
|
|
194
212
|
|
|
195
213
|
it('can calculate legendary weapon count', () => {
|
|
@@ -200,7 +218,7 @@ describe('statistics > items', () => {
|
|
|
200
218
|
{id: 1, count: 1},
|
|
201
219
|
{id: 7, count: 1},
|
|
202
220
|
{id: 77474, count: 1}
|
|
203
|
-
])).legendaryItemsWeapon).to.equal(2)
|
|
221
|
+
]), EXTRA_INFO).legendaryItemsWeapon).to.equal(2)
|
|
204
222
|
})
|
|
205
223
|
|
|
206
224
|
it('can calculate legendary armor count', () => {
|
|
@@ -211,7 +229,7 @@ describe('statistics > items', () => {
|
|
|
211
229
|
{id: 1, count: 1},
|
|
212
230
|
{id: 7, count: 1},
|
|
213
231
|
{id: 77474, count: 1}
|
|
214
|
-
])).legendaryItemsArmor).to.equal(2)
|
|
232
|
+
]), EXTRA_INFO).legendaryItemsArmor).to.equal(2)
|
|
215
233
|
})
|
|
216
234
|
|
|
217
235
|
it('can calculate legendary back count', () => {
|
|
@@ -222,7 +240,7 @@ describe('statistics > items', () => {
|
|
|
222
240
|
{id: 1, count: 1},
|
|
223
241
|
{id: 30704, count: 1},
|
|
224
242
|
{id: 77474, count: 1}
|
|
225
|
-
])).legendaryItemsBack).to.equal(2)
|
|
243
|
+
]), EXTRA_INFO).legendaryItemsBack).to.equal(2)
|
|
226
244
|
})
|
|
227
245
|
|
|
228
246
|
it('can calculate legendary trinket count', () => {
|
|
@@ -233,7 +251,7 @@ describe('statistics > items', () => {
|
|
|
233
251
|
{id: 1, count: 1},
|
|
234
252
|
{id: 81908, count: 1},
|
|
235
253
|
{id: 77474, count: 1}
|
|
236
|
-
])).legendaryItemsTrinket).to.equal(1)
|
|
254
|
+
]), EXTRA_INFO).legendaryItemsTrinket).to.equal(1)
|
|
237
255
|
})
|
|
238
256
|
|
|
239
257
|
it('can calculate fractal tonic count', () => {
|
|
@@ -243,7 +261,7 @@ describe('statistics > items', () => {
|
|
|
243
261
|
{id: 71383, count: 1},
|
|
244
262
|
{id: 49277, count: 1},
|
|
245
263
|
{id: 49277, count: 1}
|
|
246
|
-
])).fractalTonics).to.equal(3)
|
|
264
|
+
]), EXTRA_INFO).fractalTonics).to.equal(3)
|
|
247
265
|
})
|
|
248
266
|
|
|
249
267
|
it('can calculate legendary insight count', () => {
|
|
@@ -299,7 +317,7 @@ describe('statistics > items', () => {
|
|
|
299
317
|
|
|
300
318
|
function countFromList (itemList) {
|
|
301
319
|
const account = generateAccount(itemList.map(id => ({id, count: 1})))
|
|
302
|
-
return itemsStatistics(account)._legendaryInsightsFromItems
|
|
320
|
+
return itemsStatistics(account, EXTRA_INFO)._legendaryInsightsFromItems
|
|
303
321
|
}
|
|
304
322
|
|
|
305
323
|
// Count the basic items
|
|
@@ -307,7 +325,7 @@ describe('statistics > items', () => {
|
|
|
307
325
|
{id: 80516, count: 3}, // Envoy Insignia => 25 each
|
|
308
326
|
{id: 78989, count: 1}, // Gift of Prowess => 25 each
|
|
309
327
|
{id: 77302, count: 7} // Legendary Insight => 1 each
|
|
310
|
-
]))._legendaryInsightsFromItems, 'basic items').to.equal(3 * 25 + 25 + 7)
|
|
328
|
+
]), EXTRA_INFO)._legendaryInsightsFromItems, 'basic items').to.equal(3 * 25 + 25 + 7)
|
|
311
329
|
|
|
312
330
|
// Count the full first ascended set (from the achievement, so no LI spent)
|
|
313
331
|
const oneWeightAscendedSet = [
|
|
@@ -405,7 +423,7 @@ describe('statistics > items', () => {
|
|
|
405
423
|
{id: 71383, count: 1},
|
|
406
424
|
{id: 78978, count: 1},
|
|
407
425
|
{id: 78978, count: 1}
|
|
408
|
-
])).whiteMantlePortalDevices).to.equal(3)
|
|
426
|
+
]), EXTRA_INFO).whiteMantlePortalDevices).to.equal(3)
|
|
409
427
|
})
|
|
410
428
|
|
|
411
429
|
it('can calculate chak egg sack count', () => {
|
|
@@ -415,7 +433,7 @@ describe('statistics > items', () => {
|
|
|
415
433
|
{id: 71383, count: 1},
|
|
416
434
|
{id: 72021, count: 1},
|
|
417
435
|
{id: 72021, count: 1}
|
|
418
|
-
])).chakEggSacks).to.equal(3)
|
|
436
|
+
]), EXTRA_INFO).chakEggSacks).to.equal(3)
|
|
419
437
|
})
|
|
420
438
|
|
|
421
439
|
it('can calculate preserved queen bee count', () => {
|
|
@@ -425,7 +443,7 @@ describe('statistics > items', () => {
|
|
|
425
443
|
{id: 71383, count: 1},
|
|
426
444
|
{id: 68440, count: 1},
|
|
427
445
|
{id: 68440, count: 1}
|
|
428
|
-
])).preservedQueenBees).to.equal(3)
|
|
446
|
+
]), EXTRA_INFO).preservedQueenBees).to.equal(3)
|
|
429
447
|
})
|
|
430
448
|
|
|
431
449
|
it('can calculate ghostly infusion count', () => {
|
|
@@ -435,7 +453,7 @@ describe('statistics > items', () => {
|
|
|
435
453
|
{id: 71383, count: 1},
|
|
436
454
|
{id: 77316, count: 1},
|
|
437
455
|
{id: 77394, count: 1}
|
|
438
|
-
])).ghostlyInfusions).to.equal(3)
|
|
456
|
+
]), EXTRA_INFO).ghostlyInfusions).to.equal(3)
|
|
439
457
|
})
|
|
440
458
|
|
|
441
459
|
it('can calculate bauble infusion count', () => {
|
|
@@ -445,7 +463,7 @@ describe('statistics > items', () => {
|
|
|
445
463
|
{id: 71383, count: 1},
|
|
446
464
|
{id: 78028, count: 1},
|
|
447
465
|
{id: 78097, count: 1}
|
|
448
|
-
])).baubleInfusions).to.equal(3)
|
|
466
|
+
]), EXTRA_INFO).baubleInfusions).to.equal(3)
|
|
449
467
|
})
|
|
450
468
|
|
|
451
469
|
it('can calculate luminescent refractor count', () => {
|
|
@@ -455,7 +473,7 @@ describe('statistics > items', () => {
|
|
|
455
473
|
{id: 71383, count: 1},
|
|
456
474
|
{id: 67370, count: 1},
|
|
457
475
|
{id: 67372, count: 1}
|
|
458
|
-
])).luminescentRefractors).to.equal(3)
|
|
476
|
+
]), EXTRA_INFO).luminescentRefractors).to.equal(3)
|
|
459
477
|
})
|
|
460
478
|
|
|
461
479
|
it('can calculate broken spoon count', () => {
|
|
@@ -465,7 +483,7 @@ describe('statistics > items', () => {
|
|
|
465
483
|
{id: 71383, count: 1},
|
|
466
484
|
{id: 74996, count: 1},
|
|
467
485
|
{id: 74996, count: 1}
|
|
468
|
-
])).brokenSpoons).to.equal(3)
|
|
486
|
+
]), EXTRA_INFO).brokenSpoons).to.equal(3)
|
|
469
487
|
})
|
|
470
488
|
|
|
471
489
|
it('can calculate black lion claim ticket count', () => {
|
|
@@ -475,13 +493,13 @@ describe('statistics > items', () => {
|
|
|
475
493
|
{id: 71383, count: 1},
|
|
476
494
|
{id: 43998, count: 3},
|
|
477
495
|
{id: 43998, count: 1}
|
|
478
|
-
])).blackLionClaimTickets).to.equal(1.4)
|
|
496
|
+
]), EXTRA_INFO).blackLionClaimTickets).to.equal(1.4)
|
|
479
497
|
|
|
480
498
|
expect(itemsStatistics(generateAccount([
|
|
481
499
|
{id: 43992, count: 3},
|
|
482
500
|
{id: 30687, count: 1},
|
|
483
501
|
{id: 43998, count: 164}
|
|
484
|
-
])).blackLionClaimTickets).to.equal(19.4)
|
|
502
|
+
]), EXTRA_INFO).blackLionClaimTickets).to.equal(19.4)
|
|
485
503
|
})
|
|
486
504
|
|
|
487
505
|
it('can calculate instrument count', () => {
|
|
@@ -491,7 +509,7 @@ describe('statistics > items', () => {
|
|
|
491
509
|
{id: 71383, count: 1},
|
|
492
510
|
{id: 38129, count: 1}, // This is a container and does not count
|
|
493
511
|
{id: 43526, count: 1}
|
|
494
|
-
])).instruments).to.equal(2)
|
|
512
|
+
]), EXTRA_INFO).instruments).to.equal(2)
|
|
495
513
|
})
|
|
496
514
|
|
|
497
515
|
it('can calculate fish items count', () => {
|
|
@@ -501,7 +519,7 @@ describe('statistics > items', () => {
|
|
|
501
519
|
{id: 82432, count: 1},
|
|
502
520
|
{id: 97409, count: 1},
|
|
503
521
|
{id: 83826, count: 1}
|
|
504
|
-
]))
|
|
522
|
+
]), EXTRA_INFO)
|
|
505
523
|
|
|
506
524
|
expect(_statistics.fishItems).to.equal(3)
|
|
507
525
|
expect(_statistics.fishItemsLegendary).to.equal(2)
|
|
@@ -516,7 +534,7 @@ describe('statistics > items', () => {
|
|
|
516
534
|
{id: 82432, count: 1},
|
|
517
535
|
{id: 38129, count: 1},
|
|
518
536
|
{id: 83826, count: 1}
|
|
519
|
-
])).musicBoxes).to.equal(2)
|
|
537
|
+
]), EXTRA_INFO).musicBoxes).to.equal(2)
|
|
520
538
|
})
|
|
521
539
|
|
|
522
540
|
it('can calculate permanent tool count', () => {
|
|
@@ -526,7 +544,7 @@ describe('statistics > items', () => {
|
|
|
526
544
|
{id: 71383, count: 1},
|
|
527
545
|
{id: 38129, count: 1},
|
|
528
546
|
{id: 47897, count: 1}
|
|
529
|
-
])).permanentTools).to.equal(2)
|
|
547
|
+
]), EXTRA_INFO).permanentTools).to.equal(2)
|
|
530
548
|
})
|
|
531
549
|
|
|
532
550
|
it('can calculate chak egg count', () => {
|
|
@@ -536,7 +554,7 @@ describe('statistics > items', () => {
|
|
|
536
554
|
{id: 71383, count: 1},
|
|
537
555
|
{id: 72205, count: 1},
|
|
538
556
|
{id: 72205, count: 1}
|
|
539
|
-
])).chakEggs).to.equal(3)
|
|
557
|
+
]), EXTRA_INFO).chakEggs).to.equal(3)
|
|
540
558
|
})
|
|
541
559
|
|
|
542
560
|
it('can calculate reclaimed metal plate count', () => {
|
|
@@ -546,7 +564,7 @@ describe('statistics > items', () => {
|
|
|
546
564
|
{id: 71383, count: 1},
|
|
547
565
|
{id: 74356, count: 1},
|
|
548
566
|
{id: 74356, count: 1}
|
|
549
|
-
])).reclaimedMetalPlates).to.equal(3)
|
|
567
|
+
]), EXTRA_INFO).reclaimedMetalPlates).to.equal(3)
|
|
550
568
|
})
|
|
551
569
|
|
|
552
570
|
it('can calculate fossilized insects count', () => {
|
|
@@ -556,7 +574,7 @@ describe('statistics > items', () => {
|
|
|
556
574
|
{id: 71383, count: 1},
|
|
557
575
|
{id: 66646, count: 1},
|
|
558
576
|
{id: 66642, count: 1}
|
|
559
|
-
])).fossilizedInsects).to.equal(3)
|
|
577
|
+
]), EXTRA_INFO).fossilizedInsects).to.equal(3)
|
|
560
578
|
})
|
|
561
579
|
|
|
562
580
|
it('can calculate champion bag count', () => {
|
|
@@ -566,7 +584,7 @@ describe('statistics > items', () => {
|
|
|
566
584
|
{id: 71383, count: 1},
|
|
567
585
|
{id: 44226, count: 1},
|
|
568
586
|
{id: 44199, count: 250}
|
|
569
|
-
])).championBags).to.equal(252)
|
|
587
|
+
]), EXTRA_INFO).championBags).to.equal(252)
|
|
570
588
|
})
|
|
571
589
|
|
|
572
590
|
it('can calculate triple trouble chest count', () => {
|
|
@@ -576,7 +594,7 @@ describe('statistics > items', () => {
|
|
|
576
594
|
{id: 71383, count: 1},
|
|
577
595
|
{id: 49664, count: 1},
|
|
578
596
|
{id: 49664, count: 250}
|
|
579
|
-
])).tripleTroubleChests).to.equal(252)
|
|
597
|
+
]), EXTRA_INFO).tripleTroubleChests).to.equal(252)
|
|
580
598
|
})
|
|
581
599
|
|
|
582
600
|
it('can calculate tequatl chest count', () => {
|
|
@@ -586,7 +604,7 @@ describe('statistics > items', () => {
|
|
|
586
604
|
{id: 71383, count: 1},
|
|
587
605
|
{id: 47836, count: 1},
|
|
588
606
|
{id: 47836, count: 250}
|
|
589
|
-
])).tequatlChests).to.equal(252)
|
|
607
|
+
]), EXTRA_INFO).tequatlChests).to.equal(252)
|
|
590
608
|
})
|
|
591
609
|
|
|
592
610
|
it('can calculate unique tonic count', () => {
|
|
@@ -597,7 +615,7 @@ describe('statistics > items', () => {
|
|
|
597
615
|
{id: 66926, count: 1},
|
|
598
616
|
{id: 5, count: 250},
|
|
599
617
|
{id: 68046, count: 100}
|
|
600
|
-
])).uniqueTonics).to.equal(2)
|
|
618
|
+
]), EXTRA_INFO).uniqueTonics).to.equal(2)
|
|
601
619
|
})
|
|
602
620
|
|
|
603
621
|
it('can calculate blood ruby count', () => {
|
|
@@ -607,7 +625,7 @@ describe('statistics > items', () => {
|
|
|
607
625
|
{id: 71383, count: 1},
|
|
608
626
|
{id: 79280, count: 1},
|
|
609
627
|
{id: 79280, count: 250}
|
|
610
|
-
])).bloodRubies).to.equal(252)
|
|
628
|
+
]), EXTRA_INFO).bloodRubies).to.equal(252)
|
|
611
629
|
})
|
|
612
630
|
|
|
613
631
|
it('can calculate petrified wood count', () => {
|
|
@@ -617,7 +635,7 @@ describe('statistics > items', () => {
|
|
|
617
635
|
{id: 71383, count: 1},
|
|
618
636
|
{id: 79469, count: 1},
|
|
619
637
|
{id: 79469, count: 250}
|
|
620
|
-
])).petrifiedWood).to.equal(252)
|
|
638
|
+
]), EXTRA_INFO).petrifiedWood).to.equal(252)
|
|
621
639
|
})
|
|
622
640
|
|
|
623
641
|
it('can calculate tomes of knowledge count', () => {
|
|
@@ -627,7 +645,7 @@ describe('statistics > items', () => {
|
|
|
627
645
|
{id: 71383, count: 1},
|
|
628
646
|
{id: 43741, count: 1},
|
|
629
647
|
{id: 43766, count: 250}
|
|
630
|
-
])).tomesOfKnowledge).to.equal(252)
|
|
648
|
+
]), EXTRA_INFO).tomesOfKnowledge).to.equal(252)
|
|
631
649
|
})
|
|
632
650
|
|
|
633
651
|
it('can calculate permanent contract count', () => {
|
|
@@ -637,7 +655,7 @@ describe('statistics > items', () => {
|
|
|
637
655
|
{id: 71383, count: 1},
|
|
638
656
|
{id: 35984, count: 1},
|
|
639
657
|
{id: 49501, count: 1}
|
|
640
|
-
])).permanentContracts).to.equal(3)
|
|
658
|
+
]), EXTRA_INFO).permanentContracts).to.equal(3)
|
|
641
659
|
})
|
|
642
660
|
|
|
643
661
|
it('can calculate fresh winterberry count', () => {
|
|
@@ -647,7 +665,7 @@ describe('statistics > items', () => {
|
|
|
647
665
|
{id: 79899, count: 1},
|
|
648
666
|
{id: 79899, count: 1},
|
|
649
667
|
{id: 49501, count: 1}
|
|
650
|
-
])).freshWinterberries).to.equal(4)
|
|
668
|
+
]), EXTRA_INFO).freshWinterberries).to.equal(4)
|
|
651
669
|
})
|
|
652
670
|
|
|
653
671
|
it('can calculate winter\' heart infusion count', () => {
|
|
@@ -657,7 +675,7 @@ describe('statistics > items', () => {
|
|
|
657
675
|
{id: 79959, count: 1},
|
|
658
676
|
{id: 79899, count: 1},
|
|
659
677
|
{id: 49501, count: 1}
|
|
660
|
-
])).wintersHeartInfusions).to.equal(2)
|
|
678
|
+
]), EXTRA_INFO).wintersHeartInfusions).to.equal(2)
|
|
661
679
|
})
|
|
662
680
|
|
|
663
681
|
it('can calculate kodas warmth enrichment count', () => {
|
|
@@ -667,7 +685,7 @@ describe('statistics > items', () => {
|
|
|
667
685
|
{id: 79926, count: 1},
|
|
668
686
|
{id: 79899, count: 1},
|
|
669
687
|
{id: 49501, count: 1}
|
|
670
|
-
])).kodasWarmthEnrichment).to.equal(1)
|
|
688
|
+
]), EXTRA_INFO).kodasWarmthEnrichment).to.equal(1)
|
|
671
689
|
})
|
|
672
690
|
|
|
673
691
|
it('can calculate phospholuminescent infusions count', () => {
|
|
@@ -677,7 +695,7 @@ describe('statistics > items', () => {
|
|
|
677
695
|
{id: 79653, count: 1},
|
|
678
696
|
{id: 79899, count: 1},
|
|
679
697
|
{id: 49501, count: 1}
|
|
680
|
-
])).phospholuminescentInfusions).to.equal(1)
|
|
698
|
+
]), EXTRA_INFO).phospholuminescentInfusions).to.equal(1)
|
|
681
699
|
})
|
|
682
700
|
|
|
683
701
|
it('can calculate liquid aurillium count', () => {
|
|
@@ -687,7 +705,7 @@ describe('statistics > items', () => {
|
|
|
687
705
|
{id: 79653, count: 1},
|
|
688
706
|
{id: 79899, count: 1},
|
|
689
707
|
{id: 49501, count: 1}
|
|
690
|
-
])).liquidAurillium).to.equal(3)
|
|
708
|
+
]), EXTRA_INFO).liquidAurillium).to.equal(3)
|
|
691
709
|
})
|
|
692
710
|
|
|
693
711
|
it('can calculate celestial infusion count', () => {
|
|
@@ -697,7 +715,7 @@ describe('statistics > items', () => {
|
|
|
697
715
|
{id: 79653, count: 1},
|
|
698
716
|
{id: 79899, count: 1},
|
|
699
717
|
{id: 49501, count: 1}
|
|
700
|
-
])).celestialInfusion).to.equal(3)
|
|
718
|
+
]), EXTRA_INFO).celestialInfusion).to.equal(3)
|
|
701
719
|
})
|
|
702
720
|
|
|
703
721
|
it('can calculate gemstore toys count', () => {
|
|
@@ -707,7 +725,7 @@ describe('statistics > items', () => {
|
|
|
707
725
|
{id: 49939, count: 1},
|
|
708
726
|
{id: 79899, count: 1},
|
|
709
727
|
{id: 49501, count: 1}
|
|
710
|
-
])).gemstoreToys).to.equal(1
|
|
728
|
+
]), EXTRA_INFO).gemstoreToys).to.equal(2) // 1 extra comes from EXTRA_INFO
|
|
711
729
|
})
|
|
712
730
|
|
|
713
731
|
it('can calculate black lion miniature claim tickets count', () => {
|
|
@@ -717,7 +735,7 @@ describe('statistics > items', () => {
|
|
|
717
735
|
{id: 78474, count: 1},
|
|
718
736
|
{id: 79899, count: 1},
|
|
719
737
|
{id: 49501, count: 1}
|
|
720
|
-
])).blackLionMiniatureClaimTickets).to.equal(3)
|
|
738
|
+
]), EXTRA_INFO).blackLionMiniatureClaimTickets).to.equal(3)
|
|
721
739
|
})
|
|
722
740
|
|
|
723
741
|
it('can calculate jade shards count', () => {
|
|
@@ -727,7 +745,7 @@ describe('statistics > items', () => {
|
|
|
727
745
|
{id: 78474, count: 1},
|
|
728
746
|
{id: 80332, count: 1},
|
|
729
747
|
{id: 49501, count: 1}
|
|
730
|
-
])).jadeShards).to.equal(3)
|
|
748
|
+
]), EXTRA_INFO).jadeShards).to.equal(3)
|
|
731
749
|
})
|
|
732
750
|
|
|
733
751
|
it('can calculate gifts of exploration count', () => {
|
|
@@ -737,7 +755,7 @@ describe('statistics > items', () => {
|
|
|
737
755
|
{id: 78474, count: 1},
|
|
738
756
|
{id: 19677, count: 1},
|
|
739
757
|
{id: 49501, count: 1}
|
|
740
|
-
])).giftsOfExploration).to.equal(3)
|
|
758
|
+
]), EXTRA_INFO).giftsOfExploration).to.equal(3)
|
|
741
759
|
})
|
|
742
760
|
|
|
743
761
|
it('can calculate gifts of battle count', () => {
|
|
@@ -747,7 +765,7 @@ describe('statistics > items', () => {
|
|
|
747
765
|
{id: 78474, count: 1},
|
|
748
766
|
{id: 19678, count: 1},
|
|
749
767
|
{id: 49501, count: 1}
|
|
750
|
-
])).giftsOfBattle).to.equal(3)
|
|
768
|
+
]), EXTRA_INFO).giftsOfBattle).to.equal(3)
|
|
751
769
|
})
|
|
752
770
|
|
|
753
771
|
it('can calculate dragonite ore count', () => {
|
|
@@ -757,7 +775,7 @@ describe('statistics > items', () => {
|
|
|
757
775
|
{id: 78474, count: 1},
|
|
758
776
|
{id: 19677, count: 1},
|
|
759
777
|
{id: 46732, count: 4}
|
|
760
|
-
])).dragoniteOre).to.equal(422)
|
|
778
|
+
]), EXTRA_INFO).dragoniteOre).to.equal(422)
|
|
761
779
|
})
|
|
762
780
|
|
|
763
781
|
it('can calculate bloodstone dust count', () => {
|
|
@@ -767,7 +785,7 @@ describe('statistics > items', () => {
|
|
|
767
785
|
{id: 78474, count: 1},
|
|
768
786
|
{id: 19677, count: 1},
|
|
769
787
|
{id: 46730, count: 4}
|
|
770
|
-
])).bloodstoneDust).to.equal(422)
|
|
788
|
+
]), EXTRA_INFO).bloodstoneDust).to.equal(422)
|
|
771
789
|
})
|
|
772
790
|
|
|
773
791
|
it('can calculate empyreal fragments count', () => {
|
|
@@ -777,7 +795,7 @@ describe('statistics > items', () => {
|
|
|
777
795
|
{id: 78474, count: 1},
|
|
778
796
|
{id: 19677, count: 1},
|
|
779
797
|
{id: 46734, count: 4}
|
|
780
|
-
])).empyrealFragments).to.equal(422)
|
|
798
|
+
]), EXTRA_INFO).empyrealFragments).to.equal(422)
|
|
781
799
|
})
|
|
782
800
|
|
|
783
801
|
it('can calculate crystalline ore count', () => {
|
|
@@ -787,7 +805,7 @@ describe('statistics > items', () => {
|
|
|
787
805
|
{id: 78474, count: 1},
|
|
788
806
|
{id: 19677, count: 1},
|
|
789
807
|
{id: 46683, count: 4}
|
|
790
|
-
])).crystallineOre).to.equal(26)
|
|
808
|
+
]), EXTRA_INFO).crystallineOre).to.equal(26)
|
|
791
809
|
})
|
|
792
810
|
|
|
793
811
|
it('can calculate airship oil count', () => {
|
|
@@ -797,7 +815,7 @@ describe('statistics > items', () => {
|
|
|
797
815
|
{id: 78474, count: 1},
|
|
798
816
|
{id: 76933, count: 1},
|
|
799
817
|
{id: 69434, count: 4}
|
|
800
|
-
])).airshipOil).to.equal(5)
|
|
818
|
+
]), EXTRA_INFO).airshipOil).to.equal(5)
|
|
801
819
|
})
|
|
802
820
|
|
|
803
821
|
it('can calculate auric dust count', () => {
|
|
@@ -807,7 +825,7 @@ describe('statistics > items', () => {
|
|
|
807
825
|
{id: 73537, count: 1},
|
|
808
826
|
{id: 76933, count: 1},
|
|
809
827
|
{id: 69434, count: 4}
|
|
810
|
-
])).auricDust).to.equal(53)
|
|
828
|
+
]), EXTRA_INFO).auricDust).to.equal(53)
|
|
811
829
|
})
|
|
812
830
|
|
|
813
831
|
it('can calculate ley line sparks count', () => {
|
|
@@ -817,7 +835,7 @@ describe('statistics > items', () => {
|
|
|
817
835
|
{id: 76933, count: 1},
|
|
818
836
|
{id: 74042, count: 1},
|
|
819
837
|
{id: 69434, count: 4}
|
|
820
|
-
])).leyLineSparks).to.equal(24)
|
|
838
|
+
]), EXTRA_INFO).leyLineSparks).to.equal(24)
|
|
821
839
|
})
|
|
822
840
|
|
|
823
841
|
it('can calculate legendary spikes count', () => {
|
|
@@ -827,7 +845,7 @@ describe('statistics > items', () => {
|
|
|
827
845
|
{id: 76933, count: 1},
|
|
828
846
|
{id: 74042, count: 1},
|
|
829
847
|
{id: 69434, count: 4}
|
|
830
|
-
])).legendarySpikes).to.equal(22)
|
|
848
|
+
]), EXTRA_INFO).legendarySpikes).to.equal(22)
|
|
831
849
|
})
|
|
832
850
|
|
|
833
851
|
it('can calculate fire orchid blossoms count', () => {
|
|
@@ -837,7 +855,7 @@ describe('statistics > items', () => {
|
|
|
837
855
|
{id: 81127, count: 1},
|
|
838
856
|
{id: 74042, count: 1},
|
|
839
857
|
{id: 81127, count: 4}
|
|
840
|
-
])).fireOrchidBlossoms).to.equal(5)
|
|
858
|
+
]), EXTRA_INFO).fireOrchidBlossoms).to.equal(5)
|
|
841
859
|
})
|
|
842
860
|
|
|
843
861
|
it('can calculate orrian peal count', () => {
|
|
@@ -847,7 +865,7 @@ describe('statistics > items', () => {
|
|
|
847
865
|
{id: 81706, count: 1},
|
|
848
866
|
{id: 74042, count: 1},
|
|
849
867
|
{id: 81706, count: 4}
|
|
850
|
-
])).orrianPearls).to.equal(5)
|
|
868
|
+
]), EXTRA_INFO).orrianPearls).to.equal(5)
|
|
851
869
|
})
|
|
852
870
|
|
|
853
871
|
it('can calculate luck', () => {
|
|
@@ -862,7 +880,7 @@ describe('statistics > items', () => {
|
|
|
862
880
|
{id: 45178, count: 3}, // 600
|
|
863
881
|
{id: 45179, count: 1}, // 500
|
|
864
882
|
{id: 45179, count: 7} // 3500
|
|
865
|
-
]))._luckFromItems).to.equal(5810)
|
|
883
|
+
]), EXTRA_INFO)._luckFromItems).to.equal(5810)
|
|
866
884
|
})
|
|
867
885
|
|
|
868
886
|
it('can calculate kralkatite ore', () => {
|
|
@@ -877,7 +895,7 @@ describe('statistics > items', () => {
|
|
|
877
895
|
{id: 45178, count: 3},
|
|
878
896
|
{id: 86069, count: 1},
|
|
879
897
|
{id: 45179, count: 7}
|
|
880
|
-
])).kralkatiteOre).to.equal(5)
|
|
898
|
+
]), EXTRA_INFO).kralkatiteOre).to.equal(5)
|
|
881
899
|
})
|
|
882
900
|
|
|
883
901
|
it('can calculate festive confetti infusions', () => {
|
|
@@ -892,7 +910,7 @@ describe('statistics > items', () => {
|
|
|
892
910
|
{id: 45178, count: 1},
|
|
893
911
|
{id: 84882, count: 1},
|
|
894
912
|
{id: 84882, count: 1}
|
|
895
|
-
])).festiveConfettiInfusions).to.equal(4)
|
|
913
|
+
]), EXTRA_INFO).festiveConfettiInfusions).to.equal(4)
|
|
896
914
|
})
|
|
897
915
|
|
|
898
916
|
it('can calculate potions of pvp reward', () => {
|
|
@@ -907,7 +925,7 @@ describe('statistics > items', () => {
|
|
|
907
925
|
{id: 45178, count: 1},
|
|
908
926
|
{id: 84882, count: 1},
|
|
909
927
|
{id: 84882, count: 1}
|
|
910
|
-
])).potionOfPvpRewards).to.equal(2)
|
|
928
|
+
]), EXTRA_INFO).potionOfPvpRewards).to.equal(2)
|
|
911
929
|
})
|
|
912
930
|
|
|
913
931
|
it('can calculate potions of wvw reward', () => {
|
|
@@ -922,7 +940,7 @@ describe('statistics > items', () => {
|
|
|
922
940
|
{id: 78600, count: 1},
|
|
923
941
|
{id: 84882, count: 1},
|
|
924
942
|
{id: 84882, count: 1}
|
|
925
|
-
])).potionOfWvwRewards).to.equal(2)
|
|
943
|
+
]), EXTRA_INFO).potionOfWvwRewards).to.equal(2)
|
|
926
944
|
})
|
|
927
945
|
|
|
928
946
|
it('can calculate skirmish chests', () => {
|
|
@@ -937,7 +955,7 @@ describe('statistics > items', () => {
|
|
|
937
955
|
{id: 81324, count: 1},
|
|
938
956
|
{id: 84882, count: 1},
|
|
939
957
|
{id: 84882, count: 1}
|
|
940
|
-
])).skirmishChests).to.equal(2)
|
|
958
|
+
]), EXTRA_INFO).skirmishChests).to.equal(2)
|
|
941
959
|
})
|
|
942
960
|
|
|
943
961
|
it('can calculate unstable fractal essence', () => {
|
|
@@ -953,7 +971,7 @@ describe('statistics > items', () => {
|
|
|
953
971
|
{id: 94055, count: 1}, // Endless Inner Demon Combat Tonic
|
|
954
972
|
|
|
955
973
|
{id: 81761, count: 9999999} // Celestial Infusion (Blue) -- (!) Does not count
|
|
956
|
-
]))._unstableFractalEssenceFromItems).to.equal(7410)
|
|
974
|
+
]), EXTRA_INFO)._unstableFractalEssenceFromItems).to.equal(7410)
|
|
957
975
|
})
|
|
958
976
|
|
|
959
977
|
it('can calculate stat infusion count', () => {
|
|
@@ -963,6 +981,6 @@ describe('statistics > items', () => {
|
|
|
963
981
|
{ id: 71383, count: 1 },
|
|
964
982
|
{ id: 38129, count: 1 },
|
|
965
983
|
{ id: 47897, count: 1 }
|
|
966
|
-
])).statInfusions).to.equal(3)
|
|
984
|
+
]), EXTRA_INFO).statInfusions).to.equal(3)
|
|
967
985
|
})
|
|
968
986
|
})
|
|
@@ -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/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
|
|