diff --git a/Api/Utility/Attribute.cs b/Api/Utility/Attribute.cs
new file mode 100644
index 0000000..da00955
--- /dev/null
+++ b/Api/Utility/Attribute.cs
@@ -0,0 +1,22 @@
+using Milimoe.FunGame.Core.Entity;
+
+namespace Milimoe.FunGame.Core.Api.Utility
+{
+ ///
+ /// 此标记意味着属性允许初始设定,但不是强制的。适用于
+ ///
+ [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = true)]
+ public class InitOptional : Attribute
+ {
+ public InitOptional() { }
+ }
+
+ ///
+ /// 此标记意味着属性需要经过初始设定。适用于
+ ///
+ [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = true)]
+ public class InitRequired : Attribute
+ {
+ public InitRequired() { }
+ }
+}
diff --git a/Api/Utility/General.cs b/Api/Utility/General.cs
index 26aa4cb..475bd7d 100644
--- a/Api/Utility/General.cs
+++ b/Api/Utility/General.cs
@@ -38,7 +38,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
///
///
public static bool IsUserName(string str) => Regex.IsMatch(str, @"^[\u4e00-\u9fffA-Za-z0-9]+$");
-
+
///
/// 判断字符串是否是全中文的字符
///
@@ -562,4 +562,55 @@ namespace Milimoe.FunGame.Core.Api.Utility
}
#endregion
+
+ #region 计算服务
+
+ ///
+ /// 计算服务工具箱
+ ///
+ public class Calculation
+ {
+ ///
+ /// 四舍五入计算
+ ///
+ ///
+ ///
+ ///
+ public static double Round(double value, int digits)
+ {
+ return Math.Round(value, digits, MidpointRounding.AwayFromZero);
+ }
+
+ ///
+ /// 四舍五入保留2位小数
+ ///
+ ///
+ ///
+ public static double Round2Digits(double value)
+ {
+ return Round(value, 2);
+ }
+
+ ///
+ /// 四舍五入保留4位小数
+ ///
+ ///
+ ///
+ public static double Round4Digits(double value)
+ {
+ return Round(value, 4);
+ }
+
+ ///
+ /// 此方法检查一个 百分比(%) 数值是否存在于 [0,1] 区间
+ ///
+ ///
+ /// 如果超过0,则返回0;超过1则返回1。
+ public static double PercentageCheck(double value)
+ {
+ return Math.Max(0, Math.Min(value, 1));
+ }
+ }
+
+ #endregion
}
diff --git a/Entity/Character/Character.cs b/Entity/Character/Character.cs
index 7635bf4..13848f8 100644
--- a/Entity/Character/Character.cs
+++ b/Entity/Character/Character.cs
@@ -24,47 +24,99 @@ namespace Milimoe.FunGame.Core.Entity
///
/// 角色所属的玩家
///
- public User? User { get; set; } = null;
+ public User User { get; set; }
///
/// 角色统计数据
///
- public CharacterStatistics? Statistics { get; set; } = null;
+ public CharacterStatistics Statistics { get; set; }
///
/// 魔法属性
///
- public MagicType MagicType { get; set; } = MagicType.Particle;
+ public MagicType MagicType { get; set; } = MagicType.None;
///
/// 角色定位1
///
- public RoleType FirstRoleType { get; set; } = RoleType.Core;
+ public RoleType FirstRoleType { get; set; } = RoleType.None;
///
/// 角色定位2
///
- public RoleType SecondRoleType { get; set; } = RoleType.Guardian;
+ public RoleType SecondRoleType { get; set; } = RoleType.None;
///
/// 角色定位3
///
- public RoleType ThirdRoleType { get; set; } = RoleType.Vanguard;
+ public RoleType ThirdRoleType { get; set; } = RoleType.None;
///
/// 角色评级
///
- public RoleRating RoleRating { get; set; } = RoleRating.E;
+ public RoleRating RoleRating
+ {
+ get
+ {
+ if (Promotion > 998)
+ {
+ return RoleRating.X;
+ }
+ else if (Promotion > 850 && Promotion <= 998)
+ {
+ return RoleRating.S;
+ }
+ else if (Promotion > 700 && Promotion <= 850)
+ {
+ return RoleRating.APlus;
+ }
+ else if (Promotion > 550 && Promotion <= 700)
+ {
+ return RoleRating.A;
+ }
+ else if (Promotion > 400 && Promotion <= 550)
+ {
+ return RoleRating.B;
+ }
+ else if (Promotion > 300 && Promotion <= 400)
+ {
+ return RoleRating.C;
+ }
+ else if (Promotion > 200 && Promotion <= 300)
+ {
+ return RoleRating.D;
+ }
+ else
+ {
+ return RoleRating.E;
+ }
+ }
+ }
///
/// 晋升点数
///
- public int Promotion { get; set; } = 0;
+ public int Promotion { get; set; } = 100;
+
+ ///
+ /// 核心属性
+ ///
+ public PrimaryAttribute PrimaryAttribute { get; set; } = PrimaryAttribute.None;
///
/// 等级
///
- public int Level { get; set; } = 1;
+ public int Level
+ {
+ get
+ {
+ return _Level > 0 ? _Level : 1;
+ }
+ set
+ {
+ if (_Level > 0) _Level = value;
+ }
+ }
///
/// 经验值
@@ -72,193 +124,426 @@ namespace Milimoe.FunGame.Core.Entity
public double EXP { get; set; } = 0;
///
- /// 基础生命值
+ /// 初始生命值 [ 初始设定 ]
///
- public double BaseHP { get; set; } = 1;
+ [InitRequired]
+ public double InitialHP { get; set; } = 60;
///
- /// 生命值
+ /// 基础生命值 [ 与初始设定和等级相关 ] [ 与基础力量相关 ]
///
- public double HP { get; set; } = 0;
+ public double BaseHP => Calculation.Round2Digits(InitialHP + (Level - 1) * (17 + 0.68 * InitialHP) + BaseSTR * 17);
///
- /// 基础魔法值
+ /// 额外生命值 [ 与额外力量相关 ]
///
- public double BaseMP { get; set; } = 0;
+ public double ExHP => Calculation.Round2Digits(ExSTR * 17);
///
- /// 魔法值
+ /// 额外生命值2 [ 与技能和物品相关 ]
///
- public double MP { get; set; } = 0;
+ public double ExHP2 { get; set; } = 0;
///
- /// 爆发能量
+ /// 生命值 = 基础生命值 + 额外生命值 + 额外生命值2
+ ///
+ public double HP => BaseHP + ExHP + ExHP2;
+
+ ///
+ /// 初始魔法值 [ 初始设定 ]
+ ///
+ [InitRequired]
+ public double InitialMP { get; set; } = 10;
+
+ ///
+ /// 基础魔法值 [ 与初始设定和等级相关 ] [ 与基础智力相关 ]
+ ///
+ public double BaseMP => Calculation.Round2Digits(InitialMP + (Level - 1) * (1.5 + 0.14 * InitialMP) + BaseINT * 8);
+
+ ///
+ /// 额外魔法值 [ 与额外智力相关 ]
+ ///
+ public double ExMP => Calculation.Round2Digits(ExINT * 8);
+
+ ///
+ /// 额外魔法值2 [ 与技能和物品相关 ]
+ ///
+ public double ExMP2 { get; set; } = 0;
+
+ ///
+ /// 魔法值 = 基础魔法值 + 额外魔法值 + 额外魔法值2
+ ///
+ public double MP => BaseMP + ExMP + ExMP2;
+
+ ///
+ /// 爆发能量 [ 战斗相关 ]
///
public double EP { get; set; } = 0;
///
- /// 基础攻击力
+ /// 初始攻击力 [ 初始设定 ]
///
- public double BaseATK { get; set; } = 1;
+ [InitRequired]
+ public double InitialATK { get; set; } = 15;
///
- /// 攻击力
+ /// 基础攻击力 [ 与初始设定和等级相关 ] [ 与核心属性相关 ]
///
- public double ATK { get; set; } = 0;
+ public double BaseATK
+ {
+ get
+ {
+ double atk = Calculation.Round2Digits(InitialATK + (Level - 1) * (0.95 + 0.045 * InitialATK));
+ if (PrimaryAttribute == PrimaryAttribute.AGI)
+ {
+ return atk + BaseAGI;
+ }
+ else if (PrimaryAttribute == PrimaryAttribute.INT)
+ {
+ return atk + BaseINT;
+ }
+ else // 默认STR
+ {
+ return atk + BaseSTR;
+ }
+ }
+ }
///
- /// 基础物理护甲
+ /// 额外攻击力 [ 与额外核心属性相关 ]
///
- public double BaseDEF { get; set; } = 5;
+ public double ExATK
+ {
+ get
+ {
+ if (PrimaryAttribute == PrimaryAttribute.AGI)
+ {
+ return ExAGI;
+ }
+ else if (PrimaryAttribute == PrimaryAttribute.INT)
+ {
+ return ExINT;
+ }
+ else // 默认STR
+ {
+ return ExSTR;
+ }
+ }
+ }
///
- /// 物理护甲
+ /// 额外攻击力2 [ 与技能和物品相关 ]
///
- public double DEF { get; set; } = 0;
+ public double ExATK2 { get; set; } = 0;
///
- /// 物理伤害减免(%)
+ /// 攻击力 = 基础攻击力 + 额外攻击力 + 额外攻击力2
+ ///
+ public double ATK => BaseATK + ExATK + ExATK2;
+
+ ///
+ /// 初始物理护甲 [ 初始设定 ]
+ ///
+ [InitRequired]
+ public double InitialDEF { get; set; } = 5;
+
+ ///
+ /// 基础物理护甲 [ 与初始设定相关 ] [ 与基础力量相关 ]
+ ///
+ public double BaseDEF => Calculation.Round2Digits(InitialDEF + BaseSTR * 0.75);
+
+ ///
+ /// 额外物理护甲 [ 与额外力量相关 ]
+ ///
+ public double ExDEF => Calculation.Round2Digits(ExSTR * 0.75);
+
+ ///
+ /// 额外物理护甲2 [ 与技能和物品相关 ]
+ ///
+ public double ExDEF2 { get; set; } = 0;
+
+ ///
+ /// 物理护甲 = 基础物理护甲 + 额外物理护甲 + 额外物理护甲2
+ ///
+ public double DEF => BaseDEF + ExDEF + ExDEF2;
+
+ ///
+ /// 物理伤害减免(%) = [ 与物理护甲相关 ] + 额外物理伤害减免(%)
///
public double PDR
{
get
{
- double value = Math.Round((BaseDEF + DEF) / BaseDEF + DEF + 300, 4, MidpointRounding.AwayFromZero) + ExPDR;
- return value > 1 ? 1 : value;
+ double value = Calculation.Round4Digits((DEF / (DEF + 120)) + ExPDR);
+ return Calculation.PercentageCheck(value);
}
}
///
- /// 额外物理伤害减免(%)
+ /// 额外物理伤害减免(%) [ 与技能和物品相关 ]
///
public double ExPDR { get; set; } = 0;
///
- /// 魔法抗性(%)
+ /// 魔法抗性(%) [ 与技能和物品相关 ]
///
public double MDF { get; set; } = 0;
///
- /// 物理穿透(%)
+ /// 物理穿透(%) [ 与技能和物品相关 ]
///
- public double PhysicalPenetration { get; set; } = 0;
+ public double PhysicalPenetration
+ {
+ get
+ {
+ return Calculation.PercentageCheck(_PhysicalPenetration);
+ }
+ set
+ {
+ _PhysicalPenetration = Calculation.PercentageCheck(Calculation.Round4Digits(value));
+ }
+ }
///
- /// 魔法穿透(%)
+ /// 魔法穿透(%) [ 与技能和物品相关 ]
///
- public double MagicalPenetration { get; set; } = 0;
+ public double MagicalPenetration
+ {
+ get
+ {
+ return Calculation.PercentageCheck(_MagicalPenetration);
+ }
+ set
+ {
+ _MagicalPenetration = Calculation.PercentageCheck(Calculation.Round4Digits(value));
+ }
+ }
///
- /// 生命回复力
+ /// 初始生命回复力 [ 初始设定 ]
///
- public double HR { get; set; } = 0;
+ [InitRequired]
+ public double InitialHR { get; set; } = 0;
///
- /// 魔法回复力
+ /// 生命回复力 = [ 与初始设定相关 ] [ 与力量相关 ] + 额外生命回复力
///
- public double MR { get; set; } = 0;
+ public double HR => Calculation.Round2Digits(InitialHR + STR * 0.25 + ExHR);
///
- /// 能量回复力
+ /// 额外生命回复力 [ 与技能和物品相关 ]
+ ///
+ public double ExHR { get; set; } = 0;
+
+ ///
+ /// 初始魔法回复力 [ 初始设定 ]
+ ///
+ [InitRequired]
+ public double InitialMR { get; set; } = 0;
+
+ ///
+ /// 魔法回复力 = [ 与初始设定相关 ] [ 与智力相关 ] + 额外魔法回复力
+ ///
+ public double MR => Calculation.Round2Digits(InitialMR + INT * 0.1 + ExMR);
+
+ ///
+ /// 额外魔法回复力 [ 与技能和物品相关 ]
+ ///
+ public double ExMR { get; set; } = 0;
+
+ ///
+ /// 能量回复力 [ 与技能和物品相关 ]
///
public double ER { get; set; } = 0;
///
- /// 基础力量
+ /// 初始力量 [ 初始设定 ]
///
- public double BaseSTR { get; set; } = 0;
+ [InitRequired]
+ public double InitialSTR { get; set; } = 0;
///
- /// 基础敏捷
+ /// 初始敏捷 [ 初始设定 ]
///
- public double BaseAGI { get; set; } = 0;
+ [InitRequired]
+ public double InitialAGI { get; set; } = 0;
///
- /// 基础智力
+ /// 初始智力 [ 初始设定 ]
///
- public double BaseINT { get; set; } = 0;
+ [InitRequired]
+ public double InitialINT { get; set; } = 0;
///
- /// 力量
+ /// 基础力量 [ 与初始设定和等级相关 ]
///
- public double STR { get; set; } = 0;
+ public double BaseSTR => Calculation.Round2Digits(InitialSTR + STRGrowth * (Level - 1));
///
- /// 敏捷
+ /// 基础敏捷 [ 与初始设定和等级相关 ]
///
- public double AGI { get; set; } = 0;
+ public double BaseAGI => Calculation.Round2Digits(InitialAGI + AGIGrowth * (Level - 1));
///
- /// 智力
+ /// 基础智力 [ 与初始设定和等级相关 ]
///
- public double INT { get; set; } = 0;
+ public double BaseINT => Calculation.Round2Digits(InitialINT + INTGrowth * (Level - 1));
///
- /// 力量成长值
+ /// 额外力量 [ 与技能和物品相关 ]
+ ///
+ public double ExSTR { get; set; } = 0;
+
+ ///
+ /// 额外敏捷 [ 与技能和物品相关 ]
+ ///
+ public double ExAGI { get; set; } = 0;
+
+ ///
+ /// 额外智力 [ 与技能和物品相关 ]
+ ///
+ public double ExINT { get; set; } = 0;
+
+ ///
+ /// 力量 = 基础力量 + 额外力量
+ ///
+ public double STR => BaseSTR + ExSTR;
+
+ ///
+ /// 敏捷 = 基础敏捷 + 额外敏捷
+ ///
+ public double AGI => BaseAGI + ExAGI;
+
+ ///
+ /// 智力 = 基础智力 + 额外智力
+ ///
+ public double INT => BaseINT + ExINT;
+
+ ///
+ /// 力量成长值(+BaseSTR/Lv)
///
public double STRGrowth { get; set; } = 0;
///
- /// 敏捷成长值
+ /// 敏捷成长值(+BaseAGI/Lv)
///
public double AGIGrowth { get; set; } = 0;
///
- /// 智力成长值
+ /// 智力成长值(+BaseINT/Lv)
///
public double INTGrowth { get; set; } = 0;
///
- /// 行动速度
+ /// 行动速度 [ 初始设定 ]
///
- public double SPD { get; set; } = 0;
+ [InitRequired]
+ public double InitialSPD { get; set; } = 0;
///
- /// 行动系数(%)
+ /// 行动速度 = [ 与初始设定相关 ][ 与敏捷相关 ] + 额外行动速度
+ ///
+ public double SPD => Calculation.Round2Digits(InitialSPD + AGI * 0.65 + ExSPD);
+
+ ///
+ /// 额外行动速度 [ 与技能和物品相关 ]
+ ///
+ public double ExSPD { get; set; } = 0;
+
+ ///
+ /// 行动系数(%) = [ 与速度相关 ] + 额外行动系数(%)
///
public double ActionCoefficient
{
get
{
- double value = Math.Round(SPD / 1500.00, 4, MidpointRounding.AwayFromZero) + ExActionCoefficient;
- return value > 1 ? 1 : value;
+ double value = Calculation.Round4Digits(SPD / 1500.00 + ExActionCoefficient);
+ return Calculation.PercentageCheck(value);
}
}
///
- /// 额外行动系数(%)
+ /// 额外行动系数(%) [ 与技能和物品相关 ]
///
public double ExActionCoefficient { get; set; } = 0;
///
- /// 加速系数(%)
+ /// 加速系数(%) [ 与技能和物品相关 ]
///
public double AccelerationCoefficient { get; set; } = 0;
-
- ///
- /// 冷却缩减(%)
- ///
- public double CDR { get; set; } = 0;
///
- /// 攻击距离
+ /// 冷却缩减(%) = [ 与智力相关 ] + 额外冷却缩减(%)
///
- public double ATR { get; set; } = 0;
+ public double CDR
+ {
+ get
+ {
+ double value = Calculation.Round4Digits(INT * 0.0025 + ExCDR);
+ return Calculation.PercentageCheck(value);
+ }
+ }
///
- /// 暴击率(%)
+ /// 额外冷却缩减(%) [ 与技能和物品相关 ]
///
- public double CritRate { get; set; } = 0.05;
+ public double ExCDR { get; set; } = 0;
///
- /// 暴击伤害(%)
+ /// 攻击距离 [ 与技能和物品相关 ] [ 单位:格 ]
///
- public double CritDMG { get; set; } = 1.25;
+ [InitOptional]
+ public double ATR { get; set; } = 1;
///
- /// 闪避率(%)
+ /// 暴击率(%) = [ 与敏捷相关 ] + 额外暴击率(%)
///
- public double EvadeRate { get; set; } = 0.05;
+ public double CritRate
+ {
+ get
+ {
+ double value = Calculation.Round4Digits(0.05 + INT * 0.0025 + ExCDR);
+ return Calculation.PercentageCheck(value);
+ }
+ }
+
+ ///
+ /// 额外暴击率(%) [ 与技能和物品相关 ]
+ ///
+ public double ExCritRate { get; set; } = 0;
+
+ ///
+ /// 暴击伤害(%) = [ 与力量相关 ] + 额外暴击伤害(%)
+ ///
+ public double CritDMG
+ {
+ get
+ {
+ return Calculation.Round4Digits(1.25 + STR * 0.00575 + ExCritDMG);
+ }
+ }
+
+ ///
+ /// 额外暴击伤害(%) [ 与技能和物品相关 ]
+ ///
+ public double ExCritDMG { get; set; } = 0;
+
+ ///
+ /// 闪避率(%) = [ 与敏捷相关 ] + 额外闪避率(%)
+ ///
+ public double EvadeRate
+ {
+ get
+ {
+ double value = Calculation.Round4Digits(0.05 + AGI * 0.0025 + ExEvadeRate);
+ return Calculation.PercentageCheck(value);
+ }
+ }
+
+ ///
+ /// 额外闪避率(%) [ 与技能和物品相关 ]
+ ///
+ public double ExEvadeRate { get; set; } = 0;
///
/// 角色的技能组
@@ -270,9 +555,29 @@ namespace Milimoe.FunGame.Core.Entity
///
public Dictionary Items { get; set; } = [];
+ /**
+ * ===== 私有变量 =====
+ */
+
+ ///
+ /// 等级
+ ///
+ private int _Level = 1;
+
+ ///
+ /// 物理穿透
+ ///
+ private double _PhysicalPenetration = 0;
+
+ ///
+ /// 魔法穿透
+ ///
+ private double _MagicalPenetration = 0;
+
protected Character()
{
-
+ User = General.UnknownUserInstance;
+ Statistics = new();
}
internal static Character GetInstance()
@@ -280,35 +585,20 @@ namespace Milimoe.FunGame.Core.Entity
return new();
}
- public void Init()
- {
- STR = BaseSTR;
- AGI = BaseAGI;
- INT = BaseINT;
- HP = BaseHP;
- MP = BaseMP;
- ATK = BaseATK;
- DEF = BaseDEF;
- // 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)
{
return other is Character c && c.Name == Name;
}
+ ///
+ /// 获取角色实例的名字、昵称以及所属玩家
+ ///
+ ///
public override string ToString()
{
bool isChineseName = NetworkUtility.IsChineseName(Name + FirstName);
@@ -325,6 +615,11 @@ namespace Milimoe.FunGame.Core.Entity
return str;
}
+ ///
+ /// 复制一个角色
+ /// [ 推荐从模组中复制后使用对象 ]
+ ///
+ ///
public Character Copy()
{
Character c = new()
@@ -337,42 +632,47 @@ namespace Milimoe.FunGame.Core.Entity
FirstRoleType = FirstRoleType,
SecondRoleType = SecondRoleType,
ThirdRoleType = ThirdRoleType,
- RoleRating = RoleRating,
Promotion = Promotion,
+ PrimaryAttribute = PrimaryAttribute,
Level = Level,
EXP = EXP,
- BaseHP = BaseHP,
- HP = HP,
- BaseMP = BaseMP,
- MP = MP,
+ InitialHP = InitialHP,
+ ExHP2 = ExHP2,
+ InitialMP = InitialMP,
+ ExMP2 = ExMP2,
EP = EP,
- BaseATK = BaseATK,
- ATK = ATK,
- BaseDEF = BaseDEF,
- DEF = DEF,
+ InitialATK = InitialATK,
+ ExATK2 = ExATK2,
+ InitialDEF = InitialDEF,
+ ExDEF2 = ExDEF2,
MDF = MDF,
PhysicalPenetration = PhysicalPenetration,
MagicalPenetration = MagicalPenetration,
- HR = HR,
- MR = MR,
+ InitialHR = InitialHR,
+ ExHR = ExHR,
+ InitialMR = InitialMR,
+ ExMR = ExMR,
ER = ER,
- BaseSTR = BaseSTR,
- BaseAGI = BaseAGI,
- BaseINT = BaseINT,
- STR = STR,
- AGI = AGI,
- INT = INT,
+ InitialSTR = InitialSTR,
+ InitialAGI = InitialAGI,
+ InitialINT = InitialINT,
+ ExSTR = ExSTR,
+ ExAGI = ExAGI,
+ ExINT = ExINT,
STRGrowth = STRGrowth,
AGIGrowth = AGIGrowth,
INTGrowth = INTGrowth,
- SPD = SPD,
+ InitialSPD = InitialSPD,
+ ExSPD = ExSPD,
+ ExActionCoefficient = ExActionCoefficient,
AccelerationCoefficient = AccelerationCoefficient,
+ ExCDR = ExCDR,
ATR = ATR,
- CritRate = CritRate,
- CritDMG = CritDMG,
- EvadeRate = EvadeRate,
- Skills = Skills,
- Items = Items,
+ ExCritRate = ExCritRate,
+ ExCritDMG = ExCritDMG,
+ ExEvadeRate = ExEvadeRate,
+ Skills = new(Skills),
+ Items = new(Items),
};
return c;
}
diff --git a/Library/Common/Addon/Example/ExampleGameModule.cs b/Library/Common/Addon/Example/ExampleGameModule.cs
index fcb4da5..147c043 100644
--- a/Library/Common/Addon/Example/ExampleGameModule.cs
+++ b/Library/Common/Addon/Example/ExampleGameModule.cs
@@ -302,12 +302,12 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon.Example
c.FirstName = "Shiya";
c.NickName = "OSM";
c.MagicType = MagicType.PurityNatural;
- c.BaseHP = 30;
- c.BaseSTR = 20;
- c.BaseAGI = 10;
- c.BaseINT = 5;
- c.BaseATK = 100;
- c.BaseDEF = 10;
+ c.InitialHP = 30;
+ c.InitialSTR = 20;
+ c.InitialAGI = 10;
+ c.InitialINT = 5;
+ c.InitialATK = 100;
+ c.InitialDEF = 10;
list.Add(c);
return list;
}
diff --git a/Library/Common/JsonConverter/CharacterConverter.cs b/Library/Common/JsonConverter/CharacterConverter.cs
index 820dec8..31f5608 100644
--- a/Library/Common/JsonConverter/CharacterConverter.cs
+++ b/Library/Common/JsonConverter/CharacterConverter.cs
@@ -38,44 +38,44 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
case nameof(Character.ThirdRoleType):
result.ThirdRoleType = (RoleType)reader.GetInt32();
break;
- case nameof(Character.RoleRating):
- result.RoleRating = (RoleRating)reader.GetInt32();
- break;
case nameof(Character.Promotion):
result.Promotion = reader.GetInt32();
break;
+ case nameof(Character.PrimaryAttribute):
+ result.PrimaryAttribute = (PrimaryAttribute)reader.GetInt32();
+ break;
case nameof(Character.Level):
result.Level = reader.GetInt32();
break;
case nameof(Character.EXP):
result.EXP = reader.GetDouble();
break;
- case nameof(Character.BaseHP):
- result.BaseHP = reader.GetDouble();
+ case nameof(Character.InitialHP):
+ result.InitialHP = reader.GetDouble();
break;
- case nameof(Character.HP):
- result.HP = reader.GetDouble();
+ case nameof(Character.ExHP):
+ result.ExHP2 = reader.GetDouble();
break;
- case nameof(Character.BaseMP):
- result.BaseMP = reader.GetDouble();
+ case nameof(Character.InitialMP):
+ result.InitialMP = reader.GetDouble();
break;
- case nameof(Character.MP):
- result.MP = reader.GetDouble();
+ case nameof(Character.ExMP):
+ result.ExMP2 = reader.GetDouble();
break;
case nameof(Character.EP):
result.EP = reader.GetDouble();
break;
- case nameof(Character.BaseATK):
- result.BaseATK = reader.GetDouble();
+ case nameof(Character.InitialATK):
+ result.InitialATK = reader.GetDouble();
break;
- case nameof(Character.ATK):
- result.ATK = reader.GetDouble();
+ case nameof(Character.ExATK):
+ result.ExATK2 = reader.GetDouble();
break;
- case nameof(Character.BaseDEF):
- result.BaseDEF = reader.GetDouble();
+ case nameof(Character.InitialDEF):
+ result.InitialDEF = reader.GetDouble();
break;
- case nameof(Character.DEF):
- result.DEF = reader.GetDouble();
+ case nameof(Character.ExDEF):
+ result.ExDEF2 = reader.GetDouble();
break;
case nameof(Character.MDF):
result.MDF = reader.GetDouble();
@@ -86,32 +86,38 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
case nameof(Character.MagicalPenetration):
result.MagicalPenetration = reader.GetDouble();
break;
- case nameof(Character.HR):
- result.HR = reader.GetDouble();
+ case nameof(Character.InitialHR):
+ result.InitialHR = reader.GetDouble();
break;
- case nameof(Character.MR):
- result.MR = reader.GetDouble();
+ case nameof(Character.ExHR):
+ result.ExHR = reader.GetDouble();
+ break;
+ case nameof(Character.InitialMR):
+ result.InitialMR = reader.GetDouble();
+ break;
+ case nameof(Character.ExMR):
+ result.ExMR = reader.GetDouble();
break;
case nameof(Character.ER):
result.ER = reader.GetDouble();
break;
- case nameof(Character.BaseSTR):
- result.BaseSTR = reader.GetDouble();
+ case nameof(Character.InitialSTR):
+ result.InitialSTR = reader.GetDouble();
break;
- case nameof(Character.BaseAGI):
- result.BaseAGI = reader.GetDouble();
+ case nameof(Character.InitialAGI):
+ result.InitialAGI = reader.GetDouble();
break;
- case nameof(Character.BaseINT):
- result.BaseINT = reader.GetDouble();
+ case nameof(Character.InitialINT):
+ result.InitialINT = reader.GetDouble();
break;
- case nameof(Character.STR):
- result.STR = reader.GetDouble();
+ case nameof(Character.ExSTR):
+ result.ExSTR = reader.GetDouble();
break;
- case nameof(Character.AGI):
- result.AGI = reader.GetDouble();
+ case nameof(Character.ExAGI):
+ result.ExAGI = reader.GetDouble();
break;
- case nameof(Character.INT):
- result.INT = reader.GetDouble();
+ case nameof(Character.ExINT):
+ result.ExINT = reader.GetDouble();
break;
case nameof(Character.STRGrowth):
result.STRGrowth = reader.GetDouble();
@@ -122,26 +128,32 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
case nameof(Character.INTGrowth):
result.INTGrowth = reader.GetDouble();
break;
- case nameof(Character.SPD):
- result.SPD = reader.GetDouble();
+ case nameof(Character.InitialSPD):
+ result.InitialSPD = reader.GetDouble();
+ break;
+ case nameof(Character.ExSPD):
+ result.ExSPD = reader.GetDouble();
+ break;
+ case nameof(Character.ExActionCoefficient):
+ result.ExActionCoefficient = reader.GetDouble();
break;
case nameof(Character.AccelerationCoefficient):
result.AccelerationCoefficient = reader.GetDouble();
break;
- case nameof(Character.CDR):
- result.CDR = reader.GetDouble();
+ case nameof(Character.ExCDR):
+ result.ExCDR = reader.GetDouble();
break;
case nameof(Character.ATR):
result.ATR = reader.GetDouble();
break;
- case nameof(Character.CritRate):
- result.CritRate = reader.GetDouble();
+ case nameof(Character.ExCritRate):
+ result.ExCritRate = reader.GetDouble();
break;
- case nameof(Character.CritDMG):
- result.CritDMG = reader.GetDouble();
+ case nameof(Character.ExCritDMG):
+ result.ExCritDMG = reader.GetDouble();
break;
- case nameof(Character.EvadeRate):
- result.EvadeRate = reader.GetDouble();
+ case nameof(Character.ExEvadeRate):
+ result.ExEvadeRate = reader.GetDouble();
break;
}
}
@@ -156,41 +168,45 @@ namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
writer.WriteNumber(nameof(Character.FirstRoleType), (int)value.FirstRoleType);
writer.WriteNumber(nameof(Character.SecondRoleType), (int)value.SecondRoleType);
writer.WriteNumber(nameof(Character.ThirdRoleType), (int)value.ThirdRoleType);
- writer.WriteNumber(nameof(Character.RoleRating), (int)value.RoleRating);
writer.WriteNumber(nameof(Character.Promotion), value.Promotion);
+ writer.WriteNumber(nameof(Character.PrimaryAttribute), (int)value.PrimaryAttribute);
writer.WriteNumber(nameof(Character.Level), value.Level);
writer.WriteNumber(nameof(Character.EXP), value.EXP);
- writer.WriteNumber(nameof(Character.BaseHP), value.BaseHP);
- writer.WriteNumber(nameof(Character.HP), value.HP);
- writer.WriteNumber(nameof(Character.BaseMP), value.BaseMP);
- writer.WriteNumber(nameof(Character.MP), value.MP);
+ writer.WriteNumber(nameof(Character.InitialHP), value.InitialHP);
+ writer.WriteNumber(nameof(Character.ExHP2), value.ExHP2);
+ writer.WriteNumber(nameof(Character.InitialMP), value.InitialMP);
+ writer.WriteNumber(nameof(Character.ExMP2), value.ExMP2);
writer.WriteNumber(nameof(Character.EP), value.EP);
- writer.WriteNumber(nameof(Character.BaseATK), value.BaseATK);
- 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.InitialATK), value.InitialATK);
+ writer.WriteNumber(nameof(Character.ExATK2), value.ExATK2);
+ writer.WriteNumber(nameof(Character.InitialDEF), value.InitialDEF);
+ writer.WriteNumber(nameof(Character.ExDEF2), value.ExDEF2);
writer.WriteNumber(nameof(Character.MDF), value.MDF);
writer.WriteNumber(nameof(Character.PhysicalPenetration), value.PhysicalPenetration);
writer.WriteNumber(nameof(Character.MagicalPenetration), value.MagicalPenetration);
- writer.WriteNumber(nameof(Character.HR), value.HR);
- writer.WriteNumber(nameof(Character.MR), value.MR);
+ writer.WriteNumber(nameof(Character.InitialHR), value.InitialHR);
+ writer.WriteNumber(nameof(Character.ExHR), value.ExHR);
+ writer.WriteNumber(nameof(Character.InitialMR), value.InitialMR);
+ writer.WriteNumber(nameof(Character.ExMR), value.ExMR);
writer.WriteNumber(nameof(Character.ER), value.ER);
- writer.WriteNumber(nameof(Character.BaseSTR), value.BaseSTR);
- writer.WriteNumber(nameof(Character.BaseAGI), value.BaseAGI);
- writer.WriteNumber(nameof(Character.BaseINT), value.BaseINT);
- writer.WriteNumber(nameof(Character.STR), value.STR);
- writer.WriteNumber(nameof(Character.AGI), value.AGI);
- writer.WriteNumber(nameof(Character.INT), value.INT);
+ writer.WriteNumber(nameof(Character.InitialSTR), value.InitialSTR);
+ writer.WriteNumber(nameof(Character.InitialAGI), value.InitialAGI);
+ writer.WriteNumber(nameof(Character.InitialINT), value.InitialINT);
+ writer.WriteNumber(nameof(Character.ExSTR), value.ExSTR);
+ writer.WriteNumber(nameof(Character.ExAGI), value.ExAGI);
+ writer.WriteNumber(nameof(Character.ExINT), value.ExINT);
writer.WriteNumber(nameof(Character.STRGrowth), value.STRGrowth);
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.InitialSPD), value.InitialSPD);
+ writer.WriteNumber(nameof(Character.ExSPD), value.ExSPD);
+ writer.WriteNumber(nameof(Character.ExActionCoefficient), value.ExActionCoefficient);
writer.WriteNumber(nameof(Character.AccelerationCoefficient), value.AccelerationCoefficient);
- writer.WriteNumber(nameof(Character.CDR), value.CDR);
+ writer.WriteNumber(nameof(Character.ExCDR), value.ExCDR);
writer.WriteNumber(nameof(Character.ATR), value.ATR);
- writer.WriteNumber(nameof(Character.CritRate), value.CritRate);
- writer.WriteNumber(nameof(Character.CritDMG), value.CritDMG);
- writer.WriteNumber(nameof(Character.EvadeRate), value.EvadeRate);
+ writer.WriteNumber(nameof(Character.ExCritRate), value.ExCritRate);
+ writer.WriteNumber(nameof(Character.ExCritDMG), value.ExCritDMG);
+ writer.WriteNumber(nameof(Character.ExEvadeRate), value.ExEvadeRate);
writer.WriteEndObject();
}
diff --git a/Library/Common/JsonConverter/RoomConverter.cs b/Library/Common/JsonConverter/RoomConverter.cs
index fa91bf7..4734909 100644
--- a/Library/Common/JsonConverter/RoomConverter.cs
+++ b/Library/Common/JsonConverter/RoomConverter.cs
@@ -1,8 +1,8 @@
using System.Text.Json;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
-using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Core.Library.Common.Architecture;
+using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Core.Library.SQLScript.Entity;
namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
diff --git a/Library/Common/JsonConverter/UserConverter.cs b/Library/Common/JsonConverter/UserConverter.cs
index 68817df..99b3de5 100644
--- a/Library/Common/JsonConverter/UserConverter.cs
+++ b/Library/Common/JsonConverter/UserConverter.cs
@@ -1,8 +1,8 @@
using System.Text.Json;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
-using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Core.Library.Common.Architecture;
+using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Core.Library.SQLScript.Entity;
namespace Milimoe.FunGame.Core.Library.Common.JsonConverter
diff --git a/Library/Constant/TypeEnum.cs b/Library/Constant/TypeEnum.cs
index 9dec197..36b88bd 100644
--- a/Library/Constant/TypeEnum.cs
+++ b/Library/Constant/TypeEnum.cs
@@ -251,6 +251,7 @@ namespace Milimoe.FunGame.Core.Library.Constant
public enum MagicType
{
+ None,
Starmark,
PurityNatural,
PurityContemporary,
@@ -261,6 +262,14 @@ namespace Milimoe.FunGame.Core.Library.Constant
Particle
}
+ public enum PrimaryAttribute
+ {
+ None,
+ STR,
+ AGI,
+ INT
+ }
+
public enum ActionType
{
None,
@@ -291,6 +300,7 @@ namespace Milimoe.FunGame.Core.Library.Constant
public enum RoleType
{
+ None,
Core,
Vanguard,
Guardian,
diff --git a/Service/AddonManager.cs b/Service/AddonManager.cs
index 01777e6..62b86d8 100644
--- a/Service/AddonManager.cs
+++ b/Service/AddonManager.cs
@@ -17,7 +17,7 @@ namespace Milimoe.FunGame.Core.Service
/// 已加载的模组DLL名称对应的路径
///
internal static Dictionary ModuleFilePaths { get; } = [];
-
+
///
/// 从plugins目录加载所有插件
///