feat: syndicate mission rotation
This commit is contained in:
		
							parent
							
								
									731be0d5e3
								
							
						
					
					
						commit
						6cf17e8bf4
					
				@ -174,7 +174,47 @@ const getSortieTime = (day: number): number => {
 | 
				
			|||||||
    return dayStart + (isDst ? 16 : 17) * 3600000;
 | 
					    return dayStart + (isDst ? 16 : 17) * 3600000;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const pushSortieIfRelevant = (out: ISortie[], day: number): void => {
 | 
					const pushSyndicateMissions = (
 | 
				
			||||||
 | 
					    worldState: IWorldState,
 | 
				
			||||||
 | 
					    day: number,
 | 
				
			||||||
 | 
					    seed: number,
 | 
				
			||||||
 | 
					    idSuffix: string,
 | 
				
			||||||
 | 
					    syndicateTag: string
 | 
				
			||||||
 | 
					): void => {
 | 
				
			||||||
 | 
					    const nodeOptions: string[] = [];
 | 
				
			||||||
 | 
					    for (const [key, value] of Object.entries(ExportRegions)) {
 | 
				
			||||||
 | 
					        if (
 | 
				
			||||||
 | 
					            value.name.indexOf("Archwing") == -1 && // no archwing
 | 
				
			||||||
 | 
					            value.systemIndex != 23 && // no 1999 stuff
 | 
				
			||||||
 | 
					            value.missionIndex != 10 && // Exclude MT_PVP (for relays)
 | 
				
			||||||
 | 
					            value.missionIndex != 23 && // no junctions
 | 
				
			||||||
 | 
					            value.missionIndex <= 28 // no railjack or some such
 | 
				
			||||||
 | 
					        ) {
 | 
				
			||||||
 | 
					            nodeOptions.push(key);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const rng = new CRng(seed);
 | 
				
			||||||
 | 
					    const nodes: string[] = [];
 | 
				
			||||||
 | 
					    for (let i = 0; i != 6; ++i) {
 | 
				
			||||||
 | 
					        const index = rng.randomInt(0, nodeOptions.length - 1);
 | 
				
			||||||
 | 
					        nodes.push(nodeOptions[index]);
 | 
				
			||||||
 | 
					        nodeOptions.splice(index, 1);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const dayStart = getSortieTime(day);
 | 
				
			||||||
 | 
					    const dayEnd = getSortieTime(day + 1);
 | 
				
			||||||
 | 
					    worldState.SyndicateMissions.push({
 | 
				
			||||||
 | 
					        _id: { $oid: Math.trunc(dayStart / 1000).toString(16) + idSuffix },
 | 
				
			||||||
 | 
					        Activation: { $date: { $numberLong: dayStart.toString() } },
 | 
				
			||||||
 | 
					        Expiry: { $date: { $numberLong: dayEnd.toString() } },
 | 
				
			||||||
 | 
					        Tag: syndicateTag,
 | 
				
			||||||
 | 
					        Seed: seed,
 | 
				
			||||||
 | 
					        Nodes: nodes
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const pushSortieIfRelevant = (worldState: IWorldState, day: number): void => {
 | 
				
			||||||
    const dayStart = getSortieTime(day);
 | 
					    const dayStart = getSortieTime(day);
 | 
				
			||||||
    if (!isBeforeNextExpectedWorldStateRefresh(dayStart)) {
 | 
					    if (!isBeforeNextExpectedWorldStateRefresh(dayStart)) {
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
@ -231,6 +271,7 @@ const pushSortieIfRelevant = (out: ISortie[], day: number): void => {
 | 
				
			|||||||
            value.name.indexOf("Archwing") == -1 &&
 | 
					            value.name.indexOf("Archwing") == -1 &&
 | 
				
			||||||
            value.missionIndex != 0 && // Exclude MT_ASSASSINATION
 | 
					            value.missionIndex != 0 && // Exclude MT_ASSASSINATION
 | 
				
			||||||
            value.missionIndex != 5 && // Exclude MT_CAPTURE
 | 
					            value.missionIndex != 5 && // Exclude MT_CAPTURE
 | 
				
			||||||
 | 
					            value.missionIndex != 10 && // Exclude MT_PVP (for relays)
 | 
				
			||||||
            value.missionIndex != 21 && // Exclude MT_PURIFY
 | 
					            value.missionIndex != 21 && // Exclude MT_PURIFY
 | 
				
			||||||
            value.missionIndex != 22 && // Exclude MT_ARENA
 | 
					            value.missionIndex != 22 && // Exclude MT_ARENA
 | 
				
			||||||
            value.missionIndex != 23 && // Exclude MT_JUNCTION
 | 
					            value.missionIndex != 23 && // Exclude MT_JUNCTION
 | 
				
			||||||
@ -292,7 +333,7 @@ const pushSortieIfRelevant = (out: ISortie[], day: number): void => {
 | 
				
			|||||||
        missionTypes.add(missionType);
 | 
					        missionTypes.add(missionType);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    out.push({
 | 
					    worldState.Sorties.push({
 | 
				
			||||||
        _id: { $oid: Math.trunc(dayStart / 1000).toString(16) + "d4d932c97c0a3acd" },
 | 
					        _id: { $oid: Math.trunc(dayStart / 1000).toString(16) + "d4d932c97c0a3acd" },
 | 
				
			||||||
        Activation: { $date: { $numberLong: dayStart.toString() } },
 | 
					        Activation: { $date: { $numberLong: dayStart.toString() } },
 | 
				
			||||||
        Expiry: { $date: { $numberLong: dayEnd.toString() } },
 | 
					        Expiry: { $date: { $numberLong: dayEnd.toString() } },
 | 
				
			||||||
@ -301,6 +342,13 @@ const pushSortieIfRelevant = (out: ISortie[], day: number): void => {
 | 
				
			|||||||
        Boss: boss,
 | 
					        Boss: boss,
 | 
				
			||||||
        Variants: selectedNodes
 | 
					        Variants: selectedNodes
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pushSyndicateMissions(worldState, day, rng.randomInt(0, 0xffff), "ba6f84724fa48049", "ArbitersSyndicate");
 | 
				
			||||||
 | 
					    pushSyndicateMissions(worldState, day, rng.randomInt(0, 0xffff), "ba6f84724fa4804a", "CephalonSudaSyndicate");
 | 
				
			||||||
 | 
					    pushSyndicateMissions(worldState, day, rng.randomInt(0, 0xffff), "ba6f84724fa4804e", "NewLokaSyndicate");
 | 
				
			||||||
 | 
					    pushSyndicateMissions(worldState, day, rng.randomInt(0, 0xffff), "ba6f84724fa48050", "PerrinSyndicate");
 | 
				
			||||||
 | 
					    pushSyndicateMissions(worldState, day, rng.randomInt(0, 0xffff), "ba6f84724fa4805e", "RedVeilSyndicate");
 | 
				
			||||||
 | 
					    pushSyndicateMissions(worldState, day, rng.randomInt(0, 0xffff), "ba6f84724fa48061", "SteelMeridianSyndicate");
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const dailyChallenges = Object.keys(ExportNightwave.challenges).filter(x =>
 | 
					const dailyChallenges = Object.keys(ExportNightwave.challenges).filter(x =>
 | 
				
			||||||
@ -953,9 +1001,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
 | 
				
			|||||||
        });
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Sortie cycling every day
 | 
					    // Sortie & syndicate missions cycling every day (at 16:00 or 17:00 UTC depending on if London, OT is observing DST)
 | 
				
			||||||
    pushSortieIfRelevant(worldState.Sorties, day - 1);
 | 
					    pushSortieIfRelevant(worldState, day - 1);
 | 
				
			||||||
    pushSortieIfRelevant(worldState.Sorties, day);
 | 
					    pushSortieIfRelevant(worldState, day);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Archon Hunt cycling every week
 | 
					    // Archon Hunt cycling every week
 | 
				
			||||||
    worldState.LiteSorties.push(getLiteSortie(week));
 | 
					    worldState.LiteSorties.push(getLiteSortie(week));
 | 
				
			||||||
 | 
				
			|||||||
@ -63,22 +63,6 @@
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
  "SyndicateMissions": [
 | 
					  "SyndicateMissions": [
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      "_id": { "$oid": "663a4fc5ba6f84724fa48049" },
 | 
					 | 
				
			||||||
      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
					 | 
				
			||||||
      "Expiry": { "$date": { "$numberLong": "2000000000000" } },
 | 
					 | 
				
			||||||
      "Tag": "ArbitersSyndicate",
 | 
					 | 
				
			||||||
      "Seed": 24491,
 | 
					 | 
				
			||||||
      "Nodes": ["SolNode223", "SolNode89", "SolNode146", "SolNode212", "SolNode167", "SolNode48", "SolNode78"]
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      "_id": { "$oid": "663a4fc5ba6f84724fa4804a" },
 | 
					 | 
				
			||||||
      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
					 | 
				
			||||||
      "Expiry": { "$date": { "$numberLong": "2000000000000" } },
 | 
					 | 
				
			||||||
      "Tag": "CephalonSudaSyndicate",
 | 
					 | 
				
			||||||
      "Seed": 12770,
 | 
					 | 
				
			||||||
      "Nodes": ["SolNode36", "SolNode59", "SettlementNode12", "SolNode61", "SolNode12", "SolNode138", "SolNode72"]
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      "_id": { "$oid": "663a4fc5ba6f84724fa4804c" },
 | 
					      "_id": { "$oid": "663a4fc5ba6f84724fa4804c" },
 | 
				
			||||||
      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
					      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
				
			||||||
@ -103,14 +87,6 @@
 | 
				
			|||||||
      "Seed": 50102,
 | 
					      "Seed": 50102,
 | 
				
			||||||
      "Nodes": []
 | 
					      "Nodes": []
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      "_id": { "$oid": "663a4fc5ba6f84724fa4804e" },
 | 
					 | 
				
			||||||
      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
					 | 
				
			||||||
      "Expiry": { "$date": { "$numberLong": "2000000000000" } },
 | 
					 | 
				
			||||||
      "Tag": "NewLokaSyndicate",
 | 
					 | 
				
			||||||
      "Seed": 16064,
 | 
					 | 
				
			||||||
      "Nodes": ["SolNode101", "SolNode224", "SolNode205", "SettlementNode2", "SolNode171", "SolNode188", "SolNode75"]
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      "_id": { "$oid": "663a4fc5ba6f84724fa4804f" },
 | 
					      "_id": { "$oid": "663a4fc5ba6f84724fa4804f" },
 | 
				
			||||||
      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
					      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
				
			||||||
@ -119,14 +95,6 @@
 | 
				
			|||||||
      "Seed": 77721,
 | 
					      "Seed": 77721,
 | 
				
			||||||
      "Nodes": []
 | 
					      "Nodes": []
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      "_id": { "$oid": "663a4fc5ba6f84724fa48050" },
 | 
					 | 
				
			||||||
      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
					 | 
				
			||||||
      "Expiry": { "$date": { "$numberLong": "2000000000000" } },
 | 
					 | 
				
			||||||
      "Tag": "PerrinSyndicate",
 | 
					 | 
				
			||||||
      "Seed": 9940,
 | 
					 | 
				
			||||||
      "Nodes": ["SolNode39", "SolNode14", "SolNode203", "SolNode100", "SolNode130", "SolNode64", "SettlementNode15"]
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      "_id": { "$oid": "663a4fc5ba6f84724fa48052" },
 | 
					      "_id": { "$oid": "663a4fc5ba6f84724fa48052" },
 | 
				
			||||||
      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
					      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
				
			||||||
@ -255,14 +223,6 @@
 | 
				
			|||||||
      "Seed": 67257,
 | 
					      "Seed": 67257,
 | 
				
			||||||
      "Nodes": []
 | 
					      "Nodes": []
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      "_id": { "$oid": "663a4fc5ba6f84724fa4805e" },
 | 
					 | 
				
			||||||
      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
					 | 
				
			||||||
      "Expiry": { "$date": { "$numberLong": "2000000000000" } },
 | 
					 | 
				
			||||||
      "Tag": "RedVeilSyndicate",
 | 
					 | 
				
			||||||
      "Seed": 46649,
 | 
					 | 
				
			||||||
      "Nodes": ["SolNode226", "SolNode79", "SolNode216", "SettlementNode11", "SolNode56", "SolNode41", "SolNode23"]
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      "_id": { "$oid": "663a4fc5ba6f84724fa48060" },
 | 
					      "_id": { "$oid": "663a4fc5ba6f84724fa48060" },
 | 
				
			||||||
      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
					      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
				
			||||||
@ -270,14 +230,6 @@
 | 
				
			|||||||
      "Tag": "VoxSyndicate",
 | 
					      "Tag": "VoxSyndicate",
 | 
				
			||||||
      "Seed": 77972,
 | 
					      "Seed": 77972,
 | 
				
			||||||
      "Nodes": []
 | 
					      "Nodes": []
 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      "_id": { "$oid": "663a4fc5ba6f84724fa48061" },
 | 
					 | 
				
			||||||
      "Activation": { "$date": { "$numberLong": "1715097541439" } },
 | 
					 | 
				
			||||||
      "Expiry": { "$date": { "$numberLong": "2000000000000" } },
 | 
					 | 
				
			||||||
      "Tag": "SteelMeridianSyndicate",
 | 
					 | 
				
			||||||
      "Seed": 42366,
 | 
					 | 
				
			||||||
      "Nodes": ["SolNode27", "SolNode107", "SolNode214", "SettlementNode1", "SolNode177", "SolNode141", "SolNode408"]
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
  "ActiveMissions": [
 | 
					  "ActiveMissions": [
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user