コード例 #1
0
ファイル: GemGlobal.cs プロジェクト: unseen-code/tianqi_src
    public static int GetSlotUnlockRequireBatchLv(EquipLibType.ELT pos, int slotNum)
    {
        BaoShiKongPeiZhi baoShiKongPeiZhi = DataReader <BaoShiKongPeiZhi> .DataList.Find((BaoShiKongPeiZhi a) => a.position == (int)pos && a.slotOpen == slotNum);

        if (baoShiKongPeiZhi != null)
        {
            return(baoShiKongPeiZhi.openingCondition);
        }
        return(-1);
    }
コード例 #2
0
ファイル: GemGlobal.cs プロジェクト: unseen-code/tianqi_src
    public static SpriteRenderer GetGemItemFrameSprite(EquipLibType.ELT pos, int slotIndex)
    {
        BaoShiKongPeiZhi baoShiKongPeiZhi = DataReader <BaoShiKongPeiZhi> .DataList.Find((BaoShiKongPeiZhi a) => a.position == (int)pos && a.slotOpen == slotIndex);

        if (baoShiKongPeiZhi != null && baoShiKongPeiZhi.gemType.get_Count() > 0)
        {
            int color = baoShiKongPeiZhi.gemType.get_Item(0);
            return(GemGlobal.GetGemItemFrameByColor(color));
        }
        return(ResourceManagerBase.GetNullSprite());
    }
コード例 #3
0
ファイル: GemGlobal.cs プロジェクト: unseen-code/tianqi_src
    public static bool IsCanWearGem(int equipNum, int slotNum, int currTypeId = 0)
    {
        List <Goods> runeGoods = BackpackManager.Instance.RuneGoods;

        if (runeGoods.get_Count() <= 0)
        {
            return(false);
        }
        for (int i = 0; i < runeGoods.get_Count(); i++)
        {
            int           itemId     = runeGoods.get_Item(i).GetItemId();
            BaoShiShengJi gemItemCfg = DataReader <BaoShiShengJi> .Get(itemId);

            if (gemItemCfg != null)
            {
                if (GemManager.Instance.equipSlots.GetLength(0) >= equipNum)
                {
                    if (GemManager.Instance.equipSlots.GetLength(1) > slotNum)
                    {
                        GemEmbedInfo gemEmbedInfo = GemManager.Instance.equipSlots[equipNum - 1, slotNum];
                        if (gemEmbedInfo != null)
                        {
                            BaoShiKongPeiZhi baoShiKongPeiZhi = DataReader <BaoShiKongPeiZhi> .DataList.Find((BaoShiKongPeiZhi a) => a.position == equipNum && a.slotOpen == slotNum + 1);

                            if (baoShiKongPeiZhi != null)
                            {
                                if (baoShiKongPeiZhi.gemType.Find((int e) => e == gemItemCfg.type) > 0)
                                {
                                    if (gemEmbedInfo.typeId <= 0)
                                    {
                                        return(true);
                                    }
                                    BaoShiShengJi baoShiShengJi = DataReader <BaoShiShengJi> .Get(gemEmbedInfo.typeId);

                                    if (baoShiShengJi != null)
                                    {
                                        if (baoShiShengJi.type == gemItemCfg.type && baoShiShengJi.id < gemItemCfg.id)
                                        {
                                            return(true);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return(false);
    }
コード例 #4
0
ファイル: GemGlobal.cs プロジェクト: unseen-code/tianqi_src
    public static bool CheckCanShowTip(int pos)
    {
        List <Goods> runeGoods = BackpackManager.Instance.RuneGoods;

        if (runeGoods == null)
        {
            return(false);
        }
        if (runeGoods.get_Count() <= 0)
        {
            return(false);
        }
        for (int i = 0; i < runeGoods.get_Count(); i++)
        {
            int           itemId     = runeGoods.get_Item(i).GetItemId();
            BaoShiShengJi gemItemCfg = DataReader <BaoShiShengJi> .Get(itemId);

            if (gemItemCfg != null)
            {
                int j;
                for (j = 0; j < 4; j++)
                {
                    GemEmbedInfo gemEmbedInfo = GemManager.Instance.equipSlots[pos - 1, j];
                    if (gemEmbedInfo != null)
                    {
                        BaoShiKongPeiZhi baoShiKongPeiZhi = DataReader <BaoShiKongPeiZhi> .DataList.Find((BaoShiKongPeiZhi a) => a.position == pos && a.slotOpen == j + 1);

                        if (baoShiKongPeiZhi != null)
                        {
                            if (baoShiKongPeiZhi.gemType.Find((int e) => e == gemItemCfg.type) > 0)
                            {
                                if (gemEmbedInfo.typeId <= 0)
                                {
                                    return(true);
                                }
                            }
                        }
                    }
                }
            }
        }
        return(false);
    }
コード例 #5
0
ファイル: GemGlobal.cs プロジェクト: unseen-code/tianqi_src
    public static List <int> GetOneLevelGemIds(EquipLibType.ELT equipNum, int slotNum)
    {
        List <int> list           = new List <int>();
        List <int> list2          = new List <int>();
        List <int> oneLevelGemIds = GemGlobal.GetOneLevelGemIds();

        using (List <int> .Enumerator enumerator = oneLevelGemIds.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                int           current           = enumerator.get_Current();
                BaoShiShengJi BaoShiShengJiInfo = DataReader <BaoShiShengJi> .Get(current);

                BaoShiKongPeiZhi baoShiKongPeiZhi = DataReader <BaoShiKongPeiZhi> .DataList.Find((BaoShiKongPeiZhi a) => a.position == (int)equipNum && a.slotOpen == slotNum);

                if (baoShiKongPeiZhi != null && baoShiKongPeiZhi.gemType.Find((int e) => e == BaoShiShengJiInfo.type) > 0)
                {
                    list.Add(BaoShiShengJiInfo.id);
                }
            }
        }
        return(list);
    }