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

SpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/SpaceNinjaServer

feat: give skiajati and umbra mods alongside umbra, with max rank and potatoes (#2442)

Not 100% sure if the response format is correct and if this is even the correct time/place to do it, but impossible to say without a log from live. Closes #1054 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2442 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

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

代码差异

3 个文件 +130 -18
Modified src/controllers/api/claimCompletedRecipeController.ts +119 -12
@@ -14,7 +14,9 @@ import {
14 14 addRecipes,
15 15 occupySlot,
16 16 combineInventoryChanges,
17 addKubrowPetPrint
17 addKubrowPetPrint,
18 addPowerSuit,
19 addEquipment
18 20 } from "@/src/services/inventoryService";
19 21 import { IInventoryChanges } from "@/src/types/purchaseTypes";
20 22 import { InventorySlot, IPendingRecipeDatabase } from "@/src/types/inventoryTypes/inventoryTypes";
@@ -22,7 +24,7 @@ import { toOid2 } from "@/src/helpers/inventoryHelpers";
22 24 import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
23 25 import { IRecipe } from "warframe-public-export-plus";
24 26 import { config } from "@/src/services/configService";
25 import { IEquipmentClient, Status } from "@/src/types/equipmentTypes";
27 import { EquipmentFeatures, IEquipmentClient, Status } from "@/src/types/equipmentTypes";
26 28
27 29 interface IClaimCompletedRecipeRequest {
28 30 RecipeIds: IOid[];
@@ -124,17 +126,122 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) =
124 126 const pet = inventory.KubrowPets.id(pendingRecipe.KubrowPet!)!;
125 127 addKubrowPetPrint(inventory, pet, InventoryChanges);
126 128 } else if (recipe.secretIngredientAction != "SIA_UNBRAND") {
127 InventoryChanges = {
128 ...InventoryChanges,
129 ...(await addItem(
129 if (recipe.resultType == "/Lotus/Powersuits/Excalibur/ExcaliburUmbra") {
130 // Quite the special case here...
131 // We don't just get Umbra, but also Skiajati and Umbra Mods. Both items are max rank, potatoed, and with the mods are pre-installed.
132 // Source: https://wiki.warframe.com/w/The_Sacrifice, https://wiki.warframe.com/w/Excalibur/Umbra, https://wiki.warframe.com/w/Skiajati
133
134 const umbraModA = (
135 await addItem(
136 inventory,
137 "/Lotus/Upgrades/Mods/Sets/Umbra/WarframeUmbraModA",
138 1,
139 false,
140 undefined,
141 `{"lvl":5}`
142 )
143 ).Upgrades![0];
144 const umbraModB = (
145 await addItem(
146 inventory,
147 "/Lotus/Upgrades/Mods/Sets/Umbra/WarframeUmbraModB",
148 1,
149 false,
150 undefined,
151 `{"lvl":5}`
152 )
153 ).Upgrades![0];
154 const umbraModC = (
155 await addItem(
156 inventory,
157 "/Lotus/Upgrades/Mods/Sets/Umbra/WarframeUmbraModC",
158 1,
159 false,
160 undefined,
161 `{"lvl":5}`
162 )
163 ).Upgrades![0];
164 const sacrificeModA = (
165 await addItem(
166 inventory,
167 "/Lotus/Upgrades/Mods/Sets/Sacrifice/MeleeSacrificeModA",
168 1,
169 false,
170 undefined,
171 `{"lvl":5}`
172 )
173 ).Upgrades![0];
174 const sacrificeModB = (
175 await addItem(
176 inventory,
177 "/Lotus/Upgrades/Mods/Sets/Sacrifice/MeleeSacrificeModB",
178 1,
179 false,
180 undefined,
181 `{"lvl":5}`
182 )
183 ).Upgrades![0];
184 InventoryChanges.Upgrades ??= [];
185 InventoryChanges.Upgrades.push(umbraModA, umbraModB, umbraModC, sacrificeModA, sacrificeModB);
186
187 await addPowerSuit(
130 188 inventory,
131 recipe.resultType,
132 recipe.num,
133 false,
134 undefined,
135 pendingRecipe.TargetFingerprint
136 ))
137 };
189 "/Lotus/Powersuits/Excalibur/ExcaliburUmbra",
190 {
191 Configs: [
192 {
193 Upgrades: [
194 "",
195 "",
196 "",
197 "",
198 "",
199 umbraModA.ItemId.$oid,
200 umbraModB.ItemId.$oid,
201 umbraModC.ItemId.$oid
202 ]
203 }
204 ],
205 XP: 900_000,
206 Features: EquipmentFeatures.DOUBLE_CAPACITY
207 },
208 InventoryChanges
209 );
210 inventory.XPInfo.push({
211 ItemType: "/Lotus/Powersuits/Excalibur/ExcaliburUmbra",
212 XP: 900_000
213 });
214
215 addEquipment(
216 inventory,
217 "Melee",
218 "/Lotus/Weapons/Tenno/Melee/Swords/UmbraKatana/UmbraKatana",
219 {
220 Configs: [
221 { Upgrades: ["", "", "", "", "", "", sacrificeModA.ItemId.$oid, sacrificeModB.ItemId.$oid] }
222 ],
223 XP: 450_000,
224 Features: EquipmentFeatures.DOUBLE_CAPACITY
225 },
226 InventoryChanges
227 );
228 inventory.XPInfo.push({
229 ItemType: "/Lotus/Weapons/Tenno/Melee/Swords/UmbraKatana/UmbraKatana",
230 XP: 450_000
231 });
232 } else {
233 InventoryChanges = {
234 ...InventoryChanges,
235 ...(await addItem(
236 inventory,
237 recipe.resultType,
238 recipe.num,
239 false,
240 undefined,
241 pendingRecipe.TargetFingerprint
242 ))
243 };
244 }
138 245 }
139 246 if (
140 247 config.claimingBlueprintRefundsIngredients &&
Modified src/services/inventoryService.ts +8 -5
@@ -482,11 +482,14 @@ export const addItem = async (
482 482 if (quantity != 1) {
483 483 logger.warn(`adding 1 of ${typeName} ${targetFingerprint} even tho quantity ${quantity} was requested`);
484 484 }
485 inventory.Upgrades.push({
486 ItemType: typeName,
487 UpgradeFingerprint: targetFingerprint
488 });
489 return {}; // there's not exactly a common "InventoryChanges" format for these
485 const upgrade =
486 inventory.Upgrades[
487 inventory.Upgrades.push({
488 ItemType: typeName,
489 UpgradeFingerprint: targetFingerprint
490 }) - 1
491 ];
492 return { Upgrades: [upgrade.toJSON<IUpgradeClient>()] };
490 493 }
491 494 const changes = [
492 495 {
Modified src/types/purchaseTypes.ts +3 -1
@@ -8,7 +8,8 @@ import {
8 8 IRecentVendorPurchaseClient,
9 9 TEquipmentKey,
10 10 ICrewMemberClient,
11 IKubrowPetPrintClient
11 IKubrowPetPrintClient,
12 IUpgradeClient
12 13 } from "@/src/types/inventoryTypes/inventoryTypes";
13 14
14 15 export enum PurchaseSource {
@@ -80,6 +81,7 @@ export type IInventoryChanges = {
80 81 RecentVendorPurchases?: IRecentVendorPurchaseClient; // < 38.5.0
81 82 CrewMembers?: ICrewMemberClient[];
82 83 KubrowPetPrints?: IKubrowPetPrintClient[];
84 Upgrades?: IUpgradeClient[]; // TOVERIFY
83 85 } & Record<
84 86 Exclude<
85 87 string,