Skip to content

Commit

Permalink
feat: initial support for void storms
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno committed Apr 14, 2021
1 parent f214879 commit eb139b8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
16 changes: 13 additions & 3 deletions lib/Fissure.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,17 @@ class Fissure extends WorldstateObject {
* The fissure mission type
* @type {string}
*/
this.missionType = translator.missionType(data.MissionType, locale);
this.missionType = data.MissionType
? translator.missionType(data.MissionType, locale)
: translator.nodeMissionType(data.Node, locale);

/**
* The fissure mission type key
* @type {string}
*/
this.missionKey = data.MissionType
? translator.missionType(data.MissionType)
: translator.nodeMissionType(data.Node);

/**
* The faction controlling the node where the fissure has appeared
Expand All @@ -59,13 +69,13 @@ class Fissure extends WorldstateObject {
* The fissure's tier
* @type {string}
*/
this.tier = translator.fissureModifier(data.Modifier, locale);
this.tier = translator.fissureModifier(data.Modifier || data.ActiveMissionTier, locale);

/**
* The fissure's tier as a number
* @type {number}
*/
this.tierNum = translator.fissureTier(data.Modifier, locale);
this.tierNum = translator.fissureTier(data.Modifier || data.ActiveMissionTier, locale);

/**
* The date and time at which the fissure appeared
Expand Down
5 changes: 3 additions & 2 deletions lib/WorldState.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@ class WorldState {
this.syndicateMissions = parseArray(deps.SyndicateMission, data.SyndicateMissions, deps, 'syndicate');

/**
* The current fissures
* The current fissures: 'ActiveMissions' & 'VoidStorms'
* @type {Array.<News>}
*/
this.fissures = parseArray(deps.Fissure, data.ActiveMissions, deps);
this.fissures = parseArray(deps.Fissure, data.ActiveMissions, deps)
.concat(parseArray(deps.Fissure, data.VoidStorms, deps));

/**
* The current global upgrades
Expand Down
2 changes: 1 addition & 1 deletion test/integration/integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('WorldState (integration)', () => {

/* Easy debugging! */
// setTimeout(() => {
// fs.writeFileSync(`./data.${platform}.json`, JSON.stringify(wsl.syndicateMissions));
// fs.writeFileSync(`./data.${platform}.json`, JSON.stringify(wsl.fissures));
// }, 1000);
});
});
Expand Down

0 comments on commit eb139b8

Please sign in to comment.