warframe-worldstate-parser 2.30.0 → 2.31.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/lib/WorldState.js
CHANGED
|
@@ -36,6 +36,7 @@ const CambionCycle = require('./models/CambionCycle');
|
|
|
36
36
|
const SteelPathOffering = require('./models/SteelPathOffering');
|
|
37
37
|
const Dependency = require('./supporting/Dependency'); // eslint-disable-line no-unused-vars
|
|
38
38
|
const DuviriCycle = require('./models/DuviriCycle');
|
|
39
|
+
const DuviriChoice = require('./supporting/DuviriChoice');
|
|
39
40
|
|
|
40
41
|
// needed for type declarations
|
|
41
42
|
const MarkdownSettings = require('./supporting/MarkdownSettings');
|
|
@@ -74,6 +75,7 @@ const defaultDeps = {
|
|
|
74
75
|
mdConfig: new MarkdownSettings(),
|
|
75
76
|
locale: 'en',
|
|
76
77
|
logger: console,
|
|
78
|
+
DuviriChoice,
|
|
77
79
|
};
|
|
78
80
|
|
|
79
81
|
/**
|
|
@@ -339,6 +341,8 @@ module.exports = class WorldState {
|
|
|
339
341
|
*/
|
|
340
342
|
[this.archonHunt] = parseArray(deps.Sortie, data.LiteSorties, deps);
|
|
341
343
|
|
|
344
|
+
deps.duviriChoices = parseArray(deps.DuviriChoice, data.EndlessXpChoices, deps);
|
|
345
|
+
|
|
342
346
|
this.duviriCycle = new DuviriCycle(deps);
|
|
343
347
|
}
|
|
344
348
|
};
|
|
@@ -26,7 +26,7 @@ const getStageInfo = () => {
|
|
|
26
26
|
* @extends {WorldstateObject}
|
|
27
27
|
*/
|
|
28
28
|
class DuviriCycle extends WorldstateObject {
|
|
29
|
-
constructor({ timeDate, translator }) {
|
|
29
|
+
constructor({ timeDate, translator, duviriChoices }) {
|
|
30
30
|
super({ _id: { $oid: 'duviriCycle0' } }, { timeDate, translator });
|
|
31
31
|
const { activation, expiry, state } = getStageInfo();
|
|
32
32
|
|
|
@@ -45,6 +45,10 @@ class DuviriCycle extends WorldstateObject {
|
|
|
45
45
|
* @type {string}
|
|
46
46
|
*/
|
|
47
47
|
this.state = state;
|
|
48
|
+
/**
|
|
49
|
+
* Choice options for this Cycle
|
|
50
|
+
*/
|
|
51
|
+
this.choices = duviriChoices;
|
|
48
52
|
|
|
49
53
|
this.id = `duviriCycle${this.state}${this.expiry.getTime()}`;
|
|
50
54
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Single category of duviri choices
|
|
5
|
+
*/
|
|
6
|
+
class DuviriChoice {
|
|
7
|
+
constructor(data) {
|
|
8
|
+
switch (data.Category) {
|
|
9
|
+
case 'EXC_NORMAL':
|
|
10
|
+
this.category = 'normal';
|
|
11
|
+
break;
|
|
12
|
+
case 'EXC_HARD':
|
|
13
|
+
this.category = 'hard';
|
|
14
|
+
}
|
|
15
|
+
this.categoryKey = data.Category;
|
|
16
|
+
this.choices = data.Choices;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = DuviriChoice;
|
package/package.json
CHANGED
|
@@ -4,15 +4,20 @@ export = DuviriCycle;
|
|
|
4
4
|
* @extends {WorldstateObject}
|
|
5
5
|
*/
|
|
6
6
|
declare class DuviriCycle extends WorldstateObject {
|
|
7
|
-
constructor({ timeDate, translator }: {
|
|
7
|
+
constructor({ timeDate, translator, duviriChoices }: {
|
|
8
8
|
timeDate: any;
|
|
9
9
|
translator: any;
|
|
10
|
+
duviriChoices: any;
|
|
10
11
|
});
|
|
11
12
|
/**
|
|
12
13
|
* Current stage key
|
|
13
14
|
* @type {string}
|
|
14
15
|
*/
|
|
15
16
|
state: string;
|
|
17
|
+
/**
|
|
18
|
+
* Choice options for this Cycle
|
|
19
|
+
*/
|
|
20
|
+
choices: any;
|
|
16
21
|
id: string;
|
|
17
22
|
}
|
|
18
23
|
declare namespace DuviriCycle {
|