Esempio n. 1
0
    private void UpdateSweepInfo()
    {
        CounterPartInfo info    = StageDC.GetCounterPartInfo();
        int             times   = StageDC.GetPassStageTimes(m_type, m_stageid);
        bool            passed  = times > 0;
        bool            hasBoss = info.isboss > 0;
        bool            isPVE   = StageDC.GetPveMode() == PVEMode.Attack;
        // 是否需要显示扫荡UI
        bool activeSweepInfo = passed && hasBoss && isPVE;

        MyHead.SweepGroup.SetActive(activeSweepInfo);
        if (!activeSweepInfo)
        {
            return;
        }

        ItemTypeInfo sweepTicketInfo  = ItemDC.GetSweepTickets();
        int          sweepTicketCount = sweepTicketInfo == null ? 0 : sweepTicketInfo.Num;

        MyHead.LblSweepTicket.text = string.Format("x{0}", sweepTicketCount);

        int sweepOnce            = 1;
        int currentSweepMultiple = 0;

        if (info.type == (int)StageType.Normal)
        {
            currentSweepMultiple = 10;
        }
        else if (info.type == (int)StageType.Hard)
        {
            currentSweepMultiple = 3;
        }
        MyHead.LblSweepMultiple.text = string.Format(NGUIUtil.GetStringByKey(70000255), currentSweepMultiple);
        MyHead.LblSweepOnce.text     = string.Format(NGUIUtil.GetStringByKey(70000256), sweepOnce);
    }
Esempio n. 2
0
    void Resweep(UIButton sender)
    {
        ItemTypeInfo sweepTicketInfo = ItemDC.GetSweepTickets();

        if (sweepTicketInfo == null || sweepTicketInfo.Num < mSweepCount)
        {
            WndManager.DestoryDialog <StageWipeWnd>();
            NGUIUtil.ShowFreeSizeTipWnd(NGUIUtil.GetStringByKey("70000229"));
            return;
        }
        CounterPartInfo info           = StageDC.GetCounterPartInfo();
        int             playerPhysical = UserDC.GetPhysical();

        // ÌåÁ¦²»×ã
        if (playerPhysical < info.win_physical * mSweepCount)
        {
            WndManager.DestoryDialog <StageWipeWnd>();
            NGUIUtil.ShowFreeSizeTipWnd(NGUIUtil.GetStringByKey("99904008"));
            return;
        }

        StageDC.SendStageSweepRequest(StageDC.GetCompaignStageID(), mSweepCount);
        Clear();
        //DataCenter.RegisterHooks((int)gate.Command.CMD.CMD_718, ShowSweepResult);
    }
Esempio n. 3
0
    void ClickSweepMultiple(UIButton sender)
    {
        // 判定是否有扫荡券
        ItemTypeInfo sweepTicketInfo = ItemDC.GetSweepTickets();

        if (sweepTicketInfo == null || sweepTicketInfo.Num < m_AvailableMultipleSweep)
        {
            NGUIUtil.ShowFreeSizeTipWnd(NGUIUtil.GetStringByKey("70000229"));
            return;
        }

        CounterPartInfo info = StageDC.GetCounterPartInfo();

        // 体力不足
        int playerPhysical = UserDC.GetPhysical();

        if (playerPhysical < info.win_physical * m_AvailableMultipleSweep)
        {
            NGUIUtil.ShowFreeSizeTipWnd(NGUIUtil.GetStringByKey("99904008"));
            return;
        }

        // VIP, 解锁判定
        //......
        int vipLevel = UserDC.GetVIPLevel();

        if (vipLevel < 4)
        {
            string tip = string.Format(NGUIUtil.GetStringByKey("70000228"), 4);
            NGUIUtil.ShowFreeSizeTipWnd(tip);
            //return;
        }

        m_ClickSweepTimes = m_AvailableMultipleSweep;
        StageDC.SendStageSweepRequest(StageDC.GetCompaignStageID(), m_ClickSweepTimes);
        DataCenter.RegisterHooks((int)gate.Command.CMD.CMD_718, ShowSweepResult);
    }
Esempio n. 4
0
    void ClickSweepOnce(UIButton sender)
    {
        // 判定是否有扫荡券
        ItemTypeInfo sweepTicketInfo = ItemDC.GetSweepTickets();

        if (sweepTicketInfo == null || sweepTicketInfo.Num == 0)
        {
            NGUIUtil.ShowFreeSizeTipWnd(NGUIUtil.GetStringByKey("70000229"));
            return;
        }
        CounterPartInfo info           = StageDC.GetCounterPartInfo();
        int             playerPhysical = UserDC.GetPhysical();

        // 体力不足
        if (playerPhysical < info.win_physical)
        {
            NGUIUtil.ShowFreeSizeTipWnd(NGUIUtil.GetStringByKey("99904008"));
            return;
        }

        m_ClickSweepTimes = 1;
        StageDC.SendStageSweepRequest(StageDC.GetCompaignStageID(), m_ClickSweepTimes);
        DataCenter.RegisterHooks((int)gate.Command.CMD.CMD_718, ShowSweepResult);
    }