2025-03-22 06:08:00 -07:00
|
|
|
import { ExportRegions } from "warframe-public-export-plus";
|
|
|
|
import { IInfNode } from "@/src/types/inventoryTypes/inventoryTypes";
|
2025-03-22 07:30:16 -07:00
|
|
|
import { SRng } from "@/src/services/rngService";
|
2025-03-22 06:08:00 -07:00
|
|
|
|
|
|
|
export const getInfNodes = (faction: string, rank: number): IInfNode[] => {
|
|
|
|
const infNodes = [];
|
|
|
|
const systemIndex = systemIndexes[faction][rank];
|
|
|
|
for (const [key, value] of Object.entries(ExportRegions)) {
|
|
|
|
if (
|
|
|
|
value.systemIndex === systemIndex &&
|
|
|
|
value.nodeType != 3 && // not hub
|
|
|
|
value.nodeType != 7 && // not junction
|
|
|
|
value.missionIndex && // must have a mission type and not assassination
|
|
|
|
value.missionIndex != 28 && // not open world
|
|
|
|
value.missionIndex != 32 && // not railjack
|
|
|
|
value.missionIndex != 41 && // not saya's visions
|
|
|
|
value.missionIndex != 42 && // not face off
|
|
|
|
value.name.indexOf("1999NodeI") == -1 && // not stage defence
|
|
|
|
value.name.indexOf("1999NodeJ") == -1 && // not lich bounty
|
|
|
|
value.name.indexOf("Archwing") == -1
|
|
|
|
) {
|
|
|
|
//console.log(dict_en[value.name]);
|
|
|
|
infNodes.push({ Node: key, Influence: 1 });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return infNodes;
|
|
|
|
};
|
|
|
|
|
|
|
|
const systemIndexes: Record<string, number[]> = {
|
|
|
|
FC_GRINEER: [2, 3, 9, 11, 18],
|
|
|
|
FC_CORPUS: [1, 15, 4, 7, 8],
|
|
|
|
FC_INFESTATION: [23]
|
|
|
|
};
|
2025-03-22 07:30:16 -07:00
|
|
|
|
|
|
|
// Get a parazon 'passcode' based on the nemesis fingerprint so it's always the same for the same nemesis.
|
2025-04-12 19:23:23 +02:00
|
|
|
export const getNemesisPasscode = (nemesis: { fp: bigint; Faction: string }): number[] => {
|
|
|
|
const rng = new SRng(nemesis.fp);
|
2025-03-22 07:30:16 -07:00
|
|
|
const passcode = [rng.randomInt(0, 7)];
|
2025-04-12 19:23:23 +02:00
|
|
|
if (nemesis.Faction != "FC_INFESTATION") {
|
2025-03-22 07:30:16 -07:00
|
|
|
passcode.push(rng.randomInt(0, 7));
|
|
|
|
passcode.push(rng.randomInt(0, 7));
|
|
|
|
}
|
|
|
|
return passcode;
|
|
|
|
};
|
2025-04-12 19:57:55 +02:00
|
|
|
|
|
|
|
export const encodeNemesisGuess = (
|
|
|
|
symbol1: number,
|
|
|
|
result1: number,
|
|
|
|
symbol2: number,
|
|
|
|
result2: number,
|
|
|
|
symbol3: number,
|
|
|
|
result3: number
|
|
|
|
): number => {
|
|
|
|
return (
|
|
|
|
(symbol1 & 0xf) |
|
|
|
|
((result1 & 3) << 12) |
|
|
|
|
((symbol2 << 4) & 0xff) |
|
|
|
|
((result2 << 14) & 0xffff) |
|
|
|
|
((symbol3 & 0xf) << 8) |
|
|
|
|
((result3 & 3) << 16)
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const decodeNemesisGuess = (val: number): number[] => {
|
|
|
|
return [val & 0xf, (val >> 12) & 3, (val & 0xff) >> 4, (val & 0xffff) >> 14, (val >> 8) & 0xf, (val >> 16) & 3];
|
|
|
|
};
|