yyl
2 天以前 973edc44a04dceb8b48a32ca912e6167f86189d4
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
 
 
//武将突破:武将升级后需要突破才能继续升级,突破可获得潜能
using System.Collections.Generic;
 
public partial class HeroInfo
{
    //  突破配置
    public HeroBreakConfig breakConfig { get; private set;}
 
    //  品质突破配置
    public HeroQualityBreakConfig qualityBreakConfig { get; private set;}
 
    //  武将突破等级
    public int breakLevel
    {
        get
        {
            if (itemHero == null)
                return 0;
            return itemHero.GetUseDataFirstValue(74);
        }
    }
 
    Dictionary<int, int> breakAttrs = new Dictionary<int, int>();   //潜能属性id:潜能值
    //计算潜能属性
    public void RefreshBreakAttr()
    {
        breakAttrs.Clear();
        for (int i = 0; i < breakLevel; i++)
        {
            var tmpBreakConfig = HeroBreakConfig.GetHeroBreakConfig(heroId, i);
            if (tmpBreakConfig == null)
                continue;
            for(int j = 0; j < tmpBreakConfig.AttrIDList.Length; j++)
            {
                int id = tmpBreakConfig.AttrIDList[j];
                if (id == 0)
                    continue;
                if (!breakAttrs.ContainsKey(id))
                {
                    breakAttrs.Add(id, tmpBreakConfig.AttrValueList[j]);
                }
                else
                {
                    breakAttrs[id] += tmpBreakConfig.AttrValueList[j];
                }
            }
 
            if (tmpBreakConfig.SkillID != 0)
            {
                var skillConfig = SkillConfig.Get(tmpBreakConfig.SkillID);
                if (skillConfig == null) continue;
                if (allSkillTypeIDToID.ContainsKey(skillConfig.SkillTypeID))
                {
                    var tmpSkillConfig = SkillConfig.Get(allSkillTypeIDToID[skillConfig.SkillTypeID]);
                    if (skillConfig.SkillLV > tmpSkillConfig.SkillLV)
                    {
                        //取最大技能
                        allSkillTypeIDToID[skillConfig.SkillTypeID] = tmpBreakConfig.SkillID;
                    }
                }
                else
                {
                    allSkillTypeIDToID[skillConfig.SkillTypeID] = tmpBreakConfig.SkillID;
                }
            }
        }
    }
 
    public int GetBreakAttrValue(int attrType)
    {
        int value = 0;
        breakAttrs.TryGetValue(attrType, out value);
        return value;
    }
 
    public int GetBreakAttrPer(int attrType)
    { 
        if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType))
        {
            var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType];
            return breakAttrs.ContainsKey(pertype) ? breakAttrs[pertype] : 0;
        }
        return 0;
    }
}