RoundRecord 优化

This commit is contained in:
milimoe 2025-12-03 21:09:58 +08:00
parent 080d546a97
commit dcb1ffc23b
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
2 changed files with 5 additions and 3 deletions

View File

@ -3,6 +3,7 @@ using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Common.Architecture; using Milimoe.FunGame.Core.Library.Common.Architecture;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Core.Model;
namespace Milimoe.FunGame.Core.Library.Common.JsonConverter namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
{ {

View File

@ -114,6 +114,7 @@ namespace Milimoe.FunGame.Core.Entity
string hasDamage = ""; string hasDamage = "";
string hasHeal = ""; string hasHeal = "";
string hasEffect = ""; string hasEffect = "";
string hasEvaded = "";
if (Damages.TryGetValue(target, out double damage)) if (Damages.TryGetValue(target, out double damage))
{ {
hasDamage = $"伤害:{damage:0.##}"; hasDamage = $"伤害:{damage:0.##}";
@ -134,18 +135,18 @@ namespace Milimoe.FunGame.Core.Entity
{ {
if (ActionType == CharacterActionType.NormalAttack) if (ActionType == CharacterActionType.NormalAttack)
{ {
hasDamage = "完美闪避"; hasEvaded = hasDamage == "" ? "完美闪避" : "闪避";
} }
else if ((ActionType == CharacterActionType.PreCastSkill || ActionType == CharacterActionType.CastSkill || ActionType == CharacterActionType.CastSuperSkill)) else if ((ActionType == CharacterActionType.PreCastSkill || ActionType == CharacterActionType.CastSkill || ActionType == CharacterActionType.CastSuperSkill))
{ {
hasDamage = "技能免疫"; hasEvaded = "技能免疫";
} }
} }
if (IsImmune.ContainsKey(target) && hasDamage != "" && target != Actor) if (IsImmune.ContainsKey(target) && hasDamage != "" && target != Actor)
{ {
hasDamage = "免疫"; hasDamage = "免疫";
} }
string[] strs = [hasDamage, hasHeal, hasEffect]; string[] strs = [hasDamage, hasHeal, hasEffect, hasEvaded];
strs = [.. strs.Where(s => s != "")]; strs = [.. strs.Where(s => s != "")];
if (strs.Length == 0) strings.Add($"[ {target} ]"); if (strs.Length == 0) strings.Add($"[ {target} ]");
else strings.Add($"[ {target}{string.Join(" / ", strs)}]"); else strings.Add($"[ {target}{string.Join(" / ", strs)}]");