From 175682db38e412fa6d16666b74746b4ff0c55031 Mon Sep 17 00:00:00 2001 From: milimoe Date: Mon, 28 Apr 2025 00:42:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OshimaWebAPI/Controllers/FunGameController.cs | 8 ++++++-- OshimaWebAPI/Services/RainBOTService.cs | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OshimaWebAPI/Controllers/FunGameController.cs b/OshimaWebAPI/Controllers/FunGameController.cs index a59182e..cf417bf 100644 --- a/OshimaWebAPI/Controllers/FunGameController.cs +++ b/OshimaWebAPI/Controllers/FunGameController.cs @@ -5166,14 +5166,18 @@ namespace Oshima.FunGame.WebAPI.Controllers int dead = user.Inventory.Characters.Count(c => c.HP <= 0); int halfdown = user.Inventory.Characters.Count(c => (c.HP / c.MaxHP) < 0.5 && c.HP > 0); - int halfup = user.Inventory.Characters.Count(c => (c.HP / c.MaxHP) >= 0.5); + int halfup = user.Inventory.Characters.Count(c => (c.HP / c.MaxHP) >= 0.5 && c.HP != c.MaxHP); double deadNeed = 10000 * dead; double halfdownNeed = 6000 * halfdown; double halfupNeed = 2000 * halfup; double total = deadNeed + halfdownNeed + halfupNeed; - if (user.Inventory.Credits >= total) + if (total == 0) + { + msg = $"你暂时不需要生命之泉的服务,欢迎下次光临。"; + } + else if (user.Inventory.Credits >= total) { user.Inventory.Credits -= total; foreach (Character character in user.Inventory.Characters) diff --git a/OshimaWebAPI/Services/RainBOTService.cs b/OshimaWebAPI/Services/RainBOTService.cs index a4fe1eb..fb00a25 100644 --- a/OshimaWebAPI/Services/RainBOTService.cs +++ b/OshimaWebAPI/Services/RainBOTService.cs @@ -1997,7 +1997,7 @@ namespace Oshima.FunGame.WebAPI.Services if (e.Detail == "生命之泉") { - string msg = NetworkUtility.JsonDeserialize(Controller.SpringOfLife()) ?? ""; + string msg = Controller.SpringOfLife(uid); if (msg != "") { await SendAsync(e, "生命之泉", string.Join("\r\n", msg)); @@ -2007,7 +2007,7 @@ namespace Oshima.FunGame.WebAPI.Services if (uid == GeneralSettings.Master && e.Detail.StartsWith("重载FunGame", StringComparison.CurrentCultureIgnoreCase)) { - string msg = NetworkUtility.JsonDeserialize(Controller.Relaod(uid)) ?? ""; + string msg = Controller.Relaod(uid); if (msg != "") { await SendAsync(e, "重载FunGame", msg);