feat: nemesis mode p
All checks were successful
Build / build (20) (push) Successful in 40s
Build / build (18) (pull_request) Successful in 43s
Build / build (22) (pull_request) Successful in 1m13s
Build / build (18) (push) Successful in 1m11s
Build / build (22) (push) Successful in 1m14s
Build / build (20) (pull_request) Successful in 1m9s

This commit is contained in:
Sainan 2025-03-22 14:27:30 +01:00
parent c6a2785175
commit 356541ffe0
2 changed files with 38 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import { getInfNodes } from "@/src/helpers/nemesisHelpers";
import { getInfNodes, getNemesisPasscode } from "@/src/helpers/nemesisHelpers";
import { getJSONfromString } from "@/src/helpers/stringHelpers";
import { freeUpSlot, getInventory } from "@/src/services/inventoryService";
import { getAccountIdForRequest } from "@/src/services/loginService";
@ -45,6 +45,26 @@ export const nemesisController: RequestHandler = async (req, res) => {
[body.Category]: [destWeapon.toJSON()]
}
});
} else if ((req.query.mode as string) == "p") {
const inventory = await getInventory(accountId, "Nemesis");
const body = getJSONfromString<INemesisPrespawnCheckRequest>(String(req.body));
const passcode = getNemesisPasscode(inventory.Nemesis!.fp, inventory.Nemesis!.Faction);
let guessResult = 0;
if (inventory.Nemesis!.Faction == "FC_INFESTATION") {
for (let i = 0; i != 3; ++i) {
if (body.guess[i] == passcode[0]) {
guessResult = 1 + i;
break;
}
}
} else {
for (let i = 0; i != 3; ++i) {
if (body.guess[i] == passcode[i]) {
++guessResult;
}
}
}
res.json({ GuessResult: guessResult });
} else if ((req.query.mode as string) == "s") {
const inventory = await getInventory(accountId, "Nemesis NemesisAbandonedRewards");
const body = getJSONfromString<INemesisStartRequest>(String(req.body));
@ -148,6 +168,11 @@ interface INemesisStartRequest {
};
}
interface INemesisPrespawnCheckRequest {
guess: number[]; // .length == 3
potency?: number[];
}
const kuvaLichVersionSixWeapons = [
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Drakgoon/KuvaDrakgoon",
"/Lotus/Weapons/Grineer/KuvaLich/LongGuns/Karak/KuvaKarak",

View File

@ -1,5 +1,6 @@
import { ExportRegions } from "warframe-public-export-plus";
import { IInfNode } from "@/src/types/inventoryTypes/inventoryTypes";
import { SRng } from "@/src/services/rngService";
export const getInfNodes = (faction: string, rank: number): IInfNode[] => {
const infNodes = [];
@ -30,3 +31,14 @@ const systemIndexes: Record<string, number[]> = {
FC_CORPUS: [1, 15, 4, 7, 8],
FC_INFESTATION: [23]
};
// Get a parazon 'passcode' based on the nemesis fingerprint so it's always the same for the same nemesis.
export const getNemesisPasscode = (fp: bigint, faction: string): number[] => {
const rng = new SRng(fp);
const passcode = [rng.randomInt(0, 7)];
if (faction != "FC_INFESTATION") {
passcode.push(rng.randomInt(0, 7));
passcode.push(rng.randomInt(0, 7));
}
return passcode;
};