fix: handle creation of infested lich (#1252)
Some checks failed
Build Docker image / docker (push) Waiting to run
Build / build (20) (push) Has been cancelled
Build / build (22) (push) Has been cancelled
Build / build (18) (push) Has been cancelled

just setting the höllvania nodes and preventing the generation of a weapon index

Reviewed-on: #1252
This commit is contained in:
Sainan 2025-03-20 15:27:15 -07:00
parent b761ff1bff
commit 9d90a3ca26

View File

@ -13,8 +13,35 @@ export const nemesisController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const inventory = await getInventory(accountId, "Nemesis NemesisAbandonedRewards");
const body = getJSONfromString<INemesisStartRequest>(String(req.body));
body.target.fp = BigInt(body.target.fp);
const infNodes: IInfNode[] = [];
let infNodes: IInfNode[];
let weaponIdx = -1;
if (body.target.Faction == "FC_INFESTATION") {
infNodes = [
{
Node: "SolNode852",
Influence: 1
},
{
Node: "SolNode850",
Influence: 1
},
{
Node: "SolNode851",
Influence: 1
},
{
Node: "SolNode853",
Influence: 1
},
{
Node: "SolNode854",
Influence: 1
}
];
} else {
infNodes = [];
for (const [key, value] of Object.entries(ExportRegions)) {
if (
value.systemIndex == 2 && // earth
@ -43,9 +70,8 @@ export const nemesisController: RequestHandler = async (req, res) => {
throw new Error(`unknown nemesis manifest: ${body.target.manifest}`);
}
body.target.fp = BigInt(body.target.fp);
const initialWeaponIdx = new SRng(body.target.fp).randomInt(0, weapons.length - 1);
let weaponIdx = initialWeaponIdx;
weaponIdx = initialWeaponIdx;
do {
const weapon = weapons[weaponIdx];
if (!body.target.DisallowedWeapons.find(x => x == weapon)) {
@ -53,6 +79,8 @@ export const nemesisController: RequestHandler = async (req, res) => {
}
weaponIdx = (weaponIdx + 1) % weapons.length;
} while (weaponIdx != initialWeaponIdx);
}
inventory.Nemesis = {
fp: body.target.fp,
manifest: body.target.manifest,
@ -111,6 +139,8 @@ export interface INemesisStartRequest {
Weakened: boolean;
PrevOwners: number;
HenchmenKilled: number;
MissionCount?: number; // Added in 38.5.0
LastEnc?: number; // Added in 38.5.0
SecondInCommand: boolean;
};
}