Ejemplo n.º 1
0
    private void RefreshReward(RewardPreviewUI.CopyType type)
    {
        SpecialFightMode mode = SpecialFightMode.None;

        switch (type)
        {
        case RewardPreviewUI.CopyType.GUARD:
            mode = SpecialFightMode.Hold;
            break;

        case RewardPreviewUI.CopyType.ESCORT:
            mode = SpecialFightMode.Protect;
            break;

        case RewardPreviewUI.CopyType.ATTACK:
            mode = SpecialFightMode.Save;
            break;
        }
        SpecialFightCommonTableData specialFightCommonTableData = SpecialFightManager.GetSpecialFightCommonTableData(mode);

        if (specialFightCommonTableData != null)
        {
            for (int i = 0; i < this.mSpecialRewards.get_childCount(); i++)
            {
                Object.Destroy(this.mSpecialRewards.GetChild(i).get_gameObject());
            }
            for (int j = 0; j < specialFightCommonTableData.itemIDs.get_Count(); j++)
            {
                GameObject gameObject = ItemShow.ShowItem(this.mSpecialRewards, specialFightCommonTableData.itemIDs.get_Item(j), 0L, false, null, 2001);
                gameObject.get_transform().set_localScale(new Vector3(0.5f, 0.5f, 1f));
            }
            this.mSpecialRewards.get_gameObject().SetActive(true);
        }
    }
Ejemplo n.º 2
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.º 4
0
 public void Init(SpecialFightMode theMode, Action <SpecialFightMode> theBtnCallBack, string theTaskOpenText, string theCountDownText, string[] theWeekText)
 {
     this.mode          = theMode;
     this.btnCallBack   = theBtnCallBack;
     this.taskOpenText  = theTaskOpenText;
     this.countDownText = theCountDownText;
     this.weekText      = theWeekText;
     this.InfoText      = base.get_transform().FindChild(base.get_gameObject().get_name() + "Text").GetComponent <Text>();
     base.GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnBtnClick);
     this.systemId = SpecialFightManager.GetSystemIDByMode(this.mode);
 }
Ejemplo n.º 5
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);
        }
    }
    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.º 8
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);
        }
    }
Ejemplo n.º 9
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);
        }
    }
Ejemplo n.º 10
0
    public static SpecialFightCommonTableData GetSpecialFightCommonTableData(SpecialFightMode mode)
    {
        SpecialFightModeGroup modeCroup             = SpecialFightManager.GetModeCroup(mode);
        SpecialFightModeGroup specialFightModeGroup = modeCroup;

        if (specialFightModeGroup == SpecialFightModeGroup.Defend)
        {
            return(DefendFightManager.Instance.GetSpecialFightCommonTableData((DefendFightMode.DFMD)mode));
        }
        if (specialFightModeGroup != SpecialFightModeGroup.Expericence)
        {
            return(null);
        }
        return(SpecialFightManager.Instance.commonData);
    }
Ejemplo n.º 11
0
    protected static void OpenSpecialInstanceAppointedUI(SpecialFightMode mode)
    {
        if (!SystemOpenManager.IsSystemClickOpen(17, 0, true))
        {
            return;
        }
        if (!SystemOpenManager.IsSystemClickOpen(SpecialFightManager.GetSystemIDByMode(mode), 0, true))
        {
            return;
        }
        InstanceManagerUI.InstanceID = 0;
        SpecialInstanceUI specialInstanceUI = UIManagerControl.Instance.OpenUI("SpecialInstanceUI", null, false, UIType.FullScreen) as SpecialInstanceUI;

        specialInstanceUI.FakeClick(mode);
    }
Ejemplo n.º 12
0
    public static object GetSpecialFightInfo(SpecialFightMode mode)
    {
        SpecialFightModeGroup modeCroup             = SpecialFightManager.GetModeCroup(mode);
        SpecialFightModeGroup specialFightModeGroup = modeCroup;

        if (specialFightModeGroup == SpecialFightModeGroup.Defend)
        {
            return(DefendFightManager.Instance.GetModeInfo((DefendFightMode.DFMD)mode));
        }
        if (specialFightModeGroup != SpecialFightModeGroup.Expericence)
        {
            return(null);
        }
        return(SpecialFightManager.Instance.GetFightInfo(mode));
    }
Ejemplo n.º 13
0
    protected void UpdateTime()
    {
        SpecialFightModeGroup modeCroup = SpecialFightManager.GetModeCroup(this.mode);

        if (modeCroup != SpecialFightModeGroup.Defend)
        {
            if (modeCroup == SpecialFightModeGroup.Expericence)
            {
                this.InfoText.set_text(this.taskOpenText);
            }
        }
        else
        {
            this.UpdateOpenTime();
        }
    }
Ejemplo n.º 14
0
    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();
        }
    }
Ejemplo n.º 15
0
    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.º 16
0
    public void SetInit(SpecialFightMode mode)
    {
        this.currentMode  = mode;
        this.currentGroup = SpecialFightManager.GetModeCroup(mode);
        this.SetTitleText(this.currentMode);
        SpecialFightModeGroup specialFightModeGroup = this.currentGroup;

        if (specialFightModeGroup != SpecialFightModeGroup.Defend)
        {
            if (specialFightModeGroup != SpecialFightModeGroup.Expericence)
            {
            }
        }
        else
        {
            this.InitDifficulty(mode);
        }
        this.OnUpdateSpecialInstanceDetailUI();
    }
Ejemplo n.º 17
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.º 18
0
 protected void OnEnterDetail(SpecialFightMode mode, string anim)
 {
     if (!SystemOpenManager.IsSystemClickOpen(SpecialFightManager.GetSystemIDByMode(mode), 0, true))
     {
         return;
     }
     if (!this.DetailUI)
     {
         return;
     }
     SpecialFightManager.Instance.SelectDetailMode = mode;
     if (SpecialFightManager.GetModeCroup(mode) == SpecialFightModeGroup.Defend)
     {
         DefendFightManager.Instance.SelectDetailMode = (DefendFightMode.DFMD)mode;
     }
     this.DetailUI.SetInit(mode);
     SpecialFightManager.Instance.isInDetailPanel = false;
     this.animator.Play(anim, 0, 0f);
     this.EnabledModeList(false);
 }
Ejemplo n.º 19
0
    protected void OnUpdateDetailUI()
    {
        SpecialFightCommonTableData specialFightCommonTableData = SpecialFightManager.GetSpecialFightCommonTableData(this.currentMode);

        if (specialFightCommonTableData == null)
        {
            return;
        }
        Icon icon = DataReader <Icon> .Get(specialFightCommonTableData.picture);

        if (icon != null)
        {
            ResourceManager.SetTexture(this.InstanceRawImage, icon.icon);
        }
        for (int i = 0; i < this.DropInfoItem.get_childCount(); i++)
        {
            Object.Destroy(this.DropInfoItem.GetChild(i).get_gameObject());
        }
        for (int j = 0; j < specialFightCommonTableData.itemIDs.get_Count(); j++)
        {
            ItemShow.ShowItem(this.DropInfoItem, specialFightCommonTableData.itemIDs.get_Item(j), (long)specialFightCommonTableData.itemNums.get_Item(j), false, null, 2001);
        }
        this.DescribtionContent.set_text(GameDataUtils.GetChineseContent(specialFightCommonTableData.descID, false));
    }
Ejemplo n.º 20
0
    public bool CanShowBuyExperienceTimesInDailyTask()
    {
        SpecialFightInfo specialFightInfo = SpecialFightManager.GetSpecialFightInfo(SpecialFightMode.Expericence) as SpecialFightInfo;

        return(specialFightInfo != null && specialFightInfo.m_RestTimes <= 0);
    }
Ejemplo n.º 21
0
    public bool CanShowBuyBtnInDailyTask(SpecialFightMode mode)
    {
        DefendFightModeInfo defendFightModeInfo = SpecialFightManager.GetSpecialFightInfo(mode) as DefendFightModeInfo;

        return(defendFightModeInfo != null && defendFightModeInfo.todayCanChallengeTimes <= 0);
    }