warframe-worldstate-parser 4.6.2 → 5.0.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/dist/Alert-BS8PWPP3.d.ts +45 -0
- package/dist/Alert-DH1kglDU.js +52 -0
- package/dist/Archidemea-C0EMRUKc.js +59 -0
- package/dist/Archidemea-DOh4trTM.d.ts +55 -0
- package/dist/Calendar-CgEkm6e6.d.ts +78 -0
- package/dist/Calendar-CtzZQXj7.js +81 -0
- package/dist/CambionCycle-C6NHUjOU.js +30 -0
- package/dist/CambionCycle-uEBpbMim.d.ts +23 -0
- package/dist/CetusCycle-DIZdevob.js +90 -0
- package/dist/CetusCycle-ooMM7hkg.d.ts +49 -0
- package/dist/ChallengeInstance-Bi2zg4q-.d.ts +53 -0
- package/dist/ChallengeInstance-DHwTTwMH.js +48 -0
- package/dist/ConclaveChallenge-Dp5yOxVu.js +80 -0
- package/dist/ConclaveChallenge-JbcEcL4s.d.ts +76 -0
- package/dist/ConstructionProgress-DfcpaGL5.js +25 -0
- package/dist/ConstructionProgress-FAySTEod.d.ts +19 -0
- package/dist/DailyDeal-BGqZAp-j.js +66 -0
- package/dist/DailyDeal-Na-EaiFS.d.ts +66 -0
- package/dist/DarkSector-BQ97_8h6.js +138 -0
- package/dist/DarkSector-zkCUywz1.d.ts +142 -0
- package/dist/DarkSectorBattle-5PyUPhxY.js +53 -0
- package/dist/DarkSectorBattle-DY33Bfuq.d.ts +53 -0
- package/dist/Dependency-DkOHLql6.d.ts +38 -0
- package/dist/DuviriChoice-DRNDUbyc.js +22 -0
- package/dist/DuviriChoice-MIHsOBS7.d.ts +18 -0
- package/dist/DuviriCycle-B0zp0KxS.d.ts +25 -0
- package/dist/DuviriCycle-CmHJStJo.js +58 -0
- package/dist/EarthCycle-B9aIOAEY.js +75 -0
- package/dist/EarthCycle-RELuZL01.d.ts +60 -0
- package/dist/ExternalMission-DCzJkPC8.d.ts +49 -0
- package/dist/Fissure-7yFmOet3.js +85 -0
- package/dist/Fissure-Bj61i8dc.d.ts +78 -0
- package/dist/FlashSale-BxVI0J6A.js +75 -0
- package/dist/FlashSale-PDG4uQq4.d.ts +71 -0
- package/dist/GlobalUpgrade-BRQXf3JM.d.ts +55 -0
- package/dist/GlobalUpgrade-B_TKK1m_.js +58 -0
- package/dist/ImgCdn-BnbJ9K-0.js +7 -0
- package/dist/Invasion-BMic1K12.js +110 -0
- package/dist/Invasion-BskF60zh.d.ts +113 -0
- package/dist/Kinepage-CRRKVulq.d.ts +22 -0
- package/dist/Kinepage-iWFwTZtr.js +24 -0
- package/dist/Kuva-DqkxvPUg.js +85 -0
- package/dist/KuvaLogEntry-d5fskHaK.d.ts +21 -0
- package/dist/MidrathCycle-BfQtfG4p.d.ts +25 -0
- package/dist/MidrathCycle-DDfT7zVx.js +69 -0
- package/dist/Mission-CWE16ouO.d.ts +138 -0
- package/dist/Mission-ZuSsAYNm.js +140 -0
- package/dist/News-7F8Nbp4A.js +122 -0
- package/dist/News-BfAgbYSY.d.ts +101 -0
- package/dist/Nightwave-DDX0_zJU.js +60 -0
- package/dist/Nightwave-_0RzWikV.d.ts +59 -0
- package/dist/NightwaveChallenge-DDdrqvge.d.ts +51 -0
- package/dist/NightwaveChallenge-DwilvXfi.js +53 -0
- package/dist/PersistentEnemy-DRcO4V2r.d.ts +79 -0
- package/dist/PersistentEnemy-axYxYzv_.js +76 -0
- package/dist/Reward-5VIpHu9A.d.ts +68 -0
- package/dist/Reward-OauJ45jJ.js +73 -0
- package/dist/RewardData-qEvfHYxA.js +76 -0
- package/dist/RewardTypes-Cfq9FeIl.js +328 -0
- package/dist/RewardTypes-DYaUn77A.d.ts +34 -0
- package/dist/SentientOutpost-B2KZUJ7H.js +65 -0
- package/dist/SentientOutpost-DmlClvel.d.ts +47 -0
- package/dist/Simaris-B9Mvso2q.js +35 -0
- package/dist/Simaris-Bc-jNhED.d.ts +37 -0
- package/dist/Sortie-DPv-7SQ-.d.ts +60 -0
- package/dist/Sortie-DcoAnEaJ.js +73 -0
- package/dist/SortieVariant-BFkYiBho.d.ts +49 -0
- package/dist/SortieVariant-eWuI1uh9.js +51 -0
- package/dist/SteelPathOffering-DyAzr3P9.js +85 -0
- package/dist/SteelPathOffering-OHNTCFo5.d.ts +38 -0
- package/dist/SyndicateJob-BK7OMLmv.js +141 -0
- package/dist/SyndicateJob-DOtXWjRF.d.ts +76 -0
- package/dist/SyndicateMission-5PZIEM8P.js +66 -0
- package/dist/SyndicateMission-DmGG5lGy.d.ts +58 -0
- package/dist/Tmp-DkQq1arD.js +21 -0
- package/dist/VallisCycle-BX8yyKx3.js +76 -0
- package/dist/VallisCycle-BXcmzqqG.d.ts +31 -0
- package/dist/VoidTrader-CbLMfEVj.js +77 -0
- package/dist/VoidTrader-CihLWgSV.d.ts +74 -0
- package/dist/VoidTraderItem-BzeD-S6-.js +38 -0
- package/dist/VoidTraderItem-CkYAKAEn.d.ts +43 -0
- package/dist/VoidTraderSchedule-C-K8Zdfk.js +14 -0
- package/dist/VoidTraderSchedule-DKDtu-9d.d.ts +16 -0
- package/dist/WeeklyChallenge-C6sc4j7i.d.ts +20 -0
- package/dist/WeeklyChallenge-MzUEZAjv.js +21 -0
- package/dist/WorldEvent-BS9QHG_f.d.ts +205 -0
- package/dist/WorldEvent-nis9w9cn.js +213 -0
- package/dist/WorldState-DNSPrZR_.d.ts +257 -0
- package/dist/WorldState-uppX0Xt1.js +330 -0
- package/dist/WorldstateObject-BSTYuZwm.js +54 -0
- package/dist/WorldstateObject-wfRTeGpm.d.ts +48 -0
- package/dist/ZarimanCycle-BJ84QUFg.js +81 -0
- package/dist/ZarimanCycle-CjNQXhVO.d.ts +45 -0
- package/dist/lib/Tmp.d.ts +24 -0
- package/dist/lib/Tmp.js +6 -0
- package/dist/lib/WorldState.d.ts +47 -0
- package/dist/lib/WorldState.js +49 -0
- package/dist/lib/models/Alert.d.ts +8 -0
- package/dist/lib/models/Alert.js +9 -0
- package/dist/lib/models/Archidemea.d.ts +2 -0
- package/dist/lib/models/Archidemea.js +3 -0
- package/dist/lib/models/Calendar.d.ts +3 -0
- package/dist/lib/models/Calendar.js +4 -0
- package/dist/lib/models/CambionCycle.d.ts +4 -0
- package/dist/lib/models/CambionCycle.js +4 -0
- package/dist/lib/models/CetusCycle.d.ts +3 -0
- package/dist/lib/models/CetusCycle.js +4 -0
- package/dist/lib/models/ChallengeInstance.d.ts +4 -0
- package/dist/lib/models/ChallengeInstance.js +3 -0
- package/dist/lib/models/ConclaveChallenge.d.ts +5 -0
- package/dist/lib/models/ConclaveChallenge.js +4 -0
- package/dist/lib/models/ConstructionProgress.d.ts +3 -0
- package/dist/lib/models/ConstructionProgress.js +4 -0
- package/dist/lib/models/DailyDeal.d.ts +5 -0
- package/dist/lib/models/DailyDeal.js +4 -0
- package/dist/lib/models/DarkSector.d.ts +9 -0
- package/dist/lib/models/DarkSector.js +10 -0
- package/dist/lib/models/DarkSectorBattle.d.ts +3 -0
- package/dist/lib/models/DarkSectorBattle.js +3 -0
- package/dist/lib/models/DuviriCycle.d.ts +4 -0
- package/dist/lib/models/DuviriCycle.js +4 -0
- package/dist/lib/models/EarthCycle.d.ts +3 -0
- package/dist/lib/models/EarthCycle.js +4 -0
- package/dist/lib/models/Fissure.d.ts +5 -0
- package/dist/lib/models/Fissure.js +4 -0
- package/dist/lib/models/FlashSale.d.ts +5 -0
- package/dist/lib/models/FlashSale.js +4 -0
- package/dist/lib/models/GlobalUpgrade.d.ts +5 -0
- package/dist/lib/models/GlobalUpgrade.js +4 -0
- package/dist/lib/models/Invasion.d.ts +7 -0
- package/dist/lib/models/Invasion.js +8 -0
- package/dist/lib/models/Kinepage.d.ts +2 -0
- package/dist/lib/models/Kinepage.js +3 -0
- package/dist/lib/models/Kuva.d.ts +22 -0
- package/dist/lib/models/Kuva.js +3 -0
- package/dist/lib/models/MidrathCycle.d.ts +3 -0
- package/dist/lib/models/MidrathCycle.js +4 -0
- package/dist/lib/models/Mission.d.ts +6 -0
- package/dist/lib/models/Mission.js +7 -0
- package/dist/lib/models/News.d.ts +3 -0
- package/dist/lib/models/News.js +5 -0
- package/dist/lib/models/Nightwave.d.ts +4 -0
- package/dist/lib/models/Nightwave.js +5 -0
- package/dist/lib/models/NightwaveChallenge.d.ts +3 -0
- package/dist/lib/models/NightwaveChallenge.js +4 -0
- package/dist/lib/models/PersistentEnemy.d.ts +3 -0
- package/dist/lib/models/PersistentEnemy.js +4 -0
- package/dist/lib/models/Reward.d.ts +5 -0
- package/dist/lib/models/Reward.js +6 -0
- package/dist/lib/models/SentientOutpost.d.ts +4 -0
- package/dist/lib/models/SentientOutpost.js +3 -0
- package/dist/lib/models/Simaris.d.ts +4 -0
- package/dist/lib/models/Simaris.js +3 -0
- package/dist/lib/models/Sortie.d.ts +9 -0
- package/dist/lib/models/Sortie.js +10 -0
- package/dist/lib/models/SortieVariant.d.ts +4 -0
- package/dist/lib/models/SortieVariant.js +3 -0
- package/dist/lib/models/SteelPathOffering.d.ts +2 -0
- package/dist/lib/models/SteelPathOffering.js +3 -0
- package/dist/lib/models/SyndicateJob.d.ts +5 -0
- package/dist/lib/models/SyndicateJob.js +4 -0
- package/dist/lib/models/SyndicateMission.d.ts +6 -0
- package/dist/lib/models/SyndicateMission.js +5 -0
- package/dist/lib/models/VallisCycle.d.ts +3 -0
- package/dist/lib/models/VallisCycle.js +4 -0
- package/dist/lib/models/VoidTrader.d.ts +7 -0
- package/dist/lib/models/VoidTrader.js +6 -0
- package/dist/lib/models/VoidTraderItem.d.ts +4 -0
- package/dist/lib/models/VoidTraderItem.js +3 -0
- package/dist/lib/models/VoidTraderSchedule.d.ts +4 -0
- package/dist/lib/models/VoidTraderSchedule.js +3 -0
- package/dist/lib/models/WeeklyChallenge.d.ts +6 -0
- package/dist/lib/models/WeeklyChallenge.js +5 -0
- package/dist/lib/models/WorldEvent.d.ts +8 -0
- package/dist/lib/models/WorldEvent.js +9 -0
- package/dist/lib/models/WorldstateObject.d.ts +2 -0
- package/dist/lib/models/WorldstateObject.js +3 -0
- package/dist/lib/models/ZarimanCycle.d.ts +3 -0
- package/dist/lib/models/ZarimanCycle.js +4 -0
- package/dist/lib/supporting/Dependency.d.ts +3 -0
- package/dist/lib/supporting/Dependency.js +1 -0
- package/dist/lib/supporting/DuviriChoice.d.ts +3 -0
- package/dist/lib/supporting/DuviriChoice.js +3 -0
- package/dist/lib/supporting/ExternalMission.d.ts +2 -0
- package/dist/lib/supporting/ExternalMission.js +1 -0
- package/dist/lib/supporting/ImgCdn.d.ts +6 -0
- package/dist/lib/supporting/ImgCdn.js +3 -0
- package/dist/lib/supporting/KuvaLogEntry.d.ts +2 -0
- package/dist/lib/supporting/KuvaLogEntry.js +1 -0
- package/dist/lib/supporting/RewardData.d.ts +11 -0
- package/dist/lib/supporting/RewardData.js +3 -0
- package/dist/lib/supporting/RewardTypes.d.ts +2 -0
- package/dist/lib/supporting/RewardTypes.js +5 -0
- package/dist/main.d.ts +47 -0
- package/dist/main.js +49 -0
- package/dist/resources/.gitkeep +1 -0
- package/dist/resources/alt_helmet_thumb.png +0 -0
- package/dist/resources/aura_thumb.png +0 -0
- package/dist/resources/clantech_thmb.png +0 -0
- package/dist/resources/endo_thumb.png +0 -0
- package/dist/resources/exilus_thumb.png +0 -0
- package/dist/resources/forma_thumb.png +0 -0
- package/dist/resources/glaive_thumb.png +0 -0
- package/dist/resources/mutalist_thumb.png +0 -0
- package/dist/resources/nightmare_thumb.png +0 -0
- package/dist/resources/nitain_thumb.png +0 -0
- package/dist/resources/potato_thumb.png +0 -0
- package/dist/resources/resource_thumb.png +0 -0
- package/dist/resources/vauban_thumb.png +0 -0
- package/dist/resources/weapon_skin_thumb.png +0 -0
- package/package.json +9 -11
- package/lib/WorldState.js +0 -404
- package/lib/models/Alert.js +0 -90
- package/lib/models/Calendar.js +0 -74
- package/lib/models/CambionCycle.js +0 -32
- package/lib/models/CetusCycle.js +0 -126
- package/lib/models/ChallengeInstance.js +0 -57
- package/lib/models/ConclaveChallenge.js +0 -154
- package/lib/models/ConstructionProgress.js +0 -31
- package/lib/models/DailyDeal.js +0 -103
- package/lib/models/DarkSector.js +0 -154
- package/lib/models/DarkSectorBattle.js +0 -56
- package/lib/models/DeepArchidemea.js +0 -33
- package/lib/models/DuviriCycle.js +0 -65
- package/lib/models/EarthCycle.js +0 -119
- package/lib/models/Fissure.js +0 -136
- package/lib/models/FlashSale.js +0 -123
- package/lib/models/GlobalUpgrade.js +0 -122
- package/lib/models/Invasion.js +0 -183
- package/lib/models/Kinepage.js +0 -11
- package/lib/models/Kuva.js +0 -122
- package/lib/models/MidrathCycle.js +0 -94
- package/lib/models/Mission.js +0 -179
- package/lib/models/News.js +0 -174
- package/lib/models/Nightwave.js +0 -91
- package/lib/models/NightwaveChallenge.js +0 -63
- package/lib/models/PersistentEnemy.js +0 -100
- package/lib/models/Reward.js +0 -111
- package/lib/models/SentientOutpost.js +0 -68
- package/lib/models/Simaris.js +0 -47
- package/lib/models/Sortie.js +0 -143
- package/lib/models/SortieVariant.js +0 -57
- package/lib/models/SteelPathOffering.js +0 -99
- package/lib/models/SyndicateJob.js +0 -185
- package/lib/models/SyndicateMission.js +0 -111
- package/lib/models/VallisCycle.js +0 -125
- package/lib/models/VoidTrader.js +0 -134
- package/lib/models/VoidTraderItem.js +0 -24
- package/lib/models/VoidTraderSchedule.js +0 -8
- package/lib/models/WeeklyChallenge.js +0 -27
- package/lib/models/WorldEvent.js +0 -326
- package/lib/models/WorldstateObject.js +0 -106
- package/lib/models/ZarimanCycle.js +0 -124
- package/lib/supporting/Dependency.js +0 -6
- package/lib/supporting/DuviriChoice.js +0 -16
- package/lib/supporting/ExternalMission.js +0 -13
- package/lib/supporting/ImgCdn.js +0 -9
- package/lib/supporting/MarkdownSettings.js +0 -30
- package/lib/supporting/RewardData.js +0 -77
- package/lib/supporting/RewardTypes.js +0 -327
- package/main.js +0 -4
- package/types/lib/WorldState.d.ts +0 -199
- package/types/lib/models/Alert.d.ts +0 -53
- package/types/lib/models/Calendar.d.ts +0 -16
- package/types/lib/models/CambionCycle.d.ts +0 -20
- package/types/lib/models/CetusCycle.d.ts +0 -47
- package/types/lib/models/ChallengeInstance.d.ts +0 -42
- package/types/lib/models/ConclaveChallenge.d.ts +0 -90
- package/types/lib/models/ConstructionProgress.d.ts +0 -14
- package/types/lib/models/DailyDeal.d.ts +0 -78
- package/types/lib/models/DarkSector.d.ts +0 -121
- package/types/lib/models/DarkSectorBattle.d.ts +0 -44
- package/types/lib/models/DeepArchidemea.d.ts +0 -8
- package/types/lib/models/DuviriCycle.d.ts +0 -21
- package/types/lib/models/EarthCycle.d.ts +0 -64
- package/types/lib/models/Fissure.d.ts +0 -83
- package/types/lib/models/FlashSale.d.ts +0 -86
- package/types/lib/models/GlobalUpgrade.d.ts +0 -86
- package/types/lib/models/Invasion.d.ts +0 -124
- package/types/lib/models/Kinepage.d.ts +0 -6
- package/types/lib/models/Kuva.d.ts +0 -60
- package/types/lib/models/MidrathCycle.d.ts +0 -39
- package/types/lib/models/Mission.d.ts +0 -136
- package/types/lib/models/News.d.ts +0 -104
- package/types/lib/models/Nightwave.d.ts +0 -53
- package/types/lib/models/NightwaveChallenge.d.ts +0 -45
- package/types/lib/models/PersistentEnemy.d.ts +0 -70
- package/types/lib/models/Reward.d.ts +0 -95
- package/types/lib/models/SentientOutpost.d.ts +0 -54
- package/types/lib/models/Simaris.d.ts +0 -33
- package/types/lib/models/Sortie.d.ts +0 -72
- package/types/lib/models/SortieVariant.d.ts +0 -43
- package/types/lib/models/SteelPathOffering.d.ts +0 -19
- package/types/lib/models/SyndicateJob.d.ts +0 -72
- package/types/lib/models/SyndicateMission.d.ts +0 -56
- package/types/lib/models/VallisCycle.d.ts +0 -53
- package/types/lib/models/VoidTrader.d.ts +0 -45
- package/types/lib/models/VoidTraderItem.d.ts +0 -25
- package/types/lib/models/VoidTraderSchedule.d.ts +0 -7
- package/types/lib/models/WeeklyChallenge.d.ts +0 -12
- package/types/lib/models/WorldEvent.d.ts +0 -216
- package/types/lib/models/WorldstateObject.d.ts +0 -120
- package/types/lib/models/ZarimanCycle.d.ts +0 -42
- package/types/lib/supporting/Dependency.d.ts +0 -7
- package/types/lib/supporting/DuviriChoice.d.ts +0 -9
- package/types/lib/supporting/ExternalMission.d.ts +0 -48
- package/types/lib/supporting/ImgCdn.d.ts +0 -3
- package/types/lib/supporting/MarkdownSettings.d.ts +0 -30
- package/types/lib/supporting/RewardData.d.ts +0 -9
- package/types/lib/supporting/RewardTypes.d.ts +0 -8
- package/types/main.d.ts +0 -3
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { fromNow, timeDeltaToString } from 'warframe-worldstate-data/utilities';
|
|
2
|
-
|
|
3
|
-
import mdConfig from '../supporting/MarkdownSettings.js';
|
|
4
|
-
|
|
5
|
-
import WorldstateObject from './WorldstateObject.js';
|
|
6
|
-
|
|
7
|
-
const lStart = new Date('November 10, 2018 08:13:48 UTC');
|
|
8
|
-
const loopTime = 1600000;
|
|
9
|
-
const warmTime = 400000;
|
|
10
|
-
const coldTime = loopTime - warmTime;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @typedef {object} CurrentCycle
|
|
14
|
-
* @property {string} state - Current cycle state. One of `warm`, `cold`
|
|
15
|
-
* @property {number} toNextMinor - Time remaining in the current cycle state
|
|
16
|
-
* @property {number} toNextFull - Time remaining until the next cycle
|
|
17
|
-
* @property {Date} timeAtPrevious - Date and time at which the event started
|
|
18
|
-
* @property {Date} timeAtNext - Date and time at which the event start
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Get the current cycle state for Orb Vallis
|
|
23
|
-
* @returns {CurrentCycle} current cycle state
|
|
24
|
-
*/
|
|
25
|
-
function getCurrentCycle() {
|
|
26
|
-
const sinceLast = (Date.now() - lStart) % loopTime;
|
|
27
|
-
const toNextFull = loopTime - sinceLast;
|
|
28
|
-
let state = 'cold';
|
|
29
|
-
if (toNextFull > coldTime) {
|
|
30
|
-
state = 'warm';
|
|
31
|
-
}
|
|
32
|
-
let toNextMinor;
|
|
33
|
-
if (toNextFull < coldTime) {
|
|
34
|
-
toNextMinor = toNextFull;
|
|
35
|
-
} else {
|
|
36
|
-
toNextMinor = toNextFull - coldTime;
|
|
37
|
-
}
|
|
38
|
-
const milliAtNext = Date.now() + toNextMinor;
|
|
39
|
-
const milliAtPrev = Date.now() + toNextFull - (state === 'warm' ? loopTime : coldTime);
|
|
40
|
-
const timeAtPrevious = new Date(milliAtPrev);
|
|
41
|
-
timeAtPrevious.setSeconds(0);
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
state,
|
|
45
|
-
toNextMinor,
|
|
46
|
-
toNextFull,
|
|
47
|
-
timeAtNext: new Date(milliAtNext),
|
|
48
|
-
timeAtPrevious,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Represents the current Earth Day/Night Cycle
|
|
54
|
-
* @augments {WorldstateObject}
|
|
55
|
-
*/
|
|
56
|
-
export default class VallisCycle extends WorldstateObject {
|
|
57
|
-
/**
|
|
58
|
-
* The current cetus cycle, for calculating the other fields
|
|
59
|
-
* @property {string} state - Current cycle state. One of `warm`, `cold`
|
|
60
|
-
* @property {number} toNextMinor - Time remaining in the current cycle state
|
|
61
|
-
* @property {number} toNextFull - Time remaining until the next cycle
|
|
62
|
-
* @property {Date} timeAtPrevious - Date and time at which the event started
|
|
63
|
-
* @private
|
|
64
|
-
*/
|
|
65
|
-
#ec = getCurrentCycle();
|
|
66
|
-
|
|
67
|
-
constructor() {
|
|
68
|
-
super({ _id: { $oid: 'vallisCycle0' } });
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The date and time at which the event ends
|
|
72
|
-
* @type {Date}
|
|
73
|
-
*/
|
|
74
|
-
this.expiry = this.#ec.timeAtNext;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Whether or not this it's daytime
|
|
78
|
-
* @type {boolean}
|
|
79
|
-
*/
|
|
80
|
-
this.isWarm = this.#ec.state === 'warm';
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Current cycle state. One of `warm`, `cold`
|
|
84
|
-
* @type {string}
|
|
85
|
-
*/
|
|
86
|
-
this.state = this.#ec.state;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Date and time at which the event started
|
|
90
|
-
* @type {Date}
|
|
91
|
-
*/
|
|
92
|
-
this.activation = this.#ec.timeAtPrevious;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Time remaining string
|
|
96
|
-
* @type {string}
|
|
97
|
-
*/
|
|
98
|
-
this.timeLeft = timeDeltaToString(this.#ec.toNextMinor);
|
|
99
|
-
|
|
100
|
-
this.id = `vallisCycle${this.#ec.timeAtPrevious.getTime()}`;
|
|
101
|
-
|
|
102
|
-
this.shortString = `${this.timeLeft.replace(/\s\d*s/gi, '')} to ${this.isWarm ? 'Cold' : 'Warm'}`;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Get whether or not the event has expired
|
|
107
|
-
* @returns {boolean} whether this event has expired
|
|
108
|
-
*/
|
|
109
|
-
getExpired() {
|
|
110
|
-
return fromNow(this.expiry) < 0;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* The event's string representation
|
|
115
|
-
* @returns {string} the event's string representation
|
|
116
|
-
*/
|
|
117
|
-
toString() {
|
|
118
|
-
const lines = [
|
|
119
|
-
`Operator, the Orb Vallis is currently ${this.isWarm ? 'Warm' : 'Cold'}`,
|
|
120
|
-
`Time remaining until ${this.isWarm ? 'Cold' : 'Warm'}: ${this.timeLeft}`,
|
|
121
|
-
];
|
|
122
|
-
|
|
123
|
-
return lines.join(mdConfig.lineEnd);
|
|
124
|
-
}
|
|
125
|
-
}
|
package/lib/models/VoidTrader.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { fromNow, parseDate, timeDeltaToString, node, insist } from 'warframe-worldstate-data/utilities';
|
|
2
|
-
|
|
3
|
-
import mdConfig from '../supporting/MarkdownSettings.js';
|
|
4
|
-
|
|
5
|
-
import WorldstateObject from './WorldstateObject.js';
|
|
6
|
-
import VoidTraderItem from './VoidTraderItem.js';
|
|
7
|
-
import VoidTraderSchedule from './VoidTraderSchedule.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Represents a void trader
|
|
11
|
-
* @augments {WorldstateObject}
|
|
12
|
-
*/
|
|
13
|
-
export default class VoidTrader extends WorldstateObject {
|
|
14
|
-
/**
|
|
15
|
-
* @param {object} data The Void trader data
|
|
16
|
-
* @param {object} deps The dependencies object
|
|
17
|
-
* @param {string} deps.locale Locale to use for translations
|
|
18
|
-
*/
|
|
19
|
-
constructor(data, { locale = 'en' } = { locale: 'en' }) {
|
|
20
|
-
super(data);
|
|
21
|
-
insist(data, 'Activation', 'Expiry');
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The date and time at which the void trader arrives
|
|
25
|
-
* @type {Date}
|
|
26
|
-
*/
|
|
27
|
-
this.activation = parseDate(data.Activation);
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The date and time at which the void trader leaves
|
|
31
|
-
* @type {Date}
|
|
32
|
-
*/
|
|
33
|
-
this.expiry = parseDate(data.Expiry);
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The void trader's name
|
|
37
|
-
* @type {string}
|
|
38
|
-
*/
|
|
39
|
-
this.character = data.Character ? data.Character.replace("Baro'Ki Teel", "Baro Ki'Teer") : '';
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The node at which the Void Trader appears
|
|
43
|
-
* @type {string}
|
|
44
|
-
*/
|
|
45
|
-
this.location = node(data.Node, locale);
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* The trader's inventory
|
|
49
|
-
* @type {VoidTraderItem[]}
|
|
50
|
-
*/
|
|
51
|
-
this.inventory = data.Manifest ? data.Manifest.map((i) => new VoidTraderItem(i, { locale })) : [];
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Pseudo Identifier for identifying changes in inventory
|
|
55
|
-
* @type {string}
|
|
56
|
-
*/
|
|
57
|
-
this.psId = `${this.id}${this.inventory.length}`;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Whether or not the void trader is active (at time of object creation)
|
|
61
|
-
* @type {boolean}
|
|
62
|
-
*/
|
|
63
|
-
this.active = this.isActive();
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* A string indicating how long it will take for the trader to arrive
|
|
67
|
-
* (at time of object creation)
|
|
68
|
-
* @type {string}
|
|
69
|
-
*/
|
|
70
|
-
this.startString = this.getStartString();
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* A string indicating how long it will take for the trader to leave
|
|
74
|
-
* (at time of object creation)
|
|
75
|
-
* @type {string}
|
|
76
|
-
*/
|
|
77
|
-
this.endString = this.getEndString();
|
|
78
|
-
|
|
79
|
-
this.initialStart = parseDate(data.InitialStartDate);
|
|
80
|
-
this.completed = data.Completed;
|
|
81
|
-
this.schedule = data.ScheduleInfo ? data.ScheduleInfo.map((i) => new VoidTraderSchedule(i, { locale })) : [];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Get whether or not the trader is currently active
|
|
86
|
-
* @returns {boolean} whether the trader is active
|
|
87
|
-
*/
|
|
88
|
-
isActive() {
|
|
89
|
-
return fromNow(this.activation) < 0 && fromNow(this.expiry) > 0;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Get a string indicating how long it will take for the trader to arrive
|
|
94
|
-
* @returns {string} time delta string from now to the start
|
|
95
|
-
*/
|
|
96
|
-
getStartString() {
|
|
97
|
-
return timeDeltaToString(fromNow(this.activation));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Get a string indicating how long it will take for the trader to leave
|
|
102
|
-
* @returns {string} time delta string from now to the end
|
|
103
|
-
*/
|
|
104
|
-
getEndString() {
|
|
105
|
-
return timeDeltaToString(fromNow(this.expiry));
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Returns a string representation of the trader
|
|
110
|
-
* @returns {string} string representation
|
|
111
|
-
*/
|
|
112
|
-
toString() {
|
|
113
|
-
if (!this.isActive()) {
|
|
114
|
-
const timeDelta = fromNow(this.activation);
|
|
115
|
-
const nextArrivalTime = timeDeltaToString(timeDelta);
|
|
116
|
-
return (
|
|
117
|
-
`${mdConfig.codeBlock}${this.character} is not here yet, he will arrive in ` +
|
|
118
|
-
`${nextArrivalTime} at ${this.location}${mdConfig.blockEnd}`
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const inventoryString = this.inventory
|
|
123
|
-
.map((i) => ` ${i.item} - ${i.ducats} ducats + ${i.credits}cr%s`)
|
|
124
|
-
.join(mdConfig.lineEnd);
|
|
125
|
-
|
|
126
|
-
const lines = [
|
|
127
|
-
`${mdConfig.codeBlock}Void Trader at ${this.location}`,
|
|
128
|
-
inventoryString,
|
|
129
|
-
`Trader departing in ${this.getEndString()}${mdConfig.blockEnd}`,
|
|
130
|
-
];
|
|
131
|
-
|
|
132
|
-
return lines.join(mdConfig.lineEnd);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { languageString } from 'warframe-worldstate-data/utilities';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A void trader inventory item
|
|
5
|
-
* @property {string} item The name of the inventory item
|
|
6
|
-
* @property {number|string} ducats Ducat cost of the item
|
|
7
|
-
* @property {number|string} credits Credit cost of the item
|
|
8
|
-
*/
|
|
9
|
-
export default class VoidTraderItem {
|
|
10
|
-
/**
|
|
11
|
-
* @param {object} data The void trader item data
|
|
12
|
-
* @param {string} data.ItemType Worldstate Item i18n path
|
|
13
|
-
* @param {string} data.PrimePrice Ducat cost of the item
|
|
14
|
-
* @param {string} data.RegularPrice Credit price of the item
|
|
15
|
-
* @param {Dependency} deps The dependencies object
|
|
16
|
-
* @param {string} deps.locale Locale to use for translations
|
|
17
|
-
*/
|
|
18
|
-
constructor({ ItemType, PrimePrice, RegularPrice }, { locale = 'en' } = { locale: 'en' }) {
|
|
19
|
-
this.uniqueName = ItemType;
|
|
20
|
-
this.item = languageString(ItemType, locale);
|
|
21
|
-
this.ducats = Number.parseInt(PrimePrice, 10);
|
|
22
|
-
this.credits = Number.parseInt(RegularPrice, 10);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { parseDate, languageString } from 'warframe-worldstate-data/utilities';
|
|
2
|
-
|
|
3
|
-
export default class VoidTraderSchedule {
|
|
4
|
-
constructor(data, { locale = 'en' } = { locale: 'en' }) {
|
|
5
|
-
this.expiry = parseDate(data.Expiry);
|
|
6
|
-
this.item = languageString(data.FeaturedItem, locale);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import WorldstateObject from './WorldstateObject.js';
|
|
2
|
-
import ChallengeInstance from './ChallengeInstance.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Represents a void trader
|
|
6
|
-
* @augments {WorldstateObject}
|
|
7
|
-
*/
|
|
8
|
-
export default class WeeklyChallenge extends WorldstateObject {
|
|
9
|
-
/**
|
|
10
|
-
* @param {object} data The Void trader data
|
|
11
|
-
*/
|
|
12
|
-
constructor(data) {
|
|
13
|
-
super(data);
|
|
14
|
-
|
|
15
|
-
this.challenges = data.Challenges.map((challengeData) => new ChallengeInstance(challengeData));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Returns a string representation of the trader
|
|
20
|
-
* @returns {string} string representation
|
|
21
|
-
*/
|
|
22
|
-
toString() {
|
|
23
|
-
return `Starts: ${this.getStartString()}\nEnds: ${this.getEndString()}\nChallenges:\n${this.challenges
|
|
24
|
-
.map((challenge) => `\t${challenge.toString()}`)
|
|
25
|
-
.join('\n')}`;
|
|
26
|
-
}
|
|
27
|
-
}
|
package/lib/models/WorldEvent.js
DELETED
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
import { fromNow, parseDate, faction, languageString, node, syndicate } from 'warframe-worldstate-data/utilities';
|
|
2
|
-
|
|
3
|
-
import mdConfig from '../supporting/MarkdownSettings.js';
|
|
4
|
-
|
|
5
|
-
import WorldstateObject from './WorldstateObject.js';
|
|
6
|
-
import SyndicateJob from './SyndicateJob.js';
|
|
7
|
-
import Reward from './Reward.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Interim step for an event reward system.
|
|
11
|
-
* @typedef {object} InterimStep
|
|
12
|
-
* @property {number} goal Goal amount
|
|
13
|
-
* @property {Reward} reward Reward for reaching the step
|
|
14
|
-
* @property {number} winnerCount Amount of players at this step
|
|
15
|
-
* @property {object} message Message received when reaching the interim step
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Progress for one of multiple stages
|
|
20
|
-
* @typedef {object} ProgressStep
|
|
21
|
-
* @property {string} type Type of progress
|
|
22
|
-
* @property {number} progressAmt Amount of progress
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Represents an in-game special event
|
|
27
|
-
* @augments {WorldstateObject}
|
|
28
|
-
*/
|
|
29
|
-
export default class WorldEvent extends WorldstateObject {
|
|
30
|
-
/**
|
|
31
|
-
* Asynchronously build a new WorldEvent
|
|
32
|
-
* @param {object} data The event data
|
|
33
|
-
* @param {object} deps The dependencies object
|
|
34
|
-
* @param {string} deps.locale Locale to use for translations
|
|
35
|
-
* @returns {Promise.<WorldEvent>} The created WorldEvent object
|
|
36
|
-
*/
|
|
37
|
-
static async build(data, deps) {
|
|
38
|
-
const event = new WorldEvent(data, deps);
|
|
39
|
-
if (data.Jobs) {
|
|
40
|
-
const jobs = [];
|
|
41
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
42
|
-
for await (const job of data.Jobs ?? []) {
|
|
43
|
-
jobs.push(await SyndicateJob.build(job, event.expiry, deps));
|
|
44
|
-
}
|
|
45
|
-
event.jobs = jobs;
|
|
46
|
-
}
|
|
47
|
-
if (data.PreviousJobs) {
|
|
48
|
-
const previousJobs = [];
|
|
49
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
50
|
-
for await (const job of data.PreviousJobs ?? []) {
|
|
51
|
-
previousJobs.push(await SyndicateJob.build(job, event.expiry, deps));
|
|
52
|
-
}
|
|
53
|
-
event.previousJobs = previousJobs;
|
|
54
|
-
}
|
|
55
|
-
return event;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @param {object} data The event data
|
|
60
|
-
* @param {object} deps The dependencies object
|
|
61
|
-
* @param {string} deps.locale Locale to use for translations
|
|
62
|
-
*/
|
|
63
|
-
constructor(data, { locale = 'en' } = { locale: 'en' }) {
|
|
64
|
-
super(data);
|
|
65
|
-
|
|
66
|
-
const opts = {
|
|
67
|
-
locale,
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The date and time at which the event ends
|
|
72
|
-
* @type {Date}
|
|
73
|
-
*/
|
|
74
|
-
this.expiry = parseDate(data.Expiry);
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* The event's main score goal
|
|
78
|
-
* @type {number}
|
|
79
|
-
*/
|
|
80
|
-
this.maximumScore = Number.parseInt(data.Goal, 10);
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* The current score on the event
|
|
84
|
-
* @type {number}
|
|
85
|
-
*/
|
|
86
|
-
this.currentScore = Number.parseInt(data.Count, 10);
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* The first intermediate score goal
|
|
90
|
-
* @type {?number}
|
|
91
|
-
*/
|
|
92
|
-
this.smallInterval = Number.parseInt(data.GoalInterim, 10);
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* The second intermediate score goal
|
|
96
|
-
* @type {?number}
|
|
97
|
-
*/
|
|
98
|
-
this.largeInterval = Number.parseInt(data.GoalInterim2, 10);
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* The faction that the players must fight in the event
|
|
102
|
-
* @type {string}
|
|
103
|
-
*/
|
|
104
|
-
this.faction = faction(data.Faction, locale);
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* The description of the event
|
|
108
|
-
* @type {string}
|
|
109
|
-
*/
|
|
110
|
-
this.description = languageString(data.Desc, locale);
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Tooltip for the event
|
|
114
|
-
* @type {?string}
|
|
115
|
-
*/
|
|
116
|
-
this.tooltip = languageString(data.ToolTip, locale);
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* The node where the event takes place
|
|
120
|
-
* @type {?string}
|
|
121
|
-
*/
|
|
122
|
-
this.node = node(data.Node, locale);
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* The other nodes where the event takes place
|
|
126
|
-
* @type {string[]}
|
|
127
|
-
*/
|
|
128
|
-
this.concurrentNodes = data.ConcurrentNodes ? data.ConcurrentNodes.map((n) => node(n), locale) : [];
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* The victim node
|
|
132
|
-
* @type {?string}
|
|
133
|
-
*/
|
|
134
|
-
this.victimNode = node(data.VictimNode, locale);
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* The score description
|
|
138
|
-
* @type {?string}
|
|
139
|
-
*/
|
|
140
|
-
this.scoreLocTag = data.Fomorian ? 'Fomorian Assault Score' : languageString(data.ScoreLocTag, locale);
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* The event's rewards
|
|
144
|
-
* @type {Reward[]}
|
|
145
|
-
*/
|
|
146
|
-
this.rewards = Object.keys(data)
|
|
147
|
-
.filter((k) => k.includes('Reward') || k.includes('reward'))
|
|
148
|
-
.map((k) => new Reward(data[k], opts));
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Whether or not this is expired (at time of object creation)
|
|
152
|
-
* @type {boolean}
|
|
153
|
-
*/
|
|
154
|
-
this.expired = this.getExpired();
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Health remaining for the target
|
|
158
|
-
* @type {number}
|
|
159
|
-
*/
|
|
160
|
-
this.health =
|
|
161
|
-
typeof data.HealthPct !== 'undefined' ? Number.parseFloat(((data.HealthPct || 0.0) * 100).toFixed(2)) : undefined;
|
|
162
|
-
|
|
163
|
-
this.jobs = [];
|
|
164
|
-
this.previousJobs = [];
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Previous job id
|
|
168
|
-
* @type {string}
|
|
169
|
-
*/
|
|
170
|
-
this.previousId = (data.JobPreviousVersion || {}).$oid;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Array of steps
|
|
174
|
-
* @type {InterimStep[]}
|
|
175
|
-
*/
|
|
176
|
-
this.interimSteps = [];
|
|
177
|
-
|
|
178
|
-
(data.InterimRewards || []).forEach((reward, index) => {
|
|
179
|
-
const msg = (data.InterimRewardMessages || [])[index] || {};
|
|
180
|
-
this.interimSteps[index] = {
|
|
181
|
-
goal: Number.parseInt(data.InterimGoals[index], 10),
|
|
182
|
-
reward: reward ? new Reward(reward, opts) : undefined,
|
|
183
|
-
message: {
|
|
184
|
-
sender: languageString(msg.sender, locale),
|
|
185
|
-
subject: languageString(msg.subject, locale),
|
|
186
|
-
message: languageString(msg.message, locale),
|
|
187
|
-
senderIcon: msg.senderIcon,
|
|
188
|
-
attachments: msg.attachments,
|
|
189
|
-
},
|
|
190
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
191
|
-
winnerCount: (data._interimWinnerCounts || [])[index],
|
|
192
|
-
};
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Progress Steps, if any are present
|
|
197
|
-
* @type {ProgressStep[]}
|
|
198
|
-
*/
|
|
199
|
-
this.progressSteps = [];
|
|
200
|
-
|
|
201
|
-
if (data.IsMultiProgress) {
|
|
202
|
-
data.Types.forEach((type, index) => {
|
|
203
|
-
this.progressSteps[index] = {
|
|
204
|
-
type: languageString(type, locale),
|
|
205
|
-
progressAmt: Number.parseInt(data.MultiProgress[index], 10),
|
|
206
|
-
};
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Total of all MultiProgress
|
|
211
|
-
* @type {number}
|
|
212
|
-
*/
|
|
213
|
-
this.progressTotal = Number.parseFloat(data.MultiProgress.reduce((accumulator, val) => accumulator + val));
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Whether to show the total score at the end of the mission
|
|
218
|
-
* @type {boolean}
|
|
219
|
-
*/
|
|
220
|
-
this.showTotalAtEndOfMission = data.ShowTotalAtEOM;
|
|
221
|
-
/**
|
|
222
|
-
* Whether the event is personal
|
|
223
|
-
* @type {boolean}
|
|
224
|
-
*/
|
|
225
|
-
this.isPersonal = data.Personal;
|
|
226
|
-
/**
|
|
227
|
-
* Whether the event is community
|
|
228
|
-
* @type {boolean}
|
|
229
|
-
*/
|
|
230
|
-
this.isCommunity = data.Community;
|
|
231
|
-
|
|
232
|
-
/*
|
|
233
|
-
* Affectors for this mission
|
|
234
|
-
* @type {string[]}
|
|
235
|
-
*/
|
|
236
|
-
this.regionDrops = (data.RegionDrops || []).map((drop) => languageString(drop, locale));
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Archwing Drops in effect while this event is active
|
|
240
|
-
* @type {string[]}
|
|
241
|
-
*/
|
|
242
|
-
this.archwingDrops = (data.ArchwingDrops || []).map((drop) => languageString(drop, locale));
|
|
243
|
-
|
|
244
|
-
this.asString = this.toString();
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Metadata provided by DE
|
|
248
|
-
* @type {object}
|
|
249
|
-
*/
|
|
250
|
-
this.metadata = JSON.parse((data.Metadata || '{}').replace('" ', '"'));
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Bonuses given for completion
|
|
254
|
-
* @type {Array.<number>}
|
|
255
|
-
*/
|
|
256
|
-
this.completionBonuses = data.CompletionBonus || [];
|
|
257
|
-
|
|
258
|
-
this.scoreVar = data.ScoreVar;
|
|
259
|
-
|
|
260
|
-
this.altExpiry = parseDate(data.AltExpiry);
|
|
261
|
-
this.altActivation = parseDate(data.AltActivation);
|
|
262
|
-
|
|
263
|
-
this.nextAlt = {
|
|
264
|
-
expiry: parseDate(data.NextAltExpiry),
|
|
265
|
-
activation: parseDate(data.NextAltActivation),
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
if (data.JobAffiliationTag) {
|
|
269
|
-
this.affiliatedWith = syndicate(data.JobAffiliationTag, locale);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* The event's tag
|
|
274
|
-
* @type {string}
|
|
275
|
-
*/
|
|
276
|
-
this.tag = data.Tag;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Get whether the event has expired
|
|
281
|
-
* @returns {boolean} whether the event has expired
|
|
282
|
-
*/
|
|
283
|
-
getExpired() {
|
|
284
|
-
return fromNow(this.expiry) < 0;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* The event's string representation
|
|
289
|
-
* @returns {string} the event's string representation
|
|
290
|
-
*/
|
|
291
|
-
toString() {
|
|
292
|
-
let lines = [];
|
|
293
|
-
if (this.faction) {
|
|
294
|
-
lines.push(`${this.description} : ${this.faction}`);
|
|
295
|
-
} else {
|
|
296
|
-
lines.push(this.description);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
if (this.scoreLocTag && this.maximumScore) {
|
|
300
|
-
lines.push(`${this.scoreLocTag} : ${this.maximumScore}`);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
if (this.rewards.length) {
|
|
304
|
-
lines.push('Rewards:');
|
|
305
|
-
lines = lines.concat(this.rewards.map((r) => r.toString()));
|
|
306
|
-
}
|
|
307
|
-
if (this.node) {
|
|
308
|
-
lines.push(`Battle on ${this.node}`);
|
|
309
|
-
}
|
|
310
|
-
if (this.victim) {
|
|
311
|
-
lines.push(`Protect ${this.victimNode}`);
|
|
312
|
-
}
|
|
313
|
-
if (this.health) {
|
|
314
|
-
lines.push(`${this.health}% Remaining`);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
if (this.affiliatedWith && this.jobs) {
|
|
318
|
-
lines.push(
|
|
319
|
-
`${this.affiliatedWith} will reward you for performing ` +
|
|
320
|
-
`${this.jobs.map((job) => job.type).join(', ')} job${this.jobs.length > 1 ? 's' : ''}`
|
|
321
|
-
);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
return lines.join(mdConfig.lineEnd);
|
|
325
|
-
}
|
|
326
|
-
}
|