mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2026-06-04 19:42:11 +00:00
物理伤害减免、魔法抗性最大为100%
This commit is contained in:
parent
1c3f21d199
commit
db2e71706b
@ -174,7 +174,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="obj"></param>
|
||||
/// <returns></returns>
|
||||
public static string JsonSerialize<T>(T obj) => Service.JsonManager.GetString(obj);
|
||||
public static string JsonSerialize<T>(T obj) => JsonManager.GetString(obj);
|
||||
|
||||
/// <summary>
|
||||
/// 返回目标对象的Json字符串 可指定反序列化选项
|
||||
@ -183,7 +183,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// <param name="obj"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
public static string JsonSerialize<T>(T obj, JsonSerializerOptions options) => Service.JsonManager.GetString(obj, options);
|
||||
public static string JsonSerialize<T>(T obj, JsonSerializerOptions options) => JsonManager.GetString(obj, options);
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化Json对象
|
||||
@ -191,7 +191,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="json"></param>
|
||||
/// <returns></returns>
|
||||
public static T? JsonDeserialize<T>(string json) => Service.JsonManager.GetObject<T>(json);
|
||||
public static T? JsonDeserialize<T>(string json) => JsonManager.GetObject<T>(json);
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化Json对象 使用 <paramref name="reader"/> 可指定反序列化选项
|
||||
@ -200,7 +200,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
public static T? JsonDeserialize<T>(ref Utf8JsonReader reader, JsonSerializerOptions options) => Service.JsonManager.GetObject<T>(ref reader, options);
|
||||
public static T? JsonDeserialize<T>(ref Utf8JsonReader reader, JsonSerializerOptions options) => JsonManager.GetObject<T>(ref reader, options);
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化Json对象 可指定反序列化选项
|
||||
@ -209,7 +209,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// <param name="json"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
public static T? JsonDeserialize<T>(string json, JsonSerializerOptions options) => Service.JsonManager.GetObject<T>(json, options);
|
||||
public static T? JsonDeserialize<T>(string json, JsonSerializerOptions options) => JsonManager.GetObject<T>(json, options);
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化Hashtable中的Json对象
|
||||
@ -218,7 +218,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// <param name="hashtable"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public static T? JsonDeserializeFromHashtable<T>(Hashtable hashtable, string key) => Service.JsonManager.GetObject<T>(hashtable, key);
|
||||
public static T? JsonDeserializeFromHashtable<T>(Hashtable hashtable, string key) => JsonManager.GetObject<T>(hashtable, key);
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化Dictionary中的Json对象
|
||||
@ -227,7 +227,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// <param name="dict"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public static T? JsonDeserializeFromDictionary<T>(Dictionary<string, object> dict, string key) => Service.JsonManager.GetObject<T>(dict, key);
|
||||
public static T? JsonDeserializeFromDictionary<T>(Dictionary<string, object> dict, string key) => JsonManager.GetObject<T>(dict, key);
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化IEnumerable中的Json对象
|
||||
@ -236,7 +236,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// <param name="e"></param>
|
||||
/// <param name="index"></param>
|
||||
/// <returns></returns>
|
||||
public static T? JsonDeserializeFromIEnumerable<T>(IEnumerable<object> e, int index) => Service.JsonManager.GetObject<T>(e, index);
|
||||
public static T? JsonDeserializeFromIEnumerable<T>(IEnumerable<object> e, int index) => JsonManager.GetObject<T>(e, index);
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化IEnumerable中的Json对象 可指定反序列化选项
|
||||
@ -246,7 +246,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// <param name="index"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
public static T? JsonDeserializeFromIEnumerable<T>(IEnumerable<object> e, int index, JsonSerializerOptions options) => Service.JsonManager.GetObject<T>(e, index, options);
|
||||
public static T? JsonDeserializeFromIEnumerable<T>(IEnumerable<object> e, int index, JsonSerializerOptions options) => JsonManager.GetObject<T>(e, index, options);
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化Hashtable中的Json对象 可指定反序列化选项
|
||||
@ -256,7 +256,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// <param name="key"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
public static T? JsonDeserializeFromHashtable<T>(Hashtable hashtable, string key, JsonSerializerOptions options) => Service.JsonManager.GetObject<T>(hashtable, key, options);
|
||||
public static T? JsonDeserializeFromHashtable<T>(Hashtable hashtable, string key, JsonSerializerOptions options) => JsonManager.GetObject<T>(hashtable, key, options);
|
||||
|
||||
/// <summary>
|
||||
/// 创建一个静态 HttpClient 实例,供整个应用程序生命周期使用
|
||||
|
||||
@ -73,31 +73,31 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Promotion > GameplayEquilibriumConstant.PromotionsUpperLimit["S"])
|
||||
if (Promotion > GameplayEquilibriumConstant.PromotionSUpperLimit)
|
||||
{
|
||||
return RoleRating.X;
|
||||
}
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionsUpperLimit["A+"] && Promotion <= GameplayEquilibriumConstant.PromotionsUpperLimit["S"])
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionAPlusUpperLimit && Promotion <= GameplayEquilibriumConstant.PromotionSUpperLimit)
|
||||
{
|
||||
return RoleRating.S;
|
||||
}
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionsUpperLimit["A"] && Promotion <= GameplayEquilibriumConstant.PromotionsUpperLimit["A+"])
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionAUpperLimit && Promotion <= GameplayEquilibriumConstant.PromotionAPlusUpperLimit)
|
||||
{
|
||||
return RoleRating.APlus;
|
||||
}
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionsUpperLimit["B"] && Promotion <= GameplayEquilibriumConstant.PromotionsUpperLimit["A"])
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionBUpperLimit && Promotion <= GameplayEquilibriumConstant.PromotionAUpperLimit)
|
||||
{
|
||||
return RoleRating.A;
|
||||
}
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionsUpperLimit["C"] && Promotion <= GameplayEquilibriumConstant.PromotionsUpperLimit["B"])
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionCUpperLimit && Promotion <= GameplayEquilibriumConstant.PromotionBUpperLimit)
|
||||
{
|
||||
return RoleRating.B;
|
||||
}
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionsUpperLimit["D"] && Promotion <= GameplayEquilibriumConstant.PromotionsUpperLimit["C"])
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionDUpperLimit && Promotion <= GameplayEquilibriumConstant.PromotionCUpperLimit)
|
||||
{
|
||||
return RoleRating.C;
|
||||
}
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionsUpperLimit["E"] && Promotion <= GameplayEquilibriumConstant.PromotionsUpperLimit["D"])
|
||||
else if (Promotion > GameplayEquilibriumConstant.PromotionEUpperLimit && Promotion <= GameplayEquilibriumConstant.PromotionDUpperLimit)
|
||||
{
|
||||
return RoleRating.D;
|
||||
}
|
||||
@ -445,7 +445,7 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
get
|
||||
{
|
||||
double value = (DEF / (DEF + GameplayEquilibriumConstant.DEFReductionFactor)) + ExPDR;
|
||||
return Calculation.PercentageCheck(value);
|
||||
return Math.Min(1, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -11,47 +11,83 @@ namespace Milimoe.FunGame.Core.Entity
|
||||
/// <summary>
|
||||
/// 无属性魔法抗性
|
||||
/// </summary>
|
||||
public double None { get; set; } = 0;
|
||||
public double None
|
||||
{
|
||||
get => field;
|
||||
set => field = Math.Min(1, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 星痕魔法抗性
|
||||
/// </summary>
|
||||
public double Starmark { get; set; } = 0;
|
||||
public double Starmark
|
||||
{
|
||||
get => field;
|
||||
set => field = Math.Min(1, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纯粹结晶魔法抗性
|
||||
/// </summary>
|
||||
public double PurityNatural { get; set; } = 0;
|
||||
public double PurityNatural
|
||||
{
|
||||
get => field;
|
||||
set => field = Math.Min(1, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 纯现代结晶魔法抗性
|
||||
/// </summary>
|
||||
public double PurityContemporary { get; set; } = 0;
|
||||
public double PurityContemporary
|
||||
{
|
||||
get => field;
|
||||
set => field = Math.Min(1, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 光魔法抗性
|
||||
/// </summary>
|
||||
public double Bright { get; set; } = 0;
|
||||
public double Bright
|
||||
{
|
||||
get => field;
|
||||
set => field = Math.Min(1, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 影魔法抗性
|
||||
/// </summary>
|
||||
public double Shadow { get; set; } = 0;
|
||||
public double Shadow
|
||||
{
|
||||
get => field;
|
||||
set => field = Math.Min(1, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 元素魔法抗性
|
||||
/// </summary>
|
||||
public double Element { get; set; } = 0;
|
||||
public double Element
|
||||
{
|
||||
get => field;
|
||||
set => field = Math.Min(1, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 紫宛魔法抗性
|
||||
/// </summary>
|
||||
public double Aster { get; set; } = 0;
|
||||
public double Aster
|
||||
{
|
||||
get => field;
|
||||
set => field = Math.Min(1, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 时空魔法抗性
|
||||
/// </summary>
|
||||
public double SpatioTemporal { get; set; } = 0;
|
||||
public double SpatioTemporal
|
||||
{
|
||||
get => field;
|
||||
set => field = Math.Min(1, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 平均魔法抗性
|
||||
|
||||
@ -104,6 +104,21 @@ namespace Milimoe.FunGame.Core.Library.Common.Network
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送 POST 请求
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="json"></param>
|
||||
/// <returns></returns>
|
||||
public async Task HttpPost(string url, string json)
|
||||
{
|
||||
HttpContent content = new StringContent(json, General.DefaultEncoding, "application/json");
|
||||
HttpResponseMessage response = await Instance.PostAsync(url, content);
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送 POST 请求
|
||||
/// </summary>
|
||||
|
||||
@ -24,19 +24,44 @@ namespace Milimoe.FunGame.Core.Model
|
||||
public string InGameTime { get; set; } = "时间";
|
||||
|
||||
/// <summary>
|
||||
/// 晋升点数上限
|
||||
/// 晋升点数上限 - X级
|
||||
/// </summary>
|
||||
public Dictionary<string, int> PromotionsUpperLimit { get; set; } = new()
|
||||
{
|
||||
{ "X", 999 },
|
||||
{ "S", 998 },
|
||||
{ "A+", 850 },
|
||||
{ "A", 700 },
|
||||
{ "B", 550 },
|
||||
{ "C", 400 },
|
||||
{ "D", 300 },
|
||||
{ "E", 200 },
|
||||
};
|
||||
public int PromotionXUpperLimit { get; set; } = 999;
|
||||
|
||||
/// <summary>
|
||||
/// 晋升点数上限 - S级
|
||||
/// </summary>
|
||||
public int PromotionSUpperLimit { get; set; } = 998;
|
||||
|
||||
/// <summary>
|
||||
/// 晋升点数上限 - A+级
|
||||
/// </summary>
|
||||
public int PromotionAPlusUpperLimit { get; set; } = 850;
|
||||
|
||||
/// <summary>
|
||||
/// 晋升点数上限 - A级
|
||||
/// </summary>
|
||||
public int PromotionAUpperLimit { get; set; } = 700;
|
||||
|
||||
/// <summary>
|
||||
/// 晋升点数上限 - B级
|
||||
/// </summary>
|
||||
public int PromotionBUpperLimit { get; set; } = 550;
|
||||
|
||||
/// <summary>
|
||||
/// 晋升点数上限 - C级
|
||||
/// </summary>
|
||||
public int PromotionCUpperLimit { get; set; } = 400;
|
||||
|
||||
/// <summary>
|
||||
/// 晋升点数上限 - D级
|
||||
/// </summary>
|
||||
public int PromotionDUpperLimit { get; set; } = 300;
|
||||
|
||||
/// <summary>
|
||||
/// 晋升点数上限 - E级
|
||||
/// </summary>
|
||||
public int PromotionEUpperLimit { get; set; } = 200;
|
||||
|
||||
/// <summary>
|
||||
/// 使用的魔法类型
|
||||
@ -62,7 +87,7 @@ namespace Milimoe.FunGame.Core.Model
|
||||
public int MaxLevel { get; set; } = 60;
|
||||
|
||||
/// <summary>
|
||||
/// 经验值上限
|
||||
/// 经验值上限(key = 等级,value = 该等级的上限)
|
||||
/// </summary>
|
||||
public Dictionary<int, double> EXPUpperLimit { get; set; } = new()
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user