forked from OpenWF/SpaceNinjaServer
		
	feat: conquest progression
This commit is contained in:
		
							parent
							
								
									daacbf6f7b
								
							
						
					
					
						commit
						aaa985e1ae
					
				@ -6,6 +6,7 @@ import { addMissionInventoryUpdates, addMissionRewards } from "@/src/services/mi
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getInventoryResponse } from "./inventoryController";
 | 
			
		||||
import { logger } from "@/src/utils/logger";
 | 
			
		||||
import { IMissionInventoryUpdateResponse } from "@/src/types/missionTypes";
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
**** INPUT ****
 | 
			
		||||
@ -78,7 +79,7 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
 | 
			
		||||
    const inventoryResponse = await getInventoryResponse(inventory, true);
 | 
			
		||||
 | 
			
		||||
    //TODO: figure out when to send inventory. it is needed for many cases.
 | 
			
		||||
    res.json({
 | 
			
		||||
    const response: IMissionInventoryUpdateResponse = {
 | 
			
		||||
        InventoryJson: JSON.stringify(inventoryResponse),
 | 
			
		||||
        InventoryChanges: inventoryChanges,
 | 
			
		||||
        MissionRewards,
 | 
			
		||||
@ -87,7 +88,12 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
 | 
			
		||||
        //FusionPoints: inventoryChanges?.FusionPoints, // This in combination with InventoryJson or InventoryChanges seems to just double the number of endo shown, so unsure when this is needed.
 | 
			
		||||
        SyndicateXPItemReward,
 | 
			
		||||
        AffiliationMods
 | 
			
		||||
    });
 | 
			
		||||
    };
 | 
			
		||||
    if (missionReport.ConquestMissionsCompleted !== undefined) {
 | 
			
		||||
        response.ConquestCompletedMissionsCount =
 | 
			
		||||
            missionReport.ConquestMissionsCompleted == 2 ? 0 : missionReport.ConquestMissionsCompleted + 1;
 | 
			
		||||
    }
 | 
			
		||||
    res.json(response);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
@ -43,7 +43,7 @@ import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/invento
 | 
			
		||||
import { getEntriesUnsafe } from "@/src/utils/ts-utils";
 | 
			
		||||
import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import { handleStoreItemAcquisition } from "./purchaseService";
 | 
			
		||||
import { IMissionReward } from "../types/missionTypes";
 | 
			
		||||
import { IMissionCredits, IMissionReward } from "../types/missionTypes";
 | 
			
		||||
import { crackRelic } from "@/src/helpers/relicHelper";
 | 
			
		||||
import { createMessage } from "./inboxService";
 | 
			
		||||
import kuriaMessage50 from "@/static/fixed_responses/kuriaMessages/fiftyPercent.json";
 | 
			
		||||
@ -885,13 +885,6 @@ export const addMissionRewards = async (
 | 
			
		||||
    return { inventoryChanges, MissionRewards, credits, AffiliationMods, SyndicateXPItemReward };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
interface IMissionCredits {
 | 
			
		||||
    MissionCredits: number[];
 | 
			
		||||
    CreditBonus: number[];
 | 
			
		||||
    TotalCredits: number[];
 | 
			
		||||
    DailyMissionBonus?: boolean;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//creditBonus is not entirely accurate.
 | 
			
		||||
//TODO: consider ActiveBoosters
 | 
			
		||||
export const addCredits = (
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,5 @@
 | 
			
		||||
import { IAffiliationMods, IInventoryChanges } from "./purchaseTypes";
 | 
			
		||||
 | 
			
		||||
export const inventoryFields = ["RawUpgrades", "MiscItems", "Consumables", "Recipes"] as const;
 | 
			
		||||
export type IInventoryFieldType = (typeof inventoryFields)[number];
 | 
			
		||||
 | 
			
		||||
@ -11,3 +13,20 @@ export interface IMissionReward {
 | 
			
		||||
    FromEnemyCache?: boolean;
 | 
			
		||||
    IsStrippedItem?: boolean;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface IMissionCredits {
 | 
			
		||||
    MissionCredits: number[];
 | 
			
		||||
    CreditBonus: number[];
 | 
			
		||||
    TotalCredits: number[];
 | 
			
		||||
    DailyMissionBonus?: boolean;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface IMissionInventoryUpdateResponse extends Partial<IMissionCredits> {
 | 
			
		||||
    ConquestCompletedMissionsCount?: number;
 | 
			
		||||
    InventoryJson?: string;
 | 
			
		||||
    MissionRewards?: IMissionReward[];
 | 
			
		||||
    InventoryChanges?: IInventoryChanges;
 | 
			
		||||
    FusionPoints?: number;
 | 
			
		||||
    SyndicateXPItemReward?: number;
 | 
			
		||||
    AffiliationMods?: IAffiliationMods[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -125,6 +125,7 @@ export type IMissionInventoryUpdateRequest = {
 | 
			
		||||
    wagerTier?: number; // the index
 | 
			
		||||
    creditsFee?: number; // the index
 | 
			
		||||
    InvasionProgress?: IInvasionProgressClient[];
 | 
			
		||||
    ConquestMissionsCompleted?: number;
 | 
			
		||||
} & {
 | 
			
		||||
    [K in TEquipmentKey]?: IEquipmentClient[];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user