warframe-worldstate-parser 5.2.16 → 5.2.18
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/{Calendar-CRM0XhAy.d.mts → Calendar-C-rbmV_t.d.mts} +1 -1
- package/dist/{CambionCycle-OI3v1knd.d.mts → CambionCycle-BzR_MfPH.d.mts} +2 -2
- package/dist/{CetusCycle-DQ4n05vO.d.mts → CetusCycle-DaqfF4J1.d.mts} +1 -1
- package/dist/{ConstructionProgress-DG2KzS0X.d.mts → ConstructionProgress-BRxmro3-.d.mts} +1 -1
- package/dist/{DarkSectorBattle-CiSe3kFm.d.mts → DarkSectorBattle-DHRl5tG1.d.mts} +1 -1
- package/dist/{Dependency-CNqXngHD.d.mts → Dependency-Cd-TxBJy.d.mts} +1 -1
- package/dist/{EarthCycle-CxtijnVV.d.mts → EarthCycle-C_oB5gDc.d.mts} +1 -1
- package/dist/{MidrathCycle-E0gMF3AR.d.mts → MidrathCycle-CxveqDtx.d.mts} +1 -1
- package/dist/{News-DxEm-q6V.d.mts → News-CJ3lD7_g.d.mts} +1 -1
- package/dist/{Nightwave-CPqMSqGK.d.mts → Nightwave-BLHH02ht.d.mts} +2 -2
- package/dist/{NightwaveChallenge-CG3uychc.d.mts → NightwaveChallenge-j_m4hVQU.d.mts} +1 -1
- package/dist/{PersistentEnemy-DnnnreSz.d.mts → PersistentEnemy-BJ4twtUY.d.mts} +1 -1
- package/dist/{VallisCycle-6DCaWFoR.d.mts → VallisCycle-as7DM4a-.d.mts} +1 -1
- package/dist/{ZarimanCycle-BrSLIWhD.d.mts → ZarimanCycle-DyYiVfyG.d.mts} +1 -1
- package/dist/{index-Bgx8kIDy.d.mts → index-C4EJ_Mpd.d.mts} +6 -6
- package/dist/lib/WorldState.d.mts +16 -19
- package/dist/lib/WorldState.mjs +32 -48
- package/dist/lib/models/Alert.d.mts +1 -17
- package/dist/lib/models/Alert.mjs +49 -7
- package/dist/lib/models/Archimedea.d.mts +1 -17
- package/dist/lib/models/Archimedea.mjs +88 -4
- package/dist/lib/models/Calendar.d.mts +1 -2
- package/dist/lib/models/Calendar.mjs +79 -4
- package/dist/lib/models/CambionCycle.d.mts +1 -3
- package/dist/lib/models/CambionCycle.mjs +28 -4
- package/dist/lib/models/CetusCycle.d.mts +1 -2
- package/dist/lib/models/CetusCycle.mjs +87 -4
- package/dist/lib/models/ChallengeInstance.d.mts +1 -17
- package/dist/lib/models/ChallengeInstance.mjs +46 -3
- package/dist/lib/models/ConclaveChallenge.d.mts +1 -17
- package/dist/lib/models/ConclaveChallenge.mjs +77 -4
- package/dist/lib/models/ConstructionProgress.d.mts +1 -2
- package/dist/lib/models/ConstructionProgress.mjs +23 -4
- package/dist/lib/models/DailyDeal.d.mts +1 -17
- package/dist/lib/models/DailyDeal.mjs +64 -4
- package/dist/lib/models/DarkSector.d.mts +1 -17
- package/dist/lib/models/DarkSector.mjs +136 -8
- package/dist/lib/models/DarkSectorBattle.d.mts +1 -2
- package/dist/lib/models/DarkSectorBattle.mjs +49 -3
- package/dist/lib/models/DuviriCycle.d.mts +1 -17
- package/dist/lib/models/DuviriCycle.mjs +55 -4
- package/dist/lib/models/EarthCycle.d.mts +1 -2
- package/dist/lib/models/EarthCycle.mjs +73 -4
- package/dist/lib/models/Fissure.d.mts +1 -17
- package/dist/lib/models/Fissure.mjs +83 -4
- package/dist/lib/models/FlashSale.d.mts +1 -17
- package/dist/lib/models/FlashSale.mjs +73 -4
- package/dist/lib/models/GlobalUpgrade.d.mts +1 -17
- package/dist/lib/models/GlobalUpgrade.mjs +56 -4
- package/dist/lib/models/Invasion.d.mts +1 -17
- package/dist/lib/models/Invasion.mjs +106 -6
- package/dist/lib/models/Kinepage.d.mts +1 -1
- package/dist/lib/models/Kinepage.mjs +23 -3
- package/dist/lib/models/Kuva.d.mts +1 -17
- package/dist/lib/models/Kuva.mjs +85 -3
- package/dist/lib/models/MidrathCycle.d.mts +1 -2
- package/dist/lib/models/MidrathCycle.mjs +66 -4
- package/dist/lib/models/Mission.d.mts +1 -17
- package/dist/lib/models/Mission.mjs +138 -5
- package/dist/lib/models/News.d.mts +1 -2
- package/dist/lib/models/News.mjs +116 -4
- package/dist/lib/models/Nightwave.d.mts +1 -3
- package/dist/lib/models/Nightwave.mjs +58 -5
- package/dist/lib/models/NightwaveChallenge.d.mts +1 -2
- package/dist/lib/models/NightwaveChallenge.mjs +51 -4
- package/dist/lib/models/PersistentEnemy.d.mts +1 -2
- package/dist/lib/models/PersistentEnemy.mjs +74 -4
- package/dist/lib/models/Reward.d.mts +1 -17
- package/dist/lib/models/Reward.mjs +71 -4
- package/dist/lib/models/SentientOutpost.d.mts +1 -17
- package/dist/lib/models/SentientOutpost.mjs +63 -3
- package/dist/lib/models/Simaris.d.mts +1 -17
- package/dist/lib/models/Simaris.mjs +33 -3
- package/dist/lib/models/Sortie.d.mts +1 -17
- package/dist/lib/models/Sortie.mjs +71 -8
- package/dist/lib/models/SortieVariant.d.mts +1 -17
- package/dist/lib/models/SortieVariant.mjs +49 -3
- package/dist/lib/models/SteelPathOffering.d.mts +1 -1
- package/dist/lib/models/SteelPathOffering.mjs +81 -3
- package/dist/lib/models/SyndicateJob.d.mts +1 -17
- package/dist/lib/models/SyndicateJob.mjs +161 -7
- package/dist/lib/models/SyndicateMission.d.mts +1 -17
- package/dist/lib/models/SyndicateMission.mjs +64 -8
- package/dist/lib/models/Tmp.d.mts +1 -17
- package/dist/lib/models/Tmp.mjs +28 -4
- package/dist/lib/models/VallisCycle.d.mts +1 -2
- package/dist/lib/models/VallisCycle.mjs +72 -4
- package/dist/lib/models/VoidTrader.d.mts +1 -17
- package/dist/lib/models/VoidTrader.mjs +76 -6
- package/dist/lib/models/VoidTraderItem.d.mts +1 -17
- package/dist/lib/models/VoidTraderItem.mjs +36 -3
- package/dist/lib/models/VoidTraderSchedule.d.mts +1 -17
- package/dist/lib/models/VoidTraderSchedule.mjs +12 -3
- package/dist/lib/models/WeeklyChallenge.d.mts +1 -17
- package/dist/lib/models/WeeklyChallenge.mjs +19 -5
- package/dist/lib/models/WorldEvent.d.mts +1 -17
- package/dist/lib/models/WorldEvent.mjs +211 -9
- package/dist/lib/models/WorldStateObject.d.mts +1 -1
- package/dist/lib/models/WorldStateObject.mjs +52 -3
- package/dist/lib/models/ZarimanCycle.d.mts +1 -2
- package/dist/lib/models/ZarimanCycle.mjs +77 -4
- package/dist/lib/models/index.d.mts +17 -18
- package/dist/lib/models/index.mjs +43 -47
- package/dist/lib/supporting/Dependency.d.mts +1 -1
- package/dist/lib/supporting/Dependency.mjs +1 -1
- package/dist/lib/supporting/DuviriChoice.d.mts +1 -17
- package/dist/lib/supporting/DuviriChoice.mjs +24 -3
- package/dist/lib/supporting/ExternalMission.d.mts +1 -1
- package/dist/lib/supporting/ExternalMission.mjs +1 -1
- package/dist/lib/supporting/FetchProxy.d.mts +1 -1
- package/dist/lib/supporting/FetchProxy.mjs +45 -3
- package/dist/lib/supporting/ImgCdn.d.mts +1 -1
- package/dist/lib/supporting/ImgCdn.mjs +6 -3
- package/dist/lib/supporting/KuvaLogEntry.d.mts +1 -1
- package/dist/lib/supporting/KuvaLogEntry.mjs +1 -1
- package/dist/lib/supporting/RewardData.d.mts +1 -1
- package/dist/lib/supporting/RewardData.mjs +75 -3
- package/dist/lib/supporting/RewardTypes.d.mts +1 -1
- package/dist/lib/supporting/RewardTypes.mjs +326 -3
- package/dist/lib/supporting/index.d.mts +8 -23
- package/dist/lib/supporting/index.mjs +6 -8
- package/dist/main.d.mts +24 -24
- package/dist/main.mjs +48 -51
- package/package.json +1 -1
- package/dist/Alert-CPT2sBmd.mjs +0 -51
- package/dist/Archimedea-Vo36QE99.mjs +0 -90
- package/dist/Calendar-_gEQ9BEd.mjs +0 -81
- package/dist/CambionCycle-B1pqIgks.mjs +0 -30
- package/dist/CetusCycle-Ct51M2pd.mjs +0 -89
- package/dist/ChallengeInstance-BOu_e7ML.mjs +0 -48
- package/dist/ConclaveChallenge-BTN6UyV6.mjs +0 -79
- package/dist/ConstructionProgress-BoF2P9fx.mjs +0 -25
- package/dist/DailyDeal-aoNeCFWT.mjs +0 -66
- package/dist/DarkSector-D0uJWCg7.mjs +0 -138
- package/dist/DarkSectorBattle-CqRYeNpe.mjs +0 -51
- package/dist/Dependency-BR-dAeHI.mjs +0 -1
- package/dist/DuviriChoice-BEBiWA-g.mjs +0 -25
- package/dist/DuviriCycle-Do7mMnoC.mjs +0 -57
- package/dist/EarthCycle-BOAlcAuQ.mjs +0 -75
- package/dist/ExternalMission-D3MSZgnN.mjs +0 -1
- package/dist/FetchProxy-Bkdk15SX.mjs +0 -46
- package/dist/Fissure-diM4hyi3.mjs +0 -85
- package/dist/FlashSale-CNfRaZhM.mjs +0 -75
- package/dist/GlobalUpgrade-CUtZw05z.mjs +0 -58
- package/dist/ImgCdn-BJOdWAbU.mjs +0 -7
- package/dist/Invasion-Corx1lxf.mjs +0 -108
- package/dist/Kinepage-CbSzge67.mjs +0 -24
- package/dist/Kuva-Ijy2ZGBL.mjs +0 -87
- package/dist/KuvaLogEntry-D_VzIT3W.mjs +0 -1
- package/dist/MidrathCycle-XD2T8Dx5.mjs +0 -68
- package/dist/Mission-b8KP-YDf.mjs +0 -140
- package/dist/News-zAK-sYRg.mjs +0 -118
- package/dist/Nightwave-cTRmlbwH.mjs +0 -60
- package/dist/NightwaveChallenge-C8ARG7LC.mjs +0 -53
- package/dist/PersistentEnemy-3Sw5E8AN.mjs +0 -76
- package/dist/Reward-3FBJF_hS.mjs +0 -73
- package/dist/RewardData-C_9b8Yhi.mjs +0 -76
- package/dist/RewardTypes-DUrR7H3G.mjs +0 -328
- package/dist/SentientOutpost-Cadk-pIW.mjs +0 -65
- package/dist/Simaris-D6etEQp_.mjs +0 -35
- package/dist/Sortie-rSBgJc6U.mjs +0 -73
- package/dist/SortieVariant-CnuLkkNZ.mjs +0 -51
- package/dist/SteelPathOffering--wm-7hwb.mjs +0 -83
- package/dist/SyndicateJob-R89tWqvT.mjs +0 -162
- package/dist/SyndicateMission-CKZDWNyf.mjs +0 -66
- package/dist/Tmp-BYL_mYIG.mjs +0 -30
- package/dist/VallisCycle-BW2g49wB.mjs +0 -74
- package/dist/VoidTrader-DtjtVUgR.mjs +0 -78
- package/dist/VoidTraderItem-Cz6x1KTF.mjs +0 -38
- package/dist/VoidTraderSchedule-BsJLu50V.mjs +0 -14
- package/dist/WeeklyChallenge-Dl2ekl6X.mjs +0 -21
- package/dist/WorldEvent-C-LaV2ug.mjs +0 -213
- package/dist/WorldStateObject-45dbRgp7.mjs +0 -54
- package/dist/ZarimanCycle-DoAPwgaM.mjs +0 -79
- package/dist/supporting-BLSXhlWM.mjs +0 -1
- /package/dist/{ExternalMission-C82w4uMq.d.mts → ExternalMission-CT__oi7Q.d.mts} +0 -0
- /package/dist/{FetchProxy-DfSTUgkf.d.mts → FetchProxy-DHSI4JPP.d.mts} +0 -0
- /package/dist/{ImgCdn-D0hSGSB1.d.mts → ImgCdn-DIhZrwap.d.mts} +0 -0
- /package/dist/{Kinepage-B-Ym_VW5.d.mts → Kinepage-CKBuvbv5.d.mts} +0 -0
- /package/dist/{KuvaLogEntry-cftxhjfU.d.mts → KuvaLogEntry-f4ZBn2Xf.d.mts} +0 -0
- /package/dist/{RewardData-DWCgJ3UT.d.mts → RewardData-BdtdUFnh.d.mts} +0 -0
- /package/dist/{RewardTypes-Y3tHrtIJ.d.mts → RewardTypes-BnGaD7VF.d.mts} +0 -0
- /package/dist/{SteelPathOffering-CQkoKi5T.d.mts → SteelPathOffering-DYjZ29sT.d.mts} +0 -0
- /package/dist/{WorldStateObject-C1HEDkH7.d.mts → WorldStateObject-C2KjQZjd.d.mts} +0 -0
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { t as WorldStateObject } from "./WorldStateObject-45dbRgp7.mjs";
|
|
2
|
-
import { t as fetchProxy } from "./FetchProxy-Bkdk15SX.mjs";
|
|
3
|
-
import { languageString } from "warframe-worldstate-data/utilities";
|
|
4
|
-
|
|
5
|
-
//#region lib/models/SyndicateJob.ts
|
|
6
|
-
const apiBase = process.env.API_BASE_URL || "https://api.warframestat.us";
|
|
7
|
-
const bountyRewardRegex = /(?:Tier([ABCDE])|Narmer)Table([ABC])Rewards/i;
|
|
8
|
-
const ghoulRewardRegex = /GhoulBountyTable([AB])Rewards/i;
|
|
9
|
-
/**
|
|
10
|
-
* Determine the level string for the bounty
|
|
11
|
-
*/
|
|
12
|
-
const getLevelString = (job) => `${job.minEnemyLevel} - ${job.maxEnemyLevel}`;
|
|
13
|
-
const determineLocation = (i18n, raw, isVault) => {
|
|
14
|
-
const last = String(i18n).split("/").slice(-1)[0];
|
|
15
|
-
const bountyMatches = last.match(bountyRewardRegex);
|
|
16
|
-
const ghoulMatches = last.match(ghoulRewardRegex);
|
|
17
|
-
const isBounty = bountyMatches?.length;
|
|
18
|
-
const isGhoul = ghoulMatches?.length;
|
|
19
|
-
const isCetus = /eidolonjob/i.test(i18n);
|
|
20
|
-
const isVallis = /venusjob/i.test(i18n);
|
|
21
|
-
const isDeimos = /deimosmissionrewards/i.test(i18n);
|
|
22
|
-
const rotation = isBounty ? bountyMatches[2] : "";
|
|
23
|
-
const levelString = getLevelString(raw);
|
|
24
|
-
let location;
|
|
25
|
-
let levelClause;
|
|
26
|
-
if (isCetus) {
|
|
27
|
-
location = "Earth/Cetus ";
|
|
28
|
-
if (isGhoul) levelClause = `(Level ${levelString} Ghoul Bounty)`;
|
|
29
|
-
else levelClause = `(Level ${levelString} Cetus Bounty)`;
|
|
30
|
-
}
|
|
31
|
-
if (isVallis) {
|
|
32
|
-
location = "Venus/Orb Vallis ";
|
|
33
|
-
levelClause = `(Level ${levelString} Orb Vallis Bounty)`;
|
|
34
|
-
}
|
|
35
|
-
if (isDeimos) {
|
|
36
|
-
location = "Deimos/Cambion Drift ";
|
|
37
|
-
levelClause = `(Level ${levelString} ${isVault ? "Isolation Vault" : "Cambion Drift Bounty"})`;
|
|
38
|
-
}
|
|
39
|
-
const locationWRot = `${location}${levelClause}, Rot ${rotation.length ? rotation : "A"}`;
|
|
40
|
-
return {
|
|
41
|
-
location,
|
|
42
|
-
locationWRot
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
const getBountyRewards = async (i18n, raw, isVault) => {
|
|
46
|
-
let location;
|
|
47
|
-
let locationWRot;
|
|
48
|
-
if (i18n.endsWith("PlagueStarTableRewards")) {
|
|
49
|
-
location = "plague star";
|
|
50
|
-
locationWRot = "Earth/Cetus (Level 15 - 25 Plague Star), Rot A";
|
|
51
|
-
}
|
|
52
|
-
if (!location || !locationWRot) ({location, locationWRot} = determineLocation(i18n, raw, isVault));
|
|
53
|
-
const pool = (await fetchProxy(`${apiBase}/drops/search/${encodeURIComponent(location)}?grouped_by=location`).then((res) => res.json()).catch(() => {}))?.[locationWRot];
|
|
54
|
-
if (!pool) return ["Pattern Mismatch. Results inaccurate."];
|
|
55
|
-
const results = pool.rewards;
|
|
56
|
-
if (results) return Array.from(new Set(results));
|
|
57
|
-
return [];
|
|
58
|
-
};
|
|
59
|
-
const FIFTY_MINUTES = 3e6;
|
|
60
|
-
/**
|
|
61
|
-
* Represents a syndicate daily mission
|
|
62
|
-
* @augments {WorldStateObject}
|
|
63
|
-
*/
|
|
64
|
-
var SyndicateJob = class SyndicateJob extends WorldStateObject {
|
|
65
|
-
/**
|
|
66
|
-
* Reward pool unique name
|
|
67
|
-
*/
|
|
68
|
-
uniqueName;
|
|
69
|
-
/**
|
|
70
|
-
* Array of strings describing rewards
|
|
71
|
-
*/
|
|
72
|
-
rewardPool;
|
|
73
|
-
/**
|
|
74
|
-
* A structured version of the reward pool
|
|
75
|
-
*/
|
|
76
|
-
rewardPoolDrops;
|
|
77
|
-
/**
|
|
78
|
-
* The type of job this is
|
|
79
|
-
*/
|
|
80
|
-
type;
|
|
81
|
-
/**
|
|
82
|
-
* Array of enemy levels
|
|
83
|
-
*/
|
|
84
|
-
enemyLevels;
|
|
85
|
-
/**
|
|
86
|
-
* Array of standing gains per stage of job
|
|
87
|
-
*/
|
|
88
|
-
standingStages;
|
|
89
|
-
/**
|
|
90
|
-
* Minimum mastery required to participate
|
|
91
|
-
*/
|
|
92
|
-
minMR;
|
|
93
|
-
/**
|
|
94
|
-
* Whether or not this is a Vault job.
|
|
95
|
-
* No indication for difference of normal vs arcana vaults.
|
|
96
|
-
*/
|
|
97
|
-
isVault;
|
|
98
|
-
/**
|
|
99
|
-
* Corresponding chamber. Nullable
|
|
100
|
-
*/
|
|
101
|
-
locationTag;
|
|
102
|
-
/**
|
|
103
|
-
* What time phase this bounty is bound to
|
|
104
|
-
*/
|
|
105
|
-
timeBound;
|
|
106
|
-
/**
|
|
107
|
-
* Generate a job with async data (reward pool)
|
|
108
|
-
* @param data The syndicate mission data
|
|
109
|
-
* @param expiry The syndicate job expiration
|
|
110
|
-
* @param deps The dependencies object
|
|
111
|
-
* @returns The created SyndicateJob object with rewardPool
|
|
112
|
-
*/
|
|
113
|
-
static async build(data, expiry, deps) {
|
|
114
|
-
const job = new SyndicateJob(data, expiry, deps);
|
|
115
|
-
const rewards = await getBountyRewards(data.rewards, data, data.isVault);
|
|
116
|
-
if (typeof rewards[0] === "string") job.rewardPool = rewards;
|
|
117
|
-
else {
|
|
118
|
-
job.rewardPoolDrops = rewards.map((reward) => {
|
|
119
|
-
const countReg = /([0-9]{1,10})X/;
|
|
120
|
-
const count = reward.item.match(countReg)?.[1];
|
|
121
|
-
return {
|
|
122
|
-
...reward,
|
|
123
|
-
item: reward.item.replace(countReg, "").trim(),
|
|
124
|
-
count: count ? parseInt(count, 10) : 1
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
job.rewardPool = rewards.map((reward) => reward.item);
|
|
128
|
-
}
|
|
129
|
-
return job;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Construct a job without async data (reward pool)
|
|
133
|
-
* @param data The syndicate mission data
|
|
134
|
-
* @param expiry The syndicate job expiration
|
|
135
|
-
* @param deps The dependencies object
|
|
136
|
-
* @param deps.locale Locale to use for translations
|
|
137
|
-
*
|
|
138
|
-
* This DOES NOT populate the reward pool
|
|
139
|
-
*/
|
|
140
|
-
constructor(data, expiry, { locale } = { locale: "en" }) {
|
|
141
|
-
super({ _id: { $oid: data.JobCurrentVersion ? data.JobCurrentVersion.$oid : `${(data.jobType || "").split("/").slice(-1)[0]}${expiry.getTime()}` } });
|
|
142
|
-
this.uniqueName = data.rewards;
|
|
143
|
-
this.rewardPool = [];
|
|
144
|
-
this.rewardPoolDrops = [];
|
|
145
|
-
const chamber = (data.locationTag || "").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").trim();
|
|
146
|
-
this.type = data.isVault ? `Isolation Vault ${chamber}` : data.jobType ? languageString(data.jobType, locale) : void 0;
|
|
147
|
-
this.enemyLevels = [data.minEnemyLevel, data.maxEnemyLevel];
|
|
148
|
-
this.standingStages = data.xpAmounts;
|
|
149
|
-
this.minMR = data.masteryReq || 0;
|
|
150
|
-
this.isVault = data.isVault;
|
|
151
|
-
this.locationTag = data.locationTag;
|
|
152
|
-
this.expiry = expiry;
|
|
153
|
-
const jobType = data.jobType ?? "";
|
|
154
|
-
if (jobType.toLowerCase().includes("narmer")) if (jobType.toLowerCase().includes("eidolon")) {
|
|
155
|
-
this.timeBound = "day";
|
|
156
|
-
this.expiry = new Date(this.expiry.getTime() - FIFTY_MINUTES);
|
|
157
|
-
} else this.timeBound = "night";
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
//#endregion
|
|
162
|
-
export { SyndicateJob as t };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { t as WorldStateObject } from "./WorldStateObject-45dbRgp7.mjs";
|
|
2
|
-
import { t as SyndicateJob } from "./SyndicateJob-R89tWqvT.mjs";
|
|
3
|
-
import { fromNow, node, syndicate, timeDeltaToString } from "warframe-worldstate-data/utilities";
|
|
4
|
-
|
|
5
|
-
//#region lib/models/SyndicateMission.ts
|
|
6
|
-
/**
|
|
7
|
-
* Represents a syndicate daily mission
|
|
8
|
-
* @augments {WorldStateObject}
|
|
9
|
-
*/
|
|
10
|
-
var SyndicateMission = class SyndicateMission extends WorldStateObject {
|
|
11
|
-
/**
|
|
12
|
-
* The syndicate that is offering the mission
|
|
13
|
-
* @type {string}
|
|
14
|
-
*/
|
|
15
|
-
syndicate;
|
|
16
|
-
/**
|
|
17
|
-
* The syndicate that is offering the mission
|
|
18
|
-
* @type {string}
|
|
19
|
-
*/
|
|
20
|
-
syndicateKey;
|
|
21
|
-
/**
|
|
22
|
-
* The nodes on which the missions are taking place
|
|
23
|
-
* @type {Array.<string>}
|
|
24
|
-
*/
|
|
25
|
-
nodes;
|
|
26
|
-
/**
|
|
27
|
-
* The jobs for this syndicate. Will normally be []
|
|
28
|
-
* @type {Array.<SyndicateJob>}
|
|
29
|
-
*/
|
|
30
|
-
jobs;
|
|
31
|
-
/**
|
|
32
|
-
* Build a new SyndicateMission with async operations & data
|
|
33
|
-
* @param data The syndicate mission data
|
|
34
|
-
* @param deps The dependencies object
|
|
35
|
-
* @param deps.locale Locale to use for translations
|
|
36
|
-
* @returns SyndicateMission object w/ async resolution of jobs
|
|
37
|
-
*/
|
|
38
|
-
static async build(data, deps = { locale: "en" }) {
|
|
39
|
-
const syndicateMission = new SyndicateMission(data, deps);
|
|
40
|
-
if (data.Jobs?.length) syndicateMission.jobs = await Promise.all(data.Jobs.map((job) => SyndicateJob.build(job, syndicateMission.expiry, deps)));
|
|
41
|
-
else syndicateMission.jobs = [];
|
|
42
|
-
return syndicateMission;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* @param data The syndicate mission data
|
|
46
|
-
* @param deps The dependencies object
|
|
47
|
-
* @param deps.locale Locale to use for translations
|
|
48
|
-
*/
|
|
49
|
-
constructor(data, { locale = "en" } = { locale: "en" }) {
|
|
50
|
-
super(data);
|
|
51
|
-
this.syndicate = syndicate(data.Tag, locale);
|
|
52
|
-
this.syndicateKey = syndicate(data.Tag, "en");
|
|
53
|
-
this.nodes = data.Nodes.map((n) => node(n, locale));
|
|
54
|
-
this.jobs = [];
|
|
55
|
-
this.id = `${this.expiry.getTime()}${data.Tag}`;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Time delta string from now to the expiry
|
|
59
|
-
*/
|
|
60
|
-
get eta() {
|
|
61
|
-
return timeDeltaToString(fromNow(this.expiry));
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
|
-
export { SyndicateMission as t };
|
package/dist/Tmp-BYL_mYIG.mjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { t as Kinepage } from "./Kinepage-CbSzge67.mjs";
|
|
2
|
-
import { t as SentientOutpost } from "./SentientOutpost-Cadk-pIW.mjs";
|
|
3
|
-
|
|
4
|
-
//#region lib/models/Tmp.ts
|
|
5
|
-
var Tmp = class {
|
|
6
|
-
sentientOutposts;
|
|
7
|
-
kinepage;
|
|
8
|
-
faceoffBonus;
|
|
9
|
-
questToConquerCancer;
|
|
10
|
-
constructor(json, deps = { locale: "en" }) {
|
|
11
|
-
const tmp = JSON.parse(json);
|
|
12
|
-
this.sentientOutposts = new SentientOutpost(tmp.sfn, deps);
|
|
13
|
-
this.kinepage = new Kinepage(tmp.pgr, deps.locale);
|
|
14
|
-
if (tmp.fbst) {
|
|
15
|
-
const toDate = (ms) => /* @__PURE__ */ new Date(ms * 1e3);
|
|
16
|
-
this.faceoffBonus = {
|
|
17
|
-
activation: toDate(tmp.fbst.a),
|
|
18
|
-
expiry: toDate(tmp.fbst.e),
|
|
19
|
-
next: toDate(tmp.fbst.n)
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
if (tmp.QTCCFloofCount) this.questToConquerCancer = {
|
|
23
|
-
count: tmp.QTCCFloofCount,
|
|
24
|
-
goal: tmp.QTCCFloofLimit
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { Tmp as t };
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { t as WorldStateObject } from "./WorldStateObject-45dbRgp7.mjs";
|
|
2
|
-
import { fromNow, timeDeltaToString } from "warframe-worldstate-data/utilities";
|
|
3
|
-
|
|
4
|
-
//#region lib/models/VallisCycle.ts
|
|
5
|
-
const lStart = /* @__PURE__ */ new Date("2026-02-04T19:46:48Z");
|
|
6
|
-
const loopTime = 16e5;
|
|
7
|
-
const coldTime = loopTime - 4e5;
|
|
8
|
-
/**
|
|
9
|
-
* Get the current cycle state for Orb Vallis
|
|
10
|
-
* @returns current cycle state
|
|
11
|
-
*/
|
|
12
|
-
function getCurrentCycle() {
|
|
13
|
-
const toNextFull = loopTime - (Date.now() - lStart.getTime()) % loopTime;
|
|
14
|
-
let state = "cold";
|
|
15
|
-
if (toNextFull > coldTime) state = "warm";
|
|
16
|
-
let toNextMinor;
|
|
17
|
-
if (toNextFull < coldTime) toNextMinor = toNextFull;
|
|
18
|
-
else toNextMinor = toNextFull - coldTime;
|
|
19
|
-
const milliAtNext = Date.now() + toNextMinor;
|
|
20
|
-
const milliAtPrev = Date.now() + toNextFull - (state === "warm" ? loopTime : coldTime);
|
|
21
|
-
const timeAtPrevious = new Date(milliAtPrev);
|
|
22
|
-
timeAtPrevious.setSeconds(0);
|
|
23
|
-
return {
|
|
24
|
-
state,
|
|
25
|
-
toNextMinor,
|
|
26
|
-
toNextFull,
|
|
27
|
-
timeAtNext: new Date(milliAtNext),
|
|
28
|
-
timeAtPrevious
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Represents the current Earth Day/Night Cycle
|
|
33
|
-
* @augments {WorldStateObject}
|
|
34
|
-
*/
|
|
35
|
-
var VallisCycle = class extends WorldStateObject {
|
|
36
|
-
/**
|
|
37
|
-
* Whether or not this it's daytime
|
|
38
|
-
*/
|
|
39
|
-
isWarm;
|
|
40
|
-
/**
|
|
41
|
-
* Current cycle state. One of `warm`, `cold`
|
|
42
|
-
*/
|
|
43
|
-
state;
|
|
44
|
-
/**
|
|
45
|
-
* The current cetus cycle, for calculating the other fields
|
|
46
|
-
*/
|
|
47
|
-
#ec = getCurrentCycle();
|
|
48
|
-
constructor() {
|
|
49
|
-
super({ _id: { $oid: "vallisCycle0" } });
|
|
50
|
-
this.id = `vallisCycle${this.#ec.timeAtPrevious.getTime()}`;
|
|
51
|
-
this.activation = this.#ec.timeAtPrevious;
|
|
52
|
-
this.expiry = this.#ec.timeAtNext;
|
|
53
|
-
this.isWarm = this.#ec.state === "warm";
|
|
54
|
-
this.state = this.#ec.state;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Whether this event has expired
|
|
58
|
-
*/
|
|
59
|
-
get expired() {
|
|
60
|
-
return fromNow(this.expiry) < 0;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Time remaining string
|
|
64
|
-
*/
|
|
65
|
-
get timeLeft() {
|
|
66
|
-
return timeDeltaToString(this.#ec.toNextMinor);
|
|
67
|
-
}
|
|
68
|
-
get shortString() {
|
|
69
|
-
return `${this.timeLeft.replace(/\s\d*s/gi, "")} to ${this.isWarm ? "Cold" : "Warm"}`;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
export { VallisCycle as t };
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { t as WorldStateObject } from "./WorldStateObject-45dbRgp7.mjs";
|
|
2
|
-
import { t as VoidTraderItem } from "./VoidTraderItem-Cz6x1KTF.mjs";
|
|
3
|
-
import { t as VoidTraderSchedule } from "./VoidTraderSchedule-BsJLu50V.mjs";
|
|
4
|
-
import { fromNow, insist, node, parseDate, timeDeltaToString } from "warframe-worldstate-data/utilities";
|
|
5
|
-
|
|
6
|
-
//#region lib/models/VoidTrader.ts
|
|
7
|
-
/**
|
|
8
|
-
* Represents a void trader
|
|
9
|
-
* @augments {WorldStateObject}
|
|
10
|
-
*/
|
|
11
|
-
var VoidTrader = class extends WorldStateObject {
|
|
12
|
-
/**
|
|
13
|
-
* The void trader's name
|
|
14
|
-
*/
|
|
15
|
-
character;
|
|
16
|
-
/**
|
|
17
|
-
* The node at which the Void Trader appears
|
|
18
|
-
*/
|
|
19
|
-
location;
|
|
20
|
-
/**
|
|
21
|
-
* The trader's inventory
|
|
22
|
-
*/
|
|
23
|
-
inventory;
|
|
24
|
-
/**
|
|
25
|
-
* Pseudo Identifier for identifying changes in inventory
|
|
26
|
-
*/
|
|
27
|
-
psId;
|
|
28
|
-
/**
|
|
29
|
-
* The initial start date
|
|
30
|
-
*/
|
|
31
|
-
initialStart;
|
|
32
|
-
/**
|
|
33
|
-
* Whether it's completed or not
|
|
34
|
-
*/
|
|
35
|
-
completed;
|
|
36
|
-
/**
|
|
37
|
-
* Possible schedule
|
|
38
|
-
*/
|
|
39
|
-
schedule;
|
|
40
|
-
/**
|
|
41
|
-
* @param data The trader data
|
|
42
|
-
* @param deps The dependencies object
|
|
43
|
-
* @param deps.locale Locale to use for translations
|
|
44
|
-
* @param deps.character The trader name
|
|
45
|
-
*/
|
|
46
|
-
constructor(data, { locale = "en", character } = { locale: "en" }) {
|
|
47
|
-
super(data);
|
|
48
|
-
insist({ ...data }, "Activation", "Expiry");
|
|
49
|
-
this.character = data.Character ? data.Character.replace("Baro'Ki Teel", "Baro Ki'Teer") : character ?? "";
|
|
50
|
-
this.location = node(data.Node, locale);
|
|
51
|
-
this.inventory = data.Manifest ? data.Manifest.map((i) => new VoidTraderItem(i, { locale })) : [];
|
|
52
|
-
this.psId = `${this.id}${this.inventory.length}`;
|
|
53
|
-
this.initialStart = parseDate(data.InitialStartDate);
|
|
54
|
-
this.completed = data.Completed;
|
|
55
|
-
this.schedule = data.ScheduleInfo ? data.ScheduleInfo.map((i) => new VoidTraderSchedule(i, { locale })) : [];
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Whether the trader is active
|
|
59
|
-
*/
|
|
60
|
-
get active() {
|
|
61
|
-
return fromNow(this.activation) < 0 && fromNow(this.expiry) > 0;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Time delta string from now to the start
|
|
65
|
-
*/
|
|
66
|
-
get startString() {
|
|
67
|
-
return timeDeltaToString(fromNow(this.activation));
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Time delta string from now to the end
|
|
71
|
-
*/
|
|
72
|
-
get endString() {
|
|
73
|
-
return timeDeltaToString(fromNow(this.expiry));
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
//#endregion
|
|
78
|
-
export { VoidTrader as t };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { languageString } from "warframe-worldstate-data/utilities";
|
|
2
|
-
|
|
3
|
-
//#region lib/models/VoidTraderItem.ts
|
|
4
|
-
/**
|
|
5
|
-
* A void trader inventory item
|
|
6
|
-
*/
|
|
7
|
-
var VoidTraderItem = class {
|
|
8
|
-
uniqueName;
|
|
9
|
-
/**
|
|
10
|
-
* The name of the inventory item
|
|
11
|
-
*/
|
|
12
|
-
item;
|
|
13
|
-
/**
|
|
14
|
-
* Ducat cost of the item
|
|
15
|
-
*/
|
|
16
|
-
ducats;
|
|
17
|
-
/**
|
|
18
|
-
* Credit cost of the item
|
|
19
|
-
*/
|
|
20
|
-
credits;
|
|
21
|
-
/**
|
|
22
|
-
* @param data The void trader item data
|
|
23
|
-
* @param data.ItemType Worldstate Item i18n path
|
|
24
|
-
* @param data.PrimePrice Ducat cost of the item
|
|
25
|
-
* @param data.RegularPrice Credit price of the item
|
|
26
|
-
* @param deps The dependencies object
|
|
27
|
-
* @param deps.locale Locale to use for translations
|
|
28
|
-
*/
|
|
29
|
-
constructor({ ItemType, PrimePrice, RegularPrice }, { locale = "en" } = { locale: "en" }) {
|
|
30
|
-
this.uniqueName = ItemType;
|
|
31
|
-
this.item = languageString(ItemType, locale);
|
|
32
|
-
this.ducats = Number.parseInt(String(PrimePrice), 10);
|
|
33
|
-
this.credits = Number.parseInt(String(RegularPrice), 10);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
|
-
export { VoidTraderItem as t };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { languageString, parseDate } from "warframe-worldstate-data/utilities";
|
|
2
|
-
|
|
3
|
-
//#region lib/models/VoidTraderSchedule.ts
|
|
4
|
-
var VoidTraderSchedule = class {
|
|
5
|
-
expiry;
|
|
6
|
-
item;
|
|
7
|
-
constructor(data, { locale = "en" } = { locale: "en" }) {
|
|
8
|
-
this.expiry = parseDate(data.Expiry);
|
|
9
|
-
this.item = languageString(data.FeaturedItem, locale);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { VoidTraderSchedule as t };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { t as WorldStateObject } from "./WorldStateObject-45dbRgp7.mjs";
|
|
2
|
-
import { t as ChallengeInstance } from "./ChallengeInstance-BOu_e7ML.mjs";
|
|
3
|
-
|
|
4
|
-
//#region lib/models/WeeklyChallenge.ts
|
|
5
|
-
/**
|
|
6
|
-
* Represents a void trader
|
|
7
|
-
* @augments {WorldStateObject}
|
|
8
|
-
*/
|
|
9
|
-
var WeeklyChallenge = class extends WorldStateObject {
|
|
10
|
-
challenges;
|
|
11
|
-
/**
|
|
12
|
-
* @param data The Void trader data
|
|
13
|
-
*/
|
|
14
|
-
constructor(data) {
|
|
15
|
-
super(data);
|
|
16
|
-
this.challenges = data.Challenges.map((challengeData) => new ChallengeInstance(challengeData));
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
export { WeeklyChallenge as t };
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { t as Reward } from "./Reward-3FBJF_hS.mjs";
|
|
2
|
-
import { t as WorldStateObject } from "./WorldStateObject-45dbRgp7.mjs";
|
|
3
|
-
import { t as SyndicateJob } from "./SyndicateJob-R89tWqvT.mjs";
|
|
4
|
-
import { faction, fromNow, languageString, node, parseDate, syndicate } from "warframe-worldstate-data/utilities";
|
|
5
|
-
|
|
6
|
-
//#region lib/models/WorldEvent.ts
|
|
7
|
-
/**
|
|
8
|
-
* Represents an in-game special event
|
|
9
|
-
* @augments {WorldStateObject}
|
|
10
|
-
*/
|
|
11
|
-
var WorldEvent = class WorldEvent extends WorldStateObject {
|
|
12
|
-
jobs;
|
|
13
|
-
previousJobs;
|
|
14
|
-
/**
|
|
15
|
-
* The event's main score goal
|
|
16
|
-
*/
|
|
17
|
-
maximumScore;
|
|
18
|
-
/**
|
|
19
|
-
* The current score on the event
|
|
20
|
-
*/
|
|
21
|
-
currentScore;
|
|
22
|
-
/**
|
|
23
|
-
* The first intermediate score goal
|
|
24
|
-
*/
|
|
25
|
-
smallInterval;
|
|
26
|
-
/**
|
|
27
|
-
* The second intermediate score goal
|
|
28
|
-
*/
|
|
29
|
-
largeInterval;
|
|
30
|
-
/**
|
|
31
|
-
* The faction that the players must fight in the event
|
|
32
|
-
*/
|
|
33
|
-
faction;
|
|
34
|
-
/**
|
|
35
|
-
* The description of the event
|
|
36
|
-
*/
|
|
37
|
-
description;
|
|
38
|
-
/**
|
|
39
|
-
* Tooltip for the event
|
|
40
|
-
*/
|
|
41
|
-
tooltip;
|
|
42
|
-
/**
|
|
43
|
-
* The node where the event takes place
|
|
44
|
-
*/
|
|
45
|
-
node;
|
|
46
|
-
/**
|
|
47
|
-
* The other nodes where the event takes place
|
|
48
|
-
*/
|
|
49
|
-
concurrentNodes;
|
|
50
|
-
/**
|
|
51
|
-
* The victim node
|
|
52
|
-
*/
|
|
53
|
-
victimNode;
|
|
54
|
-
/**
|
|
55
|
-
* The score description
|
|
56
|
-
*/
|
|
57
|
-
scoreLocTag;
|
|
58
|
-
/**
|
|
59
|
-
* The event's rewards
|
|
60
|
-
*/
|
|
61
|
-
rewards;
|
|
62
|
-
/**
|
|
63
|
-
* Health remaining for the target
|
|
64
|
-
*/
|
|
65
|
-
health;
|
|
66
|
-
/**
|
|
67
|
-
* Previous job id
|
|
68
|
-
*/
|
|
69
|
-
previousId;
|
|
70
|
-
/**
|
|
71
|
-
* Array of steps
|
|
72
|
-
*/
|
|
73
|
-
interimSteps;
|
|
74
|
-
/**
|
|
75
|
-
* Progress Steps, if any are present
|
|
76
|
-
*/
|
|
77
|
-
progressSteps;
|
|
78
|
-
/**
|
|
79
|
-
* Total of all MultiProgress
|
|
80
|
-
*/
|
|
81
|
-
progressTotal;
|
|
82
|
-
/**
|
|
83
|
-
* Whether to show the total score at the end of the mission
|
|
84
|
-
*/
|
|
85
|
-
showTotalAtEndOfMission;
|
|
86
|
-
/**
|
|
87
|
-
* Whether the event is personal
|
|
88
|
-
*/
|
|
89
|
-
isPersonal;
|
|
90
|
-
/**
|
|
91
|
-
* Whether the event is community
|
|
92
|
-
*/
|
|
93
|
-
isCommunity;
|
|
94
|
-
regionDrops;
|
|
95
|
-
/**
|
|
96
|
-
* Archwing Drops in effect while this event is active
|
|
97
|
-
*/
|
|
98
|
-
archwingDrops;
|
|
99
|
-
/**
|
|
100
|
-
* Metadata provided by DE
|
|
101
|
-
*/
|
|
102
|
-
metadata;
|
|
103
|
-
/**
|
|
104
|
-
* Bonuses given for completion
|
|
105
|
-
*/
|
|
106
|
-
completionBonuses;
|
|
107
|
-
scoreVar;
|
|
108
|
-
altExpiry;
|
|
109
|
-
altActivation;
|
|
110
|
-
nextAlt;
|
|
111
|
-
affiliatedWith;
|
|
112
|
-
/**
|
|
113
|
-
* The event's tag
|
|
114
|
-
*/
|
|
115
|
-
tag;
|
|
116
|
-
victim;
|
|
117
|
-
/**
|
|
118
|
-
* Asynchronously build a new WorldEvent
|
|
119
|
-
* @param data The event data
|
|
120
|
-
* @param deps The dependencies object
|
|
121
|
-
* @returns The created WorldEvent object
|
|
122
|
-
*/
|
|
123
|
-
static async build(data, deps) {
|
|
124
|
-
const event = new WorldEvent(data, deps);
|
|
125
|
-
if (data.Jobs) {
|
|
126
|
-
const jobs = [];
|
|
127
|
-
for await (const job of data.Jobs ?? []) jobs.push(await SyndicateJob.build(job, event.expiry, deps));
|
|
128
|
-
event.jobs = jobs;
|
|
129
|
-
}
|
|
130
|
-
if (data.PreviousJobs) {
|
|
131
|
-
const previousJobs = [];
|
|
132
|
-
for await (const job of data.PreviousJobs ?? []) previousJobs.push(await SyndicateJob.build(job, event.expiry, deps));
|
|
133
|
-
event.previousJobs = previousJobs;
|
|
134
|
-
}
|
|
135
|
-
return event;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* @param data The event data
|
|
139
|
-
* @param deps The dependencies object
|
|
140
|
-
*/
|
|
141
|
-
constructor(data, { locale = "en" } = { locale: "en" }) {
|
|
142
|
-
super(data);
|
|
143
|
-
const opts = { locale };
|
|
144
|
-
this.maximumScore = Number.parseInt(String(data.Goal), 10);
|
|
145
|
-
this.currentScore = Number.parseInt(String(data.Count), 10);
|
|
146
|
-
this.smallInterval = Number.parseInt(String(data.GoalInterim), 10);
|
|
147
|
-
this.largeInterval = Number.parseInt(String(data.GoalInterim2), 10);
|
|
148
|
-
this.faction = data.Faction ? faction(data.Faction, locale) : void 0;
|
|
149
|
-
this.description = languageString(data.Desc, locale);
|
|
150
|
-
this.tooltip = data.ToolTip ? languageString(data.ToolTip, locale) : void 0;
|
|
151
|
-
this.node = data.Node ? node(data.Node, locale) : void 0;
|
|
152
|
-
this.concurrentNodes = data.ConcurrentNodes ? data.ConcurrentNodes.map((n) => node(n, locale)) : [];
|
|
153
|
-
this.victimNode = data.VictimNode ? node(data.VictimNode, locale) : void 0;
|
|
154
|
-
this.scoreLocTag = data.ScoreLocTag ? languageString(data.ScoreLocTag, locale) : void 0;
|
|
155
|
-
if (data.Fomorian) this.scoreLocTag = "Fomorian Assault Score";
|
|
156
|
-
this.rewards = Object.keys(data).filter((k) => k.includes("Reward") || k.includes("reward")).map((k) => new Reward(data[k], opts)).filter((r) => r.items.length > 0);
|
|
157
|
-
this.health = typeof data.HealthPct !== "undefined" ? Number.parseFloat(((data.HealthPct || 0) * 100).toFixed(2)) : void 0;
|
|
158
|
-
this.jobs = [];
|
|
159
|
-
this.previousJobs = [];
|
|
160
|
-
this.previousId = data.JobPreviousVersion?.$oid;
|
|
161
|
-
this.interimSteps = [];
|
|
162
|
-
(data.InterimRewards || []).forEach((reward, index) => {
|
|
163
|
-
const msg = (data.InterimRewardMessages || [])[index] || {};
|
|
164
|
-
this.interimSteps[index] = {
|
|
165
|
-
goal: Number.parseInt(String(data.InterimGoals[index]), 10),
|
|
166
|
-
reward: reward ? new Reward(reward, opts) : void 0,
|
|
167
|
-
message: {
|
|
168
|
-
sender: languageString(msg.sender, locale),
|
|
169
|
-
subject: languageString(msg.subject, locale),
|
|
170
|
-
message: languageString(msg.message, locale),
|
|
171
|
-
senderIcon: msg.senderIcon,
|
|
172
|
-
attachments: msg.attachments
|
|
173
|
-
},
|
|
174
|
-
winnerCount: (data._interimWinnerCounts || [])[index]
|
|
175
|
-
};
|
|
176
|
-
});
|
|
177
|
-
this.progressSteps = [];
|
|
178
|
-
if (data.IsMultiProgress) {
|
|
179
|
-
data.Types?.forEach((type, index) => {
|
|
180
|
-
this.progressSteps[index] = {
|
|
181
|
-
type: languageString(type, locale),
|
|
182
|
-
progressAmt: Number.parseInt(String(data.MultiProgress[index]), 10)
|
|
183
|
-
};
|
|
184
|
-
});
|
|
185
|
-
this.progressTotal = Number.parseFloat(String(data.MultiProgress.reduce((acc, val) => acc + Number.parseFloat(val), 0)));
|
|
186
|
-
}
|
|
187
|
-
this.showTotalAtEndOfMission = data.ShowTotalAtEOM ?? false;
|
|
188
|
-
this.isPersonal = data.Personal;
|
|
189
|
-
this.isCommunity = data.Community ?? false;
|
|
190
|
-
this.regionDrops = (data.RegionDrops || []).map((drop) => languageString(drop, locale));
|
|
191
|
-
this.archwingDrops = (data.ArchwingDrops || []).map((drop) => languageString(drop, locale));
|
|
192
|
-
this.metadata = JSON.parse((data.Metadata || "{}").replace("\" ", "\""));
|
|
193
|
-
this.completionBonuses = data.CompletionBonus || [];
|
|
194
|
-
this.scoreVar = data.ScoreVar;
|
|
195
|
-
this.altExpiry = parseDate(data.AltExpiry);
|
|
196
|
-
this.altActivation = parseDate(data.AltActivation);
|
|
197
|
-
this.nextAlt = {
|
|
198
|
-
expiry: parseDate(data.NextAltExpiry),
|
|
199
|
-
activation: parseDate(data.NextAltActivation)
|
|
200
|
-
};
|
|
201
|
-
if (data.JobAffiliationTag) this.affiliatedWith = syndicate(data.JobAffiliationTag, locale);
|
|
202
|
-
this.tag = data.Tag;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Whether the event has expired
|
|
206
|
-
*/
|
|
207
|
-
get expired() {
|
|
208
|
-
return fromNow(this.expiry) < 0;
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
//#endregion
|
|
213
|
-
export { WorldEvent as t };
|