| | |
| | | { |
| | | #region 武将列表界面 |
| | | public List<string> heroSortList { get; private set; } = new List<string>(); //上阵为主线的 GUID列表 |
| | | public int selectHeroListJob = 0; //武将列表界面 筛选职业 |
| | | public int selectHeroListCountry = 0; //武将列表界面筛选国家 |
| | | public List<int> selectHeroList = new List<int>(); //武将列表界面 筛选职业 |
| | | public string selectHeroGuid; //选中的武将id |
| | | public int[] heroRedpointItemList; //有影响红点的道具 |
| | | #endregion |
| | |
| | | |
| | | public int firstHeroIDBookUpdate = 0; //图鉴中第一个可以升级或者升星的武将,引导用 |
| | | |
| | | public List<int> heroSpecialAttrsForSelect = new List<int>(); //筛选用的特殊属性汇总 |
| | | |
| | | public override void Init() |
| | | { |
| | |
| | | QuickSetting.Instance.onQuickSettingUpdate += OnQuickSettingUpdate; |
| | | ParseConfig(); |
| | | InitHeroOnTeamRedpointList(); |
| | | InitHeroBookRedpointList(); |
| | | InitHerosData(); |
| | | } |
| | | |
| | | public override void Release() |
| | |
| | | return hero.heroLevel == GetMaxLVByBreakLV(hero.Quality, hero.breakLevel); |
| | | } |
| | | |
| | | public int GetAllHeroPer() |
| | | { |
| | | var list = HeroManager.Instance.GetHeroList(); |
| | | int per = 0; |
| | | foreach (var hero in list) |
| | | { |
| | | if (hero.isAttrActive) |
| | | { |
| | | per += hero.GetAddPer(); |
| | | } |
| | | } |
| | | return per; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | |
| | | //刷新时机, 打开武将界面 或者 关闭功能界面 |
| | | public void SortHeroList() |
| | | { |
| | | heroSortList = HeroManager.Instance.GetHeroGuidList(selectHeroListJob, selectHeroListCountry); |
| | | heroSortList = HeroManager.Instance.GetHeroGuidList(selectHeroList); |
| | | heroSortList.Sort(CmpHero); |
| | | } |
| | | |
| | |
| | | if (heroA == null || heroB == null) |
| | | { |
| | | return 0; |
| | | } |
| | | |
| | | bool isActiveA = heroA.isAttrActive; |
| | | bool isActiveB = heroB.isAttrActive; |
| | | if (isActiveA != isActiveB) |
| | | { |
| | | return isActiveA ? -1 : 1; |
| | | } |
| | | |
| | | // 排序规则:上阵>武将等级>突破等级>武将觉醒阶级>武将品质>武将吞噬星级>武将ID |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | #region 招募 |
| | | |
| | | public HappXBTitle selectCallType; //寻宝枚举类型 |
| | |
| | | |
| | | //积分招募预览 |
| | | public List<int> heroCallSortList { get; private set; } = new List<int>(); //积分招募列表 |
| | | public int selectHeroCallListJob = 0; //筛选职业 |
| | | public int selectHeroCallListCountry = 0; //筛选国家 |
| | | public List<int> selectHeroCallList = new List<int>(); //筛选 |
| | | |
| | | public List<int> newHeroIDList = new List<int>(); //新武将列表 |
| | | public bool IsNewHero(int heroID) |
| | |
| | | allHeroCallScoreList = HappyXBModel.Instance.GetAllGridLibItemIDByType((int)HappXBTitle.HeroCallScore); |
| | | } |
| | | heroCallSortList = new List<int>(); |
| | | if (selectHeroCallListJob == 0 && selectHeroCallListCountry == 0) |
| | | if (selectHeroCallList.IsNullOrEmpty()) |
| | | { |
| | | heroCallSortList = allHeroCallScoreList; |
| | | } |
| | | else |
| | | { |
| | | |
| | | int job = 0; |
| | | int country = 0; |
| | | int hurtType = 0; |
| | | int fightAttrType = 0; |
| | | int specialAttrType = 0; |
| | | if (!selectHeroCallList.IsNullOrEmpty()) |
| | | { |
| | | job = selectHeroCallList[0]; |
| | | country = selectHeroCallList[1]; |
| | | hurtType = selectHeroCallList[2]; |
| | | fightAttrType = selectHeroCallList[3]; |
| | | specialAttrType = selectHeroCallList[4]; |
| | | } |
| | | |
| | | |
| | | foreach (var item in allHeroCallScoreList) |
| | | { |
| | | HeroConfig heroConfig = HeroConfig.Get(item); |
| | |
| | | { |
| | | continue; |
| | | } |
| | | if (selectHeroCallListJob != 0 && selectHeroCallListJob != heroConfig.Class) |
| | | |
| | | //0代表全部, 同级别是可复选,不同级别为且的关系 |
| | | bool isMatch = true; |
| | | if (job != 0) |
| | | { |
| | | isMatch = isMatch && (job & (1 << heroConfig.Class)) > 0; |
| | | } |
| | | if (country != 0) |
| | | { |
| | | isMatch = isMatch && (country & (1 << heroConfig.Country)) > 0; |
| | | } |
| | | if (hurtType != 0) |
| | | { |
| | | isMatch = isMatch && (hurtType & (1 << heroConfig.HurtType)) > 0; |
| | | } |
| | | if (fightAttrType != 0) |
| | | { |
| | | isMatch = isMatch && (fightAttrType & (1 << heroConfig.Specialty)) > 0; |
| | | } |
| | | if (specialAttrType != 0) |
| | | { |
| | | bool isMatch2 = false; |
| | | for (int i = 0; i < heroConfig.Specialty2.Length; i++) |
| | | { |
| | | isMatch2 = (specialAttrType & (1 << heroConfig.Specialty2[i])) > 0; |
| | | if (isMatch2) |
| | | break; |
| | | } |
| | | isMatch = isMatch && isMatch2; |
| | | } |
| | | if (!isMatch) |
| | | { |
| | | continue; |
| | | } |
| | | if (selectHeroCallListCountry != 0 && selectHeroCallListCountry != heroConfig.Country) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | heroCallSortList.Add(item); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | void InitHeroBookRedpointList() |
| | | void InitHerosData() |
| | | { |
| | | heroBookRedpointList.Clear(); |
| | | foreach (var key in HeroConfig.GetKeys()) |
| | | { |
| | | var config = HeroConfig.Get(key); |
| | | |
| | | //汇总特殊属性 |
| | | if (!config.Specialty2.IsNullOrEmpty()) |
| | | { |
| | | foreach (var num in config.Specialty2) |
| | | { |
| | | if (!heroSpecialAttrsForSelect.Contains(num)) |
| | | { |
| | | heroSpecialAttrsForSelect.Add(num); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (config.PlayerCanUse == 0) |
| | | continue; |
| | | |
| | | //图鉴红点 |
| | | heroBookRedpointList.Add(new Redpoint(MainRedDot.HeroCardCollectRedpoint, MainRedDot.HeroCardCollectRedpoint * 10000000 + key)); |
| | | } |
| | | |
| | | heroSpecialAttrsForSelect.Sort(); |
| | | } |
| | | |
| | | |