From b5a12ad18d001bdef6ed084b337b8b52e13e7213 Mon Sep 17 00:00:00 2001 From: milimoe Date: Thu, 26 Jun 2025 01:09:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B8=B8=E6=88=8F=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E5=81=B6=E7=8E=B0=E7=9A=84=E5=B4=A9=E6=BA=83=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B=E4=BF=AE=E5=A4=8D=E7=89=A9=E5=93=81=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=A4=8D=E5=88=B6=20Others=20=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B=E5=9C=B0=E5=8C=BA=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8E=89=E8=90=BD=E7=89=A9=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Entity/Item/Item.cs | 6 +++++- Entity/System/Region.cs | 19 ++++++++++++++++--- Model/GamingQueue.cs | 13 +++++++++---- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/Entity/Item/Item.cs b/Entity/Item/Item.cs index 0358da2..16415fb 100644 --- a/Entity/Item/Item.cs +++ b/Entity/Item/Item.cs @@ -188,7 +188,7 @@ namespace Milimoe.FunGame.Core.Entity /// 所属的玩家 /// public User? User { get; set; } = null; - + /// /// 物品拥有的技能 /// @@ -650,6 +650,10 @@ namespace Milimoe.FunGame.Core.Entity item.Skills.Magics.Add(newskill); } } + foreach (string key in itemDefined.Others.Keys) + { + item.Others[key] = itemDefined.Others[key]; + } return item; } diff --git a/Entity/System/Region.cs b/Entity/System/Region.cs index 41caffb..fbd69a5 100644 --- a/Entity/System/Region.cs +++ b/Entity/System/Region.cs @@ -11,6 +11,7 @@ namespace Milimoe.FunGame.Core.Entity public HashSet Characters { get; } = []; public HashSet Units { get; } = []; public HashSet Crops { get; } = []; + public HashSet Items { get; } = []; public string Weather { get; set; } = ""; public int Temperature { get; set; } = 15; public Dictionary Weathers { get; } = []; @@ -53,19 +54,31 @@ namespace Milimoe.FunGame.Core.Entity if (Characters.Count > 0) { builder.AppendLine($"== 头目 =="); - builder.AppendLine(string.Join(",", Characters.Select(o => o.Name))); + builder.AppendLine(string.Join(",", Characters.Select(c => c.Name))); } if (Units.Count > 0) { builder.AppendLine($"== 生物 =="); - builder.AppendLine(string.Join(",", Units.Select(o => o.Name))); + builder.AppendLine(string.Join(",", Units.Select(u => u.Name))); } if (Crops.Count > 0) { builder.AppendLine($"== 作物 =="); - builder.AppendLine(string.Join(",", Crops.Select(c => c.Name))); + builder.AppendLine(string.Join(",", Crops.Select(c => c.Name + (c.Description != "" ? $":{c.Description}" : "") + (c.BackgroundStory != "" ? $"\"{c.BackgroundStory}\"" : "")))); + } + + if (Items.Count > 0) + { + builder.AppendLine($"== 掉落 =="); + builder.AppendLine(string.Join(",", Items.Select(i => + { + string itemquality = ItemSet.GetQualityTypeName(i.QualityType); + string itemtype = ItemSet.GetItemTypeName(i.ItemType) + (i.ItemType == ItemType.Weapon && i.WeaponType != WeaponType.None ? "-" + ItemSet.GetWeaponTypeName(i.WeaponType) : ""); + if (itemtype != "") itemtype = $"|{itemtype}"; + return $"[{itemquality + itemtype}]{i.Name}"; + }))); } builder.AppendLine($"探索难度:{CharacterSet.GetRarityTypeName(Difficulty)}"); diff --git a/Model/GamingQueue.cs b/Model/GamingQueue.cs index 4d1c828..906dcf4 100644 --- a/Model/GamingQueue.cs +++ b/Model/GamingQueue.cs @@ -290,6 +290,15 @@ namespace Milimoe.FunGame.Core.Model _original.Add(original.Guid, original); } + // 完全初始化 + foreach (Character character in _allCharacters) + { + // 添加统计数据 + _stats[character] = new(); + // 添加助攻对象 + _assistDetail[character] = new AssistDetail(character, _allCharacters.Where(c => c != character)); + } + // 获取 HP 小于等于 0 的角色 List deadCharacters = [.. characters.Where(c => c.HP <= 0)]; foreach (Character death in deadCharacters) @@ -325,8 +334,6 @@ namespace Milimoe.FunGame.Core.Model // 如果只有一个角色,直接加入队列 Character character = group.First(); AddCharacter(character, Calculation.Round2Digits(_queue.Count * 0.1), false); - _assistDetail.Add(character, new AssistDetail(character, _allCharacters.Where(c => c != character))); - _stats.Add(character, new()); // 初始化技能 foreach (Skill skill in character.Skills) { @@ -379,8 +386,6 @@ namespace Milimoe.FunGame.Core.Model if (selectedCharacter != null) { AddCharacter(selectedCharacter, Calculation.Round2Digits(_queue.Count * 0.1), false); - _assistDetail.Add(selectedCharacter, new AssistDetail(selectedCharacter, _allCharacters.Where(c => c != selectedCharacter))); - _stats.Add(selectedCharacter, new()); // 初始化技能 foreach (Skill skill in selectedCharacter.Skills) {