yyl
3 天以前 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
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
using System;
using System.Collections;
using System.Collections.Generic;
 
using UnityEngine;
 
public partial class HeroUIManager : GameSystemManager<HeroUIManager>
{
 
 
    #region 重生 遣散
    public int awakeRebirthCnt { get; private set; }
    public int payBackMoneyType;
    public int rebornAwakeHeroMaxCount; //觉醒武将每日的最大重生次数
 
    public List<string> heroDeleteSortList { get; private set; } = new List<string>();
    public int selectHeroDeleteListJob = 0;    //筛选职业
    public int selectHeroDeleteListCountry = 0;    //筛选国家
 
    public List<string> selectDeleteHeroList { get; private set; } = new List<string>();
 
 
    public Dictionary<int, long> GetHeroLVPayBack(int quality, int lv)
    {
        //汇总返还总数量
        Dictionary<int, long> itemCounDic = new Dictionary<int, long>();
        for (int i = 1; i < lv; i++)
        {
            var config = HeroQualityLVConfig.GetQualityLVConfig(quality, i);
            var itemID = config.UPCostItem[0];
            var count = config.UPCostItem[1];
            if (!itemCounDic.ContainsKey(itemID))
            {
                itemCounDic[itemID] = count;
            }
            else
            {
                itemCounDic[itemID] += count;
            }
        }
 
        return itemCounDic;
    }
 
 
    public Dictionary<int, long> GetHeroBreakPayBack(int quality, int lv)
    {
        //汇总返还总数量
        Dictionary<int, long> itemCounDic = new Dictionary<int, long>();
        for (int i = 0; i < lv; i++)
        {
            var config = HeroQualityBreakConfig.GetQualityBreakConfig(quality, i);
            var itemID = config.UPCostItem[0];
            var count = config.UPCostItem[1];
            if (!itemCounDic.ContainsKey(itemID))
            {
                itemCounDic[itemID] = count;
            }
            else
            {
                itemCounDic[itemID] += count;
            }
        }
 
        return itemCounDic;
 
 
    }
 
    public Dictionary<int, long> GetHeroQualityAwakePayBack(int quality, int lv)
    {
        //汇总返还总数量
        Dictionary<int, long> itemCounDic = new Dictionary<int, long>();
        for (int i = 0; i < lv; i++)
        {
            var config = HeroQualityAwakeConfig.GetQualityAwakeConfig(quality, lv);
            var itemID = config.UPCostItem[0];
            var count = config.UPCostItem[1];
            if (!itemCounDic.ContainsKey(itemID))
            {
                itemCounDic[itemID] = count;
            }
            else
            {
                itemCounDic[itemID] = itemCounDic[itemID] + count;
            }
        }
 
        return itemCounDic;
    }
 
    public void UpdateHeroInfo(HB125_tagSCPlayerHeroInfo netPack)
    {
        awakeRebirthCnt = netPack.AwakeRebirthCnt;
    }
 
 
    public void SortHeroDeleteList()
    {
        heroDeleteSortList = HeroManager.Instance.GetHeroGuidList(selectHeroDeleteListJob, selectHeroDeleteListCountry);
        heroDeleteSortList.Sort(CmpDeleteHero);
    }
 
 
    int CmpDeleteHero(string guidA, string guidB)
    {
        HeroInfo heroA = HeroManager.Instance.GetHero(guidA);
        HeroInfo heroB = HeroManager.Instance.GetHero(guidB);
        if (heroA == null || heroB == null)
        {
            return 0;
        }
 
        // 排序规则:上阵>武将等级>突破等级>武将觉醒阶级>武将品质>武将吞噬星级>武将ID
        bool isInTeamA = heroA.IsInAnyTeam();
        bool isInTeamB = heroB.IsInAnyTeam();
        if (isInTeamA != isInTeamB)
        {
            return isInTeamA ? 1 : -1;
        }
        if (heroA.heroLevel != heroB.heroLevel)
        {
            return heroA.heroLevel < heroB.heroLevel ? -1 : 1;
        }
        if (heroA.breakLevel != heroB.breakLevel)
        {
            return heroA.breakLevel < heroB.breakLevel ? -1 : 1;
        }
        if (heroA.awakeLevel != heroB.awakeLevel)
        {
            return heroA.awakeLevel < heroB.awakeLevel ? -1 : 1;
        }
        if (heroA.Quality != heroB.Quality)
        {
            return heroA.Quality < heroB.Quality ? -1 : 1;
        }
        if (heroA.heroStar != heroA.heroStar)
        {
            return heroA.heroStar < heroB.heroStar ? -1 : 1;
        }
 
        return heroB.heroId.CompareTo(heroA.heroId);
    }
 
 
    #endregion
 
}