| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年9月3日 |
| | | // [ Date ]: Friday, September 12, 2025 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | } |
| | | |
| | | public int TypeID; |
| | | public string id; |
| | | public int prefix; |
| | | public int plus; |
| | | public int minus; |
| | |
| | | string[] tables = input.Split('\t'); |
| | | int.TryParse(tables[0],out TypeID); |
| | | |
| | | id = tables[1]; |
| | | int.TryParse(tables[1],out prefix); |
| | | |
| | | int.TryParse(tables[2],out prefix); |
| | | int.TryParse(tables[2],out plus); |
| | | |
| | | int.TryParse(tables[3],out plus); |
| | | int.TryParse(tables[3],out minus); |
| | | |
| | | int.TryParse(tables[4],out minus); |
| | | |
| | | if (tables[5].Contains("[")) |
| | | if (tables[4].Contains("[")) |
| | | { |
| | | nums = JsonMapper.ToObject<int[]>(tables[5]); |
| | | nums = JsonMapper.ToObject<int[]>(tables[4]); |
| | | } |
| | | else |
| | | { |
| | | string[] numsStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | string[] numsStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | nums = new int[numsStringArray.Length]; |
| | | for (int i=0;i<numsStringArray.Length;i++) |
| | | { |
| | |
| | | |
| | | public static string DisplayDamageNum(long num, int attackType) |
| | | { |
| | | // 服务器位数到客户端类型ID的映射 |
| | | Dictionary<int, int> serverToClientTypeMap = new Dictionary<int, int> |
| | | { |
| | | { 1, 2 }, // 普通伤血 |
| | | { 2, 4 }, // 恢复回血 |
| | | { 3, 8 }, // 反弹伤血 |
| | | { 4, 16 }, // 持续伤血 |
| | | { 5, 32 }, // 格挡 |
| | | { 7, 64 }, // 暴击伤害 |
| | | { 9, 128 }, // 闪避 |
| | | // 其它类型如需补充可继续添加 |
| | | }; |
| | | |
| | | int damageTypeValue = 0; |
| | | for (int i = 0; i < 32; i++) |
| | | { |
| | | int flag = 1 << i; |
| | | if ((attackType & flag) != 0) |
| | | { |
| | | // 只处理有映射的类型 |
| | | if (serverToClientTypeMap.TryGetValue(i + 1, out int clientTypeId)) |
| | | { |
| | | damageTypeValue += clientTypeId; |
| | | } |
| | | } |
| | | } |
| | | DamageType damageType = (DamageType)damageTypeValue; |
| | | |
| | | var config = DamageNumConfig.Get(damageTypeValue); |
| | | var config = DamageNumConfig.Get(attackType); |
| | | var basePowerStr = UIHelper.ReplaceLargeArtNum(num); |
| | | var result = string.Empty; |
| | | for (int i = 0; i < basePowerStr.Length; i++) |
| | |
| | | var numChar = (char)GetDamageNumKey(config, basePowerStr[i]); |
| | | if (numChar > 0) |
| | | { |
| | | result += numChar; |
| | | result += numChar; |
| | | } |
| | | } |
| | | return result; |
| | |
| | | |
| | | |
| | | |
| | | // AttackType = 伤害飘血类型 |
| | | |
| | | // 即BattleType一般代表本次技能的攻击方式,如 1-物伤常规攻击、11-物伤连击、22-法伤反击等 |
| | |
| | | |
| | | public enum DamageType |
| | | { |
| | | Damage = 1, //普通伤害 |
| | | Damage = 2, //普通伤害 (2^1) |
| | | |
| | | Recovery = 2, //治疗 |
| | | Recovery = 4, //治疗 (2^2) |
| | | |
| | | Reflect = 4, //反弹伤害 |
| | | Reflect = 8, //反弹伤害 (2^3) |
| | | |
| | | Bloody = 8, //流血伤害 |
| | | Bloody = 16, //流血伤害 (2^4) |
| | | |
| | | Block = 16, //格挡 |
| | | Block = 32, //格挡 (2^5) |
| | | |
| | | TakePlace1 = 32,//占位1 (暂无用) |
| | | TakePlace1 = 64, //占位1 (暂无用) (2^6) |
| | | |
| | | Crit = 64, //暴击 |
| | | Crit = 128, //暴击 (2^7) |
| | | |
| | | TakePlace2 = 128,//占位2 (暂无用) |
| | | TakePlace2 = 256, //占位2 (暂无用) (2^8) |
| | | |
| | | Dodge = 256, //闪避 |
| | | Dodge = 512, //闪避 (2^9) |
| | | |
| | | RageUp = 512, //怒气提升 |
| | | RageUp = 1024, //怒气提升 (2^10) |
| | | |
| | | SuckHP = 1024, //吸血 |
| | | SuckHP = 2048, //吸血 (2^11) |
| | | |
| | | Realdamage = 2048, //真伤 |
| | | Realdamage = 4096, //真伤 (2^12) |
| | | |
| | | CritDamage = Crit + Damage, //暴击伤害 |
| | | CritDamage = Crit + Damage, //暴击伤害 |
| | | |
| | | CritHeal = Crit + Recovery, //暴击回血 |
| | | CritHeal = Crit + Recovery, //暴击回血 |
| | | |
| | | CritRealdamage = Crit + Realdamage, //暴击真伤 |
| | | } |