mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-04-23 12:39:35 +08:00
修改角色属性的定义;修改decimal为double (#86)
This commit is contained in:
parent
d6787de920
commit
599958f1ac
@ -13,7 +13,7 @@ namespace Milimoe.FunGame.Core.Api.Factory
|
||||
return General.UnknownUserInstance;
|
||||
}
|
||||
|
||||
public static User Create(long Id = 0, string Username = "", DateTime? RegTime = null, DateTime? LastTime = null, string Email = "", string NickName = "", bool IsAdmin = false, bool IsOperator = false, bool IsEnable = true, decimal Credits = 0, decimal Materials = 0, decimal GameTime = 0, string AutoKey = "")
|
||||
public static User Create(long Id = 0, string Username = "", DateTime? RegTime = null, DateTime? LastTime = null, string Email = "", string NickName = "", bool IsAdmin = false, bool IsOperator = false, bool IsEnable = true, double Credits = 0, double Materials = 0, double GameTime = 0, string AutoKey = "")
|
||||
{
|
||||
return new(Id, Username, RegTime, LastTime, Email, NickName, IsAdmin, IsOperator, IsEnable, Credits, Materials, GameTime, AutoKey);
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// <param name="GameTime"></param>
|
||||
/// <param name="AutoKey"></param>
|
||||
/// <returns></returns>
|
||||
public static User GetUser(long Id = 0, string Username = "", DateTime? RegTime = null, DateTime? LastTime = null, string Email = "", string NickName = "", bool IsAdmin = false, bool IsOperator = false, bool IsEnable = true, decimal Credits = 0, decimal Materials = 0, decimal GameTime = 0, string AutoKey = "")
|
||||
public static User GetUser(long Id = 0, string Username = "", DateTime? RegTime = null, DateTime? LastTime = null, string Email = "", string NickName = "", bool IsAdmin = false, bool IsOperator = false, bool IsEnable = true, double Credits = 0, double Materials = 0, double GameTime = 0, string AutoKey = "")
|
||||
{
|
||||
return UserFactory.Create(Id, Username, RegTime, LastTime, Email, NickName, IsAdmin, IsOperator, IsEnable, Credits, Materials, GameTime, AutoKey);
|
||||
}
|
||||
@ -210,9 +210,9 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
bool IsAdmin = Convert.ToInt32(dr[UserQuery.Column_IsAdmin]) == 1;
|
||||
bool IsOperator = Convert.ToInt32(dr[UserQuery.Column_IsOperator]) == 1;
|
||||
bool IsEnable = Convert.ToInt32(dr[UserQuery.Column_IsEnable]) == 1;
|
||||
decimal Credits = Convert.ToDecimal(dr[UserQuery.Column_Credits]);
|
||||
decimal Materials = Convert.ToDecimal(dr[UserQuery.Column_Materials]);
|
||||
decimal GameTime = Convert.ToDecimal(dr[UserQuery.Column_GameTime]);
|
||||
double Credits = Convert.ToDouble(dr[UserQuery.Column_Credits]);
|
||||
double Materials = Convert.ToDouble(dr[UserQuery.Column_Materials]);
|
||||
double GameTime = Convert.ToDouble(dr[UserQuery.Column_GameTime]);
|
||||
string AutoKey = (string)dr[UserQuery.Column_AutoKey];
|
||||
return UserFactory.Create(Id, Username, RegTime, LastTime, Email, NickName, IsAdmin, IsOperator, IsEnable, Credits, Materials, GameTime, AutoKey);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// 简易的插件配置文件生成器<para/>
|
||||
/// 仅支持部分基本类型(<see cref="long"/>, <see cref="decimal"/>, <see cref="string"/>, <see cref="bool"/>)及其数组(<see cref="List{T}">List<long>, List<decimal>, List<string>, List<bool></see>和<see cref="Array">long[], decimal[], string[], bool[]</see>)
|
||||
/// 仅支持部分基本类型(<see cref="long"/>, <see cref="double"/>, <see cref="decimal"/>, <see cref="string"/>, <see cref="bool"/>)及其数组(<see cref="List{T}">List<long>, List<double>, List<decimal>, List<string>, List<bool></see>和<see cref="Array">long[], double[], decimal[], string[], bool[]</see>)
|
||||
/// <para/>文件会保存为:程序目录/configs/<see cref="PluginName"/>/<see cref="FileName"/>.json
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@ -158,6 +158,10 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
{
|
||||
base.Add(key, longValue);
|
||||
}
|
||||
else if (obj.ValueKind == JsonValueKind.Number && obj.TryGetDouble(out double douValue))
|
||||
{
|
||||
base.Add(key, douValue);
|
||||
}
|
||||
else if (obj.ValueKind == JsonValueKind.Number && obj.TryGetDecimal(out decimal decValue))
|
||||
{
|
||||
base.Add(key, decValue);
|
||||
@ -184,6 +188,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
private void AddValues(string key, JsonElement.ArrayEnumerator obj)
|
||||
{
|
||||
List<long> longList = [];
|
||||
List<double> douList = [];
|
||||
List<decimal> decList = [];
|
||||
List<string> strList = [];
|
||||
List<bool> bolList = [];
|
||||
@ -193,6 +198,10 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
{
|
||||
longList.Add(longValue);
|
||||
}
|
||||
else if (array_e.ValueKind == JsonValueKind.Number && array_e.TryGetDouble(out double douValue))
|
||||
{
|
||||
douList.Add(douValue);
|
||||
}
|
||||
else if (array_e.ValueKind == JsonValueKind.Number && array_e.TryGetDecimal(out decimal decValue))
|
||||
{
|
||||
decList.Add(decValue);
|
||||
@ -207,6 +216,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
}
|
||||
}
|
||||
if (longList.Count > 0) base.Add(key, longList);
|
||||
if (douList.Count > 0) base.Add(key, douList);
|
||||
if (decList.Count > 0) base.Add(key, decList);
|
||||
if (strList.Count > 0) base.Add(key, strList);
|
||||
if (bolList.Count > 0) base.Add(key, bolList);
|
||||
|
@ -69,167 +69,196 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
/// <summary>
|
||||
/// 经验值
|
||||
/// </summary>
|
||||
public decimal EXP { get; set; } = 0;
|
||||
public double EXP { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 基础生命值
|
||||
/// </summary>
|
||||
public decimal BaseHP { get; set; } = 0;
|
||||
public double BaseHP { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 生命值
|
||||
/// </summary>
|
||||
public decimal HP { get; set; } = 0;
|
||||
public double HP { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 基础魔法值
|
||||
/// </summary>
|
||||
public decimal BaseMP { get; set; } = 0;
|
||||
public double BaseMP { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 魔法值
|
||||
/// </summary>
|
||||
public decimal MP { get; set; } = 0;
|
||||
public double MP { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 能量
|
||||
/// 爆发能量
|
||||
/// </summary>
|
||||
public decimal EP { get; set; } = 0;
|
||||
public double EP { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 基础攻击力
|
||||
/// </summary>
|
||||
public decimal BaseATK { get; set; } = 0;
|
||||
public double BaseATK { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 攻击力
|
||||
/// </summary>
|
||||
public decimal ATK { get; set; } = 0;
|
||||
public double ATK { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 基础物理护甲
|
||||
/// </summary>
|
||||
public decimal BaseDEF { get; set; } = 0;
|
||||
public double BaseDEF { get; set; } = 5;
|
||||
|
||||
/// <summary>
|
||||
/// 物理护甲
|
||||
/// </summary>
|
||||
public decimal DEF { get; set; } = 0;
|
||||
public double DEF { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 物理伤害减免(%)
|
||||
/// </summary>
|
||||
public decimal PDR { get; set; } = 0;
|
||||
public double PDR
|
||||
{
|
||||
get
|
||||
{
|
||||
double value = Math.Round((BaseDEF + DEF) / BaseDEF + DEF + 300, 4, MidpointRounding.AwayFromZero) + ExPDR;
|
||||
return value > 1 ? 1 : value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 额外物理伤害减免(%)
|
||||
/// </summary>
|
||||
public double ExPDR { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 魔法抗性(%)
|
||||
/// </summary>
|
||||
public decimal MDF { get; set; } = 0;
|
||||
public double MDF { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 物理穿透(%)
|
||||
/// </summary>
|
||||
public decimal PhysicalPenetration { get; set; } = 0;
|
||||
public double PhysicalPenetration { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 魔法穿透(%)
|
||||
/// </summary>
|
||||
public decimal MagicalPenetration { get; set; } = 0;
|
||||
public double MagicalPenetration { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 生命回复力
|
||||
/// </summary>
|
||||
public decimal HR { get; set; } = 0;
|
||||
public double HR { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 魔法回复力
|
||||
/// </summary>
|
||||
public decimal MR { get; set; } = 0;
|
||||
public double MR { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 能量回复力
|
||||
/// </summary>
|
||||
public decimal ER { get; set; } = 0;
|
||||
public double ER { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 基础力量
|
||||
/// </summary>
|
||||
public decimal BaseSTR { get; set; } = 0;
|
||||
public double BaseSTR { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 基础敏捷
|
||||
/// </summary>
|
||||
public decimal BaseAGI { get; set; } = 0;
|
||||
public double BaseAGI { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 基础智力
|
||||
/// </summary>
|
||||
public decimal BaseINT { get; set; } = 0;
|
||||
public double BaseINT { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 力量
|
||||
/// </summary>
|
||||
public decimal STR { get; set; } = 0;
|
||||
public double STR { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 敏捷
|
||||
/// </summary>
|
||||
public decimal AGI { get; set; } = 0;
|
||||
public double AGI { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 智力
|
||||
/// </summary>
|
||||
public decimal INT { get; set; } = 0;
|
||||
public double INT { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 力量成长值
|
||||
/// </summary>
|
||||
public decimal STRGrowth { get; set; } = 0;
|
||||
public double STRGrowth { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 敏捷成长值
|
||||
/// </summary>
|
||||
public decimal AGIGrowth { get; set; } = 0;
|
||||
public double AGIGrowth { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 智力成长值
|
||||
/// </summary>
|
||||
public decimal INTGrowth { get; set; } = 0;
|
||||
public double INTGrowth { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 速度
|
||||
/// 行动速度
|
||||
/// </summary>
|
||||
public decimal SPD { get; set; } = 0;
|
||||
public double SPD { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 行动系数(%)
|
||||
/// </summary>
|
||||
public decimal ActionCoefficient { get; set; } = 0;
|
||||
public double ActionCoefficient
|
||||
{
|
||||
get
|
||||
{
|
||||
double value = Math.Round(SPD / 1500.00, 4, MidpointRounding.AwayFromZero) + ExActionCoefficient;
|
||||
return value > 1 ? 1 : value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 额外行动系数(%)
|
||||
/// </summary>
|
||||
public double ExActionCoefficient { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 加速系数(%)
|
||||
/// </summary>
|
||||
public decimal AccelerationCoefficient { get; set; } = 0;
|
||||
public double AccelerationCoefficient { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 冷却缩减(%)
|
||||
/// </summary>
|
||||
public double CDR { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 攻击距离
|
||||
/// </summary>
|
||||
public decimal ATR { get; set; } = 0;
|
||||
public double ATR { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 暴击率(%)
|
||||
/// </summary>
|
||||
public decimal CritRate { get; set; } = 0.05M;
|
||||
public double CritRate { get; set; } = 0.05;
|
||||
|
||||
/// <summary>
|
||||
/// 暴击伤害
|
||||
/// 暴击伤害(%)
|
||||
/// </summary>
|
||||
public decimal CritDMG { get; set; } = 1.25M;
|
||||
public double CritDMG { get; set; } = 1.25;
|
||||
|
||||
/// <summary>
|
||||
/// 闪避率(%)
|
||||
/// </summary>
|
||||
public decimal EvadeRate { get; set; } = 0.05M;
|
||||
public double EvadeRate { get; set; } = 0.05;
|
||||
|
||||
/// <summary>
|
||||
/// 角色的技能组
|
||||
@ -251,15 +280,28 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
return new();
|
||||
}
|
||||
|
||||
public void SetDefaultBase()
|
||||
public void Init()
|
||||
{
|
||||
STR = BaseSTR;
|
||||
AGI = BaseAGI;
|
||||
INT = BaseINT;
|
||||
HP = BaseHP;
|
||||
MP = BaseMP;
|
||||
ATK = BaseATK;
|
||||
DEF = BaseDEF;
|
||||
STR = BaseSTR;
|
||||
AGI = BaseAGI;
|
||||
INT = BaseINT;
|
||||
// STR
|
||||
HP = Math.Round(HP + STR * 17, 2, MidpointRounding.AwayFromZero);
|
||||
HR = Math.Round(HR + STR * 0.7, 2, MidpointRounding.AwayFromZero);
|
||||
DEF = Math.Round(DEF + STR * 0.75, 2, MidpointRounding.AwayFromZero);
|
||||
CritDMG = Math.Round(CritDMG + STR * 0.00575, 4, MidpointRounding.AwayFromZero);
|
||||
// AGI
|
||||
SPD = Math.Round(SPD + AGI * 0.65, 2, MidpointRounding.AwayFromZero);
|
||||
EvadeRate = Math.Round(EvadeRate + AGI * 0.0025, 4, MidpointRounding.AwayFromZero);
|
||||
CritRate = Math.Round(CritRate + AGI * 0.00235, 4, MidpointRounding.AwayFromZero);
|
||||
// INT
|
||||
MP = Math.Round(MP + INT * 8, 2, MidpointRounding.AwayFromZero);
|
||||
MR = Math.Round(MR + INT * 0.4, 2, MidpointRounding.AwayFromZero);
|
||||
CDR = Math.Round(CDR + INT * 0.0025, 4, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
|
||||
public override bool Equals(IBaseEntity? other)
|
||||
@ -308,7 +350,6 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
ATK = ATK,
|
||||
BaseDEF = BaseDEF,
|
||||
DEF = DEF,
|
||||
PDR = PDR,
|
||||
MDF = MDF,
|
||||
PhysicalPenetration = PhysicalPenetration,
|
||||
MagicalPenetration = MagicalPenetration,
|
||||
@ -325,7 +366,6 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
AGIGrowth = AGIGrowth,
|
||||
INTGrowth = INTGrowth,
|
||||
SPD = SPD,
|
||||
ActionCoefficient = ActionCoefficient,
|
||||
AccelerationCoefficient = AccelerationCoefficient,
|
||||
ATR = ATR,
|
||||
CritRate = CritRate,
|
||||
|
@ -5,7 +5,7 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
public class Item : BaseEntity, IItem
|
||||
{
|
||||
public string Describe { get; set; } = "";
|
||||
public decimal Price { get; set; }
|
||||
public double Price { get; set; }
|
||||
public char Key { get; set; }
|
||||
public bool Active { get; set; }
|
||||
public bool Enable { get; set; }
|
||||
|
@ -6,15 +6,15 @@
|
||||
public Room Room { get; }
|
||||
public DateTime RecordTime { get; set; } = DateTime.Now;
|
||||
public string Record { get; set; } = "";
|
||||
public Dictionary<User, decimal> DamageStats { get; set; } = new();
|
||||
public Dictionary<User, decimal> PhysicalDamageStats { get; } = new();
|
||||
public Dictionary<User, decimal> MagicDamageStats { get; } = new();
|
||||
public Dictionary<User, decimal> RealDamageStats { get; } = new();
|
||||
public decimal AvgDamageStats
|
||||
public Dictionary<User, double> DamageStats { get; set; } = new();
|
||||
public Dictionary<User, double> PhysicalDamageStats { get; } = new();
|
||||
public Dictionary<User, double> MagicDamageStats { get; } = new();
|
||||
public Dictionary<User, double> RealDamageStats { get; } = new();
|
||||
public double AvgDamageStats
|
||||
{
|
||||
get
|
||||
{
|
||||
decimal total = 0;
|
||||
double total = 0;
|
||||
foreach (User user in DamageStats.Keys)
|
||||
{
|
||||
total += DamageStats[user];
|
||||
@ -22,11 +22,11 @@
|
||||
return Math.Round(total / DamageStats.Count, 2);
|
||||
}
|
||||
}
|
||||
public decimal AvgPhysicalDamageStats
|
||||
public double AvgPhysicalDamageStats
|
||||
{
|
||||
get
|
||||
{
|
||||
decimal total = 0;
|
||||
double total = 0;
|
||||
foreach (User user in PhysicalDamageStats.Keys)
|
||||
{
|
||||
total += PhysicalDamageStats[user];
|
||||
@ -34,11 +34,11 @@
|
||||
return Math.Round(total / PhysicalDamageStats.Count, 2);
|
||||
}
|
||||
}
|
||||
public decimal AvgMagicDamageStats
|
||||
public double AvgMagicDamageStats
|
||||
{
|
||||
get
|
||||
{
|
||||
decimal total = 0;
|
||||
double total = 0;
|
||||
foreach (User user in MagicDamageStats.Keys)
|
||||
{
|
||||
total += MagicDamageStats[user];
|
||||
@ -46,11 +46,11 @@
|
||||
return Math.Round(total / MagicDamageStats.Count, 2);
|
||||
}
|
||||
}
|
||||
public decimal AvgRealDamageStats
|
||||
public double AvgRealDamageStats
|
||||
{
|
||||
get
|
||||
{
|
||||
decimal total = 0;
|
||||
double total = 0;
|
||||
foreach (User user in RealDamageStats.Keys)
|
||||
{
|
||||
total += RealDamageStats[user];
|
||||
@ -58,13 +58,13 @@
|
||||
return Math.Round(total / RealDamageStats.Count, 2);
|
||||
}
|
||||
}
|
||||
public Dictionary<User, decimal> KillStats { get; } = new();
|
||||
public Dictionary<User, double> KillStats { get; } = new();
|
||||
public Dictionary<User, Dictionary<User, int>> KillDetailStats { get; } = new(); // 子字典记录的是被击杀者以及被击杀次数
|
||||
public Dictionary<User, decimal> DeathStats { get; } = new();
|
||||
public Dictionary<User, double> DeathStats { get; } = new();
|
||||
public Dictionary<User, Dictionary<User, int>> DeathDetailStats { get; } = new(); // 子字典记录的是击杀者以及击杀次数
|
||||
public Dictionary<User, long> AssistStats { get; } = new();
|
||||
public Dictionary<User, decimal> RatingStats { get; } = new(); // 结算后的Rating
|
||||
public Dictionary<User, decimal> EloStats { get; } = new(); // Elo分数变化(+/-)
|
||||
public Dictionary<User, double> RatingStats { get; } = new(); // 结算后的Rating
|
||||
public Dictionary<User, double> EloStats { get; } = new(); // Elo分数变化(+/-)
|
||||
public Dictionary<User, string> RankStats { get; } = new(); // 结算后的Rank(非比赛前)
|
||||
|
||||
public GameStatistics(Room Room)
|
||||
|
@ -8,19 +8,19 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
{
|
||||
public long Id => User.Id;
|
||||
public User User { get; }
|
||||
public Dictionary<long, decimal> DamageStats { get; } = new();
|
||||
public Dictionary<long, decimal> PhysicalDamageStats { get; } = new();
|
||||
public Dictionary<long, decimal> MagicDamageStats { get; } = new();
|
||||
public Dictionary<long, decimal> RealDamageStats { get; } = new();
|
||||
public Dictionary<long, decimal> AvgDamageStats
|
||||
public Dictionary<long, double> DamageStats { get; } = new();
|
||||
public Dictionary<long, double> PhysicalDamageStats { get; } = new();
|
||||
public Dictionary<long, double> MagicDamageStats { get; } = new();
|
||||
public Dictionary<long, double> RealDamageStats { get; } = new();
|
||||
public Dictionary<long, double> AvgDamageStats
|
||||
{
|
||||
get
|
||||
{
|
||||
Dictionary<long, decimal> avgdamage = new();
|
||||
Dictionary<long, double> avgdamage = new();
|
||||
foreach (long key in Plays.Keys)
|
||||
{
|
||||
long plays = Plays[key];
|
||||
decimal total = 0;
|
||||
double total = 0;
|
||||
if (DamageStats.ContainsKey(key))
|
||||
{
|
||||
total = DamageStats.Values.Sum();
|
||||
@ -30,15 +30,15 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
return avgdamage;
|
||||
}
|
||||
}
|
||||
public Dictionary<long, decimal> AvgPhysicalDamageStats
|
||||
public Dictionary<long, double> AvgPhysicalDamageStats
|
||||
{
|
||||
get
|
||||
{
|
||||
Dictionary<long, decimal> avgdamage = new();
|
||||
Dictionary<long, double> avgdamage = new();
|
||||
foreach (long key in Plays.Keys)
|
||||
{
|
||||
long plays = Plays[key];
|
||||
decimal total = 0;
|
||||
double total = 0;
|
||||
if (PhysicalDamageStats.ContainsKey(key))
|
||||
{
|
||||
total = PhysicalDamageStats.Values.Sum();
|
||||
@ -48,15 +48,15 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
return avgdamage;
|
||||
}
|
||||
}
|
||||
public Dictionary<long, decimal> AvgMagicDamageStats
|
||||
public Dictionary<long, double> AvgMagicDamageStats
|
||||
{
|
||||
get
|
||||
{
|
||||
Dictionary<long, decimal> avgdamage = new();
|
||||
Dictionary<long, double> avgdamage = new();
|
||||
foreach (long key in Plays.Keys)
|
||||
{
|
||||
long plays = Plays[key];
|
||||
decimal total = 0;
|
||||
double total = 0;
|
||||
if (MagicDamageStats.ContainsKey(key))
|
||||
{
|
||||
total = MagicDamageStats.Values.Sum();
|
||||
@ -66,15 +66,15 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
return avgdamage;
|
||||
}
|
||||
}
|
||||
public Dictionary<long, decimal> AvgRealDamageStats
|
||||
public Dictionary<long, double> AvgRealDamageStats
|
||||
{
|
||||
get
|
||||
{
|
||||
Dictionary<long, decimal> avgdamage = new();
|
||||
Dictionary<long, double> avgdamage = new();
|
||||
foreach (long key in Plays.Keys)
|
||||
{
|
||||
long plays = Plays[key];
|
||||
decimal total = 0;
|
||||
double total = 0;
|
||||
if (RealDamageStats.ContainsKey(key))
|
||||
{
|
||||
total = RealDamageStats.Values.Sum();
|
||||
@ -90,26 +90,26 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
public Dictionary<long, long> Plays { get; } = new();
|
||||
public Dictionary<long, long> Wins { get; } = new();
|
||||
public Dictionary<long, long> Loses { get; } = new();
|
||||
public Dictionary<long, decimal> Winrates
|
||||
public Dictionary<long, double> Winrates
|
||||
{
|
||||
get
|
||||
{
|
||||
Dictionary<long, decimal> winrates = new();
|
||||
Dictionary<long, double> winrates = new();
|
||||
foreach (long key in Plays.Keys)
|
||||
{
|
||||
long plays = Plays[key];
|
||||
long wins = 0;
|
||||
if (Wins.ContainsKey(key))
|
||||
if (Wins.TryGetValue(key, out long value))
|
||||
{
|
||||
wins = Wins[key];
|
||||
wins = value;
|
||||
}
|
||||
winrates.Add(key, Math.Round(wins * 1.0000M / plays * 1.0000M, 4));
|
||||
winrates.Add(key, Math.Round(wins * 1.0 / plays * 1.0, 4));
|
||||
}
|
||||
return winrates;
|
||||
}
|
||||
}
|
||||
public Dictionary<long, decimal> RatingStats { get; } = new();
|
||||
public Dictionary<long, decimal> EloStats { get; } = new();
|
||||
public Dictionary<long, double> RatingStats { get; } = new();
|
||||
public Dictionary<long, double> EloStats { get; } = new();
|
||||
public Dictionary<long, string> RankStats { get; } = new();
|
||||
|
||||
public string GetWinrate(long season)
|
||||
|
@ -8,11 +8,11 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
public string Description { get; set; } = "";
|
||||
public bool IsNeedApproval { get; set; } = false;
|
||||
public bool IsPublic { get; set; } = false;
|
||||
public decimal ClubPoins { get; set; } = 0M;
|
||||
public double ClubPoins { get; set; } = 0;
|
||||
public User? Master { get; set; }
|
||||
public Dictionary<string, User> Admins { get; set; } = new();
|
||||
public Dictionary<string, User> Members { get; set; } = new();
|
||||
public Dictionary<string, User> Applicants { get; set; } = new();
|
||||
public Dictionary<string, User> Admins { get; set; } = [];
|
||||
public Dictionary<string, User> Members { get; set; } = [];
|
||||
public Dictionary<string, User> Applicants { get; set; } = [];
|
||||
|
||||
public bool Equals(Club other)
|
||||
{
|
||||
|
@ -14,9 +14,9 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
public bool IsAdmin { get; set; } = false;
|
||||
public bool IsOperator { get; set; } = false;
|
||||
public bool IsEnable { get; set; } = true;
|
||||
public decimal Credits { get; set; } = 0;
|
||||
public decimal Materials { get; set; } = 0;
|
||||
public decimal GameTime { get; set; } = 0;
|
||||
public double Credits { get; set; } = 0;
|
||||
public double Materials { get; set; } = 0;
|
||||
public double GameTime { get; set; } = 0;
|
||||
public string AutoKey { get; set; } = "";
|
||||
public UserStatistics Statistics { get; }
|
||||
public Inventory Inventory { get; }
|
||||
@ -27,7 +27,7 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
Inventory = new(this);
|
||||
}
|
||||
|
||||
internal User(long Id = 0, string Username = "", DateTime? RegTime = null, DateTime? LastTime = null, string Email = "", string NickName = "", bool IsAdmin = false, bool IsOperator = false, bool IsEnable = true, decimal Credits = 0, decimal Materials = 0, decimal GameTime = 0, string AutoKey = "")
|
||||
internal User(long Id = 0, string Username = "", DateTime? RegTime = null, DateTime? LastTime = null, string Email = "", string NickName = "", bool IsAdmin = false, bool IsOperator = false, bool IsEnable = true, double Credits = 0, double Materials = 0, double GameTime = 0, string AutoKey = "")
|
||||
{
|
||||
this.Id = Id;
|
||||
this.Username = Username;
|
||||
|
@ -3,7 +3,7 @@
|
||||
public interface IItem : IActiveEnable, IRelateCharacter
|
||||
{
|
||||
public string Describe { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
public double Price { get; set; }
|
||||
public char Key { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -48,103 +48,100 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
|
||||
result.Level = reader.GetInt32();
|
||||
break;
|
||||
case nameof(Character.EXP):
|
||||
result.EXP = reader.GetDecimal();
|
||||
result.EXP = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.BaseHP):
|
||||
result.BaseHP = reader.GetDecimal();
|
||||
result.BaseHP = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.HP):
|
||||
result.HP = reader.GetDecimal();
|
||||
result.HP = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.BaseMP):
|
||||
result.BaseMP = reader.GetDecimal();
|
||||
result.BaseMP = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.MP):
|
||||
result.MP = reader.GetDecimal();
|
||||
result.MP = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.EP):
|
||||
result.EP = reader.GetDecimal();
|
||||
result.EP = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.BaseATK):
|
||||
result.BaseATK = reader.GetDecimal();
|
||||
result.BaseATK = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.ATK):
|
||||
result.ATK = reader.GetDecimal();
|
||||
result.ATK = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.BaseDEF):
|
||||
result.BaseDEF = reader.GetDecimal();
|
||||
result.BaseDEF = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.DEF):
|
||||
result.DEF = reader.GetDecimal();
|
||||
break;
|
||||
case nameof(Character.PDR):
|
||||
result.PDR = reader.GetDecimal();
|
||||
result.DEF = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.MDF):
|
||||
result.MDF = reader.GetDecimal();
|
||||
result.MDF = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.PhysicalPenetration):
|
||||
result.PhysicalPenetration = reader.GetDecimal();
|
||||
result.PhysicalPenetration = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.MagicalPenetration):
|
||||
result.MagicalPenetration = reader.GetDecimal();
|
||||
result.MagicalPenetration = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.HR):
|
||||
result.HR = reader.GetDecimal();
|
||||
result.HR = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.MR):
|
||||
result.MR = reader.GetDecimal();
|
||||
result.MR = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.ER):
|
||||
result.ER = reader.GetDecimal();
|
||||
result.ER = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.BaseSTR):
|
||||
result.BaseSTR = reader.GetDecimal();
|
||||
result.BaseSTR = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.BaseAGI):
|
||||
result.BaseAGI = reader.GetDecimal();
|
||||
result.BaseAGI = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.BaseINT):
|
||||
result.BaseINT = reader.GetDecimal();
|
||||
result.BaseINT = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.STR):
|
||||
result.STR = reader.GetDecimal();
|
||||
result.STR = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.AGI):
|
||||
result.AGI = reader.GetDecimal();
|
||||
result.AGI = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.INT):
|
||||
result.INT = reader.GetDecimal();
|
||||
result.INT = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.STRGrowth):
|
||||
result.STRGrowth = reader.GetDecimal();
|
||||
result.STRGrowth = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.AGIGrowth):
|
||||
result.AGIGrowth = reader.GetDecimal();
|
||||
result.AGIGrowth = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.INTGrowth):
|
||||
result.INTGrowth = reader.GetDecimal();
|
||||
result.INTGrowth = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.SPD):
|
||||
result.SPD = reader.GetDecimal();
|
||||
break;
|
||||
case nameof(Character.ActionCoefficient):
|
||||
result.ActionCoefficient = reader.GetDecimal();
|
||||
result.SPD = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.AccelerationCoefficient):
|
||||
result.AccelerationCoefficient = reader.GetDecimal();
|
||||
result.AccelerationCoefficient = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.CDR):
|
||||
result.CDR = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.ATR):
|
||||
result.ATR = reader.GetDecimal();
|
||||
result.ATR = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.CritRate):
|
||||
result.CritRate = reader.GetDecimal();
|
||||
result.CritRate = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.CritDMG):
|
||||
result.CritDMG = reader.GetDecimal();
|
||||
result.CritDMG = reader.GetDouble();
|
||||
break;
|
||||
case nameof(Character.EvadeRate):
|
||||
result.EvadeRate = reader.GetDecimal();
|
||||
result.EvadeRate = reader.GetDouble();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -172,7 +169,6 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
|
||||
writer.WriteNumber(nameof(Character.ATK), value.ATK);
|
||||
writer.WriteNumber(nameof(Character.BaseDEF), value.BaseDEF);
|
||||
writer.WriteNumber(nameof(Character.DEF), value.DEF);
|
||||
writer.WriteNumber(nameof(Character.PDR), value.PDR);
|
||||
writer.WriteNumber(nameof(Character.MDF), value.MDF);
|
||||
writer.WriteNumber(nameof(Character.PhysicalPenetration), value.PhysicalPenetration);
|
||||
writer.WriteNumber(nameof(Character.MagicalPenetration), value.MagicalPenetration);
|
||||
@ -189,8 +185,8 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
|
||||
writer.WriteNumber(nameof(Character.AGIGrowth), value.AGIGrowth);
|
||||
writer.WriteNumber(nameof(Character.INTGrowth), value.INTGrowth);
|
||||
writer.WriteNumber(nameof(Character.SPD), value.SPD);
|
||||
writer.WriteNumber(nameof(Character.ActionCoefficient), value.ActionCoefficient);
|
||||
writer.WriteNumber(nameof(Character.AccelerationCoefficient), value.AccelerationCoefficient);
|
||||
writer.WriteNumber(nameof(Character.CDR), value.CDR);
|
||||
writer.WriteNumber(nameof(Character.ATR), value.ATR);
|
||||
writer.WriteNumber(nameof(Character.CritRate), value.CritRate);
|
||||
writer.WriteNumber(nameof(Character.CritDMG), value.CritDMG);
|
||||
|
@ -56,13 +56,13 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
|
||||
result.IsEnable = reader.GetBoolean();
|
||||
break;
|
||||
case UserQuery.Column_Credits:
|
||||
result.Credits = reader.GetDecimal();
|
||||
result.Credits = reader.GetDouble();
|
||||
break;
|
||||
case UserQuery.Column_Materials:
|
||||
result.Materials = reader.GetDecimal();
|
||||
result.Materials = reader.GetDouble();
|
||||
break;
|
||||
case UserQuery.Column_GameTime:
|
||||
result.GameTime = reader.GetDecimal();
|
||||
result.GameTime = reader.GetDouble();
|
||||
break;
|
||||
case UserQuery.Column_AutoKey:
|
||||
result.AutoKey = reader.GetString() ?? "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user