gw2e-account-statistics 3.16.1 → 3.17.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.
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+
5
+ var _coloredTitles = require('@gw2efficiency/game-data/titles/categories/colored-titles');
6
+
7
+ var _coloredTitles2 = _interopRequireDefault(_coloredTitles);
8
+
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+
11
+ var coloredTitleIds = _coloredTitles2.default.map(function (x) {
12
+ return x.id;
13
+ });
14
+
15
+ exports.default = coloredTitleIds;
@@ -42,5 +42,40 @@ exports.default = {
42
42
  ],
43
43
  envoyInsignia: 80516,
44
44
  giftOfProwess: 78989,
45
- legendaryInsight: 77302
45
+ legendaryInsight: 77302,
46
+ raidCoffers: [91203, // Vale Guardian Coffer
47
+ 91215, // Gorseval's Coffer
48
+ 91147, // Sabetha's Coffer
49
+ 91160, // Slothasor's Coffer
50
+ 91184, // Prison-Camp Chest (container)
51
+ 91252, // Matthias's Coffer
52
+ 91262, // McLeod's Coffer
53
+ 91187, // Keep Construct's Coffer
54
+ 91182, // Xera's Coffer
55
+ 91186, // Cairn's Coffer
56
+ 91191, // Mursaat Overseer's Coffer
57
+ 91267, // Samarog's Coffer
58
+ 91233, // Deimos's Coffer
59
+ 91211, // Desmina's Coffer
60
+ 91244, // River of Souls Coffer
61
+ 91138, // Statue of Grenth Coffer
62
+ 91220, // Dhuum's Coffer
63
+ 91157, // Conjured Amalgamate's Coffer
64
+ 91166, // Twin Largos' Coffer
65
+ 91237, // Qadim's Coffer
66
+ 91241, // Cardinal Sabir's Coffer
67
+ 91200, // Cardinal Adina's Coffer
68
+ 91260, // Qadim the Peerless's Coffer
69
+ 103783, // Greer's Coffer
70
+ 103926, // Decima's Coffer
71
+ 103946 // Ura's Coffer
72
+ ],
73
+ strikeCmCoffers: [97269, // Mai Trin's Magnificent Coffer
74
+ 96638, // Ankka's Magnificent Coffer
75
+ 96419, // Minister Li's Magnificent Coffer
76
+ 95986, // Void's Magnificent Coffer
77
+ 99204, // Assault Knights' Magnificent Coffer
78
+ 101542, // Cerus's Magnificent Coffer
79
+ 101172 // Dagda's Magnificent Coffer
80
+ ]
46
81
  };
@@ -71,5 +71,6 @@ exports.default = {
71
71
  staticCharge: 72,
72
72
  pinchOfStardust: 73,
73
73
  calcifiedGasp: 75,
74
- ursusOblige: 76
74
+ ursusOblige: 76,
75
+ gaetingCrystals: 77
75
76
  };
@@ -510,7 +510,9 @@ function countLegendaryInsights(items) {
510
510
  perfectedIds = _legendaryInsightItemIds2.default.perfectedIds,
511
511
  envoyInsignia = _legendaryInsightItemIds2.default.envoyInsignia,
512
512
  giftOfProwess = _legendaryInsightItemIds2.default.giftOfProwess,
513
- legendaryInsight = _legendaryInsightItemIds2.default.legendaryInsight;
513
+ legendaryInsight = _legendaryInsightItemIds2.default.legendaryInsight,
514
+ raidCoffers = _legendaryInsightItemIds2.default.raidCoffers,
515
+ strikeCmCoffers = _legendaryInsightItemIds2.default.strikeCmCoffers;
514
516
 
515
517
 
516
518
  var refinedCount = refinedIds.reduce(function (sum, id) {
@@ -525,11 +527,8 @@ function countLegendaryInsights(items) {
525
527
  li += Math.min(perfectedCount, 6) * 25 + Math.max(perfectedCount - 6, 0) * 50;
526
528
  li += countItems(items, [envoyInsignia, giftOfProwess]) * 25;
527
529
  li += countItems(items, legendaryInsight);
528
- li += countItems(items, [97269, // Mai Trin's Magnificent Coffer
529
- 96638, // Ankka's Magnificent Coffer
530
- 96419, // Minister Li's Magnificent Coffer
531
- 95986 // Void's Magnificent Coffer
532
- ]);
530
+ li += countItems(items, raidCoffers);
531
+ li += countItems(items, strikeCmCoffers);
533
532
 
534
533
  return li;
535
534
  }
@@ -36,7 +36,8 @@ exports.default = function (accountData, extraInformation) {
36
36
  _pristineFractalRelicsFromTitles: pristineFractalRelicsFromTitles(accountData),
37
37
  _unstableFractalEssenceFromUnlocks: unstableFractalEssenceFromUnlocks(accountData),
38
38
  aureneLegendaryVariantSkins: aureneLegendaryVariantSkins(accountData),
39
- suffusedObsidianArmorSkins: suffusedObsidianArmorSkins(accountData)
39
+ suffusedObsidianArmorSkins: suffusedObsidianArmorSkins(accountData),
40
+ coloredTitleCount: coloredTitleCount(accountData)
40
41
  };
41
42
  };
42
43
 
@@ -64,6 +65,10 @@ var _suffusedObsidianArmors = require('../gameData/suffusedObsidianArmors');
64
65
 
65
66
  var _suffusedObsidianArmors2 = _interopRequireDefault(_suffusedObsidianArmors);
66
67
 
68
+ var _coloredTitles = require('../gameData/coloredTitles');
69
+
70
+ var _coloredTitles2 = _interopRequireDefault(_coloredTitles);
71
+
67
72
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
68
73
 
69
74
  // The unlocked dyes on the account
@@ -202,6 +207,18 @@ function titleCount(accountData) {
202
207
  return accountData.titles.length;
203
208
  }
204
209
 
210
+ function coloredTitleCount(accountData) {
211
+ if (!accountData.titles) {
212
+ return null;
213
+ }
214
+
215
+ var titleCount = _coloredTitles2.default.filter(function (x) {
216
+ return accountData.titles.includes(x);
217
+ }).length;
218
+
219
+ return titleCount;
220
+ }
221
+
205
222
  // The unlocked recipes on the account
206
223
  function recipeCount(accountData) {
207
224
  if (!accountData.recipes) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gw2e-account-statistics",
3
- "version": "3.16.1",
3
+ "version": "3.17.1",
4
4
  "description": "Calculate statistics of guildwars2 accounts",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -149,6 +149,13 @@ describe('statistics > unlocks', () => {
149
149
  expect(unlocksStatistics({titles: [1, 2, 7, 9, 10]}, EXTRA_INFO).titleCount).to.equal(5)
150
150
  })
151
151
 
152
+ it('can calculate colored title coun', () => {
153
+ expect(unlocksStatistics({}, EXTRA_INFO).coloredTitleCount).to.equal(null)
154
+ expect(unlocksStatistics({titles: []}, EXTRA_INFO).coloredTitleCount).to.equal(0)
155
+ expect(unlocksStatistics({titles: [1]}, EXTRA_INFO).coloredTitleCount).to.equal(0)
156
+ expect(unlocksStatistics({titles: [1, 89]}, EXTRA_INFO).coloredTitleCount).to.equal(1)
157
+ })
158
+
152
159
  it('can calculate recipe count', () => {
153
160
  expect(unlocksStatistics({}, EXTRA_INFO).recipeCount).to.equal(null)
154
161
  expect(unlocksStatistics({recipes: []}, EXTRA_INFO).recipeCount).to.equal(0)
@@ -75,7 +75,8 @@ describe('statistics > wallet', () => {
75
75
  jadeMinersKeycard: null,
76
76
  pinchOfStardust: null,
77
77
  staticCharge: null,
78
- ursusOblige: null
78
+ ursusOblige: null,
79
+ gaetingCrystals: null
79
80
  })
80
81
  })
81
82
 
@@ -196,7 +197,8 @@ describe('statistics > wallet', () => {
196
197
  jadeMinersKeycard: 0,
197
198
  pinchOfStardust: 0,
198
199
  staticCharge: 0,
199
- ursusOblige: 0
200
+ ursusOblige: 0,
201
+ gaetingCrystals: 0
200
202
  })
201
203
  })
202
204