From 188316e1ef0801f5118ec8660c890ad83415beb6 Mon Sep 17 00:00:00 2001 From: milimoe Date: Thu, 2 Jan 2025 01:10:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=92=E8=89=B2=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Entity/Character/Character.cs | 126 ++++++++++++++++++---------------- 1 file changed, 68 insertions(+), 58 deletions(-) diff --git a/Entity/Character/Character.cs b/Entity/Character/Character.cs index f366aff..f8eb1ff 100644 --- a/Entity/Character/Character.cs +++ b/Entity/Character/Character.cs @@ -1419,7 +1419,7 @@ namespace Milimoe.FunGame.Core.Entity /// 获取角色的简略信息 /// /// - public string GetSimpleInfo(bool showUser = true, bool showGrowth = true, bool showEXP = false) + public string GetSimpleInfo(bool showUser = true, bool showGrowth = true, bool showEXP = false, bool showBasicOnly = false) { StringBuilder builder = new(); @@ -1442,74 +1442,84 @@ namespace Milimoe.FunGame.Core.Entity MDF.Bright + MDF.Shadow + MDF.Element + MDF.Fleabane + MDF.Particle) / 9) * 100; if (Calculation.IsApproximatelyZero(mdf)) mdf = 0; builder.AppendLine($"魔法抗性:{mdf:0.##}%(平均)"); - double exSPD = AGI * General.GameplayEquilibriumConstant.AGItoSPDMultiplier + ExSPD; - builder.AppendLine($"行动速度:{SPD:0.##}" + (exSPD != 0 ? $" [{InitialSPD:0.##} {(exSPD >= 0 ? "+" : "-")} {Math.Abs(exSPD):0.##}]" : "") + $" ({ActionCoefficient * 100:0.##}%)"); - builder.AppendLine($"核心属性:{CharacterSet.GetPrimaryAttributeName(PrimaryAttribute)}"); - double exSTR = ExSTR + ExSTR2; - builder.AppendLine($"力量:{STR:0.##}" + (exSTR != 0 ? $" [{BaseSTR:0.##} {(exSTR >= 0 ? "+" : "-")} {Math.Abs(exSTR):0.##}]" : "") + (showGrowth ? $"({(STRGrowth >= 0 ? "+" : "-")}{Math.Abs(STRGrowth)}/Lv)" : "")); - double exAGI = ExAGI + ExAGI2; - builder.AppendLine($"敏捷:{AGI:0.##}" + (exAGI != 0 ? $" [{BaseAGI:0.##} {(exAGI >= 0 ? "+" : "-")} {Math.Abs(exAGI):0.##}]" : "") + (showGrowth ? $"({(AGIGrowth >= 0 ? "+" : "-")}{Math.Abs(AGIGrowth)}/Lv)" : "")); - double exINT = ExINT + ExINT2; - builder.AppendLine($"智力:{INT:0.##}" + (exINT != 0 ? $" [{BaseINT:0.##} {(exINT >= 0 ? "+" : "-")} {Math.Abs(exINT):0.##}]" : "") + (showGrowth ? $"({(INTGrowth >= 0 ? "+" : "-")}{Math.Abs(INTGrowth)}/Lv)" : "")); + if (showBasicOnly) + { + builder.AppendLine($"核心属性:{PrimaryAttributeValue:0.##}({CharacterSet.GetPrimaryAttributeName(PrimaryAttribute)})"); + } + else + { + double exSPD = AGI * General.GameplayEquilibriumConstant.AGItoSPDMultiplier + ExSPD; + builder.AppendLine($"行动速度:{SPD:0.##}" + (exSPD != 0 ? $" [{InitialSPD:0.##} {(exSPD >= 0 ? "+" : "-")} {Math.Abs(exSPD):0.##}]" : "") + $" ({ActionCoefficient * 100:0.##}%)"); + builder.AppendLine($"核心属性:{CharacterSet.GetPrimaryAttributeName(PrimaryAttribute)}"); + double exSTR = ExSTR + ExSTR2; + builder.AppendLine($"力量:{STR:0.##}" + (exSTR != 0 ? $" [{BaseSTR:0.##} {(exSTR >= 0 ? "+" : "-")} {Math.Abs(exSTR):0.##}]" : "") + (showGrowth ? $"({(STRGrowth >= 0 ? "+" : "-")}{Math.Abs(STRGrowth)}/Lv)" : "")); + double exAGI = ExAGI + ExAGI2; + builder.AppendLine($"敏捷:{AGI:0.##}" + (exAGI != 0 ? $" [{BaseAGI:0.##} {(exAGI >= 0 ? "+" : "-")} {Math.Abs(exAGI):0.##}]" : "") + (showGrowth ? $"({(AGIGrowth >= 0 ? "+" : "-")}{Math.Abs(AGIGrowth)}/Lv)" : "")); + double exINT = ExINT + ExINT2; + builder.AppendLine($"智力:{INT:0.##}" + (exINT != 0 ? $" [{BaseINT:0.##} {(exINT >= 0 ? "+" : "-")} {Math.Abs(exINT):0.##}]" : "") + (showGrowth ? $"({(INTGrowth >= 0 ? "+" : "-")}{Math.Abs(INTGrowth)}/Lv)" : "")); + } builder.AppendLine($"生命回复:{HR:0.##}" + (ExHR != 0 ? $" [{InitialHR + STR * General.GameplayEquilibriumConstant.STRtoHRFactor:0.##} {(ExHR >= 0 ? "+" : "-")} {Math.Abs(ExHR):0.##}]" : "")); builder.AppendLine($"魔法回复:{MR:0.##}" + (ExMR != 0 ? $" [{InitialMR + INT * General.GameplayEquilibriumConstant.INTtoMRFactor:0.##} {(ExMR >= 0 ? "+" : "-")} {Math.Abs(ExMR):0.##}]" : "")); - if (CharacterState != CharacterState.Actionable) + if (!showBasicOnly) { - builder.AppendLine(CharacterSet.GetCharacterState(CharacterState)); - } + if (CharacterState != CharacterState.Actionable) + { + builder.AppendLine(CharacterSet.GetCharacterState(CharacterState)); + } - if (IsNeutral) - { - builder.AppendLine("角色是无敌的"); - } + if (IsNeutral) + { + builder.AppendLine("角色是无敌的"); + } - if (IsUnselectable) - { - builder.AppendLine("角色是不可选中的"); - } + if (IsUnselectable) + { + builder.AppendLine("角色是不可选中的"); + } - if (Skills.Count > 0) - { - builder.AppendLine("== 角色技能 =="); - builder.AppendLine(string.Join(",", Skills.Select(s => s.Name))); - } + if (Skills.Count > 0) + { + builder.AppendLine("== 角色技能 =="); + builder.AppendLine(string.Join(",", Skills.Select(s => s.Name))); + } - if (EquipSlot.Any()) - { - builder.AppendLine("== 已装备槽位 =="); - List types = []; - if (EquipSlot.MagicCardPack != null) + if (EquipSlot.Any()) { - types.Add(EquipSlotType.MagicCardPack); + builder.AppendLine("== 已装备槽位 =="); + List types = []; + if (EquipSlot.MagicCardPack != null) + { + types.Add(EquipSlotType.MagicCardPack); + } + if (EquipSlot.Weapon != null) + { + types.Add(EquipSlotType.Weapon); + } + if (EquipSlot.Armor != null) + { + types.Add(EquipSlotType.Armor); + } + if (EquipSlot.Shoes != null) + { + types.Add(EquipSlotType.Shoes); + } + if (EquipSlot.Accessory1 != null) + { + types.Add(EquipSlotType.Accessory1); + } + if (EquipSlot.Accessory2 != null) + { + types.Add(EquipSlotType.Accessory2); + } + builder.AppendLine(string.Join(",", types.Select(ItemSet.GetEquipSlotTypeName))); } - if (EquipSlot.Weapon != null) - { - types.Add(EquipSlotType.Weapon); - } - if (EquipSlot.Armor != null) - { - types.Add(EquipSlotType.Armor); - } - if (EquipSlot.Shoes != null) - { - types.Add(EquipSlotType.Shoes); - } - if (EquipSlot.Accessory1 != null) - { - types.Add(EquipSlotType.Accessory1); - } - if (EquipSlot.Accessory2 != null) - { - types.Add(EquipSlotType.Accessory2); - } - builder.AppendLine(string.Join(",", types.Select(ItemSet.GetEquipSlotTypeName))); - } - if (Effects.Where(e => e.EffectType != EffectType.Item).Any()) - { - builder.AppendLine("== 状态栏 =="); - builder.Append(string.Join(",", Effects.Where(e => e.EffectType != EffectType.Item).Select(e => e.Name))); + if (Effects.Where(e => e.EffectType != EffectType.Item).Any()) + { + builder.AppendLine("== 状态栏 =="); + builder.Append(string.Join(",", Effects.Where(e => e.EffectType != EffectType.Item).Select(e => e.Name))); + } } return builder.ToString();