From fbc95f5dc1a76799231b1f6e64e428aa454255a8 Mon Sep 17 00:00:00 2001 From: milimoe Date: Sat, 7 Dec 2024 01:34:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E6=88=90=E5=88=A4=E6=96=AD=20item.Cha?= =?UTF-8?q?racter=EF=BC=8C=E6=96=B9=E4=BE=BF=E4=B8=80=E4=BA=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OshimaCore/Controllers/FunGameController.cs | 12 ++++++------ OshimaCore/Utils/FunGameService.cs | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/OshimaCore/Controllers/FunGameController.cs b/OshimaCore/Controllers/FunGameController.cs index 43f67bc..252ec72 100644 --- a/OshimaCore/Controllers/FunGameController.cs +++ b/OshimaCore/Controllers/FunGameController.cs @@ -514,8 +514,8 @@ namespace Oshima.Core.Controllers string str = $"{itemCount}. [{ItemSet.GetQualityTypeName(first.QualityType)}|{ItemSet.GetItemTypeName(first.ItemType)}] {first.Name}\r\n"; str += $"物品描述:{first.Description}\r\n"; str += $"物品序号:{string.Join(",", objs.Select(i => items.IndexOf(i) + 1))}\r\n"; - str += $"拥有数量:{objs.Count}(" + (itemCanEquip.Contains(first.ItemType) ? $"可装备数量:{objs.Count(i => i.EquipSlotType == EquipSlotType.None)}," : "") + - (itemCanUsed.Contains(first.ItemType) ? $"可使用数量:{objs.Count(i => i.EquipSlotType == EquipSlotType.None)}," : "") + + str += $"拥有数量:{objs.Count}(" + (itemCanEquip.Contains(first.ItemType) ? $"可装备数量:{objs.Count(i => i.Character is null)}," : "") + + (itemCanUsed.Contains(first.ItemType) ? $"可使用数量:{objs.Count(i => i.RemainUseTimes > 0)}," : "") + $"可出售数量:{objs.Count(i => i.IsSellable)},可交易数量:{objs.Count(i => i.IsTradable)})"; list.Add(str); } @@ -594,8 +594,8 @@ namespace Oshima.Core.Controllers string str = $"{itemCount}. [{ItemSet.GetQualityTypeName(first.QualityType)}|{ItemSet.GetItemTypeName(first.ItemType)}] {first.Name}\r\n"; str += $"物品描述:{first.Description}\r\n"; str += $"物品序号:{string.Join(",", objs.Select(i => items.IndexOf(i) + 1))}\r\n"; - str += $"拥有数量:{objs.Count}(" + (itemCanEquip.Contains(first.ItemType) ? $"可装备数量:{objs.Count(i => i.EquipSlotType == EquipSlotType.None)}," : "") + - (itemCanUsed.Contains(first.ItemType) ? $"可使用数量:{objs.Count(i => i.EquipSlotType == EquipSlotType.None)}," : "") + + str += $"拥有数量:{objs.Count}(" + (itemCanEquip.Contains(first.ItemType) ? $"可装备数量:{objs.Count(i => i.Character is null)}," : "") + + (itemCanUsed.Contains(first.ItemType) ? $"可使用数量:{objs.Count(i => i.RemainUseTimes > 0)}," : "") + $"可出售数量:{objs.Count(i => i.IsSellable)},可交易数量:{objs.Count(i => i.IsTradable)})"; list.Add(str); } @@ -998,9 +998,9 @@ namespace Oshima.Core.Controllers { return NetworkUtility.JsonSerialize($"这个物品无法被装备!"); } - else if (item.EquipSlotType != EquipSlotType.None) + else if (item.Character != null) { - return NetworkUtility.JsonSerialize($"这个物品无法被装备!" + (item.Character != null ? $"[ {item.Character.ToStringWithLevelWithOutUser()} ] 已装备此物品。" : "")); + return NetworkUtility.JsonSerialize($"这个物品无法被装备![ {item.Character.ToStringWithLevelWithOutUser()} ] 已装备此物品。"); } } else diff --git a/OshimaCore/Utils/FunGameService.cs b/OshimaCore/Utils/FunGameService.cs index 0725da1..7d15f75 100644 --- a/OshimaCore/Utils/FunGameService.cs +++ b/OshimaCore/Utils/FunGameService.cs @@ -63,6 +63,7 @@ namespace Oshima.Core.Utils item.Id = Convert.ToInt64("16" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 8)); item.Name = GenerateRandomChineseName(); item.ItemType = ItemType.MagicCard; + item.RemainUseTimes = 1; int total; if (qualityType != null)