添加额外生命值/魔法值3;负数额外加成将会显示在详细面板上;物理伤害减免因子调整

This commit is contained in:
milimoe 2024-12-04 01:00:57 +08:00
parent 570d48f979
commit c7c33938bf
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
3 changed files with 51 additions and 22 deletions

View File

@ -701,6 +701,17 @@ namespace Milimoe.FunGame.Core.Api.Utility
{ {
return Math.Max(0, Math.Min(value, 1)); return Math.Max(0, Math.Min(value, 1));
} }
/// <summary>
/// 检查 <paramref name="value"/> 是否约等于 0
/// </summary>
/// <param name="value"></param>
/// <param name="epsilon"></param>
/// <returns></returns>
public static bool IsApproximatelyZero(double value, double epsilon = 1e-10)
{
return Math.Abs(value) < epsilon;
}
} }
#endregion #endregion

View File

@ -181,6 +181,11 @@ namespace Milimoe.FunGame.Core.Entity
/// 额外生命值2 [ 与技能和物品相关 ] /// 额外生命值2 [ 与技能和物品相关 ]
/// </summary> /// </summary>
public double ExHP2 { get; set; } = 0; public double ExHP2 { get; set; } = 0;
/// <summary>
/// 额外生命值3 [ 额外生命值% ]
/// </summary>
public double ExHP3 => (BaseHP + ExHP + ExHP2) * ExHPPercentage;
/// <summary> /// <summary>
/// 额外生命值% [ 与技能和物品相关 ] /// 额外生命值% [ 与技能和物品相关 ]
@ -188,9 +193,9 @@ namespace Milimoe.FunGame.Core.Entity
public double ExHPPercentage { get; set; } = 0; public double ExHPPercentage { get; set; } = 0;
/// <summary> /// <summary>
/// 最大生命值 = 基础生命值 + 额外生命值 + 额外生命值2 + 额外生命值% /// 最大生命值 = 基础生命值 + 额外生命值 + 额外生命值2 + 额外生命值3
/// </summary> /// </summary>
public double MaxHP => BaseHP + ExHP + ExHP2 + ((BaseHP + ExHP + ExHP2) * ExHPPercentage); public double MaxHP => BaseHP + ExHP + ExHP2 + ExHP3;
/// <summary> /// <summary>
/// 当前生命值 [ 战斗相关 ] /// 当前生命值 [ 战斗相关 ]
@ -230,15 +235,20 @@ namespace Milimoe.FunGame.Core.Entity
/// </summary> /// </summary>
public double ExMP2 { get; set; } = 0; public double ExMP2 { get; set; } = 0;
/// <summary>
/// 额外魔法值2 [ 额外魔法值% ]
/// </summary>
public double ExMP3 => (BaseMP + ExMP + ExMP2) * ExMPPercentage;
/// <summary> /// <summary>
/// 额外魔法值% [ 与技能和物品相关 ] /// 额外魔法值% [ 与技能和物品相关 ]
/// </summary> /// </summary>
public double ExMPPercentage { get; set; } = 0; public double ExMPPercentage { get; set; } = 0;
/// <summary> /// <summary>
/// 最大魔法值 = 基础魔法值 + 额外魔法值 + 额外魔法值2 + 额外魔法值% /// 最大魔法值 = 基础魔法值 + 额外魔法值 + 额外魔法值2 + 额外魔法值3
/// </summary> /// </summary>
public double MaxMP => BaseMP + ExMP + ExMP2 + ((BaseMP + ExMP + ExMP2) * ExMPPercentage); public double MaxMP => BaseMP + ExMP + ExMP2 + ExMP3;
/// <summary> /// <summary>
/// 当前魔法值 [ 战斗相关 ] /// 当前魔法值 [ 战斗相关 ]
@ -1116,22 +1126,27 @@ namespace Milimoe.FunGame.Core.Entity
StringBuilder builder = new(); StringBuilder builder = new();
builder.AppendLine(showUser ? ToStringWithLevel() : ToStringWithLevelWithOutUser()); builder.AppendLine(showUser ? ToStringWithLevel() : ToStringWithLevelWithOutUser());
builder.AppendLine($"生命值:{HP:0.##} / {MaxHP:0.##}" + (ExHP + ExHP2 + ExHPPercentage > 0 ? $" [{BaseHP:0.##} + {ExHP + ExHP2 + (MaxHP * ExHPPercentage):0.##}]" : "")); double exHP = ExHP + ExHP2 + ExHP3;
builder.AppendLine($"魔法值:{MP:0.##} / {MaxMP:0.##}" + (ExMP + ExMP2 + ExMPPercentage > 0 ? $" [{BaseMP:0.##} + {ExMP + ExMP2 + (MaxMP * ExMPPercentage):0.##}]" : "")); builder.AppendLine($"生命值:{HP:0.##} / {MaxHP:0.##}" + (exHP != 0 ? $" [{BaseHP:0.##} {(exHP >= 0 ? "+" : "-")} {Math.Abs(exHP):0.##}]" : ""));
double exMP = ExMP + ExMP2 + ExMP3;
builder.AppendLine($"魔法值:{MP:0.##} / {MaxMP:0.##}" + (exMP != 0 ? $" [{BaseMP:0.##} {(exMP >= 0 ? "+" : "-")} {Math.Abs(exMP):0.##}]" : ""));
builder.AppendLine($"能量值:{EP:0.##} / {General.GameplayEquilibriumConstant.MaxEP:0.##}"); builder.AppendLine($"能量值:{EP:0.##} / {General.GameplayEquilibriumConstant.MaxEP:0.##}");
builder.AppendLine($"攻击力:{ATK:0.##}" + (ExATK + ExATK2 > 0 ? $" [{BaseATK:0.##} + {ExATK + ExATK2:0.##}]" : "")); double exATK = ExATK + ExATK2;
builder.AppendLine($"物理护甲:{DEF:0.##}" + (ExDEF + ExDEF2 > 0 ? $" [{BaseDEF:0.##} + {ExDEF + ExDEF2:0.##}]" : "") + $" ({PDR * 100:0.##}%)"); builder.AppendLine($"攻击力:{ATK:0.##}" + (exATK != 0 ? $" [{BaseATK:0.##} {(exATK >= 0 ? "+" : "-")} {Math.Abs(exATK):0.##}]" : ""));
double mdf = (MDF.None + MDF.Starmark + MDF.PurityNatural + MDF.PurityContemporary + double exDEF = ExDEF + ExDEF2;
MDF.Bright + MDF.Shadow + MDF.Element + MDF.Fleabane + MDF.Particle) / 9; builder.AppendLine($"物理护甲:{DEF:0.##}" + (exDEF != 0 ? $" [{BaseDEF:0.##} {(exMP >= 0 ? "+" : "-")} {Math.Abs(exDEF):0.##}]" : "") + $" ({PDR * 100:0.##}%)");
builder.AppendLine($"魔法抗性:{Calculation.Round4Digits(mdf) * 100:0.##}%(平均)"); double mdf = Calculation.Round4Digits((MDF.None + MDF.Starmark + MDF.PurityNatural + MDF.PurityContemporary +
MDF.Bright + MDF.Shadow + MDF.Element + MDF.Fleabane + MDF.Particle) / 9) * 100;
if (Calculation.IsApproximatelyZero(mdf)) mdf = 0;
builder.AppendLine($"魔法抗性:{mdf:0.##}%(平均)");
double exSPD = AGI * General.GameplayEquilibriumConstant.AGItoSPDMultiplier + ExSPD; double exSPD = AGI * General.GameplayEquilibriumConstant.AGItoSPDMultiplier + ExSPD;
builder.AppendLine($"行动速度:{SPD:0.##}" + (exSPD > 0 ? $" [{InitialSPD:0.##} + {exSPD:0.##}]" : "") + $" ({ActionCoefficient * 100:0.##}%)"); builder.AppendLine($"行动速度:{SPD:0.##}" + (exSPD != 0 ? $" [{InitialSPD:0.##} {(exSPD >= 0 ? "+" : "-")} {Math.Abs(exSPD):0.##}]" : "") + $" ({ActionCoefficient * 100:0.##}%)");
builder.AppendLine($"核心属性:{CharacterSet.GetPrimaryAttributeName(PrimaryAttribute)}"); builder.AppendLine($"核心属性:{CharacterSet.GetPrimaryAttributeName(PrimaryAttribute)}");
builder.AppendLine($"力量:{STR:0.##}" + (ExSTR > 0 ? $" [{BaseSTR:0.##} + {ExSTR:0.##}]" : "")); builder.AppendLine($"力量:{STR:0.##}" + (ExSTR != 0 ? $" [{BaseSTR:0.##} {(ExSTR >= 0 ? "+" : "-")} {Math.Abs(ExSTR):0.##}]" : ""));
builder.AppendLine($"敏捷:{AGI:0.##}" + (ExAGI > 0 ? $" [{BaseAGI:0.##} + {ExAGI:0.##}]" : "")); builder.AppendLine($"敏捷:{AGI:0.##}" + (ExAGI != 0 ? $" [{BaseAGI:0.##} {(ExAGI >= 0 ? "+" : "-")} {Math.Abs(ExAGI):0.##}]" : ""));
builder.AppendLine($"智力:{INT:0.##}" + (ExINT > 0 ? $" [{BaseINT:0.##} + {ExINT:0.##}]" : "")); builder.AppendLine($"智力:{INT:0.##}" + (ExINT != 0 ? $" [{BaseINT:0.##} {(ExINT >= 0 ? "+" : "-")} {Math.Abs(ExINT):0.##}]" : ""));
builder.AppendLine($"生命回复:{HR:0.##}" + (ExHR > 0 ? $" [{InitialHR + STR * 0.25:0.##} + {ExHR:0.##}]" : "")); builder.AppendLine($"生命回复:{HR:0.##}" + (ExHR != 0 ? $" [{InitialHR + STR * 0.25:0.##} {(ExHR >= 0 ? "+" : "-")} {Math.Abs(ExHR):0.##}]" : ""));
builder.AppendLine($"魔法回复:{MR:0.##}" + (ExMR > 0 ? $" [{InitialMR + INT * 0.1:0.##} + {ExMR:0.##}]" : "")); builder.AppendLine($"魔法回复:{MR:0.##}" + (ExMR != 0 ? $" [{InitialMR + INT * 0.1:0.##} {(ExMR >= 0 ? "+" : "-")} {Math.Abs(ExMR):0.##}]" : ""));
builder.AppendLine($"暴击率:{CritRate * 100:0.##}%"); builder.AppendLine($"暴击率:{CritRate * 100:0.##}%");
builder.AppendLine($"暴击伤害:{CritDMG * 100:0.##}%"); builder.AppendLine($"暴击伤害:{CritDMG * 100:0.##}%");
builder.AppendLine($"闪避率:{EvadeRate * 100:0.##}%"); builder.AppendLine($"闪避率:{EvadeRate * 100:0.##}%");
@ -1235,11 +1250,14 @@ namespace Milimoe.FunGame.Core.Entity
StringBuilder builder = new(); StringBuilder builder = new();
builder.AppendLine(ToStringWithLevel()); builder.AppendLine(ToStringWithLevel());
builder.AppendLine($"生命值:{HP:0.##} / {MaxHP:0.##}" + (ExHP + ExHP2 > 0 ? $" [{BaseHP:0.##} + {ExHP + ExHP2:0.##}]" : "")); double exHP = ExHP + ExHP2 + ExHP3;
builder.AppendLine($"魔法值:{MP:0.##} / {MaxMP:0.##}" + (ExMP + ExMP2 > 0 ? $" [{BaseMP:0.##} + {ExMP + ExMP2:0.##}]" : "")); builder.AppendLine($"生命值:{HP:0.##} / {MaxHP:0.##}" + (exHP != 0 ? $" [{BaseHP:0.##} {(exHP >= 0 ? "+" : "-")} {Math.Abs(exHP):0.##}]" : ""));
double exMP = ExMP + ExMP2 + ExMP3;
builder.AppendLine($"魔法值:{MP:0.##} / {MaxMP:0.##}" + (exMP != 0 ? $" [{BaseMP:0.##} {(exMP >= 0 ? "+" : "-")} {Math.Abs(exMP):0.##}]" : ""));
builder.AppendLine($"能量值:{EP:0.##} / {General.GameplayEquilibriumConstant.MaxEP:0.##}"); builder.AppendLine($"能量值:{EP:0.##} / {General.GameplayEquilibriumConstant.MaxEP:0.##}");
builder.AppendLine($"攻击力:{ATK:0.##}" + (ExATK + ExATK2 > 0 ? $" [{BaseATK:0.##} + {ExATK + ExATK2:0.##}]" : "")); double exATK = ExATK + ExATK2;
builder.AppendLine($"核心属性:{PrimaryAttributeValue:0.##}" + (ExPrimaryAttributeValue > 0 ? $" [{BasePrimaryAttributeValue:0.##} + {ExPrimaryAttributeValue:0.##}]" : "")); builder.AppendLine($"攻击力:{ATK:0.##}" + (exATK != 0 ? $" [{BaseATK:0.##} {(exATK >= 0 ? "+" : "-")} {Math.Abs(exATK):0.##}]" : ""));
builder.AppendLine($"核心属性:{PrimaryAttributeValue:0.##}" + (ExPrimaryAttributeValue != 0 ? $" [{BasePrimaryAttributeValue:0.##} {(ExPrimaryAttributeValue >= 0 ? "+" : "-")} {Math.Abs(ExPrimaryAttributeValue):0.##}]" : ""));
if (CharacterState != CharacterState.Actionable) if (CharacterState != CharacterState.Actionable)
{ {

View File

@ -188,7 +188,7 @@
/// <summary> /// <summary>
/// 物理伤害减免因子 /// 物理伤害减免因子
/// </summary> /// </summary>
public double DEFReductionFactor { get; set; } = 120; public double DEFReductionFactor { get; set; } = 240;
/// <summary> /// <summary>
/// 行动速度上限 /// 行动速度上限