Beispiel #1
0
 void CheckPvpBuy()
 {
     if (buytime >= time)
     {
         SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(25166));
         JCPromptBox.Close();
         return;
     }
     if (Core.Data.playerManager.Stone < stone)
     {
         SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(7310));
         JCPromptBox.Close();
         return;
     }
     OnFightAddGamble();
     JCPromptBox.Close();
 }
Beispiel #2
0
    //安全自动显示购买弹出窗   type -->  //1:技能副本;2:战魂副本;3:经验副本;4:宝石副本
    public void AutoShowBuyBox(int type)
    {
        NewDungeonsManager ndm = Core.Data.newDungeonsManager;
        string title = null;
        string content = null;
        //是否够买一次机会
        bool haveEnoughMoney = false;

        if(type == 1)  //技能副本
        {
            VipInfoData vip =Core.Data.vipManager.GetVipInfoData(Core.Data.playerManager.curVipLv);
            if(vip != null && ndm.explorDoors != null && ndm.explorDoors.skill != null && ndm.explorDoors.skill.passCount >= ndm.explorDoors.skill.count )
            {
                if(ndm.explorDoors.skill.buyCount < vip.specialdoor1)
                {
                    title = Core.Data.stringManager.getString(9115)+":"+ndm.explorDoors.skill.buyCount.ToString()+"/"+vip.specialdoor1.ToString();
                    content = Core.Data.stringManager.getString(9116).Replace("{}","[ffff00]"+ndm.explorDoors.skill.needStone.ToString()+"[-]");
                    haveEnoughMoney = Core.Data.playerManager.Stone >= ndm.explorDoors.skill.needStone;
                }
                else
                {
                    VipInfoData data = Core.Data.vipManager.GetNextVipLevelBuyActiveFB(type,ndm.explorDoors.skill.buyCount);
                    if(data != null)
                        SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(9120).Replace("{}",data.vipLv.ToString()));
                }
            }
        }
        else if(type ==2) //战魂副本
        {
            VipInfoData vip =Core.Data.vipManager.GetVipInfoData(Core.Data.playerManager.curVipLv);
            if(vip != null && ndm.explorDoors != null && ndm.explorDoors.souls != null && ndm.explorDoors.souls.passCount >= ndm.explorDoors.souls.count )
            {
                if(ndm.explorDoors.souls.buyCount < vip.specialdoor2)
                {
                    title = Core.Data.stringManager.getString(9115)+":"+ndm.explorDoors.souls.buyCount.ToString()+"/"+vip.specialdoor2.ToString();
                    content = Core.Data.stringManager.getString(9116).Replace("{}","[ffff00]"+ndm.explorDoors.souls.needStone.ToString()+"[-]");
                    haveEnoughMoney = Core.Data.playerManager.Stone >= ndm.explorDoors.souls.needStone;
                }
                else
                {
                    VipInfoData data = Core.Data.vipManager.GetNextVipLevelBuyActiveFB(type,ndm.explorDoors.souls.buyCount);
                    if(data != null)
                        SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(9120).Replace("{}",data.vipLv.ToString()));
                }
            }
        }
        else if(type ==3) //经验副本
        {
            VipInfoData vip =Core.Data.vipManager.GetVipInfoData(Core.Data.playerManager.curVipLv);
            if(vip != null && ndm.explorDoors != null && ndm.explorDoors.exp != null && ndm.explorDoors.exp.passCount >= ndm.explorDoors.exp.count )
            {
                if(ndm.explorDoors.exp.buyCount < vip.specialdoor3)
                {
                    title = Core.Data.stringManager.getString(9115)+":"+ndm.explorDoors.exp.buyCount.ToString()+"/"+vip.specialdoor3.ToString();
                    content = Core.Data.stringManager.getString(9116).Replace("{}","[ffff00]"+ndm.explorDoors.exp.needStone.ToString()+"[-]");
                    haveEnoughMoney = Core.Data.playerManager.Stone >= ndm.explorDoors.exp.needStone;
                }
                else
                {
                    VipInfoData data = Core.Data.vipManager.GetNextVipLevelBuyActiveFB(type,ndm.explorDoors.exp.buyCount);
                    if(data != null)
                        SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(9120).Replace("{}",data.vipLv.ToString()));
                }
            }
        }
        else if(type ==4) //宝石副本
        {
            VipInfoData vip =Core.Data.vipManager.GetVipInfoData(Core.Data.playerManager.curVipLv);
            if(vip != null && ndm.explorDoors != null && ndm.explorDoors.gems != null && ndm.explorDoors.gems.passCount >= ndm.explorDoors.gems.count )
            {
                if(ndm.explorDoors.gems.buyCount < vip.specialdoor4)
                {
                    title = Core.Data.stringManager.getString(9115)+":"+ndm.explorDoors.gems.buyCount.ToString()+"/"+vip.specialdoor4.ToString();
                    content = Core.Data.stringManager.getString(9116).Replace("{}","[ffff00]"+ndm.explorDoors.gems.needStone.ToString()+"[-]");
                    haveEnoughMoney = Core.Data.playerManager.Stone >= ndm.explorDoors.gems.needStone;
                }
                else
                {
                    VipInfoData data = Core.Data.vipManager.GetNextVipLevelBuyActiveFB(type,ndm.explorDoors.gems.buyCount);
                    if(data != null)
                        SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(9120).Replace("{}",data.vipLv.ToString()));
                }
            }
        }

        //如果调用弹窗
        if(title != null && content != null)
        {
            JCPromptBox.OpenUI(title,content).OnBtnBuyClick = () =>
            {
                //客户端预判钻石
                if(haveEnoughMoney)
                {
                    HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response);
                    task.AppendCommonParam(RequestType.BUY_PVEACT_FB, new BuyPVEActivityFB(Core.Data.playerManager.PlayerID,type,1) );
                    task.afterCompleted = (BaseHttpRequest request, BaseResponse response) =>
                    {
                        if (response.status != BaseResponse.ERROR)
                        {
                            SyncPveResponse SPR= response as SyncPveResponse;
                            Core.Data.newDungeonsManager.explorDoors = SPR.data;
                            OnEnable();
                            if(FreshExpOrGem != null)
                            {
                                FreshExpOrGem();
                            }
                            JCPromptBox.Close();
                            DBUIController.mDBUIInstance.RefreshUserInfo();
                        }
                        else
                        {
                            SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getNetworkErrorString(response.errorCode));
                        }
                    };
                    task.DispatchToRealHandler();
                }
                else
                {
                    //35006钻石不足
                    SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(35006));
                }
            };
        }
    }