feat: Quests1 #852

Merged
OrdisPrime merged 8 commits from missioninventoryupdate-refactor-1 into main 2025-01-24 05:13:21 -08:00
3 changed files with 6 additions and 3 deletions
Showing only changes of commit 9eff55538d - Show all commits

View File

@ -57,6 +57,7 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
if (missionReport.MissionStatus !== "GS_SUCCESS") { if (missionReport.MissionStatus !== "GS_SUCCESS") {
console.log(`Mission failed: ${missionReport.RewardInfo?.node}`); console.log(`Mission failed: ${missionReport.RewardInfo?.node}`);
//todo: return expected response for failed mission //todo: return expected response for failed mission
res.json([]);
//duvirisadjob does not provide missionStatus //duvirisadjob does not provide missionStatus
} }

View File

@ -300,10 +300,12 @@ function getRandomMissionDrops(RewardInfo: IRewardInfo): IRngResult[] {
}); });
if (region.cacheRewardManifest && RewardInfo.EnemyCachesFound) { if (region.cacheRewardManifest && RewardInfo.EnemyCachesFound) {
console.log("cache rewards", RewardInfo.EnemyCachesFound);
const deck = ExportRewards[region.cacheRewardManifest]; const deck = ExportRewards[region.cacheRewardManifest];
for (let rotation = 0; rotation != RewardInfo.EnemyCachesFound; ++rotation) { for (let rotation = 0; rotation != RewardInfo.EnemyCachesFound; ++rotation) {
const drop = getRandomRewardByChance(deck[rotation]); const drop = getRandomRewardByChance(deck[rotation]);
if (drop) { if (drop) {
console.log("cache drop", drop);
drops.push(drop); drops.push(drop);
} }
} }

View File

@ -13,9 +13,9 @@ export const getPersonalRooms = async (accountId: string) => {
export const updateShipFeature = async (accountId: string, shipFeature: string) => { export const updateShipFeature = async (accountId: string, shipFeature: string) => {
const personalRooms = await getPersonalRooms(accountId); const personalRooms = await getPersonalRooms(accountId);
// if (personalRooms.Ship.Features.includes(shipFeature)) { if (personalRooms.Ship.Features.includes(shipFeature)) {
// throw new Error(`ship feature ${shipFeature} already unlocked`); throw new Error(`ship feature ${shipFeature} already unlocked`);
// } }
personalRooms.Ship.Features.push(shipFeature); personalRooms.Ship.Features.push(shipFeature);
await personalRooms.save(); await personalRooms.save();