using Milimoe.FunGame.Core.Interface.Entity; using Milimoe.FunGame.Core.Library.Constant; namespace Milimoe.FunGame.Core.Entity { public class Character : BaseEntity, ICopyable { /// /// 角色的名字 /// public string FirstName { get; set; } = ""; /// /// 角色的昵称 /// public string NickName { get; set; } = ""; /// /// 角色所属的玩家 /// public User? User { get; set; } = null; /// /// 角色统计数据 /// public CharacterStatistics? Statistics { get; set; } = null; /// /// 魔法属性 /// public MagicType MagicType { get; set; } = MagicType.Particle; /// /// 角色定位1 /// public RoleType FirstRoleType { get; set; } = RoleType.Core; /// /// 角色定位2 /// public RoleType SecondRoleType { get; set; } = RoleType.Guardian; /// /// 角色定位3 /// public RoleType ThirdRoleType { get; set; } = RoleType.Vanguard; /// /// 角色评级 /// public RoleRating RoleRating { get; set; } = RoleRating.E; /// /// 晋升点数 /// public int Promotion { get; set; } = 0; /// /// 等级 /// public int Level { get; set; } = 1; /// /// 经验值 /// public decimal EXP { get; set; } = 0; /// /// 基础生命值 /// public decimal BaseHP { get; set; } = 0; /// /// 生命值 /// public decimal HP { get; set; } = 0; /// /// 基础魔法值 /// public decimal BaseMP { get; set; } = 0; /// /// 魔法值 /// public decimal MP { get; set; } = 0; /// /// 能量 /// public decimal EP { get; set; } = 0; /// /// 基础攻击力 /// public decimal BaseATK { get; set; } = 0; /// /// 攻击力 /// public decimal ATK { get; set; } = 0; /// /// 基础物理护甲 /// public decimal BaseDEF { get; set; } = 0; /// /// 物理护甲 /// public decimal DEF { get; set; } = 0; /// /// 物理伤害减免(%) /// public decimal PDR { get; set; } = 0; /// /// 魔法抗性(%) /// public decimal MDF { get; set; } = 0; /// /// 物理穿透(%) /// public decimal PhysicalPenetration { get; set; } = 0; /// /// 魔法穿透(%) /// public decimal MagicalPenetration { get; set; } = 0; /// /// 生命回复力 /// public decimal HR { get; set; } = 0; /// /// 魔法回复力 /// public decimal MR { get; set; } = 0; /// /// 能量回复力 /// public decimal ER { get; set; } = 0; /// /// 基础力量 /// public decimal BaseSTR { get; set; } = 0; /// /// 基础敏捷 /// public decimal BaseAGI { get; set; } = 0; /// /// 基础智力 /// public decimal BaseINT { get; set; } = 0; /// /// 力量 /// public decimal STR { get; set; } = 0; /// /// 敏捷 /// public decimal AGI { get; set; } = 0; /// /// 智力 /// public decimal INT { get; set; } = 0; /// /// 力量成长值 /// public decimal STRGrowth { get; set; } = 0; /// /// 敏捷成长值 /// public decimal AGIGrowth { get; set; } = 0; /// /// 智力成长值 /// public decimal INTGrowth { get; set; } = 0; /// /// 速度 /// public decimal SPD { get; set; } = 0; /// /// 行动系数(%) /// public decimal ActionCoefficient { get; set; } = 0; /// /// 加速系数(%) /// public decimal AccelerationCoefficient { get; set; } = 0; /// /// 攻击距离 /// public decimal ATR { get; set; } = 0; /// /// 暴击率(%) /// public decimal CritRate { get; set; } = 0.05M; /// /// 暴击伤害 /// public decimal CritDMG { get; set; } = 1.25M; /// /// 闪避率(%) /// public decimal EvadeRate { get; set; } = 0.05M; /// /// 角色的技能组 /// public Dictionary Skills { get; set; } = []; /// /// 角色携带的物品 /// public Dictionary Items { get; set; } = []; protected Character() { } internal static Character GetInstance() { return new(); } public void SetDefaultBase() { HP = BaseHP; MP = BaseMP; ATK = BaseATK; DEF = BaseDEF; STR = BaseSTR; AGI = BaseAGI; INT = BaseINT; } public override bool Equals(IBaseEntity? other) { return other is Character c && c.Name == Name; } public override string ToString() { string str = (Name + " " + FirstName).Trim(); if (NickName != "") { if (str != "") str += ", "; str += NickName; } if (User != null && User.Username != "") { str += "(" + User.Username + ")"; } return str; } public Character Copy() { Character c = new() { Name = Name, FirstName = FirstName, NickName = NickName, Statistics = Statistics, MagicType = MagicType, FirstRoleType = FirstRoleType, SecondRoleType = SecondRoleType, ThirdRoleType = ThirdRoleType, RoleRating = RoleRating, Promotion = Promotion, Level = Level, EXP = EXP, BaseHP = BaseHP, HP = HP, BaseMP = BaseMP, MP = MP, EP = EP, BaseATK = BaseATK, ATK = ATK, BaseDEF = BaseDEF, DEF = DEF, PDR = PDR, MDF = MDF, PhysicalPenetration = PhysicalPenetration, MagicalPenetration = MagicalPenetration, HR = HR, MR = MR, ER = ER, BaseSTR = BaseSTR, BaseAGI = BaseAGI, BaseINT = BaseINT, STR = STR, AGI = AGI, INT = INT, STRGrowth = STRGrowth, AGIGrowth = AGIGrowth, INTGrowth = INTGrowth, SPD = SPD, ActionCoefficient = ActionCoefficient, AccelerationCoefficient = AccelerationCoefficient, ATR = ATR, CritRate = CritRate, CritDMG = CritDMG, EvadeRate = EvadeRate, Skills = Skills, Items = Items, }; return c; } } }