lcy
4 小时以前 3575c016271e455cfaab964b98e3d4ef84ef75cb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System.Collections.Generic;
 
public partial class HeroInfo
{
    //继承百分比对应三围,对应属性条目表里的ID
    private Dictionary<int, int> _inheritPer;
    
    Dictionary<int, int> inheritPer
    {
        get
        {
            if (_inheritPer == null)
            {
                _inheritPer = new Dictionary<int, int>() {
                    { 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;
    }
 
 
}