| | |
| | | {
|
| | | get
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | #if UNITY_EDITOR
|
| | | if (Time.time - xbLastTime > 1)
|
| | | #else
|
| | | #else
|
| | | if (Time.time - xbLastTime > 10)
|
| | | #endif
|
| | | #endif
|
| | | {
|
| | | m_IsWaitServerXB = false;
|
| | | return m_IsWaitServerXB;
|
| | |
| | | m_IsWaitServerXB = value;
|
| | | xbLastTime = Time.time;
|
| | | }
|
| | | } |
| | | }
|
| | | private Dictionary<int, XBTypeInfo> xbTypeInfoDict = new Dictionary<int, XBTypeInfo>(); //抽奖状态相关的 服务器记录
|
| | |
|
| | | public int lhQuality;
|
| | |
| | | public int addXBScore { get; private set; }
|
| | | public int addXBScoreType { get; private set; } //寻宝积分货币类型
|
| | | public int addXBLuckValue { get; private set; }
|
| | | public int addXBAddItemID { get; private set; } // 本次寻宝额外赠送的物品ID
|
| | | public long addXBItemCount { get; private set; } // 本次寻宝额外赠送的物品ID个数
|
| | | public Dictionary<int, XBGetItem> xbResultDict { get; private set; } = new Dictionary<int, XBGetItem>(); //奖品顺序:奖品
|
| | | public void GetServerXBResult(HA350_tagMCTreasureResult result)
|
| | | {
|
| | |
| | | addXBScore = result.AddMoneyValue;
|
| | | addXBScoreType = result.AddMoneyType;
|
| | | addXBLuckValue = result.AddTreasureLuck;
|
| | | addXBAddItemID = (int)result.AddItemID;
|
| | | addXBItemCount = result.AddItemCount;
|
| | | JsonData resultData = JsonMapper.ToObject(result.TreasureResult);
|
| | | if (resultData.IsArray)
|
| | | {
|
| | |
| | | UIManager.Instance.OpenWindowAsync<HeroCallResultWin>().Forget();
|
| | | }
|
| | | }
|
| | |
|
| | | if (ActHeroAppearConfig.GetActTreasureTypeList().Contains(type))
|
| | | {
|
| | | if (!UIManager.Instance.IsOpened<HeroDebutCallResultWin>())
|
| | | {
|
| | | UIManager.Instance.OpenWindow<HeroDebutCallResultWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public int GetCountInResult(int itemID)
|
| | | { |
| | | {
|
| | | int count = 0;
|
| | | if (xbResultDict != null && xbResultDict.Count > 0)
|
| | | {
|
| | |
| | | xbResultDict.Clear();
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | public void GetServerXBInfo(HA351_tagMCTreasureInfo info)
|
| | | {
|
| | | for (int i = 0; i < info.InfoCount; i++)
|
| | |
| | | typeInfo.freeCountToday = info.TreasuerInfoList[i].FreeCountToday;
|
| | | typeInfo.treasureCount = (int)info.TreasuerInfoList[i].TreasureCount;
|
| | | typeInfo.treasureCountToday = (int)info.TreasuerInfoList[i].TreasureCountToday;
|
| | | typeInfo.treasureCountTodayGold = (int)info.TreasuerInfoList[i].TreasureCountTodayGold;
|
| | | typeInfo.treasureCntAward = (int)info.TreasuerInfoList[i].TreasureCntAward;
|
| | | if (typeInfo.gridLimitCntDict == null)
|
| | | typeInfo.gridLimitCntDict = new Dictionary<int, int>();
|
| | |
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].freeCountToday = info.TreasuerInfoList[i].FreeCountToday;
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].treasureCount = (int)info.TreasuerInfoList[i].TreasureCount;
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].treasureCountToday = (int)info.TreasuerInfoList[i].TreasureCountToday;
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].treasureCountTodayGold = (int)info.TreasuerInfoList[i].TreasureCountTodayGold;
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].treasureCntAward = (int)info.TreasuerInfoList[i].TreasureCntAward;
|
| | | if (xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].gridLimitCntDict == null)
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].gridLimitCntDict = new Dictionary<int, int>();
|
| | |
| | | int cnt = info.TreasuerInfoList[i].GridLimitCntList[j].GridCnt;
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].gridLimitCntDict[num] = cnt;
|
| | | }
|
| | | |
| | |
|
| | | xbTypeInfoDict[info.TreasuerInfoList[i].TreasureType].wishCntDict.Clear();
|
| | | for (int j = 0; j < info.TreasuerInfoList[i].WishLibCnt; j++)
|
| | | {
|
| | |
| | | public void SendXBQuest(int type, int index, int costType)
|
| | | {
|
| | | if (isXBCoolTime) return;
|
| | | |
| | |
|
| | | isXBCoolTime = true;
|
| | | CA568_tagCMRequestTreasure treasure = new CA568_tagCMRequestTreasure();
|
| | | treasure.TreasureType = (byte)type;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public bool CheckIsEmptyGrid(int[] checkPackList, int needGrid = 1)
|
| | | {
|
| | | if (checkPackList.IsNullOrEmpty())
|
| | | return true;
|
| | | for (int i = 0; i < checkPackList.Length; i++)
|
| | | {
|
| | | if (!CheckIsEmptyGrid((PackType)checkPackList[i], needGrid))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | public bool CheckIsEmptyGrid(PackType type, int needGrid = 1)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | var funcSet = TreasureSetConfig.Get(xbType);
|
| | | if (CheckIsEmptyGrid((PackType)config.PackType))
|
| | | if (CheckIsEmptyGrid(config.CheckPackList))
|
| | | {
|
| | | //道具寻宝
|
| | | if (funcSet.CostItemID != 0 && IsHaveOneXBTool(xbType))
|
| | |
| | | }
|
| | |
|
| | | var funcSet = TreasureSetConfig.Get(xbType);
|
| | | if (CheckIsEmptyGrid((PackType)config.PackType, 10))
|
| | | if (CheckIsEmptyGrid(config.CheckPackList, 10))
|
| | | {
|
| | | int toolCnt = 0;
|
| | | int needToolCnt = 0;
|
| | |
| | | {
|
| | | return typeInfo.freeCountToday;
|
| | | }
|
| | | |
| | |
|
| | | return 0;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | qualityList = new List<int>();
|
| | |
|
| | | //无配置写死
|
| | | //无配置写死品质
|
| | | if (type == (int)HappXBTitle.Gubao)
|
| | | {
|
| | | qualityList.Add(3);
|
| | |
| | | var xbConfig = GetXBItemConfigByType(type);
|
| | | var luckList = xbConfig.LuckyItemRateInfo.Keys.ToList();
|
| | | luckList.Sort();
|
| | | //按阶梯显示
|
| | | for (int i = 0; i < luckList.Count; i++)
|
| | | {
|
| | | if (typeInfo.luckValue < luckList[i])
|
| | | //开特权卡之后才有幸运奖励
|
| | | var luckyValue = typeInfo.luckValue;
|
| | | if (type == (int)HappXBTitle.HeroCallAdvanced && !InvestModel.Instance.IsInvested(InvestModel.foreverCardType))
|
| | | {
|
| | | luckyValue = 0;
|
| | | }
|
| | | if (luckyValue < luckList[i])
|
| | | {
|
| | | if (type == (int)HappXBTitle.HeroCallAdvanced)
|
| | | {
|
| | |
| | | qualityList = xbConfig.LuckyItemRateInfo[luckList[i]].Select(x => x[1]).ToList();
|
| | | qualityList.Sort();
|
| | | }
|
| | | return luckList[i] - typeInfo.luckValue;
|
| | | return luckList[i] - luckyValue;
|
| | | }
|
| | | }
|
| | | return 0;
|
| | |
| | | needMoney = funcSet.CostMoneyList[0] * (needToolCnt - toolCnt);
|
| | | }
|
| | | else
|
| | | { |
| | | {
|
| | | //全部不足的按多次价格算 可能配置了折扣
|
| | | needMoney = funcSet.CostMoneyList[1];
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | public int GetCostItemID(int type)
|
| | | { |
| | | {
|
| | | var funcSet = TreasureSetConfig.Get(type);
|
| | | if (funcSet == null) return 0;
|
| | | return funcSet.CostItemID;
|
| | |
| | | public Redpoint bestXB10Red = new Redpoint(HappyXB_RedKey, XBHeroCall10_RedKey);
|
| | | public Redpoint bestXBScoreRed = new Redpoint(HappyXB_RedKey, XBHeroCallScore_RedKey);
|
| | |
|
| | | |
| | |
|
| | |
|
| | | private void UpdateFuncState(int funcId)
|
| | | {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | void OnDayEvent()
|
| | |
| | |
|
| | | if (IsHaveFreeXB((int)HappXBTitle.HeroCallAdvanced))
|
| | | {
|
| | | bestXBFreeRed.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ?RedPointState.GetReward : RedPointState.Simple;
|
| | | bestXBFreeRed.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ? RedPointState.GetReward : RedPointState.Simple;
|
| | | }
|
| | |
|
| | | if (IsHaveManyXBToolEx((int)HappXBTitle.HeroCallAdvanced, out int xbtoolCnt, out int needtoolCnt, out int needMoney))
|
| | | {
|
| | | bestXB10Red.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ?RedPointState.GetReward : RedPointState.Simple;
|
| | | bestXB10Red.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ? RedPointState.GetReward : RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | if ((InvestModel.Instance.IsInvested(InvestModel.monthCardType)
|
| | | || GetXBInfoByType((int)HappXBTitle.HeroCallScore)?.treasureCount == 0)
|
| | | && UIHelper.GetMoneyCnt(51) >= TreasureSetConfig.Get((int)HappXBTitle.HeroCallScore).CostMoneyList[0])
|
| | | { |
| | | bestXBScoreRed.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ?RedPointState.GetReward : RedPointState.Simple;
|
| | | {
|
| | | bestXBScoreRed.state = PlayerDatas.Instance.baseData.realmLevel >= 1 ? RedPointState.GetReward : RedPointState.Simple;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | return itemIDListTemp.Distinct().ToList();
|
| | |
|
| | | }
|
| | | |
| | |
|
| | | #endregion
|
| | | }
|
| | |
|
| | |
| | | public int freeCountToday; //今日已免费寻宝次数
|
| | | public int treasureCount; //已寻宝总次数
|
| | | public int treasureCountToday; //今日已寻宝总次数
|
| | | public int treasureCountTodayGold; //今日消耗货币已寻宝总次数
|
| | | public int treasureCntAward; //累计寻宝次数对应奖励领奖状态,按奖励记录索引二进制记录是否已领取
|
| | | public Dictionary<int, int> gridLimitCntDict; //<有限制抽取次数的格子编号,已抽到次数> 有限制抽取次数的格子次数信息
|
| | | public Dictionary<int, XBWishInfo> wishCntDict; //心愿抽取情况 <LIBID:已抽到次数,是否勾选自动,当前心愿ID>
|