feat: Quests1 #852
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user