XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

feat: eidolon & lua lens crafting (#3456)

Closes #3453 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3456 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

c4eeb6f1
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

3 个文件 +24 -5
Modified src/controllers/api/claimCompletedRecipeController.ts +9 -4
@@ -1,7 +1,7 @@
1 1 import type { RequestHandler } from "express";
2 2 import { logger } from "../../utils/logger.ts";
3 3 import { getRecipe } from "../../services/itemDataService.ts";
4 import type { IOidWithLegacySupport } from "../../types/commonTypes.ts";
4 import type { IOidWithLegacySupport, ITypeCount } from "../../types/commonTypes.ts";
5 5 import { getJSONfromString } from "../../helpers/stringHelpers.ts";
6 6 import type { TAccountDocument } from "../../services/loginService.ts";
7 7 import { getAccountForRequest } from "../../services/loginService.ts";
@@ -24,6 +24,7 @@ import type { TInventoryDatabaseDocument } from "../../models/inventoryModels/in
24 24 import type { IRecipe } from "warframe-public-export-plus";
25 25 import type { IEquipmentClient } from "../../types/equipmentTypes.ts";
26 26 import { EquipmentFeatures, Status } from "../../types/equipmentTypes.ts";
27 import { pseudoRecipeToOwnedRecipeMap } from "../../services/foundryService.ts";
27 28
28 29 interface IClaimCompletedRecipeRequest {
29 30 RecipeIds?: IOidWithLegacySupport[]; // U24.4 and beyond
@@ -146,12 +147,16 @@ const claimCompletedRecipe = async (
146 147 }
147 148
148 149 if (recipe.consumeOnUse) {
149 addRecipes(inventory, [
150 const recipeChanges: ITypeCount[] = [
150 151 {
151 ItemType: pendingRecipe.ItemType,
152 ItemType: pseudoRecipeToOwnedRecipeMap[pendingRecipe.ItemType] ?? pendingRecipe.ItemType,
152 153 ItemCount: -1
153 154 }
154 ]);
155 ];
156 addRecipes(inventory, recipeChanges);
157 if (recipeChanges[0].ItemType != pendingRecipe.ItemType) {
158 combineInventoryChanges(resp.InventoryChanges, { Recipes: recipeChanges });
159 }
155 160 }
156 161
157 162 if (rush) {
Modified src/controllers/custom/getItemListsController.ts +2 -1
@@ -28,6 +28,7 @@ import {
28 28 import allIncarnons from "../../../static/fixed_responses/allIncarnonList.json" with { type: "json" };
29 29 import varzia from "../../constants/varzia.ts";
30 30 import suitDefaultUpgrades from "../../constants/suitDefaultUpgrades.ts";
31 import { pseudoRecipeToOwnedRecipeMap } from "../../services/foundryService.ts";
31 32
32 33 interface ListedItem {
33 34 uniqueName: string;
@@ -301,7 +302,7 @@ const getItemListsController: RequestHandler = (req, response) => {
301 302 }
302 303 const recipeNameTemplate = getString("/Lotus/Language/Items/BlueprintAndItem", lang);
303 304 for (const [uniqueName, item] of Object.entries(ExportRecipes)) {
304 if (!item.hidden) {
305 if (!item.hidden && !(uniqueName in pseudoRecipeToOwnedRecipeMap)) {
305 306 const resultName = getItemName(item.resultType);
306 307 if (resultName) {
307 308 let itemName = getString(resultName, lang);
Added src/services/foundryService.ts +13 -0
@@ -0,0 +1,13 @@
1 // These are used internally for crafting these items, but only the 'generic' blueprint can/should be owned.
2 export const pseudoRecipeToOwnedRecipeMap: Record<string, string> = {
3 "/Lotus/Types/Recipes/Lens/AttackLensOstronBlueprint": "/Lotus/Types/Recipes/Lens/GenericLensOstronBlueprint",
4 "/Lotus/Types/Recipes/Lens/DefenseLensOstronBlueprint": "/Lotus/Types/Recipes/Lens/GenericLensOstronBlueprint",
5 "/Lotus/Types/Recipes/Lens/PowerLensOstronBlueprint": "/Lotus/Types/Recipes/Lens/GenericLensOstronBlueprint",
6 "/Lotus/Types/Recipes/Lens/TacticLensOstronBlueprint": "/Lotus/Types/Recipes/Lens/GenericLensOstronBlueprint",
7 "/Lotus/Types/Recipes/Lens/WardLensOstronBlueprint": "/Lotus/Types/Recipes/Lens/GenericLensOstronBlueprint",
8 "/Lotus/Types/Recipes/Lens/AttackLensLuaBlueprint": "/Lotus/Types/Recipes/Lens/GenericLensLuaBlueprint",
9 "/Lotus/Types/Recipes/Lens/DefenseLensLuaBlueprint": "/Lotus/Types/Recipes/Lens/GenericLensLuaBlueprint",
10 "/Lotus/Types/Recipes/Lens/PowerLensLuaBlueprint": "/Lotus/Types/Recipes/Lens/GenericLensLuaBlueprint",
11 "/Lotus/Types/Recipes/Lens/TacticLensLuaBlueprint": "/Lotus/Types/Recipes/Lens/GenericLensLuaBlueprint",
12 "/Lotus/Types/Recipes/Lens/WardLensLuaBlueprint": "/Lotus/Types/Recipes/Lens/GenericLensLuaBlueprint"
13 };