yyl
2025-09-05 bb145d27787e6d54cb4bf0995cf11a41d1c9e67d
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
 
 
using System;
using System.Collections.Generic;
using System.Linq;
 
public partial class HeroInfo
{
 
    // 生命
    public int hp = 0;
    // 攻击力
    public int attack = 0;
    // 防御力
    public int defense = 0;
 
 
 
    //战斗属性 击晕、暴击、连击、格挡、反击、吸血
    //眩晕概率
    public int stunRate = 0;
    //暴击概率
    public int critRate = 0;
    //连击概率
    public int comboRate = 0;
    //格挡概率
    public int blockRate = 0;
    //反击概率
    public int counterAttackRate = 0;
    //攻击目标时,造成伤害转化成生命的百分比数值提升
    public int recoverRate = 0;
 
    //战斗抵抗属性
    //眩晕抵抗
    public int stunResist = 0;
    //暴击抵抗
    public int critResist = 0;
    //连击抵抗
    public int comboResist = 0;
    //格挡抵抗
    public int blockResist = 0;
    //反击抵抗
    public int counterAttackResist = 0;
    //减少攻击时吸血转化成生命的百分比数值
    public int recoverResist = 0;
 
    //  特殊属性(待补充)
    //  最终伤害
    public int finalDamageIncrease = 0;
    //  最终免伤
    public int finalDamageReduce;
    //  爆伤
    public int critDamageIncrease;
    //  减少爆伤
    public int critDamageReduce;
    //  治疗增益
    public int healIncrease;
    //  治疗减益
    public int healReduce;
    //  物理增伤
    public int damageIncrease;
    //  减少物伤
    public int damageReduce;
    //  法术增伤
    public int magicIncrease;
    //  减少法伤
    public int magicReduce;
    //  普攻增伤
    public int normalAttackIncrease;
    //  减少普攻伤害
    public int normalAttackReduce;
    //  增加技能伤害
    public int rageSkillAttackIncrease;
    //  减少技能伤害
    public int rageSkillAttackReduce;
    //  增加持续伤害的百分比
    public int continousSkillIncrease;
    //  减少持续伤害的百分比
    public int continousSkillReduce;
    //  增加护盾百分比
    public int shieldSkillIncrease;
    //  减少护盾百分比
    public int shieldSkillReduce;
 
 
 
    //计算个人/职业/种族养成属性加成
    public void CalculateProperties()
    {
        allSkillTypeIDToID.Clear();
        var skill = SkillConfig.Get(heroConfig.AtkSkillID);
        if (skill != null)
        { 
            allSkillTypeIDToID[skill.SkillTypeID] = heroConfig.AtkSkillID;
        }
        skill = SkillConfig.Get(heroConfig.AngerSkillID);
        if (skill != null)
        { 
            allSkillTypeIDToID[skill.SkillTypeID] = heroConfig.AngerSkillID;
        }
 
        RefreshTalentAttr();
        RefreshBreakAttr();
        RefreshAwakeAttr();
    }
 
 
 
    long tmpFightPower = 0;
    public long CalculatePower(bool forceRefresh = true)
    {
        if (forceRefresh || tmpFightPower == 0)
        { 
            tmpFightPower = FightPowerManager.Instance.GetHeroFightPower(this);
        }
        return tmpFightPower;
    }
 
 
    //上阵属性:攻防血
    public int GetOnBattleAddPer()
    {
        return qualityConfig.InitAddPer + qualityConfig.LVAddPer * heroLevel + qualityConfig.BreakLVAddPer * breakLevel + qualityConfig.StarAddPer * heroStar;
    }
 
    public int GetLineupLVAddPer()
    {
        return qualityConfig.LVAddPer * heroLevel;
    }
 
    public int GetLineupBreakLVAddPer()
    {
        return qualityConfig.BreakLVAddPer * breakLevel;
    }
 
    public int GetLineupStarAddPer()
    {
        return qualityConfig.StarAddPer * heroStar;
    }
 
    //额外配置的百分百比加成 三围对应的 百分比加成
    public int GetSelfAddPer(int attrType)
    {
        if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrType))
        {
            var pertype = PlayerPropertyConfig.baseAttr2perDict[attrType];
            return heroConfig.BatAttrDict.ContainsKey(pertype) ? heroConfig.BatAttrDict[pertype] : 0;
        }
        return 0;
    }
 
    public int GetSelfAddValue(int attrType)
    {
        return heroConfig.BatAttrDict.ContainsKey(attrType) ? heroConfig.BatAttrDict[attrType] : 0;
    }
    
}