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: purchase focus cost (#4223)

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

c50c1d09
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

2 个文件 +13 -0
Modified src/services/purchaseService.ts +11 -0
@@ -340,6 +340,17 @@ export const handlePurchase = async (
340 340 purchaseResponse.InventoryChanges
341 341 );
342 342 }
343 if (offer.focusXpCost) {
344 const polarity = offer.focusXpCost.polarity;
345 const cost = offer.focusXpCost.cost * purchaseRequest.PurchaseParams.Quantity;
346 inventory.FocusXP ??= {};
347 inventory.FocusXP[polarity] ??= 0;
348 inventory.FocusXP[polarity] -= cost;
349 purchaseResponse.FocusCost = {
350 Polarity: polarity,
351 Cost: cost
352 };
353 }
343 354 }
344 355 } else {
345 356 let manifest = getVendorManifestByOid(
Modified src/types/purchaseTypes.ts +2 -0
@@ -1,3 +1,4 @@
1 import type { TFocusSchool } from "warframe-public-export-plus";
1 2 import type { IOid, ITypeCount } from "./commonTypes.ts";
2 3 import type { IEquipmentClient } from "./equipmentTypes.ts";
3 4 import type {
@@ -133,6 +134,7 @@ export interface IPurchaseResponse {
133 134 BoosterPackItems?: string;
134 135 Body?: string;
135 136 DailyDealUsed?: string;
137 FocusCost?: { Polarity: TFocusSchool; Cost: number };
136 138 }
137 139
138 140 export type IBinChanges = {