From 3c1cb897af0f7b96d27174826f900a44b834302e Mon Sep 17 00:00:00 2001 From: milimoe Date: Thu, 19 Dec 2024 02:13:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OshimaCore/Controllers/FunGameController.cs | 31 +++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/OshimaCore/Controllers/FunGameController.cs b/OshimaCore/Controllers/FunGameController.cs index 4878090..f1763d9 100644 --- a/OshimaCore/Controllers/FunGameController.cs +++ b/OshimaCore/Controllers/FunGameController.cs @@ -1680,36 +1680,39 @@ namespace Oshima.Core.Controllers int originalBreak = character.LevelBreak; - if (FunGameService.LevelBreakNeedyList.TryGetValue(originalBreak, out Dictionary? needy) && needy != null && needy.Count > 0) + if (FunGameService.LevelBreakNeedyList.TryGetValue(originalBreak + 1, out Dictionary? needy) && needy != null && needy.Count > 0) { foreach (string key in needy.Keys) { int needCount = needy[key]; if (key == General.GameplayEquilibriumConstant.InGameMaterial) { - if (user.Inventory.Credits >= needCount) + if (user.Inventory.Materials >= needCount) { - user.Inventory.Credits -= needCount; + user.Inventory.Materials -= needCount; } else { - return NetworkUtility.JsonSerialize($"你的{General.GameplayEquilibriumConstant.InGameCurrency}不足 {needCount} 呢,不满足突破条件!"); + return NetworkUtility.JsonSerialize($"你的{General.GameplayEquilibriumConstant.InGameMaterial}不足 {needCount} 呢,不满足突破条件!"); } } - if (needCount > 0) + else { - IEnumerable items = user.Inventory.Items.Where(i => i.Name == key); - if (items.Count() >= needCount) + if (needCount > 0) { - items = items.Reverse().Take(needCount); - foreach (Item item in items) + IEnumerable items = user.Inventory.Items.Where(i => i.Name == key); + if (items.Count() >= needCount) { - user.Inventory.Items.Remove(item); + items = items.Reverse().Take(needCount); + foreach (Item item in items) + { + user.Inventory.Items.Remove(item); + } + } + else + { + return NetworkUtility.JsonSerialize($"你的物品【{key}】数量不足 {needCount} 呢,不满足突破条件!"); } - } - else - { - return NetworkUtility.JsonSerialize($"你的物品【{key}】数量不足 {needCount} 呢,不满足突破条件!"); } } }