forked from OpenWF/SpaceNinjaServer
chore: add TNemesisFaction
This commit is contained in:
parent
382f8c55ce
commit
2a40449604
@ -24,7 +24,8 @@ import {
|
|||||||
IUpgradeClient,
|
IUpgradeClient,
|
||||||
IWeaponSkinClient,
|
IWeaponSkinClient,
|
||||||
LoadoutIndex,
|
LoadoutIndex,
|
||||||
TEquipmentKey
|
TEquipmentKey,
|
||||||
|
TNemesisFaction
|
||||||
} from "@/src/types/inventoryTypes/inventoryTypes";
|
} from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { logger } from "@/src/utils/logger";
|
import { logger } from "@/src/utils/logger";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
@ -269,7 +270,7 @@ interface INemesisStartRequest {
|
|||||||
WeaponIdx: number;
|
WeaponIdx: number;
|
||||||
AgentIdx: number;
|
AgentIdx: number;
|
||||||
BirthNode: string;
|
BirthNode: string;
|
||||||
Faction: string;
|
Faction: TNemesisFaction;
|
||||||
Rank: number;
|
Rank: number;
|
||||||
k: boolean;
|
k: boolean;
|
||||||
Traded: boolean;
|
Traded: boolean;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ExportRegions, ExportWarframes } from "warframe-public-export-plus";
|
import { ExportRegions, ExportWarframes } from "warframe-public-export-plus";
|
||||||
import { IInfNode, ITypeCount } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IInfNode, ITypeCount, TNemesisFaction } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { getRewardAtPercentage, SRng } from "@/src/services/rngService";
|
import { getRewardAtPercentage, SRng } from "@/src/services/rngService";
|
||||||
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
||||||
import { logger } from "../utils/logger";
|
import { logger } from "../utils/logger";
|
||||||
@ -11,7 +11,7 @@ import { fromStoreItem, toStoreItem } from "../services/itemDataService";
|
|||||||
import { createMessage } from "../services/inboxService";
|
import { createMessage } from "../services/inboxService";
|
||||||
import { version_compare } from "./inventoryHelpers";
|
import { version_compare } from "./inventoryHelpers";
|
||||||
|
|
||||||
export const getInfNodes = (faction: string, rank: number): IInfNode[] => {
|
export const getInfNodes = (faction: TNemesisFaction, rank: number): IInfNode[] => {
|
||||||
const infNodes = [];
|
const infNodes = [];
|
||||||
const systemIndex = systemIndexes[faction][rank];
|
const systemIndex = systemIndexes[faction][rank];
|
||||||
for (const [key, value] of Object.entries(ExportRegions)) {
|
for (const [key, value] of Object.entries(ExportRegions)) {
|
||||||
@ -35,20 +35,20 @@ export const getInfNodes = (faction: string, rank: number): IInfNode[] => {
|
|||||||
return infNodes;
|
return infNodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
const systemIndexes: Record<string, number[]> = {
|
const systemIndexes: Record<TNemesisFaction, number[]> = {
|
||||||
FC_GRINEER: [2, 3, 9, 11, 18],
|
FC_GRINEER: [2, 3, 9, 11, 18],
|
||||||
FC_CORPUS: [1, 15, 4, 7, 8],
|
FC_CORPUS: [1, 15, 4, 7, 8],
|
||||||
FC_INFESTATION: [23]
|
FC_INFESTATION: [23]
|
||||||
};
|
};
|
||||||
|
|
||||||
export const showdownNodes: Record<string, string> = {
|
export const showdownNodes: Record<TNemesisFaction, string> = {
|
||||||
FC_GRINEER: "CrewBattleNode557",
|
FC_GRINEER: "CrewBattleNode557",
|
||||||
FC_CORPUS: "CrewBattleNode558",
|
FC_CORPUS: "CrewBattleNode558",
|
||||||
FC_INFESTATION: "CrewBattleNode559"
|
FC_INFESTATION: "CrewBattleNode559"
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get a parazon 'passcode' based on the nemesis fingerprint so it's always the same for the same nemesis.
|
// Get a parazon 'passcode' based on the nemesis fingerprint so it's always the same for the same nemesis.
|
||||||
export const getNemesisPasscode = (nemesis: { fp: bigint; Faction: string }): number[] => {
|
export const getNemesisPasscode = (nemesis: { fp: bigint; Faction: TNemesisFaction }): number[] => {
|
||||||
const rng = new SRng(nemesis.fp);
|
const rng = new SRng(nemesis.fp);
|
||||||
const choices = [0, 1, 2, 3, 5, 6, 7];
|
const choices = [0, 1, 2, 3, 5, 6, 7];
|
||||||
let choiceIndex = rng.randomInt(0, choices.length - 1);
|
let choiceIndex = rng.randomInt(0, choices.length - 1);
|
||||||
@ -87,7 +87,7 @@ const antivirusMods: readonly string[] = [
|
|||||||
"/Lotus/Upgrades/Mods/Immortal/AntivirusEightMod"
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusEightMod"
|
||||||
];
|
];
|
||||||
|
|
||||||
export const getNemesisPasscodeModTypes = (nemesis: { fp: bigint; Faction: string }): string[] => {
|
export const getNemesisPasscodeModTypes = (nemesis: { fp: bigint; Faction: TNemesisFaction }): string[] => {
|
||||||
const passcode = getNemesisPasscode(nemesis);
|
const passcode = getNemesisPasscode(nemesis);
|
||||||
return nemesis.Faction == "FC_INFESTATION"
|
return nemesis.Faction == "FC_INFESTATION"
|
||||||
? passcode.map(i => antivirusMods[i])
|
? passcode.map(i => antivirusMods[i])
|
||||||
@ -248,7 +248,7 @@ export const getWeaponsForManifest = (manifest: string): readonly string[] => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const isNemesisCompatibleWithVersion = (
|
export const isNemesisCompatibleWithVersion = (
|
||||||
nemesis: { manifest: string; Faction: string },
|
nemesis: { manifest: string; Faction: TNemesisFaction },
|
||||||
buildLabel: string
|
buildLabel: string
|
||||||
): boolean => {
|
): boolean => {
|
||||||
// Anything below 35.6.0 is not going to be okay given our set of supported manifests.
|
// Anything below 35.6.0 is not going to be okay given our set of supported manifests.
|
||||||
|
@ -863,6 +863,8 @@ export interface IMission extends IMissionDatabase {
|
|||||||
RewardsCooldownTime?: IMongoDate;
|
RewardsCooldownTime?: IMongoDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type TNemesisFaction = "FC_GRINEER" | "FC_CORPUS" | "FC_INFESTATION";
|
||||||
|
|
||||||
export interface INemesisBaseClient {
|
export interface INemesisBaseClient {
|
||||||
fp: bigint | number;
|
fp: bigint | number;
|
||||||
manifest: string;
|
manifest: string;
|
||||||
@ -872,7 +874,7 @@ export interface INemesisBaseClient {
|
|||||||
WeaponIdx: number;
|
WeaponIdx: number;
|
||||||
AgentIdx: number;
|
AgentIdx: number;
|
||||||
BirthNode: string;
|
BirthNode: string;
|
||||||
Faction: string;
|
Faction: TNemesisFaction;
|
||||||
Rank: number;
|
Rank: number;
|
||||||
k: boolean;
|
k: boolean;
|
||||||
Traded: boolean;
|
Traded: boolean;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user