yyl
2025-08-20 8f983d0dab26becb6b85dbbb616fde21c3ad8f02
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
using System.Collections.Generic;
using UnityEngine;
using LitJson;
 
//  武将信息:实际获得的武将,不包含图鉴数据
public partial class HeroInfo
{
    //  武将配置表ID
    public int heroId;
 
    //  武将配置
    public HeroConfig heroConfig { get; private set; }
    public ItemModel itemHero;  //引用背包里的 数据同步
 
    public HeroCountry heroCountry
    {
        get
        {
            return (HeroCountry)heroConfig.Country;
        }
    }
 
    //  品质配置
    public HeroQualityConfig qualityConfig { get; private set; }
 
    public int Quality
    {
        get
        {
            return heroConfig.Quality;
        }
    }
 
    //  武将等级
    public int heroLevel
    {
        get
        {
            if (itemHero == null)
                return 0;
            return itemHero.GetUseDataFirstValue(70);
        }
    }
    // 优先功能提醒类型:1觉醒 2升级 3突破 4升星
    // 优先顺序:
    public int funcState
    {
        get
        {
            return 0;
        }
    }
 
    public bool isLock
    {
        get
        {
            return itemHero.itemInfo.isLock;
        }
    }
 
 
    //已学习的所有技能取最高级的技能
    Dictionary<int, int> allSkillTypeIDToID = new Dictionary<int, int>();  //技能类型ID:  最高技能ID
 
 
    public HeroInfo(ItemModel _itemHero)
    {
        UpdateHero(_itemHero);
    }
 
 
 
 
    public void UpdateHero(ItemModel _itemHero)
    {
        itemHero = _itemHero;
        // HeroConfigUtility
        heroId = itemHero.config.ID;
 
        InitConfigs();
 
        CalculateProperties();
        // //  羁绊
        // fetterInfoList.Clear();
        // for (int i = 0; i < heroConfig.FetterIDList.Length; i++)
        // {
        //     fetterInfoList.Add(new HeroFetterInfo(this, heroConfig.FetterIDList[i]));
        // }
 
        // 80 # 主阵型上阵位置
    }
 
    protected void InitConfigs()
    {
        //  武将配置
        heroConfig = HeroConfig.Get(heroId);
        //  品质配置
        qualityConfig = HeroQualityConfig.Get(Quality);
 
        //  品质突破配置
        qualityBreakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(Quality, breakLevel);
 
        breakConfig = HeroBreakConfig.GetHeroBreakConfig(heroId, breakLevel);
        awakeConfig = HeroAwakeConfig.GetHeroAwakeConfig(heroId, awakeLevel);
        qualityAwakeConfig = HeroQualityAwakeConfig.GetQualityAwakeConfig(Quality, awakeLevel);
 
    }
 
 
 
    //是否上x阵 服务端队伍
    public bool IsInTeamByTeamType(TeamType teamType)
    {
        return TeamManager.Instance.GetTeam(teamType).HasHeroInServer(itemHero.guid);
    }
 
    public long GetSkillsFightPower()
    {
        long fightPower = 0;
        foreach (var skillID in allSkillTypeIDToID.Values)
        {
            fightPower += SkillConfig.Get(skillID).FightPower;
        }
        return fightPower;
    }
 
}