Пример #1
0
    private void InitTastePanel()
    {
        List <vipTiYanQia> dataList    = DataReader <vipTiYanQia> .DataList;
        vipTiYanQia        vipTiYanQia = dataList.get_Item(0);

        if (dataList == null)
        {
            return;
        }
        List <int> effect = vipTiYanQia.effect;
        string     empty  = string.Empty;
        int        num    = -1;

        this.ClearScroll();
        for (int i = 0; i < effect.get_Count(); i++)
        {
            int        key        = effect.get_Item(i);
            VipXiaoGuo vipXiaoGuo = DataReader <VipXiaoGuo> .Get(key);

            if (vipXiaoGuo != null)
            {
                string chineseContent = GameDataUtils.GetChineseContent(vipXiaoGuo.name, true);
                if (!string.IsNullOrEmpty(chineseContent))
                {
                    num++;
                    this.UpdateCardItemInfo(num, chineseContent);
                }
            }
        }
    }
Пример #2
0
    private VipXiaoGuo CheckOwnEffect(int type, int vipLevel)
    {
        if (EntityWorld.Instance.EntSelf == null)
        {
            return(null);
        }
        VipXiaoGuo result = null;

        if (VIPManager.Instance.LimitCardData.Times > TimeManager.Instance.PreciseServerSecond)
        {
            result = this.GetVipEffect(type, vipLevel);
        }
        if (VipTasteCardManager.Instance.CardTime > TimeManager.Instance.PreciseServerSecond)
        {
            List <vipTiYanQia> dataList = DataReader <vipTiYanQia> .DataList;
            if (dataList == null || dataList.get_Count() == 0)
            {
                return(result);
            }
            vipTiYanQia vipTiYanQia = dataList.get_Item(0);
            List <int>  effect      = vipTiYanQia.effect;
            for (int i = 0; i < effect.get_Count(); i++)
            {
                VipXiaoGuo vipXiaoGuo = DataReader <VipXiaoGuo> .Get(effect.get_Item(i));

                if (vipXiaoGuo != null && vipXiaoGuo.type == type)
                {
                    result = vipXiaoGuo;
                }
            }
        }
        return(result);
    }
Пример #3
0
    public VipXiaoGuo GetVipEffect(int type, int vipLevel)
    {
        int        num    = 0;
        VipXiaoGuo result = null;

        for (int i = vipLevel; i >= 0; i--)
        {
            VipDengJi vipDengJi = DataReader <VipDengJi> .Get(i);

            if (vipDengJi != null)
            {
                List <int> effect = vipDengJi.effect;
                for (int j = 0; j < effect.get_Count(); j++)
                {
                    VipXiaoGuo vipXiaoGuo = DataReader <VipXiaoGuo> .Get(effect.get_Item(j));

                    if (vipXiaoGuo != null && vipXiaoGuo.type == type)
                    {
                        if (num < i)
                        {
                            result = vipXiaoGuo;
                            num    = i;
                        }
                        break;
                    }
                }
            }
        }
        return(result);
    }
Пример #4
0
    public void OpenTreasure(int vipLevel, VipXiaoGuo dataVIPEffect)
    {
        if (!TreasureUIViewModel.IsTreasureValid(vipLevel, dataVIPEffect))
        {
            TreasureUIView.Instance.Show(false);
            return;
        }
        UIManagerControl.Instance.OpenUI("TreasureUI", UINodesManager.NormalUIRoot, false, UIType.NonPush);
        this.ObatinItems.Clear();
        this.SpecialItemText = string.Empty;
        this.VIPEffect       = dataVIPEffect;
        this.VIPLevel10      = GameDataUtils.GetNumIcon10(vipLevel, NumType.Yellow_light);
        this.VIPLevel1       = GameDataUtils.GetNumIcon1(vipLevel, NumType.Yellow_light);
        this.BtnOKText       = GameDataUtils.GetChineseContent(508009, false);
        if (dataVIPEffect.value2 > 0 && dataVIPEffect.value3 > 0)
        {
            this.ConsumeOn   = true;
            this.ConsumeIcon = GameDataUtils.GetItemIcon(dataVIPEffect.value2);
            this.ConsumeNum  = dataVIPEffect.value3.ToString();
        }
        else
        {
            this.ConsumeOn = false;
        }
        string text = string.Empty;
        List <VipBoxItemInfo> vIPBox = VIPManager.Instance.GetVIPBox(dataVIPEffect.effect);

        if (vIPBox != null)
        {
            for (int i = 0; i < vIPBox.get_Count(); i++)
            {
                VipBoxItemInfo vipBoxItemInfo = vIPBox.get_Item(i);
                if (SpecialItem.IsSpecial(vipBoxItemInfo.itemId))
                {
                    string colorByID = TextColorMgr.GetColorByID("x" + vipBoxItemInfo.itemCount, 405);
                    if (string.IsNullOrEmpty(text))
                    {
                        text = GameDataUtils.GetItemName(vipBoxItemInfo.itemId, true, 0L) + colorByID;
                    }
                    else
                    {
                        text = text + ", " + GameDataUtils.GetItemName(vipBoxItemInfo.itemId, true, 0L) + colorByID;
                    }
                }
                else
                {
                    OOItem2Draw oOItem2Draw = new OOItem2Draw();
                    oOItem2Draw.ID       = vipBoxItemInfo.itemId;
                    oOItem2Draw.ItemIcon = GameDataUtils.GetItemIcon(vipBoxItemInfo.itemId);
                    oOItem2Draw.ItemName = Utils.GetItemNum(vipBoxItemInfo.itemId, (long)vipBoxItemInfo.itemCount);
                    this.ObatinItems.Add(oOItem2Draw);
                }
            }
        }
        this.SpecialItemText = text;
    }
Пример #5
0
    public int Effect2TreasureID(int effectId)
    {
        int        result     = 0;
        VipXiaoGuo vipXiaoGuo = DataReader <VipXiaoGuo> .Get(effectId);

        if (vipXiaoGuo != null && vipXiaoGuo.type == 99)
        {
            result = vipXiaoGuo.value1;
        }
        return(result);
    }
Пример #6
0
    public bool IsOpenSweepSeries()
    {
        bool result = false;

        if (EntityWorld.Instance.EntSelf != null)
        {
            VipXiaoGuo vipXiaoGuo = this.CheckOwnEffect(101, EntityWorld.Instance.EntSelf.VipLv);
            if (vipXiaoGuo != null)
            {
                result = true;
            }
        }
        return(result);
    }
Пример #7
0
    public int GetVipTimesByType(int type)
    {
        int result = 0;

        if (EntityWorld.Instance.EntSelf != null)
        {
            VipXiaoGuo vipXiaoGuo = this.CheckOwnEffect(type, EntityWorld.Instance.EntSelf.VipLv);
            if (vipXiaoGuo != null)
            {
                result = vipXiaoGuo.value1;
            }
        }
        return(result);
    }
Пример #8
0
    public int GetMaxVipTimesByType(int type)
    {
        int result = 0;

        if (EntityWorld.Instance.EntSelf != null)
        {
            VipXiaoGuo vipEffect = this.GetVipEffect(type, VIPManager.Instance.MaxVipLevel);
            if (vipEffect != null)
            {
                result = vipEffect.value1;
            }
        }
        return(result);
    }
Пример #9
0
    private void InitExpirePanel(bool isMyOwnVip = false)
    {
        List <int> list = null;

        if (isMyOwnVip)
        {
            VipDengJi vipDengJi = DataReader <VipDengJi> .Get(EntityWorld.Instance.EntSelf.VipLv);

            if (vipDengJi != null)
            {
                list = vipDengJi.effect;
            }
        }
        else
        {
            List <vipTiYanQia> dataList    = DataReader <vipTiYanQia> .DataList;
            vipTiYanQia        vipTiYanQia = dataList.get_Item(0);
            if (dataList != null)
            {
                list = vipTiYanQia.effect;
            }
        }
        string empty = string.Empty;
        int    num   = -1;

        this.ClearExpireScroll();
        for (int i = 0; i < list.get_Count(); i++)
        {
            int        key        = list.get_Item(i);
            VipXiaoGuo vipXiaoGuo = DataReader <VipXiaoGuo> .Get(key);

            if (vipXiaoGuo != null)
            {
                string chineseContent = GameDataUtils.GetChineseContent(vipXiaoGuo.name, true);
                if (!string.IsNullOrEmpty(chineseContent))
                {
                    num++;
                    this.UpdateExpireCardItemInfo(num, chineseContent);
                }
            }
        }
    }
Пример #10
0
    private int GetGoldTime(bool isFree = false)
    {
        int result = 0;

        if (VIPManager.Instance.LimitCardData.Times > TimeManager.Instance.PreciseServerSecond && EntityWorld.Instance.EntSelf != null)
        {
            VipDengJi vipDengJi = DataReader <VipDengJi> .Get(EntityWorld.Instance.EntSelf.VipLv);

            if (vipDengJi != null && vipDengJi.effect.get_Count() > 1)
            {
                VipXiaoGuo vipXiaoGuo = DataReader <VipXiaoGuo> .Get(vipDengJi.effect.get_Item((!isFree) ? 4 : 5));

                if (vipXiaoGuo != null)
                {
                    result = vipXiaoGuo.value1;
                }
            }
        }
        return(result);
    }
Пример #11
0
    private void RefreshRingTaskTime()
    {
        int num = 0;

        if (VIPManager.Instance.LimitCardData.Times > TimeManager.Instance.UnscaleServerSecond && EntityWorld.Instance.EntSelf != null)
        {
            VipDengJi vipDengJi = DataReader <VipDengJi> .Get(EntityWorld.Instance.EntSelf.VipLv);

            if (vipDengJi != null && vipDengJi.effect.get_Count() > 1)
            {
                VipXiaoGuo vipXiaoGuo = DataReader <VipXiaoGuo> .Get(vipDengJi.effect.get_Item(1));

                if (vipXiaoGuo != null)
                {
                    num = vipXiaoGuo.value1;
                }
            }
        }
        MainTaskManager.Instance.RingMaxTimes  = (int)float.Parse(DataReader <PaoHuanRenWuPeiZhi> .Get("challengeNum").value) + num;
        MainTaskManager.Instance.Ring2MaxTimes = (int)float.Parse(DataReader <PaoHuanRenWuPeiZhi> .Get("challengeNum2").value);
    }
Пример #12
0
    public VipXiaoGuo VIP2FirstObtainTreasure(int vipLevel)
    {
        VipDengJi vipDengJi = DataReader <VipDengJi> .Get(vipLevel);

        if (vipDengJi == null)
        {
            return(null);
        }
        List <int> effect = vipDengJi.effect;

        for (int i = 0; i < effect.get_Count(); i++)
        {
            VipXiaoGuo vipXiaoGuo = DataReader <VipXiaoGuo> .Get(effect.get_Item(i));

            if (vipXiaoGuo != null && vipXiaoGuo.type == 99)
            {
                return(vipXiaoGuo);
            }
        }
        return(null);
    }
Пример #13
0
    public void SetTreasure(int vipLevel, VipXiaoGuo dataVIPEffect)
    {
        this.ObatinItems.Clear();
        this.ObatinSpecialItems.Clear();
        List <VipBoxItemInfo> vIPBox = VIPManager.Instance.GetVIPBox(dataVIPEffect.effect);

        if (vIPBox != null)
        {
            for (int i = 0; i < vIPBox.get_Count(); i++)
            {
                VipBoxItemInfo vipBoxItemInfo = vIPBox.get_Item(i);
                OOItem2Draw    oOItem2Draw    = new OOItem2Draw();
                oOItem2Draw.BgShow    = true;
                oOItem2Draw.ID        = vipBoxItemInfo.itemId;
                oOItem2Draw.FrameIcon = GameDataUtils.GetItemFrame(vipBoxItemInfo.itemId);
                oOItem2Draw.ItemIcon  = GameDataUtils.GetItemIcon(vipBoxItemInfo.itemId);
                oOItem2Draw.ItemName  = Utils.GetItemNum(vipBoxItemInfo.itemId, (long)vipBoxItemInfo.itemCount);
                this.ObatinItems.Add(oOItem2Draw);
            }
        }
    }
Пример #14
0
    public bool GetCanShowTips()
    {
        if (EntityWorld.Instance.EntSelf == null)
        {
            return(false);
        }
        bool result = false;

        for (int i = EntityWorld.Instance.EntSelf.VipLv; i > 0; i--)
        {
            VipXiaoGuo vipXiaoGuo = VIPPrivilegeManager.Instance.VIP2FirstObtainTreasure(i);
            if (vipXiaoGuo != null && !TreasureUIViewModel.IsTreasureObtain(i, vipXiaoGuo))
            {
                bool flag = TreasureUIViewModel.IsTreasureValid(i, vipXiaoGuo);
                if (flag)
                {
                    return(true);
                }
            }
        }
        return(result);
    }
Пример #15
0
    public static bool IsTreasureValid(int vipLevel, VipXiaoGuo dataVIPEffect)
    {
        VipEffectInfo vipEffectInfo = VIPManager.Instance.GetVipEffectInfo(vipLevel, dataVIPEffect.effect);

        if (vipEffectInfo != null && vipEffectInfo.opened && !vipEffectInfo.boxOpened)
        {
            return(true);
        }
        if (vipEffectInfo != null && !vipEffectInfo.opened)
        {
            return(false);
        }
        if (vipEffectInfo != null && vipEffectInfo.boxOpened)
        {
            UIManagerControl.Instance.ShowToastText("宝箱已开启");
        }
        else if (vipEffectInfo != null && !vipEffectInfo.opened)
        {
            UIManagerControl.Instance.ShowToastText("VIP等级不足");
        }
        return(false);
    }
Пример #16
0
    public int GetPrizeTimes()
    {
        if (EntityWorld.Instance.EntSelf == null)
        {
            return(0);
        }
        int key = EntityWorld.Instance.EntSelf.VipLv;

        if (!VIPManager.Instance.IsVIPPrivilegeOn())
        {
            key = 0;
        }
        int        num  = 0;
        List <int> date = DataReader <JJingYingFuBenPeiZhi> .Get("prizeTimes").date;

        if (date != null)
        {
            num = date.get_Item(0);
        }
        VipDengJi vipDengJi = DataReader <VipDengJi> .Get(key);

        if (vipDengJi != null)
        {
            for (int i = 0; i < vipDengJi.effect.get_Count(); i++)
            {
                VipXiaoGuo vipXiaoGuo = DataReader <VipXiaoGuo> .Get(vipDengJi.effect.get_Item(i));

                if (vipXiaoGuo != null)
                {
                    if (vipXiaoGuo.type == 17)
                    {
                        num += vipXiaoGuo.value1;
                    }
                }
            }
        }
        return(num);
    }
Пример #17
0
    public static bool IsTreasureObtain(int vipLevel, VipXiaoGuo dataVIPEffect)
    {
        VipEffectInfo vipEffectInfo = VIPManager.Instance.GetVipEffectInfo(vipLevel, dataVIPEffect.effect);

        return((vipEffectInfo == null || !vipEffectInfo.opened || vipEffectInfo.boxOpened) && vipEffectInfo != null && vipEffectInfo.boxOpened);
    }