feat: rewards for enemy caches & rathuum #384
@ -23,7 +23,10 @@ const getRewards = ({
|
|||||||
return { InventoryChanges: {}, MissionRewards: [] };
|
return { InventoryChanges: {}, MissionRewards: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
const rewardManifests = ExportRegions[RewardInfo.node]?.rewardManifests ?? [];
|
const drops: IReward[] = [];
|
||||||
|
if (RewardInfo.node in ExportRegions) {
|
||||||
|
const region = ExportRegions[RewardInfo.node];
|
||||||
|
const rewardManifests = region.rewardManifests ?? [];
|
||||||
if (rewardManifests.length == 0) {
|
if (rewardManifests.length == 0) {
|
||||||
return { InventoryChanges: {}, MissionRewards: [] };
|
return { InventoryChanges: {}, MissionRewards: [] };
|
||||||
}
|
}
|
||||||
@ -38,7 +41,6 @@ const getRewards = ({
|
|||||||
const rotationCount = RewardInfo.rewardQualifications?.length || 0;
|
const rotationCount = RewardInfo.rewardQualifications?.length || 0;
|
||||||
rotations = getRotations(rotationCount);
|
rotations = getRotations(rotationCount);
|
||||||
}
|
}
|
||||||
const drops: IReward[] = [];
|
|
||||||
rewardManifests
|
rewardManifests
|
||||||
.map(name => ExportRewards[name])
|
.map(name => ExportRewards[name])
|
||||||
.forEach(table => {
|
.forEach(table => {
|
||||||
@ -51,6 +53,17 @@ const getRewards = ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (region.cacheRewardManifest && RewardInfo.EnemyCachesFound) {
|
||||||
|
const deck = ExportRewards[region.cacheRewardManifest];
|
||||||
|
for (let rotation = 0; rotation != RewardInfo.EnemyCachesFound; ++rotation) {
|
||||||
|
const drop = getRandomRewardByChance(deck[rotation]);
|
||||||
|
if (drop) {
|
||||||
|
drops.push(drop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
logger.debug("Mission rewards:", drops);
|
logger.debug("Mission rewards:", drops);
|
||||||
return formatRewardsToInventoryType(drops);
|
return formatRewardsToInventoryType(drops);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user