using System.Collections.Generic; public partial class HeroInfo { //继承百分比对应三围,对应属性条目表里的ID private Dictionary _inheritPer; Dictionary inheritPer { get { if (_inheritPer == null) { _inheritPer = new Dictionary() { { 6, heroConfig.AtkInheritPer + heroConfig.AtkInheritPerStar * heroStar }, { 7, heroConfig.DefInheritPer + heroConfig.DefInheritPerStar * heroStar}, { 8, heroConfig.HPInheritPer + heroConfig.HPInheritPerStar * heroStar}, }; } return _inheritPer; } } public void RefreshInheritPer() { _inheritPer = null; } //原来继承是按品通用,现在升星也会加继承,通过三维ID获取6,7,8 public int GetInheritAttrPer(int attrType) { return inheritPer.TryGetValue(attrType, out int value) ? value : 0; } //通过继承ID获取对应的万分率 public int GetInheritAttrPerByInheritID(int id) { var baseID = id == 13 ? 6 : id == 14 ? 7 : id == 15 ? 8 : 0; return GetInheritAttrPer(baseID); } // 获取继承ID public int GetInheritAttrIDByBaseID(int id) { if (id == 6) return 13; if (id == 7) return 14; if (id == 8) return 15; return 0; } //获取每星提升属性值 万分率 public int GetInheritSingleAttrValue(int id) { if (id == 13) return heroConfig.AtkInheritPerStar; if (id == 14) return heroConfig.DefInheritPerStar; if (id == 15) return heroConfig.HPInheritPerStar; return 0; } }