| 
  
 | 
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 - 1) + qualityConfig.BreakLVAddPer * breakLevel + qualityConfig.StarAddPer * heroStar; 
 | 
    } 
 | 
  
 | 
    public int GetLineupLVAddPer() 
 | 
    { 
 | 
        return qualityConfig.LVAddPer * (heroLevel - 1); 
 | 
    } 
 | 
  
 | 
    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; 
 | 
    } 
 | 
     
 | 
} 
 |