From fbe547756826e894c81db03e9d3c97528d47c108 Mon Sep 17 00:00:00 2001 From: milimoe Date: Sat, 21 Sep 2024 03:18:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=BB=9F=E8=AE=A1=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Api/Utility/ActionQueue.cs | 17 ++++++++++++++--- Entity/Character/Character.cs | 15 +++++++++++++++ Entity/Statistics/CharacterStatistics.cs | 10 ++++++++-- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/Api/Utility/ActionQueue.cs b/Api/Utility/ActionQueue.cs index 9764f25..78591ac 100644 --- a/Api/Utility/ActionQueue.cs +++ b/Api/Utility/ActionQueue.cs @@ -1,5 +1,4 @@ using Milimoe.FunGame.Core.Entity; -using Milimoe.FunGame.Core.Interface.Entity; using Milimoe.FunGame.Core.Library.Constant; namespace Milimoe.FunGame.Core.Api.Utility @@ -678,8 +677,8 @@ namespace Milimoe.FunGame.Core.Api.Utility // 统计 _stats[character].LiveRound += 1; _stats[character].LiveTime = Calculation.Round2Digits(_stats[character].LiveTime + timeToReduce); - _stats[character].DamagePerRound = Calculation.Round2Digits(_stats[character].TotalDamage / TotalRound); - _stats[character].DamagePerTurn = Calculation.Round2Digits(_stats[character].TotalDamage / _stats[character].LiveRound); + _stats[character].DamagePerRound = Calculation.Round2Digits(_stats[character].TotalDamage / _stats[character].LiveRound); + _stats[character].DamagePerTurn = Calculation.Round2Digits(_stats[character].TotalDamage / _stats[character].ActionTurn); _stats[character].DamagePerSecond = Calculation.Round2Digits(_stats[character].TotalDamage / _stats[character].LiveTime); // 回血回蓝 @@ -1098,18 +1097,30 @@ namespace Milimoe.FunGame.Core.Api.Utility if (top == 1) { WriteLine("冠军:" + topCharacter); + _stats[_eliminated[i]].Wins += 1; + _stats[_eliminated[i]].Top3s += 1; } else if (top == 2) { WriteLine("亚军:" + topCharacter); + _stats[_eliminated[i]].Loses += 1; + _stats[_eliminated[i]].Top3s += 1; } else if (top == 3) { WriteLine("季军:" + topCharacter); + _stats[_eliminated[i]].Loses += 1; + _stats[_eliminated[i]].Top3s += 1; } else { WriteLine($"第 {top} 名:" + topCharacter); + _stats[_eliminated[i]].Loses += 1; + } + _stats[_eliminated[i]].Plays += 1; + if (_earnedMoney.TryGetValue(_eliminated[i], out int money)) + { + _stats[Eliminated[i]].TotalEarnedMoney += money; } top++; } diff --git a/Entity/Character/Character.cs b/Entity/Character/Character.cs index a61bde1..8be1c76 100644 --- a/Entity/Character/Character.cs +++ b/Entity/Character/Character.cs @@ -1006,6 +1006,21 @@ namespace Milimoe.FunGame.Core.Entity } return str; } + + /// + /// 获取角色实例的名字、昵称 + /// + /// + public string ToStringWithOutUser() + { + string str = GetName(); + if (NickName != "") + { + if (str != "") str += ", "; + str += NickName; + } + return str; + } /// /// 获取角色实例的名字、昵称以及所属玩家,包含等级 diff --git a/Entity/Statistics/CharacterStatistics.cs b/Entity/Statistics/CharacterStatistics.cs index fc41131..0de096a 100644 --- a/Entity/Statistics/CharacterStatistics.cs +++ b/Entity/Statistics/CharacterStatistics.cs @@ -14,6 +14,10 @@ public double AvgPhysicalDamage { get; set; } = 0; public double AvgMagicDamage { get; set; } = 0; public double AvgRealDamage { get; set; } = 0; + public double AvgTakenDamage { get; set; } = 0; + public double AvgTakenPhysicalDamage { get; set; } = 0; + public double AvgTakenMagicDamage { get; set; } = 0; + public double AvgTakenRealDamage { get; set; } = 0; public int LiveRound { get; set; } = 0; public int AvgLiveRound { get; set; } = 0; public int ActionTurn { get; set; } = 0; @@ -23,14 +27,16 @@ public double DamagePerRound { get; set; } = 0; public double DamagePerTurn { get; set; } = 0; public double DamagePerSecond { get; set; } = 0; - public double TotalEarnedMoney { get; set; } = 0; - public double AvgEarnedMoney { get; set; } = 0; + public int TotalEarnedMoney { get; set; } = 0; + public int AvgEarnedMoney { get; set; } = 0; public int Kills { get; set; } = 0; public int Deaths { get; set; } = 0; public int Assists { get; set; } = 0; public int Plays { get; set; } = 0; public int Wins { get; set; } = 0; + public int Top3s { get; set; } = 0; public int Loses { get; set; } = 0; public double Winrates { get; set; } = 0; + public double Top3rates { get; set; } = 0; } }