Exemplo n.º 1
0
 public void OnClickResetMapBtnHandler()
 {
     if (ExpeditionProxy.instance.resetCount == 0)
     {
         if (ExpeditionProxy.instance.expeditionRemaindBuyTimes > 0)
         {
             if (ConsumeTipProxy.instance.GetConsumeTipEnable(ConsumeTipType.DiamondResetExpeditionCount))
             {
                 ConfirmCostTipsView.Open(GlobalData.GetGlobalData().faraway_buy_ResData, Localization.Get("ui.expedition_view.resetNotEnough"), Localization.Get("ui.expedition_view.canResetOnce"), null, ExpendCostToResetMapHandler, ConsumeTipType.DiamondResetExpeditionCount);
             }
             else
             {
                 ExpendCostToResetMapHandler();
             }
             return;
         }
         int nextVip = ExpeditionProxy.instance.nextVipExtraBuyTimes;
         if (nextVip != 0)
         {
             ConfirmTipsView.Open(string.Format(Localization.Get("ui.expedition_view.improveVip"), nextVip), OpenRechargeHandler);
             return;
         }
         CommonErrorTipsView.Open(Localization.Get("ui.expedition_view.resetCountDown"));
         return;
     }
     else
     {
         ConfirmTipsView.Open(Localization.Get("ui.expedition_view.confirmResetTip"), ClickConfirmResetMapHandler);
     }
 }
        protected override void ClickWinNextHandler()
        {
            int nextDungeonDataID = FightProxy.instance.CurrentDungeonData.unlockDungeonIDNext1;
            WorldTreeDungeonInfo nextWorldTreeDungeonInfo = WorldTreeProxy.instance.GetWorldTreeInfoByID(nextDungeonDataID);

            if (WorldTreeProxy.instance.WorldTreeFruit <= 0)
            {
                ConfirmTipsView.Open(Localization.Get("ui.world_tree_preview_view.tips.out_of_fruit_description"), () => {
                    FunctionOpenProxy.instance.OpenFunction(FunctionOpenType.Shop_Action);
                });
                return;
            }

            if (nextWorldTreeDungeonInfo.worldTreeDungeonStatus == WorldTreeDungeonStatus.Locked)
            {
                CommonAutoDestroyTipsView.Open(Localization.Get("ui.world_tree_preview_view.tips.dungeon_locked"));
                return;
            }
            if (nextWorldTreeDungeonInfo.worldTreeDungeonStatus == WorldTreeDungeonStatus.Passed)
            {
                CommonAutoDestroyTipsView.Open(Localization.Get("ui.world_tree_preview_view.tips.dungeon_passed"));
                return;
            }
            WorldTreeController.instance.CLIENT2LOBBY_WORLD_TREE_CHALLENGE_REQ(nextWorldTreeDungeonInfo.dungeonID);
        }
Exemplo n.º 3
0
 public void ClickBuyChanllengeBtnHandler()
 {
     if (GameProxy.instance.PveAction < CurrentSelectDungeonData.actionNeed)
     {
         CommonErrorTipsView.Open(Localization.Get("ui.common_tips.not_enough_pveAction"));
         return;
     }
     if (_activityInfo.remainBuyActivityTimes > 0)
     {
         int index = _activityInfo.buyActivityChanllengeTimes;
         if (_activityInfo.buyActivityChanllengeTimes >= GlobalData.GetGlobalData().daily_dungeon_buy_List.Count)
         {
             index = GlobalData.GetGlobalData().daily_dungeon_buy_List.Count - 1;
         }
         GameResData data = GlobalData.GetGlobalData().daily_dungeon_buy_List[index];
         ConfirmCostTipsView.Open(data, Localization.Get("ui.daily_dungeon_info_view.buy_challenge_times_tips_title"), Localization.Get("ui.daily_dungeon_info_view.buy_challenge_times_tips_content"), null, ExpendCostToBuyChallengeHandler);
         return;
     }
     if (_activityInfo.hasBuyActivityTimesByMaxVip)
     {
         ConfirmTipsView.Open(Localization.Get("ui.daily_dungeon_info_view.upgrade_vip_tips"), OpenRechargeHandler);
         return;
     }
     CommonErrorTipsView.Open(Localization.Get("ui.daily_dungeon_info_view.out_of_challenge_time"));
 }
Exemplo n.º 4
0
 public bool canStartFight()
 {
     if (GameProxy.instance.PveAction - DungeonDetailProxy.instance.DungeonInfo.dungeonData.actionNeed < 0)
     {
         string tipString = Localization.Get("ui.common_tips.not_enough_pve_action_and_go_to_buy");
         ConfirmTipsView.Open(tipString, GoToBuyAction);
         return(false);
     }
     if (!DungeonDetailProxy.instance.DungeonInfo.hasChallengeTimes())
     {
         CommonErrorTipsView.Open(Localization.Get("ui.common_tips.not_enough_fight_times"));
         return(false);
     }
     return(true);
 }
Exemplo n.º 5
0
        public void ClickStartChallengeHandler()
        {
            if (WorldTreeProxy.instance.WorldTreeFruit <= 0)
            {
                ConfirmTipsView.Open(Localization.Get("ui.world_tree_preview_view.tips.out_of_fruit_description"), OnClickConfirmBuyWorldTreeFruitHandler);
                return;
            }

            if (_selectedWorldTreeDungeonInfo.worldTreeDungeonStatus == WorldTreeDungeonStatus.Locked)
            {
                CommonAutoDestroyTipsView.Open(Localization.Get("ui.world_tree_preview_view.tips.dungeon_locked"));
                return;
            }
            if (_selectedWorldTreeDungeonInfo.worldTreeDungeonStatus == WorldTreeDungeonStatus.Passed)
            {
                CommonAutoDestroyTipsView.Open(Localization.Get("ui.world_tree_preview_view.tips.dungeon_passed"));
                return;
            }
            WorldTreeController.instance.CLIENT2LOBBY_WORLD_TREE_CHALLENGE_REQ(_selectedWorldTreeDungeonInfo.dungeonID);
        }
Exemplo n.º 6
0
        public void OnClickBuyChallengeTimesHandler()
        {
            DungeonInfo dungeonInfo = DungeonDetailProxy.instance.DungeonInfo;

            if (dungeonInfo.dayRefreshTimes < VIPProxy.instance.VIPData.dayRefreshTimes)
            {
                int cost = TimesCostData.GetTimesCostData(2, dungeonInfo.dayRefreshTimes + 1).cost;
                if (GameProxy.instance.BaseResourceDictionary[BaseResType.Diamond] < cost)
                {
                    ConfirmTipsView.Open(Localization.Get("ui.dungeon_detail_view.diamond_not_enough_tips_title"), OnClickGoToBuyDiamond, ConsumeTipType.None);
                    return;
                }
                DungeonController.instance.CLIENT2LOBBY_RefreshDayTimesReq(dungeonInfo.dungeonData.dungeonID);
            }
            else
            {
                VIPData improveDayRefreshTimesVIPData = null;
                VIPData tempVIPData = VIPProxy.instance.VIPData;
                while (tempVIPData != null)
                {
                    if (tempVIPData.dayRefreshTimes > VIPProxy.instance.VIPData.dayRefreshTimes)
                    {
                        improveDayRefreshTimesVIPData = tempVIPData;
                        break;
                    }
                    tempVIPData = tempVIPData.GetNextLevelVIPData();
                }

                if (improveDayRefreshTimesVIPData != null)
                {
                    string tipString = Localization.Format("ui.dungeon_detail_view.dungeon_challenge_times_not_enough_and_go_to_recharge_tips", improveDayRefreshTimesVIPData.ShortName);
                    ConfirmTipsView.Open(tipString, OnClickGoToBuyDiamond, ConsumeTipType.None);
                }
                else
                {
                    CommonAutoDestroyTipsView.Open(Localization.Get("ui.dungeon_detail_view.dungeon_challenge_times_not_enough_tips"));
                }
            }
        }
Exemplo n.º 7
0
        public void OnClickDeleteAllReadMailHandler()
        {
            bool hasDelete = false;
            Dictionary <int, MailInfo> mailDic = MailProxy.instance.MailInfoDictionary;

            foreach (KeyValuePair <int, MailInfo> value in mailDic)
            {
                if (value.Value.isGetReward || value.Value.rewardList.Count == 0)
                {
                    hasDelete = true;
                    break;
                }
            }
            if (hasDelete)
            {
                ConfirmTipsView.Open(Localization.Get("ui.mail_view.confirmDelete"), ConfirmDeleteMail);
            }
            else
            {
                CommonAutoDestroyTipsView.Open(Localization.Get("ui.mail_view.noMailDelete"));
            }
        }
Exemplo n.º 8
0
        public void ClickNextHandler()
        {
            DungeonData dungeonData = _activityInfo.ActivityData.GetDungeonDataOfLevel(_currentSelectLevel);

            if (_activityInfo.remainChallengeTimes <= 0)
            {
                ClickBuyChanllengeBtnHandler();
                return;
            }
            if (GameProxy.instance.PveAction < dungeonData.actionNeed)
            {
                string tipString = Localization.Get("ui.common_tips.not_enough_pve_action_and_go_to_buy");
                ConfirmTipsView.Open(tipString, GoToBuyAction);
                return;
            }
            if (_currentSelectLevel > _activityInfo.ChallengedHighestLevel)
            {
                _activityInfo.ChallengedHighestLevel = _currentSelectLevel;
            }
            _activityInfo.LastChallengedLevel = _currentSelectLevel;
            ActivityController.instance.CLIENT2LOBBY_ACTIVITY_PVE_CHALLENGE_REQ(dungeonData.dungeonID, false);
        }
Exemplo n.º 9
0
        public void OnClickPvpFighterButtonHandler(PvpFighterButton fighterBtn)
        {
            if (GameProxy.instance.PvpAction <= 0)
            {
                ConfirmTipsView.Open(Localization.Get("ui.pvp_formation_view.notEnoughChallengeTimesAndGoToBuy"), GoToBuyAction);
                return;
            }

            PvpProxy.instance.ChallengeFighter = fighterBtn.pvpFighterInfo;

            //			string id = "";
            //			for(int i = 0,count= fighterBtn.pvpFighterInfo.heroTeamDataList.Count;i<count;i++)
            //			{
            //				HeroTeamProtoData data = fighterBtn.pvpFighterInfo.heroTeamDataList[i];
            //				id = string.Format("{0}{1},",id,data.id);
            //
            //			}
            Debugger.Log(string.Format("挑战对手{0}:playerid:{1}", fighterBtn.pvpFighterInfo.id, fighterBtn.pvpFighterInfo.playerInfo.instanceID));
            //PvpFormationView.Open(true);
            //PVPEmbattleView.Open(true);
            PvpController.instance.CLIENT2LOBBY_RANK_ARENA_CHANLLENGE_REQ(PvpProxy.instance.ChallengeFighter);
            //LuaTable friendCtrlLua = (LuaTable)LuaScriptMgr.Instance.CallLuaFunction("gamemanager.GetCtrl","friend_controller")[0];
            //friendCtrlLua.GetLuaFunction("RoleInfoLookUpReq").Call(fighterBtn.pvpFighterInfo.id,(int)FunctionOpenType.FightCenter_Arena);
        }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
0
        public void ClickBuyHandler()
        {
            int            shopID          = 0;
            int            shopItemID      = 0;
            string         shopItemName    = string.Empty;
            GameResData    costGameResData = null;
            int            costType        = 1;
            ConsumeTipType consumTipType   = ConsumeTipType.None;          //提示

            if (_shopHeroRandomCardInfo != null)
            {
                shopID          = _shopHeroRandomCardInfo.ShopCardRandomData.shopID;
                shopItemID      = _shopHeroRandomCardInfo.ShopCardRandomData.id;
                shopItemName    = Localization.Get(_shopHeroRandomCardInfo.ShopCardRandomData.name);
                costGameResData = _shopHeroRandomCardInfo.ShopCardRandomData.costGameResData;
                if (_shopHeroRandomCardInfo.RemainFreeTimes > 0 && _shopHeroRandomCardInfo.NextFreeBuyCountDownTime <= 0)
                {
                    costType = 0;
                }
                consumTipType = _shopHeroRandomCardInfo.ShopCardRandomData.buyType == 1 ? ConsumeTipType.DiamondDrawSingleHero : ConsumeTipType.DiamondDrawTenHeroes;
            }
            else if (_shopEquipmentRandomCardInfo != null)
            {
                shopID          = _shopEquipmentRandomCardInfo.ShopCardRandomData.shopID;
                shopItemID      = _shopEquipmentRandomCardInfo.ShopCardRandomData.id;
                shopItemName    = Localization.Get(_shopEquipmentRandomCardInfo.ShopCardRandomData.name);
                costGameResData = _shopEquipmentRandomCardInfo.ShopCardRandomData.costGameResData;
                if (_shopEquipmentRandomCardInfo.RemainFreeTimes > 0 && _shopEquipmentRandomCardInfo.NextFreeBuyCountDownTime <= 0)
                {
                    costType = 0;
                }
//				consumTipType = _shopEquipmentRandomCardInfo.ShopCardRandomData.buyType == 1 ? ConsumeTipType.DiamondSingleLotteryEquip : ConsumeTipType.None;
            }
            else if (_shopDiamondItemInfo != null)
            {
                shopID          = _shopDiamondItemInfo.ShopDiamondData.shopID;
                shopItemID      = _shopDiamondItemInfo.ShopDiamondData.id;
                shopItemName    = Localization.Get(_shopDiamondItemInfo.ShopDiamondData.name);
                costGameResData = _shopDiamondItemInfo.ShopDiamondData.costGameResData;
            }
            else if (_shopActionItemInfo != null)
            {
                shopID          = _shopActionItemInfo.ShopLimitItemData.shopID;
                shopItemID      = _shopActionItemInfo.ShopLimitItemData.id;
                shopItemName    = Localization.Get(_shopActionItemInfo.ShopLimitItemData.name);
                costGameResData = _shopActionItemInfo.ShopLimitItemData.costGameResData;
                BaseResType resourseResType = _shopActionItemInfo.ShopLimitItemData.resourseGameResData.type;
                if (resourseResType == BaseResType.TowerAction)
                {
                    consumTipType = ConsumeTipType.DiamondBuyWorldTreeCount;
                }
                else if (resourseResType == BaseResType.PvpAction)
                {
                    consumTipType = ConsumeTipType.DiamondBuyPvpCount;
                }
                else if (resourseResType == BaseResType.PveAction)
                {
                    consumTipType = ConsumeTipType.DiamondBuyPveAction;
                }
            }
            else if (_shopGoldItemInfo != null)
            {
                shopID          = _shopGoldItemInfo.ShopLimitItemData.shopID;
                shopItemID      = _shopGoldItemInfo.ShopLimitItemData.id;
                shopItemName    = Localization.Get(_shopGoldItemInfo.ShopLimitItemData.name);
                costGameResData = _shopGoldItemInfo.ShopLimitItemData.costGameResData;
                consumTipType   = ConsumeTipType.DiamondBuyCoin;
            }
            else if (_shopGoodsItemInfo != null)
            {
                shopID          = _shopGoodsItemInfo.ShopGoodsData.shopID;
                shopItemID      = _shopGoodsItemInfo.ShopGoodsData.id;
                shopItemName    = Localization.Get(_shopGoodsItemInfo.ShopGoodsData.name);
                costGameResData = _shopGoodsItemInfo.ShopGoodsData.costGameResData;
            }

            // 对于限制购买次数的物品,先判断是否还有购买次数
            if (_shopActionItemInfo != null || _shopGoldItemInfo != null)
            {
                ShopLimitItemData shopLimitItemData = null;
                if (_shopActionItemInfo != null)
                {
                    shopLimitItemData = _shopActionItemInfo.ShopLimitItemData;
                    if (shopLimitItemData.baseResType == BaseResType.PveAction)
                    {
                        if (shopLimitItemData.id > VIPProxy.instance.VIPData.pveActionBuyTimes)
                        {
                            ConfirmTipsView.Open(Localization.Get("ui.shop_view.not_enough_remain_times_tips"), ClickGoToBuyDiamond);
                            return;
                        }
                    }
                    else if (shopLimitItemData.baseResType == BaseResType.TowerAction)
                    {
                        if (shopLimitItemData.id > VIPProxy.instance.VIPData.worldTreeActionBuyTimes)
                        {
                            ConfirmTipsView.Open(Localization.Get("ui.shop_view.not_enough_remain_times_tips"), ClickGoToBuyDiamond);
                            return;
                        }
                    }
                }
                else if (_shopGoldItemInfo != null)
                {
                    shopLimitItemData = _shopGoldItemInfo.ShopLimitItemData;
                    if (shopLimitItemData.id > VIPProxy.instance.VIPData.goldBuyTimes)
                    {
                        ConfirmTipsView.Open(Localization.Get("ui.shop_view.not_enough_remain_times_tips"), ClickGoToBuyDiamond);
                        return;
                    }
                }
            }
            // 对于限制购买次数的物品,先判断是否还有购买次数

            if (costType == 0)               //免费
            {
                ShopController.instance.CLIENT2LOBBY_PURCHASE_GOODS_REQ(shopID, shopItemID, costType);
            }
            else if (costType == 1)               //非免费
            {
                if (GameResUtil.IsBaseRes(costGameResData.type))
                {
                    if (GameProxy.instance.BaseResourceDictionary[costGameResData.type] < costGameResData.count)
                    {
                        if (costGameResData.type == BaseResType.Diamond)
                        {
                            string diamondNotEnoughTipsString = Localization.Get("ui.common_tips.not_enough_diamond_and_go_to_buy");
                            ConfirmTipsView.Open(diamondNotEnoughTipsString, ClickGoToBuyDiamond, ConsumeTipType.None);
                        }
                        else
                        {
                            CommonErrorTipsView.Open(string.Format(Localization.Get("ui.common_tips.not_enough_resource"), GameResUtil.GetBaseResName(costGameResData.type)));
                        }
                        return;
                    }

                    if (costGameResData.type == Logic.Enums.BaseResType.Diamond)
                    {
                        if (ConsumeTipProxy.instance.GetConsumeTipEnable(consumTipType))
                        {
                            ConfirmBuyShopItemTipsView.Open(shopItemName, costGameResData, ClickConfirmBuyHandler, consumTipType);
                        }
                        else
                        {
                            ClickConfirmBuyHandler();
                        }
                    }
                    else
                    {
                        ShopController.instance.CLIENT2LOBBY_PURCHASE_GOODS_REQ(shopID, shopItemID, costType);
                    }
                }
                else
                {
                    ShopController.instance.CLIENT2LOBBY_PURCHASE_GOODS_REQ(shopID, shopItemID, costType);
                }
                Debugger.Log(string.Format("[ShopItemView]shopid:{0},shopitemid:{1},costtype:{2}", shopID, shopItemID, costType));
            }
        }