fix: handle creation of infested lich (#1252)
just setting the höllvania nodes and preventing the generation of a weapon index Reviewed-on: OpenWF/SpaceNinjaServer#1252
This commit is contained in:
		
							parent
							
								
									b761ff1bff
								
							
						
					
					
						commit
						9d90a3ca26
					
				@ -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;
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user