Ejemplo n.º 1
0
    public bool IsFinishInDailyTask(SpecialFightMode mode)
    {
        DefendFightModeInfo defendFightModeInfo = SpecialFightManager.GetSpecialFightInfo(mode) as DefendFightModeInfo;

        if (defendFightModeInfo == null)
        {
            return(false);
        }
        int type = 0;

        switch (mode)
        {
        case SpecialFightMode.Hold:
            type = 8;
            break;

        case SpecialFightMode.Protect:
            type = 7;
            break;

        case SpecialFightMode.Save:
            type = 6;
            break;
        }
        int maxVipTimesByType = VIPPrivilegeManager.Instance.GetMaxVipTimesByType(type);

        return(defendFightModeInfo.todayBuyTimes >= maxVipTimesByType);
    }
    protected void InitDifficulty(SpecialFightMode mode)
    {
        DefendFightModeInfo defendFightModeInfo = SpecialFightManager.GetSpecialFightInfo(mode) as DefendFightModeInfo;

        this.DifficultyList.get_gameObject().SetActive(false);
        this.BuffObj.SetActive(false);
        this.OnUpdateDetailUI();
        this.InstanceTimesNum.set_text(defendFightModeInfo.todayCanChallengeTimes.ToString());
        this.BuyTimeBtn.get_gameObject().SetActive(defendFightModeInfo.todayCanChallengeTimes == 0);
    }
Ejemplo n.º 3
0
    public bool IsFinishExperienceTimes()
    {
        SpecialFightInfo specialFightInfo = SpecialFightManager.GetSpecialFightInfo(SpecialFightMode.Expericence) as SpecialFightInfo;

        if (specialFightInfo == null)
        {
            return(false);
        }
        int maxVipTimesByType = VIPPrivilegeManager.Instance.GetMaxVipTimesByType(15);

        return(specialFightInfo.m_ExtendTimes >= maxVipTimesByType);
    }
    private void OnBuyBuffCallBack()
    {
        SpecialFightInfo specialFightInfo = SpecialFightManager.GetSpecialFightInfo(this.currentMode) as SpecialFightInfo;

        if (specialFightInfo == null)
        {
            return;
        }
        if (specialFightInfo.m_BuffIds.get_Count() > 0)
        {
            this.SelectBuff(specialFightInfo.m_BuffIds);
        }
    }
Ejemplo n.º 5
0
    public void OnBuyDefendTimes(SpecialFightMode mode)
    {
        DefendFightModeInfo defendFightModeInfo = SpecialFightManager.GetSpecialFightInfo(mode) as DefendFightModeInfo;

        if (defendFightModeInfo == null)
        {
            return;
        }
        SpecialFightCommonTableData specialFightCommonTableData = SpecialFightManager.GetSpecialFightCommonTableData(mode);

        if (specialFightCommonTableData == null)
        {
            return;
        }
        int todayBuyTimes    = defendFightModeInfo.todayBuyTimes;
        int todayCanBuyTimes = defendFightModeInfo.todayCanBuyTimes;
        int canBuyTimes      = Math.Max(todayCanBuyTimes - todayBuyTimes, 0);

        if (canBuyTimes <= 0 && todayBuyTimes < specialFightCommonTableData.priceList.get_Count())
        {
            string chineseContent = GameDataUtils.GetChineseContent(505105, false);
            DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(621264, false), chineseContent, null, delegate
            {
                LinkNavigationManager.OpenVIPUI2Privilege();
            }, "取 消", "确 定", "button_orange_1", "button_yellow_1", null, true, true);
            return;
        }
        if (todayBuyTimes >= specialFightCommonTableData.priceList.get_Count())
        {
            DialogBoxUIViewModel.Instance.ShowAsConfirm(GameDataUtils.GetChineseContent(513531, false), GameDataUtils.GetChineseContent(513528, false), delegate
            {
            }, GameDataUtils.GetChineseContent(505114, false), "button_orange_1", null);
        }
        else
        {
            DialogBoxUIViewModel.Instance.ShowAsOKCancel_as(GameDataUtils.GetChineseContent(513531, false), string.Format(GameDataUtils.GetChineseContent(513530, false), specialFightCommonTableData.priceList.get_Item(todayBuyTimes), canBuyTimes, todayCanBuyTimes), null, null, delegate
            {
                if (canBuyTimes == 0)
                {
                    UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(513528, false), 1f, 1f);
                    DialogBoxUIViewModel.Instance.BtnRclose = false;
                }
                else
                {
                    DialogBoxUIViewModel.Instance.BtnRclose = true;
                    DefendFightManager.Instance.SendDefendFightBuyChallengeReq((DefendFightMode.DFMD)mode);
                }
            }, GameDataUtils.GetChineseContent(500012, false), GameDataUtils.GetChineseContent(500011, false), "button_orange_1", "button_yellow_1", null);
        }
    }
    public void SetModeInit(SpecialFightMode mode)
    {
        this.currentMode = mode;
        SpecialFightInfo specialFightInfo = SpecialFightManager.GetSpecialFightInfo(mode) as SpecialFightInfo;

        if (specialFightInfo != null && specialFightInfo.m_BuffIds.get_Count() > 0)
        {
            this.SelectBuff(specialFightInfo.m_BuffIds);
        }
        else
        {
            this.ClearBuffs();
        }
    }
Ejemplo n.º 7
0
    public void OnBuyExperienceTimes()
    {
        SpecialFightInfo specialFightInfo = SpecialFightManager.GetSpecialFightInfo(SpecialFightMode.Expericence) as SpecialFightInfo;

        if (specialFightInfo == null)
        {
            return;
        }
        List <int> date = DataReader <FJingYanFuBenPeiZhi> .Get("price").date;

        List <int> date2 = DataReader <FJingYanFuBenPeiZhi> .Get("buyTimes").date;

        int extendTimes = specialFightInfo.m_ExtendTimes;
        int num         = EntityWorld.Instance.EntSelf.VipLv;

        if (!VIPManager.Instance.IsVIPPrivilegeOn())
        {
            num = 0;
        }
        int num2 = 0;

        if (num <= 0 && VIPManager.Instance.IsVIPCardOn())
        {
            num2 = VIPPrivilegeManager.Instance.GetVipTimesByType(15);
        }
        int num3 = date2.get_Item(num);
        int num4 = Mathf.Max(num3 + num2 - extendTimes, 0);

        if (num4 <= 0 && extendTimes < date.get_Count())
        {
            DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(621264, false), GameDataUtils.GetChineseContent(505105, false), null, delegate
            {
                LinkNavigationManager.OpenVIPUI2Privilege();
            }, "取 消", "确 定", "button_orange_1", "button_yellow_1", null, true, true);
            return;
        }
        if (extendTimes >= date.get_Count() || num4 == 0)
        {
            DialogBoxUIViewModel.Instance.ShowAsConfirm(GameDataUtils.GetChineseContent(513531, false), GameDataUtils.GetChineseContent(513528, false), null, GameDataUtils.GetChineseContent(505114, false), "button_orange_1", null);
        }
        else
        {
            int num5 = date.get_Item(extendTimes);
            DialogBoxUIViewModel.Instance.ShowAsOKCancel_as(GameDataUtils.GetChineseContent(513531, false), string.Format(GameDataUtils.GetChineseContent(513530, false), num5, num4, num3), null, null, delegate
            {
                DialogBoxUIViewModel.Instance.BtnRclose = true;
                SpecialFightManager.Instance.ExtendExperienceTimeReq();
            }, GameDataUtils.GetChineseContent(500012, false), GameDataUtils.GetChineseContent(500011, false), "button_orange_1", "button_yellow_1", null);
        }
    }
    protected void StartExperienceFight()
    {
        SpecialFightInfo specialFightInfo = SpecialFightManager.GetSpecialFightInfo(this.currentMode) as SpecialFightInfo;

        if (specialFightInfo == null)
        {
            return;
        }
        if (specialFightInfo.m_RestTimes <= 0)
        {
            this.OnBuyExperienceTimes();
        }
        else
        {
            SpecialFightManager.Instance.StartExperienceFight();
        }
    }
    protected void InitBuff(SpecialFightMode mode)
    {
        this.DifficultyList.get_gameObject().SetActive(false);
        this.BuffObj.SetActive(true);
        SpecialFightInfo specialFightInfo = SpecialFightManager.GetSpecialFightInfo(this.currentMode) as SpecialFightInfo;

        if (specialFightInfo == null)
        {
            return;
        }
        int buffId = 0;

        if (specialFightInfo.m_BuffIds != null && specialFightInfo.m_BuffIds.get_Count() > 0)
        {
            buffId = specialFightInfo.m_BuffIds.get_Item(0);
        }
        this.OnUpdateBuff(buffId);
    }
Ejemplo n.º 10
0
    protected void OnUpdateExpericenceInstanceDetailUI()
    {
        SpecialFightInfo specialFightInfo = SpecialFightManager.GetSpecialFightInfo(this.currentMode) as SpecialFightInfo;

        if (specialFightInfo == null)
        {
            return;
        }
        this.OnUpdateDetailUI();
        this.InstanceTimesNum.set_text(specialFightInfo.m_RestTimes.ToString());
        this.BuyTimeBtn.get_gameObject().SetActive(specialFightInfo.m_RestTimes == 0);
        int buffId = 0;

        if (specialFightInfo.m_BuffIds != null && specialFightInfo.m_BuffIds.get_Count() > 0)
        {
            buffId = specialFightInfo.m_BuffIds.get_Item(0);
        }
        this.OnUpdateBuff(buffId);
    }
Ejemplo n.º 11
0
    public bool CanShowBuyBtnInDailyTask(SpecialFightMode mode)
    {
        DefendFightModeInfo defendFightModeInfo = SpecialFightManager.GetSpecialFightInfo(mode) as DefendFightModeInfo;

        return(defendFightModeInfo != null && defendFightModeInfo.todayCanChallengeTimes <= 0);
    }
Ejemplo n.º 12
0
    public bool CanShowBuyExperienceTimesInDailyTask()
    {
        SpecialFightInfo specialFightInfo = SpecialFightManager.GetSpecialFightInfo(SpecialFightMode.Expericence) as SpecialFightInfo;

        return(specialFightInfo != null && specialFightInfo.m_RestTimes <= 0);
    }