From 0cefe36d832b59cfbcfbd947fba952744710c9bf Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Mon, 28 Apr 2025 03:41:18 +0200 Subject: [PATCH] fix: only consider market-listed blueprints for login reward --- package-lock.json | 8 ++++---- package.json | 2 +- src/services/loginRewardService.ts | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 45cca760..beab4607 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "morgan": "^1.10.0", "ncp": "^2.0.0", "typescript": "^5.5", - "warframe-public-export-plus": "^0.5.58", + "warframe-public-export-plus": "^0.5.59", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0" @@ -3789,9 +3789,9 @@ } }, "node_modules/warframe-public-export-plus": { - "version": "0.5.58", - "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.58.tgz", - "integrity": "sha512-2G3tKcoblUl7S3Rkk5k/qH+VGZBUmU2QjtIrEO/Bt6UlgO83s648elkNdDKOLBKXnxIsa194nVwz+ci1K86sXg==" + "version": "0.5.59", + "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.59.tgz", + "integrity": "sha512-/SUCVjngVDBz6gahz7CdVLywtHLODL6O5nmNtQcxFDUwrUGnF1lETcG8/UO+WLeGxBVAy4BDPbq+9ZWlYZM4uQ==" }, "node_modules/warframe-riven-info": { "version": "0.1.2", diff --git a/package.json b/package.json index 816118ff..e5deb9bc 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "morgan": "^1.10.0", "ncp": "^2.0.0", "typescript": "^5.5", - "warframe-public-export-plus": "^0.5.58", + "warframe-public-export-plus": "^0.5.59", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0" diff --git a/src/services/loginRewardService.ts b/src/services/loginRewardService.ts index 2f42f04b..c897442e 100644 --- a/src/services/loginRewardService.ts +++ b/src/services/loginRewardService.ts @@ -77,7 +77,6 @@ const getRandomLoginReward = (rng: CRng, day: number, inventory: TInventoryDatab const reward = rng.randomReward(randomRewards)!; //const reward = randomRewards.find(x => x.RewardType == "RT_BOOSTER")!; if (reward.RewardType == "RT_RANDOM_RECIPE") { - // Not very faithful implementation but roughly the same idea const masteredItems = new Set(); for (const entry of inventory.XPInfo) { masteredItems.add(entry.ItemType); @@ -95,12 +94,12 @@ const getRandomLoginReward = (rng: CRng, day: number, inventory: TInventoryDatab } const eligibleRecipes: string[] = []; for (const [uniqueName, recipe] of Object.entries(ExportRecipes)) { - if (unmasteredItems.has(recipe.resultType)) { + if (!recipe.excludeFromMarket && unmasteredItems.has(recipe.resultType)) { eligibleRecipes.push(uniqueName); } } if (eligibleRecipes.length == 0) { - // This account has all warframes and weapons already mastered (filthy cheater), need a different reward. + // This account has all applicable warframes and weapons already mastered (filthy cheater), need a different reward. return getRandomLoginReward(rng, day, inventory); } reward.StoreItemType = toStoreItem(rng.randomElement(eligibleRecipes));