warframe-worldstate-parser 2.23.0 → 2.24.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/Alert.js +8 -8
- package/lib/CambionCycle.js +1 -5
- package/lib/CetusCycle.js +3 -3
- package/lib/ChallengeInstance.js +6 -6
- package/lib/ConclaveChallenge.js +2 -5
- package/lib/ConstructionProgress.js +4 -2
- package/lib/DailyDeal.js +1 -3
- package/lib/DarkSector.js +11 -8
- package/lib/EarthCycle.js +4 -4
- package/lib/Fissure.js +3 -3
- package/lib/FlashSale.js +2 -7
- package/lib/GlobalUpgrade.js +5 -5
- package/lib/Invasion.js +11 -10
- package/lib/Kuva.js +16 -10
- package/lib/Mission.js +30 -20
- package/lib/News.js +13 -15
- package/lib/Nightwave.js +7 -4
- package/lib/NightwaveChallenge.js +2 -4
- package/lib/PersistentEnemy.js +1 -3
- package/lib/Reward.js +64 -60
- package/lib/SentientOutpost.js +6 -8
- package/lib/Simaris.js +5 -3
- package/lib/Sortie.js +12 -8
- package/lib/SortieVariant.js +13 -13
- package/lib/SyndicateJob.js +49 -17
- package/lib/SyndicateMission.js +6 -6
- package/lib/VallisCycle.js +2 -2
- package/lib/VoidTrader.js +9 -13
- package/lib/WeeklyChallenge.js +4 -3
- package/lib/WorldEvent.js +24 -30
- package/lib/WorldState.js +32 -24
- package/lib/WorldstateObject.js +3 -3
- package/lib/ZarimanCycle.js +136 -0
- package/lib/timeDate.js +2 -2
- package/lib/translation.js +22 -12
- package/package.json +3 -118
- package/types/lib/Alert.d.ts +1 -1
- package/types/lib/CambionCycle.d.ts +1 -0
- package/types/lib/ConclaveChallenge.d.ts +1 -1
- package/types/lib/DailyDeal.d.ts +1 -1
- package/types/lib/DarkSector.d.ts +1 -1
- package/types/lib/Fissure.d.ts +3 -3
- package/types/lib/FlashSale.d.ts +1 -1
- package/types/lib/GlobalUpgrade.d.ts +1 -1
- package/types/lib/Invasion.d.ts +4 -4
- package/types/lib/Kuva.d.ts +1 -6
- package/types/lib/Mission.d.ts +11 -4
- package/types/lib/News.d.ts +4 -4
- package/types/lib/Nightwave.d.ts +1 -1
- package/types/lib/NightwaveChallenge.d.ts +1 -1
- package/types/lib/PersistentEnemy.d.ts +1 -1
- package/types/lib/SentientOutpost.d.ts +1 -1
- package/types/lib/Sortie.d.ts +1 -1
- package/types/lib/SortieVariant.d.ts +10 -10
- package/types/lib/SyndicateJob.d.ts +13 -9
- package/types/lib/SyndicateMission.d.ts +1 -1
- package/types/lib/VoidTrader.d.ts +1 -1
- package/types/lib/WorldEvent.d.ts +3 -3
- package/types/lib/WorldState.d.ts +5 -0
- package/types/lib/ZarimanCycle.d.ts +55 -0
package/lib/Reward.js
CHANGED
|
@@ -94,34 +94,36 @@ const rewardTypes = [
|
|
|
94
94
|
description: 'Vauban parts',
|
|
95
95
|
test: (s) => /^vauban(?!.*helmet)/i.test(s),
|
|
96
96
|
thumbnail: 'https://i.imgur.com/r5x0owi.png',
|
|
97
|
-
color:
|
|
97
|
+
color: 0x5c5a53,
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
name: 'vandal',
|
|
101
101
|
description: 'Vandal Weapon Parts',
|
|
102
102
|
test: (s) => /vandal/i.test(s),
|
|
103
103
|
thumbnail: 'https://i.imgur.com/kPQcg5B.png',
|
|
104
|
-
color:
|
|
104
|
+
color: 0x5c5a53,
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
name: 'wraith',
|
|
108
108
|
description: 'Wraith Weapon Parts',
|
|
109
109
|
test: (s) => /wraith/i.test(s),
|
|
110
110
|
thumbnail: 'https://i.imgur.com/B5sv3mQ.png',
|
|
111
|
-
color:
|
|
111
|
+
color: 0x5c5a53,
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
name: 'skin',
|
|
115
115
|
description: 'Weapon skins',
|
|
116
116
|
test: (s) => /skin/i.test(s),
|
|
117
|
-
thumbnail:
|
|
118
|
-
|
|
117
|
+
thumbnail:
|
|
118
|
+
'https://raw.githubusercontent.com/Warframe-Community-Developers/warframe-worldstate-parser/master/resources/weapon_skin_thumb.png',
|
|
119
|
+
color: 0x4f4c33,
|
|
119
120
|
},
|
|
120
121
|
{
|
|
121
122
|
name: 'helmet',
|
|
122
123
|
description: 'Alternative helmets',
|
|
123
124
|
test: (s) => /helmet/i.test(s),
|
|
124
|
-
thumbnail:
|
|
125
|
+
thumbnail:
|
|
126
|
+
'https://raw.githubusercontent.com/Warframe-Community-Developers/warframe-worldstate-parser/master/resources/alt_helmet_thumb.png',
|
|
125
127
|
color: 0x567677,
|
|
126
128
|
},
|
|
127
129
|
{
|
|
@@ -129,273 +131,275 @@ const rewardTypes = [
|
|
|
129
131
|
description: 'Nitain extract',
|
|
130
132
|
test: (s) => /nitain/i.test(s),
|
|
131
133
|
thumbnail: 'https://i.imgur.com/3Db4PHh.png',
|
|
132
|
-
color:
|
|
134
|
+
color: 0xaeada4,
|
|
133
135
|
},
|
|
134
136
|
{
|
|
135
137
|
name: 'mutalist',
|
|
136
138
|
description: 'Mutalist Alad V coordinates',
|
|
137
139
|
test: (s) => /mutalist/i.test(s),
|
|
138
140
|
thumbnail: 'https://i.imgur.com/96AWqr8.png',
|
|
139
|
-
color:
|
|
141
|
+
color: 0x26b37,
|
|
140
142
|
},
|
|
141
143
|
{
|
|
142
144
|
name: 'weapon',
|
|
143
145
|
description: 'Weapons',
|
|
144
146
|
test: (s) => /dagger|sword|glaive/i.test(s),
|
|
145
147
|
thumbnail: 'https://i.imgur.com/A2gbH8k.png',
|
|
146
|
-
color:
|
|
148
|
+
color: 0xa3a097,
|
|
147
149
|
},
|
|
148
150
|
{
|
|
149
151
|
name: 'fieldron',
|
|
150
152
|
description: 'Fieldron',
|
|
151
153
|
test: (s) => /fieldron/i.test(s),
|
|
152
154
|
thumbnail: 'https://i.imgur.com/qlrlfft.png',
|
|
153
|
-
color:
|
|
155
|
+
color: 0x4d5556,
|
|
154
156
|
},
|
|
155
157
|
{
|
|
156
158
|
name: 'detonite',
|
|
157
159
|
description: 'Detonite Injector',
|
|
158
160
|
test: (s) => /detonite/i.test(s),
|
|
159
161
|
thumbnail: 'https://i.imgur.com/rV6lN4W.png',
|
|
160
|
-
color:
|
|
162
|
+
color: 0x4d5556,
|
|
161
163
|
},
|
|
162
164
|
{
|
|
163
165
|
name: 'mutagen',
|
|
164
166
|
description: 'Mutagen Mass',
|
|
165
167
|
test: (s) => /mutagen/i.test(s),
|
|
166
168
|
thumbnail: 'https://i.imgur.com/vV7kzub.png',
|
|
167
|
-
color:
|
|
169
|
+
color: 0x4d5556,
|
|
168
170
|
},
|
|
169
171
|
{
|
|
170
172
|
name: 'clantech',
|
|
171
173
|
description: 'Clantech resources',
|
|
172
174
|
test: (s) => /fieldron|detonite|mutagen/i.test(s),
|
|
173
|
-
thumbnail:
|
|
174
|
-
|
|
175
|
+
thumbnail:
|
|
176
|
+
'https://github.com/Warframe-Community-Developers/warframe-worldstate-parser/raw/master/resources/clantech_thmb.png',
|
|
177
|
+
color: 0x4d5556,
|
|
175
178
|
},
|
|
176
179
|
{
|
|
177
180
|
name: 'aura',
|
|
178
181
|
description: 'Auras',
|
|
179
182
|
test: (s) => auras.includes(s),
|
|
180
|
-
thumbnail:
|
|
181
|
-
|
|
183
|
+
thumbnail:
|
|
184
|
+
'https://github.com/Warframe-Community-Developers/warframe-worldstate-parser/raw/master/resources/aura_thumb.png',
|
|
185
|
+
color: 0xc8f8ff,
|
|
182
186
|
},
|
|
183
187
|
{
|
|
184
188
|
name: 'neuralSensors',
|
|
185
189
|
description: 'Neural Sensors',
|
|
186
190
|
test: (s) => /neural/i.test(s),
|
|
187
191
|
thumbnail: 'https://i.imgur.com/Gq6cz9p.png',
|
|
188
|
-
color:
|
|
192
|
+
color: 0xc8f8ff,
|
|
189
193
|
},
|
|
190
194
|
{
|
|
191
195
|
name: 'neurodes',
|
|
192
196
|
description: 'Neurodes',
|
|
193
197
|
test: (s) => /neurode/i.test(s),
|
|
194
198
|
thumbnail: 'https://cdn.warframestat.us/img/component-neurode.png',
|
|
195
|
-
color:
|
|
199
|
+
color: 0xc8f8ff,
|
|
196
200
|
},
|
|
197
201
|
{
|
|
198
202
|
name: 'orokinCell',
|
|
199
203
|
description: 'Orokin Cell',
|
|
200
204
|
test: (s) => /orokin\scell/i.test(s),
|
|
201
205
|
thumbnail: 'https://i.imgur.com/tEQdoDE.png',
|
|
202
|
-
color:
|
|
206
|
+
color: 0xc8f8ff,
|
|
203
207
|
},
|
|
204
208
|
{
|
|
205
209
|
name: 'alloyPlate',
|
|
206
210
|
description: 'Alloy Plate',
|
|
207
211
|
test: (s) => /alloy\splate/i.test(s),
|
|
208
212
|
thumbnail: 'https://i.imgur.com/E8K3fOI.png',
|
|
209
|
-
color:
|
|
213
|
+
color: 0xc8f8ff,
|
|
210
214
|
},
|
|
211
215
|
{
|
|
212
216
|
name: 'circuits',
|
|
213
217
|
description: 'Circuits',
|
|
214
218
|
test: (s) => /circuits/i.test(s),
|
|
215
219
|
thumbnail: 'https://i.imgur.com/OxJvWIx.png',
|
|
216
|
-
color:
|
|
220
|
+
color: 0xc8f8ff,
|
|
217
221
|
},
|
|
218
222
|
{
|
|
219
223
|
name: 'controlModule',
|
|
220
224
|
description: 'Control Module',
|
|
221
225
|
test: (s) => /control\smodule/i.test(s),
|
|
222
226
|
thumbnail: 'https://i.imgur.com/F1UUub1.png',
|
|
223
|
-
color:
|
|
227
|
+
color: 0xc8f8ff,
|
|
224
228
|
},
|
|
225
229
|
{
|
|
226
230
|
name: 'ferrite',
|
|
227
231
|
description: 'Ferrite',
|
|
228
232
|
test: (s) => /ferrite/i.test(s),
|
|
229
233
|
thumbnail: 'https://i.imgur.com/h93eVLr.png',
|
|
230
|
-
color:
|
|
234
|
+
color: 0xc8f8ff,
|
|
231
235
|
},
|
|
232
236
|
{
|
|
233
237
|
name: 'gallium',
|
|
234
238
|
description: 'Gallium',
|
|
235
239
|
test: (s) => /gallium/i.test(s),
|
|
236
240
|
thumbnail: 'https://i.imgur.com/pvpc73S.png',
|
|
237
|
-
color:
|
|
241
|
+
color: 0xa1adba,
|
|
238
242
|
},
|
|
239
243
|
{
|
|
240
244
|
name: 'morphics',
|
|
241
245
|
description: 'Morphics',
|
|
242
246
|
test: (s) => /morphics/i.test(s),
|
|
243
247
|
thumbnail: 'https://i.imgur.com/SF3XWd6.png',
|
|
244
|
-
color:
|
|
248
|
+
color: 0xc8f8ff,
|
|
245
249
|
},
|
|
246
250
|
{
|
|
247
251
|
name: 'nanoSpores',
|
|
248
252
|
description: 'Nano Spores',
|
|
249
253
|
test: (s) => /nano\sspores/i.test(s),
|
|
250
254
|
thumbnail: 'https://i.imgur.com/bb71Cy7.png',
|
|
251
|
-
color:
|
|
255
|
+
color: 0x533f36,
|
|
252
256
|
},
|
|
253
257
|
{
|
|
254
258
|
name: 'oxium',
|
|
255
259
|
description: 'Oxium',
|
|
256
260
|
test: (s) => /oxium/i.test(s),
|
|
257
261
|
thumbnail: 'https://i.imgur.com/hY8NCjk.png',
|
|
258
|
-
color:
|
|
262
|
+
color: 0x92713b,
|
|
259
263
|
},
|
|
260
264
|
{
|
|
261
265
|
name: 'rubedo',
|
|
262
266
|
description: 'Rubedo',
|
|
263
267
|
test: (s) => /rubedo/i.test(s),
|
|
264
268
|
thumbnail: 'https://i.imgur.com/gSO9ILf.png',
|
|
265
|
-
color:
|
|
269
|
+
color: 0xce3e36,
|
|
266
270
|
},
|
|
267
271
|
{
|
|
268
272
|
name: 'salvage',
|
|
269
273
|
description: 'Salvage',
|
|
270
274
|
test: (s) => /salvage/i.test(s),
|
|
271
275
|
thumbnail: 'https://i.imgur.com/3L7xLYg.png',
|
|
272
|
-
color:
|
|
276
|
+
color: 0x8b8e8d,
|
|
273
277
|
},
|
|
274
278
|
{
|
|
275
279
|
name: 'plastids',
|
|
276
280
|
description: 'Plastids',
|
|
277
281
|
test: (s) => /plastids/i.test(s),
|
|
278
282
|
thumbnail: 'https://i.imgur.com/5yVfTEF.png',
|
|
279
|
-
color:
|
|
283
|
+
color: 0xceae88,
|
|
280
284
|
},
|
|
281
285
|
{
|
|
282
286
|
name: 'polymerBundle',
|
|
283
287
|
description: 'Polymer Bundle',
|
|
284
288
|
test: (s) => /polymer\sbundle/i.test(s),
|
|
285
289
|
thumbnail: 'https://i.imgur.com/pg8asnC.png',
|
|
286
|
-
color:
|
|
290
|
+
color: 0x6b4da4,
|
|
287
291
|
},
|
|
288
292
|
{
|
|
289
293
|
name: 'argonCrystal',
|
|
290
294
|
description: 'Argon Crystal',
|
|
291
295
|
test: (s) => /argon\scrystal/i.test(s),
|
|
292
296
|
thumbnail: 'https://i.imgur.com/DdJJYSB.png',
|
|
293
|
-
color:
|
|
297
|
+
color: 0xc8f8ff,
|
|
294
298
|
},
|
|
295
299
|
{
|
|
296
300
|
name: 'cryotic',
|
|
297
301
|
description: 'Cryotic',
|
|
298
302
|
test: (s) => /cryotic/i.test(s),
|
|
299
303
|
thumbnail: 'https://i.imgur.com/yqPgj21.png',
|
|
300
|
-
color:
|
|
304
|
+
color: 0x78a2b3,
|
|
301
305
|
},
|
|
302
306
|
{
|
|
303
307
|
name: 'tellurium',
|
|
304
308
|
description: 'Tellurium',
|
|
305
309
|
test: (s) => /tellurium/i.test(s),
|
|
306
310
|
thumbnail: 'https://i.imgur.com/ocjnGU8.png',
|
|
307
|
-
color:
|
|
311
|
+
color: 0xe72e18,
|
|
308
312
|
},
|
|
309
313
|
{
|
|
310
314
|
name: 'resource',
|
|
311
315
|
description: 'Resources',
|
|
312
316
|
test: (s) => resources.includes(s),
|
|
313
317
|
thumbnail: 'https://i.imgur.com/Bq5TEPo.png',
|
|
314
|
-
color:
|
|
318
|
+
color: 0xffee9c,
|
|
315
319
|
},
|
|
316
320
|
{
|
|
317
321
|
name: 'nightmare',
|
|
318
322
|
description: 'Nightmare mods',
|
|
319
323
|
test: (s) => nightmare.includes(s),
|
|
320
324
|
thumbnail: 'https://i.imgur.com/cAYNH7j.png',
|
|
321
|
-
color:
|
|
325
|
+
color: 0xb22e2c,
|
|
322
326
|
},
|
|
323
327
|
{
|
|
324
328
|
name: 'endo',
|
|
325
329
|
description: 'Endo',
|
|
326
330
|
test: (s) => /\d+\sendo/i.test(s),
|
|
327
331
|
thumbnail: 'https://i.imgur.com/mS8oSwx.png',
|
|
328
|
-
color:
|
|
332
|
+
color: 0xc2a24c,
|
|
329
333
|
},
|
|
330
334
|
{
|
|
331
335
|
name: 'reactor',
|
|
332
336
|
description: 'Orokin Reactors',
|
|
333
337
|
test: (s) => /reactor/i.test(s),
|
|
334
338
|
thumbnail: 'https://i.imgur.com/6Hm1BEq.png',
|
|
335
|
-
color:
|
|
339
|
+
color: 0xd7c37d,
|
|
336
340
|
},
|
|
337
341
|
{
|
|
338
342
|
name: 'catalyst',
|
|
339
343
|
description: 'Orokin Catalyst',
|
|
340
344
|
test: (s) => /catalyst/i.test(s),
|
|
341
345
|
thumbnail: 'https://i.imgur.com/C4X9NWm.png',
|
|
342
|
-
color:
|
|
346
|
+
color: 0x689add,
|
|
343
347
|
},
|
|
344
348
|
{
|
|
345
349
|
name: 'potato',
|
|
346
350
|
description: 'Orokin Catalysts/Reactors',
|
|
347
351
|
test: (s) => /catalyst|reactor/i.test(s),
|
|
348
352
|
thumbnail: 'https://i.imgur.com/6Hm1BEq.png',
|
|
349
|
-
color:
|
|
353
|
+
color: 0x689add,
|
|
350
354
|
},
|
|
351
355
|
{
|
|
352
356
|
name: 'forma',
|
|
353
357
|
description: 'Forma',
|
|
354
358
|
test: (s) => /forma/i.test(s),
|
|
355
359
|
thumbnail: 'https://i.imgur.com/2b0FT3D.png',
|
|
356
|
-
color:
|
|
360
|
+
color: 0xb19547,
|
|
357
361
|
},
|
|
358
362
|
{
|
|
359
363
|
name: 'exilus',
|
|
360
364
|
description: 'Exilus',
|
|
361
365
|
test: (s) => /exilus/i.test(s),
|
|
362
366
|
thumbnail: 'https://i.imgur.com/eQNeNpY.png',
|
|
363
|
-
color:
|
|
367
|
+
color: 0x88332d,
|
|
364
368
|
},
|
|
365
369
|
{
|
|
366
370
|
name: 'synthula',
|
|
367
371
|
description: 'Synthula',
|
|
368
372
|
test: (s) => /synthula/i.test(s),
|
|
369
373
|
thumbnail: 'https://i.imgur.com/X0Lvfc9.png',
|
|
370
|
-
color:
|
|
374
|
+
color: 0x9fa19f,
|
|
371
375
|
},
|
|
372
376
|
{
|
|
373
377
|
name: 'kavatGene',
|
|
374
378
|
description: 'Kavat Genetic Code',
|
|
375
379
|
test: (s) => /Kavat Ge/i.test(s),
|
|
376
380
|
thumbnail: 'https://i.imgur.com/ijVUmQV.png',
|
|
377
|
-
color:
|
|
381
|
+
color: 0x76a8ad,
|
|
378
382
|
},
|
|
379
383
|
{
|
|
380
384
|
name: 'kubrowEgg',
|
|
381
385
|
description: 'Kubrow Egg',
|
|
382
386
|
test: (s) => /kubrow\segg/i.test(s),
|
|
383
387
|
thumbnail: 'https://i.imgur.com/Vv3LXnz.png',
|
|
384
|
-
color:
|
|
388
|
+
color: 0xa5937f,
|
|
385
389
|
},
|
|
386
390
|
{
|
|
387
391
|
name: 'traces',
|
|
388
392
|
description: 'Void Traces',
|
|
389
393
|
test: (s) => /trace/i.test(s),
|
|
390
394
|
thumbnail: 'https://i.imgur.com/vvZGMPv.png',
|
|
391
|
-
color:
|
|
395
|
+
color: 0x69a4dd,
|
|
392
396
|
},
|
|
393
397
|
{
|
|
394
398
|
name: 'riven',
|
|
395
399
|
description: 'Riven Mod',
|
|
396
400
|
test: (s) => /riven/i.test(s),
|
|
397
401
|
thumbnail: 'https://i.imgur.com/LoficZr.png',
|
|
398
|
-
color:
|
|
402
|
+
color: 0xa183bd,
|
|
399
403
|
},
|
|
400
404
|
// Catch-all
|
|
401
405
|
{
|
|
@@ -403,7 +407,7 @@ const rewardTypes = [
|
|
|
403
407
|
description: 'Other',
|
|
404
408
|
test: () => true,
|
|
405
409
|
thumbnail: '',
|
|
406
|
-
color:
|
|
410
|
+
color: 0x4f545c,
|
|
407
411
|
},
|
|
408
412
|
];
|
|
409
413
|
|
|
@@ -448,11 +452,13 @@ class Reward {
|
|
|
448
452
|
* The counted items being rewarded
|
|
449
453
|
* @type {Array.<Object>}
|
|
450
454
|
*/
|
|
451
|
-
this.countedItems = data.countedItems
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
455
|
+
this.countedItems = data.countedItems
|
|
456
|
+
? data.countedItems.map((i) => ({
|
|
457
|
+
count: i.ItemCount,
|
|
458
|
+
type: translator.languageString(i.ItemType, locale),
|
|
459
|
+
key: translator.languageString(i.ItemType),
|
|
460
|
+
}))
|
|
461
|
+
: [];
|
|
456
462
|
|
|
457
463
|
/**
|
|
458
464
|
* The credits being rewarded
|
|
@@ -462,13 +468,13 @@ class Reward {
|
|
|
462
468
|
|
|
463
469
|
this.asString = this.toString();
|
|
464
470
|
|
|
465
|
-
this.itemString = this.items
|
|
466
|
-
this.countedItems.map((i) => `${i.count > 1 ? i.count : ''} ${i.type}`.trim())
|
|
467
|
-
|
|
471
|
+
this.itemString = this.items
|
|
472
|
+
.concat(this.countedItems.map((i) => `${i.count > 1 ? i.count : ''} ${i.type}`.trim()))
|
|
473
|
+
.join(' + ');
|
|
468
474
|
|
|
469
475
|
this.thumbnail = this.getTypesFull()[0] ? this.getTypesFull()[0].thumbnail : 'https://i.imgur.com/JCKyUXJ.png';
|
|
470
476
|
|
|
471
|
-
this.color = this.getTypesFull()[0] ? this.getTypesFull()[0].color :
|
|
477
|
+
this.color = this.getTypesFull()[0] ? this.getTypesFull()[0].color : 0xf1c40f;
|
|
472
478
|
}
|
|
473
479
|
|
|
474
480
|
/**
|
|
@@ -492,9 +498,7 @@ class Reward {
|
|
|
492
498
|
* @returns {string}
|
|
493
499
|
*/
|
|
494
500
|
toString() {
|
|
495
|
-
const tokens = this.items.concat(
|
|
496
|
-
this.countedItems.map((i) => `${i.count > 1 ? i.count : ''} ${i.type}`.trim()),
|
|
497
|
-
);
|
|
501
|
+
const tokens = this.items.concat(this.countedItems.map((i) => `${i.count > 1 ? i.count : ''} ${i.type}`.trim()));
|
|
498
502
|
|
|
499
503
|
if (this.credits) {
|
|
500
504
|
tokens.push(`${this.credits}cr`);
|
package/lib/SentientOutpost.js
CHANGED
|
@@ -8,8 +8,8 @@ const sat = () => {
|
|
|
8
8
|
const cycleSeconds = now % duration;
|
|
9
9
|
// active range is after 30m and lasts for 30m
|
|
10
10
|
const active = cycleSeconds > 0 && cycleSeconds < 1800;
|
|
11
|
-
const start = (
|
|
12
|
-
const end = (
|
|
11
|
+
const start = (now - cycleSeconds) * 1000;
|
|
12
|
+
const end = (now - cycleSeconds + duration) * 1000;
|
|
13
13
|
|
|
14
14
|
return {
|
|
15
15
|
active,
|
|
@@ -40,15 +40,13 @@ const sat = () => {
|
|
|
40
40
|
* @property {Date} previous.expiry When the mission became or becomes inactive
|
|
41
41
|
*/
|
|
42
42
|
class SentientOutpost {
|
|
43
|
-
constructor(data, {
|
|
44
|
-
translator, locale, sentientData, logger,
|
|
45
|
-
}) {
|
|
43
|
+
constructor(data, { translator, locale, sentientData, logger }) {
|
|
46
44
|
// eslint-disable-next-line no-param-reassign
|
|
47
45
|
if (!data) data = '{"sfn":000}';
|
|
48
46
|
const node = (data.match(/\d{3}/g) || ['000'])[0];
|
|
49
47
|
const id = `CrewBattleNode${node}`;
|
|
50
48
|
if (node === '000') {
|
|
51
|
-
this.mission =
|
|
49
|
+
this.mission = undefined;
|
|
52
50
|
} else {
|
|
53
51
|
this.mission = {
|
|
54
52
|
node: translator.node(id, locale),
|
|
@@ -57,14 +55,14 @@ class SentientOutpost {
|
|
|
57
55
|
};
|
|
58
56
|
}
|
|
59
57
|
({ activation: this.activation, expiry: this.expiry } = sat());
|
|
60
|
-
this.active = this.mission
|
|
58
|
+
this.active = !!this.mission;
|
|
61
59
|
this.id = `${id}:${this.active}`;
|
|
62
60
|
|
|
63
61
|
if (!sentientData) {
|
|
64
62
|
logger.debug('No outpost data, skipping');
|
|
65
63
|
} else {
|
|
66
64
|
this.activation = new Date(sentientData.start * 1000);
|
|
67
|
-
this.expiry = new Date(
|
|
65
|
+
this.expiry = new Date(sentientData.end * 1000);
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
68
|
}
|
package/lib/Simaris.js
CHANGED
|
@@ -35,7 +35,7 @@ class Simaris {
|
|
|
35
35
|
* Whether or not the target is currently active
|
|
36
36
|
* @type {Boolean}
|
|
37
37
|
*/
|
|
38
|
-
this.isTargetActive = !
|
|
38
|
+
this.isTargetActive = !data.LastCompletedTargetType;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* A string representation of the current sanctuary status
|
|
@@ -49,8 +49,10 @@ class Simaris {
|
|
|
49
49
|
* @returns {string}
|
|
50
50
|
*/
|
|
51
51
|
toString() {
|
|
52
|
-
return
|
|
53
|
-
|
|
52
|
+
return (
|
|
53
|
+
`Simaris's ${this.isTargetActive ? 'current' : 'previous'} objective ` +
|
|
54
|
+
`${this.isTargetActive ? 'is' : 'was'} ${this.target}`
|
|
55
|
+
);
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
|
package/lib/Sortie.js
CHANGED
|
@@ -17,13 +17,16 @@ class Sortie extends WorldstateObject {
|
|
|
17
17
|
* @param {SortieVariant} deps.SortieVariant The sortie variant parser
|
|
18
18
|
* @param {string} deps.locale Locale to use for translations
|
|
19
19
|
*/
|
|
20
|
-
constructor(data, {
|
|
21
|
-
mdConfig, translator, timeDate, sortieData, SortieVariant, locale,
|
|
22
|
-
}) {
|
|
20
|
+
constructor(data, { mdConfig, translator, timeDate, sortieData, SortieVariant, locale }) {
|
|
23
21
|
super(data, { timeDate });
|
|
24
22
|
|
|
25
23
|
const opts = {
|
|
26
|
-
mdConfig,
|
|
24
|
+
mdConfig,
|
|
25
|
+
translator,
|
|
26
|
+
timeDate,
|
|
27
|
+
sortieData,
|
|
28
|
+
SortieVariant,
|
|
29
|
+
locale,
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
/**
|
|
@@ -135,14 +138,15 @@ class Sortie extends WorldstateObject {
|
|
|
135
138
|
*/
|
|
136
139
|
toString() {
|
|
137
140
|
if (this.isExpired()) {
|
|
138
|
-
return `${this.mdConfig.codeMulti}There's currently no sortie${this.mdConfig.lineEnd}
|
|
139
|
-
+ `${this.mdConfig.blockEnd}`;
|
|
141
|
+
return `${this.mdConfig.codeMulti}There's currently no sortie${this.mdConfig.lineEnd}${this.mdConfig.blockEnd}`;
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
const variantString = this.variants.map((v) => v.toString()).join('');
|
|
143
145
|
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
+
return (
|
|
147
|
+
`${this.mdConfig.codeMulti}${this.getBoss()}: ends in ${this.getETAString()}` +
|
|
148
|
+
`${this.mdConfig.doubleReturn}${variantString}${this.mdConfig.blockEnd}`
|
|
149
|
+
);
|
|
146
150
|
}
|
|
147
151
|
}
|
|
148
152
|
|
package/lib/SortieVariant.js
CHANGED
|
@@ -12,9 +12,7 @@ class SortieVariant {
|
|
|
12
12
|
* @param {Object} deps.sortieData The data used to parse sorties
|
|
13
13
|
* @param {string} deps.locale Locale to use for translations
|
|
14
14
|
*/
|
|
15
|
-
constructor(data, {
|
|
16
|
-
mdConfig, translator, locale,
|
|
17
|
-
}) {
|
|
15
|
+
constructor(data, { mdConfig, translator, locale }) {
|
|
18
16
|
/**
|
|
19
17
|
* The markdown settings
|
|
20
18
|
* @type {MarkdownSettings}
|
|
@@ -24,21 +22,21 @@ class SortieVariant {
|
|
|
24
22
|
Object.defineProperty(this, 'mdConfig', { enumerable: false, configurable: false });
|
|
25
23
|
|
|
26
24
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
* The variant's mission type
|
|
26
|
+
* @type {string}
|
|
27
|
+
*/
|
|
30
28
|
this.missionType = translator.missionType(data.missionType, locale);
|
|
31
29
|
|
|
32
30
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
* The variant's modifier
|
|
32
|
+
* @type {string}
|
|
33
|
+
*/
|
|
36
34
|
this.modifier = translator.sortieModifier(data.modifierType, locale);
|
|
37
35
|
|
|
38
36
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
* The variant's modifier description
|
|
38
|
+
* @type {string}
|
|
39
|
+
*/
|
|
42
40
|
this.modifierDescription = translator.sortieModDesc(data.modifierType, locale);
|
|
43
41
|
|
|
44
42
|
/**
|
|
@@ -53,7 +51,9 @@ class SortieVariant {
|
|
|
53
51
|
* @returns {string}
|
|
54
52
|
*/
|
|
55
53
|
toString() {
|
|
56
|
-
return `${this.node.padEnd(25, ' ')} | ${this.modifier.padEnd(20, ' ')} | ${this.missionType}${
|
|
54
|
+
return `${this.node.padEnd(25, ' ')} | ${this.modifier.padEnd(20, ' ')} | ${this.missionType}${
|
|
55
|
+
this.mdConfig.lineEnd
|
|
56
|
+
}`;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|