diff --git a/Api/Factory/UserFactory.cs b/Api/Factory/UserFactory.cs index ca5732c..5668e77 100644 --- a/Api/Factory/UserFactory.cs +++ b/Api/Factory/UserFactory.cs @@ -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); } diff --git a/Api/Utility/Factory.cs b/Api/Utility/Factory.cs index 2fbd36e..bc63c45 100644 --- a/Api/Utility/Factory.cs +++ b/Api/Utility/Factory.cs @@ -173,7 +173,7 @@ namespace Milimoe.FunGame.Core.Api.Utility /// /// /// - 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); } diff --git a/Api/Utility/PluginConfig.cs b/Api/Utility/PluginConfig.cs index 5db7f8c..c21bd3c 100644 --- a/Api/Utility/PluginConfig.cs +++ b/Api/Utility/PluginConfig.cs @@ -5,7 +5,7 @@ namespace Milimoe.FunGame.Core.Api.Utility { /// /// 简易的插件配置文件生成器 - /// 仅支持部分基本类型(, , , )及其数组(List<long>, List<decimal>, List<string>, List<bool>long[], decimal[], string[], bool[]) + /// 仅支持部分基本类型(, , , , )及其数组(List<long>, List<double>, List<decimal>, List<string>, List<bool>long[], double[], decimal[], string[], bool[]) /// 文件会保存为:程序目录/configs//.json /// /// @@ -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 longList = []; + List douList = []; List decList = []; List strList = []; List 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); diff --git a/Entity/Character/Character.cs b/Entity/Character/Character.cs index d80208d..7635bf4 100644 --- a/Entity/Character/Character.cs +++ b/Entity/Character/Character.cs @@ -15,7 +15,7 @@ namespace Milimoe.FunGame.Core.Entity /// 角色的名字 /// public string FirstName { get; set; } = ""; - + /// /// 角色的昵称 /// @@ -69,167 +69,196 @@ namespace Milimoe.FunGame.Core.Entity /// /// 经验值 /// - public decimal EXP { get; set; } = 0; + public double EXP { get; set; } = 0; /// /// 基础生命值 /// - public decimal BaseHP { get; set; } = 0; + public double BaseHP { get; set; } = 1; /// /// 生命值 /// - public decimal HP { get; set; } = 0; + public double HP { get; set; } = 0; /// /// 基础魔法值 /// - public decimal BaseMP { get; set; } = 0; + public double BaseMP { get; set; } = 0; /// /// 魔法值 /// - public decimal MP { get; set; } = 0; + public double MP { get; set; } = 0; /// - /// 能量 + /// 爆发能量 /// - public decimal EP { get; set; } = 0; + public double EP { get; set; } = 0; /// /// 基础攻击力 /// - public decimal BaseATK { get; set; } = 0; + public double BaseATK { get; set; } = 1; /// /// 攻击力 /// - public decimal ATK { get; set; } = 0; + public double ATK { get; set; } = 0; /// /// 基础物理护甲 /// - public decimal BaseDEF { get; set; } = 0; + public double BaseDEF { get; set; } = 5; /// /// 物理护甲 /// - public decimal DEF { get; set; } = 0; + public double DEF { get; set; } = 0; /// /// 物理伤害减免(%) /// - 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; + } + } + + /// + /// 额外物理伤害减免(%) + /// + public double ExPDR { get; set; } = 0; /// /// 魔法抗性(%) /// - public decimal MDF { get; set; } = 0; + public double MDF { get; set; } = 0; /// /// 物理穿透(%) /// - public decimal PhysicalPenetration { get; set; } = 0; + public double PhysicalPenetration { get; set; } = 0; /// /// 魔法穿透(%) /// - public decimal MagicalPenetration { get; set; } = 0; + public double MagicalPenetration { get; set; } = 0; /// /// 生命回复力 /// - public decimal HR { get; set; } = 0; + public double HR { get; set; } = 0; /// /// 魔法回复力 /// - public decimal MR { get; set; } = 0; + public double MR { get; set; } = 0; /// /// 能量回复力 /// - public decimal ER { get; set; } = 0; + public double ER { get; set; } = 0; /// /// 基础力量 /// - public decimal BaseSTR { get; set; } = 0; + public double BaseSTR { get; set; } = 0; /// /// 基础敏捷 /// - public decimal BaseAGI { get; set; } = 0; + public double BaseAGI { get; set; } = 0; /// /// 基础智力 /// - public decimal BaseINT { get; set; } = 0; + public double BaseINT { get; set; } = 0; /// /// 力量 /// - public decimal STR { get; set; } = 0; + public double STR { get; set; } = 0; /// /// 敏捷 /// - public decimal AGI { get; set; } = 0; + public double AGI { get; set; } = 0; /// /// 智力 /// - public decimal INT { get; set; } = 0; + public double INT { get; set; } = 0; /// /// 力量成长值 /// - public decimal STRGrowth { get; set; } = 0; + public double STRGrowth { get; set; } = 0; /// /// 敏捷成长值 /// - public decimal AGIGrowth { get; set; } = 0; + public double AGIGrowth { get; set; } = 0; /// /// 智力成长值 /// - public decimal INTGrowth { get; set; } = 0; + public double INTGrowth { get; set; } = 0; /// - /// 速度 + /// 行动速度 /// - public decimal SPD { get; set; } = 0; + public double SPD { get; set; } = 0; /// /// 行动系数(%) /// - 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; + } + } + + /// + /// 额外行动系数(%) + /// + public double ExActionCoefficient { get; set; } = 0; /// /// 加速系数(%) /// - public decimal AccelerationCoefficient { get; set; } = 0; + public double AccelerationCoefficient { get; set; } = 0; + + /// + /// 冷却缩减(%) + /// + public double CDR { get; set; } = 0; /// /// 攻击距离 /// - public decimal ATR { get; set; } = 0; + public double ATR { get; set; } = 0; /// /// 暴击率(%) /// - public decimal CritRate { get; set; } = 0.05M; + public double CritRate { get; set; } = 0.05; /// - /// 暴击伤害 + /// 暴击伤害(%) /// - public decimal CritDMG { get; set; } = 1.25M; + public double CritDMG { get; set; } = 1.25; /// /// 闪避率(%) /// - public decimal EvadeRate { get; set; } = 0.05M; + public double EvadeRate { get; set; } = 0.05; /// /// 角色的技能组 @@ -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, diff --git a/Entity/Item/Item.cs b/Entity/Item/Item.cs index 1d07b8c..4e98dd1 100644 --- a/Entity/Item/Item.cs +++ b/Entity/Item/Item.cs @@ -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; } diff --git a/Entity/Statistics/GameStatistics.cs b/Entity/Statistics/GameStatistics.cs index c748779..f9b321d 100644 --- a/Entity/Statistics/GameStatistics.cs +++ b/Entity/Statistics/GameStatistics.cs @@ -6,15 +6,15 @@ public Room Room { get; } public DateTime RecordTime { get; set; } = DateTime.Now; public string Record { get; set; } = ""; - public Dictionary DamageStats { get; set; } = new(); - public Dictionary PhysicalDamageStats { get; } = new(); - public Dictionary MagicDamageStats { get; } = new(); - public Dictionary RealDamageStats { get; } = new(); - public decimal AvgDamageStats + public Dictionary DamageStats { get; set; } = new(); + public Dictionary PhysicalDamageStats { get; } = new(); + public Dictionary MagicDamageStats { get; } = new(); + public Dictionary 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 KillStats { get; } = new(); + public Dictionary KillStats { get; } = new(); public Dictionary> KillDetailStats { get; } = new(); // 子字典记录的是被击杀者以及被击杀次数 - public Dictionary DeathStats { get; } = new(); + public Dictionary DeathStats { get; } = new(); public Dictionary> DeathDetailStats { get; } = new(); // 子字典记录的是击杀者以及击杀次数 public Dictionary AssistStats { get; } = new(); - public Dictionary RatingStats { get; } = new(); // 结算后的Rating - public Dictionary EloStats { get; } = new(); // Elo分数变化(+/-) + public Dictionary RatingStats { get; } = new(); // 结算后的Rating + public Dictionary EloStats { get; } = new(); // Elo分数变化(+/-) public Dictionary RankStats { get; } = new(); // 结算后的Rank(非比赛前) public GameStatistics(Room Room) diff --git a/Entity/Statistics/UserStatistics.cs b/Entity/Statistics/UserStatistics.cs index 29a8302..041951d 100644 --- a/Entity/Statistics/UserStatistics.cs +++ b/Entity/Statistics/UserStatistics.cs @@ -8,19 +8,19 @@ namespace Milimoe.FunGame.Core.Entity { public long Id => User.Id; public User User { get; } - public Dictionary DamageStats { get; } = new(); - public Dictionary PhysicalDamageStats { get; } = new(); - public Dictionary MagicDamageStats { get; } = new(); - public Dictionary RealDamageStats { get; } = new(); - public Dictionary AvgDamageStats + public Dictionary DamageStats { get; } = new(); + public Dictionary PhysicalDamageStats { get; } = new(); + public Dictionary MagicDamageStats { get; } = new(); + public Dictionary RealDamageStats { get; } = new(); + public Dictionary AvgDamageStats { get { - Dictionary avgdamage = new(); + Dictionary 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 AvgPhysicalDamageStats + public Dictionary AvgPhysicalDamageStats { get { - Dictionary avgdamage = new(); + Dictionary 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 AvgMagicDamageStats + public Dictionary AvgMagicDamageStats { get { - Dictionary avgdamage = new(); + Dictionary 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 AvgRealDamageStats + public Dictionary AvgRealDamageStats { get { - Dictionary avgdamage = new(); + Dictionary 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 Plays { get; } = new(); public Dictionary Wins { get; } = new(); public Dictionary Loses { get; } = new(); - public Dictionary Winrates + public Dictionary Winrates { get { - Dictionary winrates = new(); + Dictionary 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 RatingStats { get; } = new(); - public Dictionary EloStats { get; } = new(); + public Dictionary RatingStats { get; } = new(); + public Dictionary EloStats { get; } = new(); public Dictionary RankStats { get; } = new(); public string GetWinrate(long season) diff --git a/Entity/System/Club.cs b/Entity/System/Club.cs index 89c0e9c..3e1cf42 100644 --- a/Entity/System/Club.cs +++ b/Entity/System/Club.cs @@ -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 Admins { get; set; } = new(); - public Dictionary Members { get; set; } = new(); - public Dictionary Applicants { get; set; } = new(); + public Dictionary Admins { get; set; } = []; + public Dictionary Members { get; set; } = []; + public Dictionary Applicants { get; set; } = []; public bool Equals(Club other) { diff --git a/Entity/User/User.cs b/Entity/User/User.cs index 27fe96f..6ff3d08 100644 --- a/Entity/User/User.cs +++ b/Entity/User/User.cs @@ -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; diff --git a/Interface/Entity/Typical/IItem.cs b/Interface/Entity/Typical/IItem.cs index 2ce9fc6..c70e573 100644 --- a/Interface/Entity/Typical/IItem.cs +++ b/Interface/Entity/Typical/IItem.cs @@ -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; } } } diff --git a/Library/Common/JsonConverter/CharacterConverter.cs b/Library/Common/JsonConverter/CharacterConverter.cs index 4b23514..820dec8 100644 --- a/Library/Common/JsonConverter/CharacterConverter.cs +++ b/Library/Common/JsonConverter/CharacterConverter.cs @@ -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); diff --git a/Library/Common/JsonConverter/UserConverter.cs b/Library/Common/JsonConverter/UserConverter.cs index 5c99064..68817df 100644 --- a/Library/Common/JsonConverter/UserConverter.cs +++ b/Library/Common/JsonConverter/UserConverter.cs @@ -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() ?? "";