예제 #1
0
        public int GetSweepTimes()
        {
            DungeonInfo info          = DungeonDetailProxy.instance.DungeonInfo;
            int         count         = 10;
            int         countByAction = 0;

            if (info.dungeonData.actionNeed == 0)
            {
                countByAction = 99;
            }
            else
            {
                countByAction = (int)(GameProxy.instance.PveAction / info.dungeonData.actionNeed);
            }
            int countByLimit = info.GetRemindChallengeTimes();

            count = Mathf.Min(count, countByAction);
            count = Mathf.Min(count, countByLimit);
            return(count);
        }
예제 #2
0
        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);
        }