| | |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += UpdateFuncState;
|
| | | PackManager.Instance.RefreshItemEvent += RefreshXBTool;
|
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
|
| | | InvestModel.Instance.onInvestUpdate += OnInvestUpdate;
|
| | |
|
| | | xbGetItemDict.Clear();
|
| | | xbTypeItemDict.Clear();
|
| | |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= UpdateFuncState;
|
| | | PackManager.Instance.RefreshItemEvent -= RefreshXBTool;
|
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk;
|
| | | InvestModel.Instance.onInvestUpdate -= OnInvestUpdate;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | isXBCoolTime = false;
|
| | | xbTypeInfoDict.Clear();
|
| | | }
|
| | |
|
| | | void OnPlayerLoginOk()
|
| | | {
|
| | | HeroCallRedPoint();
|
| | | }
|
| | |
|
| | |
|
| | | void OnInvestUpdate(int type)
|
| | | {
|
| | | if (type == 7)
|
| | | HeroCallRedPoint();
|
| | | }
|
| | | public XBGetItemConfig GetXBItemConfigByType(int type)
|
| | | {
|
| | | int lv = 0;
|
| | |
| | | //货币寻宝
|
| | | int moneyType = funcSet.CostMoneyType;
|
| | | int xbOneMoney = funcSet.CostMoneyList[0];
|
| | |
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= xbOneMoney)
|
| | | //暂定充值货币需要二次确认
|
| | | if (moneyType == 1)
|
| | | {
|
| | | //暂定充值货币需要二次确认
|
| | | if (moneyType == 1)
|
| | | StoreModel.Instance.UseMoneyCheck(xbOneMoney, moneyType, () =>
|
| | | {
|
| | | StoreModel.Instance.UseMoneyCheck(xbOneMoney, moneyType, () =>
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= xbOneMoney)
|
| | | {
|
| | | SendXBQuest(xbType, 0, 0);
|
| | | }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, xbOneMoney,
|
| | | UIHelper.GetIconNameWithMoneyType(moneyType), funcSet.CostItemCountList[0]));
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | }
|
| | | }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, xbOneMoney,
|
| | | UIHelper.GetIconNameWithMoneyType(moneyType), funcSet.CostItemCountList[0]));
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | SendXBQuest(xbType, 0, 0);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= xbOneMoney)
|
| | | {
|
| | | SendXBQuest(xbType, 0, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | //货币寻宝
|
| | | int moneyType = funcSet.CostMoneyType;
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= needMoney)
|
| | |
|
| | | //暂定充值货币需要二次确认
|
| | | if (moneyType == 1)
|
| | | {
|
| | | //暂定充值货币需要二次确认
|
| | | if (moneyType == 1)
|
| | | StoreModel.Instance.UseMoneyCheck(needMoney, moneyType, () =>
|
| | | {
|
| | | StoreModel.Instance.UseMoneyCheck(needMoney, moneyType, () =>
|
| | | //只要有道具就是道具寻宝,不足部分服务端扣货币
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= needMoney)
|
| | | {
|
| | | //只要有道具就是道具寻宝,不足部分服务端扣货币
|
| | | SendXBQuest(xbType, 1, toolCnt > 0 ? 2 : 0);
|
| | | }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, needMoney,
|
| | | UIHelper.GetIconNameWithMoneyType(moneyType), needToolCnt - toolCnt));
|
| | | }
|
| | | else
|
| | | {
|
| | | SendXBQuest(xbType, 1, toolCnt > 0 ? 2 : 0);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | }
|
| | | }, (int)BuyStoreItemCheckType.HeroCall, fullTip: Language.Get("CostMoneyForItem", funcSet.CostItemID, needMoney,
|
| | | UIHelper.GetIconNameWithMoneyType(moneyType), needToolCnt - toolCnt));
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | if (UIHelper.GetMoneyCnt(moneyType) >= needMoney)
|
| | | {
|
| | | SendXBQuest(xbType, 1, toolCnt > 0 ? 2 : 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | ItemTipUtility.ShowMoneyTip(moneyType);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | #region 红点逻辑
|
| | | public const int HappyXB_RedKey = 203;
|
| | | public const int XBHeroCall1_RedKey = 20300; //武将免费召唤
|
| | | public const int XBHeroCall10_RedKey = 20301; //武将10召唤
|
| | | public const int XBHeroCallScore_RedKey = 20302; //武将积分召唤
|
| | |
|
| | |
|
| | | public Redpoint happyXBRed = new Redpoint(HappyXB_RedKey);
|
| | | public Redpoint happyXBRed = new Redpoint(MainRedDot.MainHerosRedpoint, HappyXB_RedKey);
|
| | | public Redpoint bestXBFreeRed = new Redpoint(HappyXB_RedKey, XBHeroCall1_RedKey);
|
| | | public Redpoint bestXB10Red = new Redpoint(HappyXB_RedKey, XBHeroCall10_RedKey);
|
| | | public Redpoint bestXBScoreRed = new Redpoint(HappyXB_RedKey, XBHeroCallScore_RedKey);
|
| | |
|
| | |
|
| | |
|
| | | private void UpdateFuncState(int funcId)
|
| | |
| | | HeroCallRedPoint();
|
| | | }
|
| | |
|
| | | void OnDayEvent()
|
| | | { |
| | | HeroCallRedPoint();
|
| | | }
|
| | |
|
| | | //英雄招募
|
| | | public void HeroCallRedPoint()
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.HappyFindTreasure)) return;
|
| | | // 免费 10连 积分
|
| | | happyXBRed.state = RedPointState.None;
|
| | | bestXB10Red.state = RedPointState.None;
|
| | | bestXBFreeRed.state = RedPointState.None;
|
| | | bestXBScoreRed.state = RedPointState.None;
|
| | |
|
| | |
|
| | | if (IsHaveFreeXB((int)HappXBTitle.HeroCallAdvanced))
|
| | | {
|
| | | bestXBFreeRed.state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | bestXBFreeRed.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | if (IsHaveManyXBToolEx((int)HappXBTitle.HeroCallAdvanced, out int xbtoolCnt, out int needtoolCnt, out int needMoney))
|
| | | {
|
| | | happyXBRed.state = RedPointState.Simple;
|
| | | bestXB10Red.state = 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 = RedPointState.Simple;
|
| | | }
|
| | |
|
| | | }
|
| | |
|