| | |
| | | { |
| | | public int[] xbGridArr; |
| | | public Dictionary<int, int[][]> heroQaulityColor; |
| | | public int[][] seeArr; |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin; |
| | |
| | | var config = FuncConfigConfig.Get("HeroAppear"); |
| | | xbGridArr = JsonMapper.ToObject<int[]>(config.Numerical1); |
| | | heroQaulityColor = ConfigParse.ParseIntArray2Dict(config.Numerical2); |
| | | seeArr = JsonMapper.ToObject<int[][]>(config.Numerical3); |
| | | |
| | | InitRedPointId(); |
| | | } |
| | |
| | | var heroConfig = HeroConfig.Get(heroId); |
| | | if (heroConfig == null) return 0; |
| | | |
| | | // 没获得武将本体不可领取 |
| | | if (!HeroManager.Instance.HasHero(heroId))return 0; |
| | | |
| | | if (!starHeroIndexDict.TryGetValue(actNum, out int index)) return 0; |
| | | if (IsStarUpFreeHave(index, config.AwardIndex)) return 2; |
| | | if (IsHeroStarCntOk(heroConfig.HeroID, config.NeedStar)) return 1; |
| | |
| | | #endregion |
| | | |
| | | #region 皇权礼包 |
| | | |
| | | //没售罄 |
| | | public bool IsCanBuyToday(int ctgID) |
| | | { |
| | | CTGConfig config = CTGConfig.Get(ctgID); |
| | | if (config == null) return false; |
| | | if (!RechargeManager.Instance.TryGetRechargeCount(ctgID, out var rechargeCount)) return false; |
| | | |
| | | if (config.DailyBuyCount == 0) return true; |
| | | return rechargeCount.todayCount < config.DailyBuyCount; |
| | | } |
| | | |
| | | public bool IsNoSellOutCTGID(int ctgID) |
| | | { |
| | | CTGConfig config = CTGConfig.Get(ctgID); |
| | |
| | | { |
| | | res = res.OrderBy(item => |
| | | { |
| | | bool isCanBuy = item.type == 0 ? IsNoSellOutShopID(item.id) : IsNoSellOutCTGID(item.id); |
| | | bool isCanBuy = item.type == 0 ? IsNoSellOutShopID(item.id) : IsCanBuyToday(item.id); |
| | | return !isCanBuy; |
| | | }) |
| | | .ThenBy(item => item.type) |
| | |
| | | return ctgDict; |
| | | } |
| | | |
| | | public bool HasItemInSkinCTGIDList(int cfgID, int findItemID) |
| | | { |
| | | var config = ActHeroAppearConfig.Get(cfgID); |
| | | if (config == null || config.SkinCTGIDList == null) return false; |
| | | |
| | | for (int i = 0; i < config.SkinCTGIDList.Length; i++) |
| | | { |
| | | var ctgID = config.SkinCTGIDList[i]; |
| | | var ctgConfig = CTGConfig.Get(ctgID); |
| | | if (ctgConfig == null || ctgConfig.GainItemList == null) continue; |
| | | |
| | | for (int j = 0; j < ctgConfig.GainItemList.Length; j++) |
| | | { |
| | | var itemID = ctgConfig.GainItemList[j][0]; |
| | | if (itemID == findItemID) return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | public List<int> GetSkinIDList(int cfgID, int heroID, int mainSkinID) |
| | | { |