fix: only consider market-listed blueprints for login reward
This commit is contained in:
		
							parent
							
								
									45748fa8be
								
							
						
					
					
						commit
						0cefe36d83
					
				
							
								
								
									
										8
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										8
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@ -18,7 +18,7 @@
 | 
				
			|||||||
        "morgan": "^1.10.0",
 | 
					        "morgan": "^1.10.0",
 | 
				
			||||||
        "ncp": "^2.0.0",
 | 
					        "ncp": "^2.0.0",
 | 
				
			||||||
        "typescript": "^5.5",
 | 
					        "typescript": "^5.5",
 | 
				
			||||||
        "warframe-public-export-plus": "^0.5.58",
 | 
					        "warframe-public-export-plus": "^0.5.59",
 | 
				
			||||||
        "warframe-riven-info": "^0.1.2",
 | 
					        "warframe-riven-info": "^0.1.2",
 | 
				
			||||||
        "winston": "^3.17.0",
 | 
					        "winston": "^3.17.0",
 | 
				
			||||||
        "winston-daily-rotate-file": "^5.0.0"
 | 
					        "winston-daily-rotate-file": "^5.0.0"
 | 
				
			||||||
@ -3789,9 +3789,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/warframe-public-export-plus": {
 | 
					    "node_modules/warframe-public-export-plus": {
 | 
				
			||||||
      "version": "0.5.58",
 | 
					      "version": "0.5.59",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.58.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.59.tgz",
 | 
				
			||||||
      "integrity": "sha512-2G3tKcoblUl7S3Rkk5k/qH+VGZBUmU2QjtIrEO/Bt6UlgO83s648elkNdDKOLBKXnxIsa194nVwz+ci1K86sXg=="
 | 
					      "integrity": "sha512-/SUCVjngVDBz6gahz7CdVLywtHLODL6O5nmNtQcxFDUwrUGnF1lETcG8/UO+WLeGxBVAy4BDPbq+9ZWlYZM4uQ=="
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/warframe-riven-info": {
 | 
					    "node_modules/warframe-riven-info": {
 | 
				
			||||||
      "version": "0.1.2",
 | 
					      "version": "0.1.2",
 | 
				
			||||||
 | 
				
			|||||||
@ -25,7 +25,7 @@
 | 
				
			|||||||
    "morgan": "^1.10.0",
 | 
					    "morgan": "^1.10.0",
 | 
				
			||||||
    "ncp": "^2.0.0",
 | 
					    "ncp": "^2.0.0",
 | 
				
			||||||
    "typescript": "^5.5",
 | 
					    "typescript": "^5.5",
 | 
				
			||||||
    "warframe-public-export-plus": "^0.5.58",
 | 
					    "warframe-public-export-plus": "^0.5.59",
 | 
				
			||||||
    "warframe-riven-info": "^0.1.2",
 | 
					    "warframe-riven-info": "^0.1.2",
 | 
				
			||||||
    "winston": "^3.17.0",
 | 
					    "winston": "^3.17.0",
 | 
				
			||||||
    "winston-daily-rotate-file": "^5.0.0"
 | 
					    "winston-daily-rotate-file": "^5.0.0"
 | 
				
			||||||
 | 
				
			|||||||
@ -77,7 +77,6 @@ const getRandomLoginReward = (rng: CRng, day: number, inventory: TInventoryDatab
 | 
				
			|||||||
    const reward = rng.randomReward(randomRewards)!;
 | 
					    const reward = rng.randomReward(randomRewards)!;
 | 
				
			||||||
    //const reward = randomRewards.find(x => x.RewardType == "RT_BOOSTER")!;
 | 
					    //const reward = randomRewards.find(x => x.RewardType == "RT_BOOSTER")!;
 | 
				
			||||||
    if (reward.RewardType == "RT_RANDOM_RECIPE") {
 | 
					    if (reward.RewardType == "RT_RANDOM_RECIPE") {
 | 
				
			||||||
        // Not very faithful implementation but roughly the same idea
 | 
					 | 
				
			||||||
        const masteredItems = new Set();
 | 
					        const masteredItems = new Set();
 | 
				
			||||||
        for (const entry of inventory.XPInfo) {
 | 
					        for (const entry of inventory.XPInfo) {
 | 
				
			||||||
            masteredItems.add(entry.ItemType);
 | 
					            masteredItems.add(entry.ItemType);
 | 
				
			||||||
@ -95,12 +94,12 @@ const getRandomLoginReward = (rng: CRng, day: number, inventory: TInventoryDatab
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        const eligibleRecipes: string[] = [];
 | 
					        const eligibleRecipes: string[] = [];
 | 
				
			||||||
        for (const [uniqueName, recipe] of Object.entries(ExportRecipes)) {
 | 
					        for (const [uniqueName, recipe] of Object.entries(ExportRecipes)) {
 | 
				
			||||||
            if (unmasteredItems.has(recipe.resultType)) {
 | 
					            if (!recipe.excludeFromMarket && unmasteredItems.has(recipe.resultType)) {
 | 
				
			||||||
                eligibleRecipes.push(uniqueName);
 | 
					                eligibleRecipes.push(uniqueName);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (eligibleRecipes.length == 0) {
 | 
					        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);
 | 
					            return getRandomLoginReward(rng, day, inventory);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        reward.StoreItemType = toStoreItem(rng.randomElement(eligibleRecipes));
 | 
					        reward.StoreItemType = toStoreItem(rng.randomElement(eligibleRecipes));
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user