添加应用

This commit is contained in:
milimoe 2025-04-28 00:42:26 +08:00
parent ba4921aa1f
commit 175682db38
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
2 changed files with 8 additions and 4 deletions

View File

@ -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)

View File

@ -1997,7 +1997,7 @@ namespace Oshima.FunGame.WebAPI.Services
if (e.Detail == "生命之泉")
{
string msg = NetworkUtility.JsonDeserialize<string>(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<string>(Controller.Relaod(uid)) ?? "";
string msg = Controller.Relaod(uid);
if (msg != "")
{
await SendAsync(e, "重载FunGame", msg);