Beispiel #1
0
        public static VIPData GetVIPData(int vipLevel)
        {
            VIPData vipData = null;

            VIPDataDictionary.TryGetValue(vipLevel, out vipData);
            return(vipData);
        }
Beispiel #2
0
        public VIPData GetNextLevelVIPData()
        {
            VIPData nextLevelVIPData = null;

            VIPDataDictionary.TryGetValue(id + 1, out nextLevelVIPData);
            return(nextLevelVIPData);
        }
Beispiel #3
0
        /*
         * public void UpdateVIPInfo (bool dailyget,int totalRecharge, List<int> hasReceivedGiftVIPLevelList)
         * {
         * dailyGetted = dailyget;
         *      _totalRecharge = totalRecharge;
         *      _hasReceivedGiftVIPLevelList = hasReceivedGiftVIPLevelList;
         *
         *      int vipLevel = 0;
         *      List<VIPData> allVIPDataList = VIPData.GetAllVIPDataList();
         *      int vipDataCount = allVIPDataList.Count;
         *      for (int i = 0; i < vipDataCount; i++)
         *      {
         *              if (_totalRecharge >= allVIPDataList[i].exp)
         *              {
         *                      vipLevel = allVIPDataList[i].id;
         *              }
         *              else
         *              {
         *                      break;
         *              }
         *      }
         *      _vipLevel = vipLevel;
         *
         *      if (onVIPInfoUpdateDelegate != null)
         *      {
         *              onVIPInfoUpdateDelegate(_vipLevel, _totalRecharge, _hasReceivedGiftVIPLevelList);
         *      }
         * Logic.UI.SoftGuide.Model.SoftGuideProxy.instance.UpdateSoftGuide();
         * }
         */

        /*
         * public void DrawVIPBenefitsSuccess (int vipLevel)
         * {
         *      if (onDrawVIPBenefitsSuccessDelegate != null)
         *      {
         *              onDrawVIPBenefitsSuccessDelegate(vipLevel);
         *      }
         * }
         */

        public int GetRechargeDiamondToNextVIPLevel()
        {
            int rechargeDiamondToNextVIPLevel = 0;

            if (!VIPData.IsMaxLevelVIPData())
            {
                VIPData nextVIPData = VIPData.GetNextLevelVIPData();
                rechargeDiamondToNextVIPLevel = (nextVIPData.exp - VIPProxy.instance.TotalRecharge) * 10;
            }
            return(rechargeDiamondToNextVIPLevel);
        }
        public bool CheckSweep(bool isTen)
        {
            lastCheckSweepType = isTen ? SweepType.Ten : SweepType.Single;
            if (isTen)
            {
                if (!Logic.FunctionOpen.Model.FunctionOpenProxy.instance.IsFunctionOpen(FunctionOpenType.TenSweep, false))
                {
                    FunctionOpen.Model.FunctionData sweepTenOpenData = FunctionOpen.Model.FunctionData.GetFunctionDataByID((int)FunctionOpenType.TenSweep);
                    Logic.VIP.Model.VIPData         vipData          = Logic.VIP.Model.VIPData.GetVIPData(sweepTenOpenData.vip);
                    if (VIPProxy.instance.VIPLevel < sweepTenOpenData.vip)
                    {
                        string tipsString = Localization.Format("ui.dungeon_detail_view.sweep_ten_times_locked_tips", vipData.ShortName);
                        ConfirmTipsView.Open(tipsString, GoToBuyDiamond);
                        return(false);
                    }
                }
            }
            else
            {
                if (!Logic.FunctionOpen.Model.FunctionOpenProxy.instance.IsFunctionOpen(FunctionOpenType.SingleSweep, true))
                {
                    return(false);
                }
            }



            if (DungeonDetailProxy.instance.DungeonInfo.star < 3)
            {
                CommonAutoDestroyTipsView.Open(Localization.Get("ui.dungeon_detail_view.text_sweep_not_enough_star"));
                return(false);
            }
            if (GameProxy.instance.CheckPackFull())
            {
                return(false);
            }

            DungeonInfo info          = DungeonDetailProxy.instance.DungeonInfo;
            int         count         = 1;//默认等于10改为1下面判断是扫荡10次才变值
            int         countByAction = (int)(GameProxy.instance.PveAction / info.dungeonData.actionNeed);

            if (countByAction == 0)
            {
                string tipString = Localization.Get("ui.common_tips.not_enough_pve_action_and_go_to_buy");
                ConfirmTipsView.Open(tipString, GoToBuyAction);
                return(false);
            }
            int countByLimit = info.GetRemindChallengeTimes();

            if (countByLimit == 0)
            {
                CommonAutoDestroyTipsView.Open(Localization.Get("ui.dungeon_detail_view.challengeTimesNotEnoughTip"));
                return(false);
            }
            count = Mathf.Min(count, countByAction);
            count = Mathf.Min(count, countByLimit);
            if (isTen)
            {
                count = count <= 1 ? 10: count;
            }

            GameResData ticket        = GlobalData.GetGlobalData().sweepTicket;
            GameResData buyTicketCost = GlobalData.GetGlobalData().buy_sweep_cost;
            int         num           = ItemProxy.instance.GetItemCountByItemID(ticket.id);
            int         buyCount      = count;
            int         needCost      = buyTicketCost.count * buyCount;
            int         cost          = buyCount - num;

            if (cost > 0)
            {
                string tip = string.Format(Localization.Get("ui.dungeon_detail_view.text_sweep_not_enough_tip"), buyCount);
                ConfirmCostTipsView.Open(new GameResData(BaseResType.Diamond, 0, needCost, 0), tip, null, () => {
                    ItemController.instance.CLIENT2LOBBY_BuySweepCouponsReq(buyCount);
                });
                return(false);
            }
            return(true);
        }