mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-04-22 03:59:35 +08:00
完善统计系统
This commit is contained in:
parent
e1d58144a3
commit
fbe5477568
@ -1,5 +1,4 @@
|
|||||||
using Milimoe.FunGame.Core.Entity;
|
using Milimoe.FunGame.Core.Entity;
|
||||||
using Milimoe.FunGame.Core.Interface.Entity;
|
|
||||||
using Milimoe.FunGame.Core.Library.Constant;
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Api.Utility
|
namespace Milimoe.FunGame.Core.Api.Utility
|
||||||
@ -678,8 +677,8 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
// 统计
|
// 统计
|
||||||
_stats[character].LiveRound += 1;
|
_stats[character].LiveRound += 1;
|
||||||
_stats[character].LiveTime = Calculation.Round2Digits(_stats[character].LiveTime + timeToReduce);
|
_stats[character].LiveTime = Calculation.Round2Digits(_stats[character].LiveTime + timeToReduce);
|
||||||
_stats[character].DamagePerRound = Calculation.Round2Digits(_stats[character].TotalDamage / TotalRound);
|
_stats[character].DamagePerRound = Calculation.Round2Digits(_stats[character].TotalDamage / _stats[character].LiveRound);
|
||||||
_stats[character].DamagePerTurn = 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);
|
_stats[character].DamagePerSecond = Calculation.Round2Digits(_stats[character].TotalDamage / _stats[character].LiveTime);
|
||||||
|
|
||||||
// 回血回蓝
|
// 回血回蓝
|
||||||
@ -1098,18 +1097,30 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
if (top == 1)
|
if (top == 1)
|
||||||
{
|
{
|
||||||
WriteLine("冠军:" + topCharacter);
|
WriteLine("冠军:" + topCharacter);
|
||||||
|
_stats[_eliminated[i]].Wins += 1;
|
||||||
|
_stats[_eliminated[i]].Top3s += 1;
|
||||||
}
|
}
|
||||||
else if (top == 2)
|
else if (top == 2)
|
||||||
{
|
{
|
||||||
WriteLine("亚军:" + topCharacter);
|
WriteLine("亚军:" + topCharacter);
|
||||||
|
_stats[_eliminated[i]].Loses += 1;
|
||||||
|
_stats[_eliminated[i]].Top3s += 1;
|
||||||
}
|
}
|
||||||
else if (top == 3)
|
else if (top == 3)
|
||||||
{
|
{
|
||||||
WriteLine("季军:" + topCharacter);
|
WriteLine("季军:" + topCharacter);
|
||||||
|
_stats[_eliminated[i]].Loses += 1;
|
||||||
|
_stats[_eliminated[i]].Top3s += 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WriteLine($"第 {top} 名:" + topCharacter);
|
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++;
|
top++;
|
||||||
}
|
}
|
||||||
|
@ -1007,6 +1007,21 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取角色实例的名字、昵称
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string ToStringWithOutUser()
|
||||||
|
{
|
||||||
|
string str = GetName();
|
||||||
|
if (NickName != "")
|
||||||
|
{
|
||||||
|
if (str != "") str += ", ";
|
||||||
|
str += NickName;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取角色实例的名字、昵称以及所属玩家,包含等级
|
/// 获取角色实例的名字、昵称以及所属玩家,包含等级
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -14,6 +14,10 @@
|
|||||||
public double AvgPhysicalDamage { get; set; } = 0;
|
public double AvgPhysicalDamage { get; set; } = 0;
|
||||||
public double AvgMagicDamage { get; set; } = 0;
|
public double AvgMagicDamage { get; set; } = 0;
|
||||||
public double AvgRealDamage { 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 LiveRound { get; set; } = 0;
|
||||||
public int AvgLiveRound { get; set; } = 0;
|
public int AvgLiveRound { get; set; } = 0;
|
||||||
public int ActionTurn { get; set; } = 0;
|
public int ActionTurn { get; set; } = 0;
|
||||||
@ -23,14 +27,16 @@
|
|||||||
public double DamagePerRound { get; set; } = 0;
|
public double DamagePerRound { get; set; } = 0;
|
||||||
public double DamagePerTurn { get; set; } = 0;
|
public double DamagePerTurn { get; set; } = 0;
|
||||||
public double DamagePerSecond { get; set; } = 0;
|
public double DamagePerSecond { get; set; } = 0;
|
||||||
public double TotalEarnedMoney { get; set; } = 0;
|
public int TotalEarnedMoney { get; set; } = 0;
|
||||||
public double AvgEarnedMoney { get; set; } = 0;
|
public int AvgEarnedMoney { get; set; } = 0;
|
||||||
public int Kills { get; set; } = 0;
|
public int Kills { get; set; } = 0;
|
||||||
public int Deaths { get; set; } = 0;
|
public int Deaths { get; set; } = 0;
|
||||||
public int Assists { get; set; } = 0;
|
public int Assists { get; set; } = 0;
|
||||||
public int Plays { get; set; } = 0;
|
public int Plays { get; set; } = 0;
|
||||||
public int Wins { get; set; } = 0;
|
public int Wins { get; set; } = 0;
|
||||||
|
public int Top3s { get; set; } = 0;
|
||||||
public int Loses { get; set; } = 0;
|
public int Loses { get; set; } = 0;
|
||||||
public double Winrates { get; set; } = 0;
|
public double Winrates { get; set; } = 0;
|
||||||
|
public double Top3rates { get; set; } = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user