Пример #1
0
    public static List <int> GetTalentIds(int petId, int effect)
    {
        List <int> list   = new List <int>();
        PetInfo    onePet = PetEvoGlobal.GetOnePet(petId);

        if (onePet == null || onePet.petTalents == null)
        {
            return(list);
        }
        using (List <PetTalent> .Enumerator enumerator = onePet.petTalents.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                PetTalent     current          = enumerator.get_Current();
                ChongWuTianFu chongWuTianFuRow = PetEvoGlobal.GetChongWuTianFuRow(current.talentId);
                if (chongWuTianFuRow != null)
                {
                    if (chongWuTianFuRow.effect == effect)
                    {
                        list.Add(current.talentId);
                    }
                }
            }
        }
        return(list);
    }
Пример #2
0
    public static bool IsMaxSkillLv(int talentId, int talentLv)
    {
        int    lvRuleId = PetEvoGlobal.GetChongWuTianFuRow(talentId).lvRuleId;
        int    num      = talentLv + 1;
        string rowId    = lvRuleId.ToString() + "_" + num.ToString();

        return(PetEvoGlobal.GetTianFuDengJiGuiZeRow(rowId) == null);
    }
Пример #3
0
    private void SetSkillDesc(int cellIndex, int skillId)
    {
        Transform         child                = base.get_transform().GetChild(cellIndex);
        int               skillLv              = PetEvoGlobal.GetSkillLv(PetBasicUIViewModel.PetID, skillId);
        int               num                  = skillLv + 1;
        ChongWuTianFu     chongWuTianFuRow     = PetEvoGlobal.GetChongWuTianFuRow(skillId);
        string            rowId                = chongWuTianFuRow.lvRuleId + "_" + skillLv;
        TianFuDengJiGuiZe tianFuDengJiGuiZeRow = PetEvoGlobal.GetTianFuDengJiGuiZeRow(rowId);

        if (tianFuDengJiGuiZeRow != null)
        {
            int num2 = 0;
            if (tianFuDengJiGuiZeRow.describeValue.get_Count() > 0)
            {
                num2 = (int)tianFuDengJiGuiZeRow.describeValue.get_Item(0);
            }
            if (chongWuTianFuRow.describe != 0)
            {
                string chineseContent = GameDataUtils.GetChineseContent(chongWuTianFuRow.describe, false);
                child.FindChild("texSkillDescCurr").GetComponent <Text>().set_text(string.Format(chineseContent, num2));
            }
            if (PetEvoGlobal.IsMaxSkillLv(skillId, skillLv))
            {
                child.FindChild("texSkillDescNext").GetComponent <Text>().set_text("该技能已提升到满级");
            }
            else
            {
                string            rowId2 = chongWuTianFuRow.lvRuleId + "_" + num;
                TianFuDengJiGuiZe tianFuDengJiGuiZeRow2 = PetEvoGlobal.GetTianFuDengJiGuiZeRow(rowId2);
                string            chineseContent2       = GameDataUtils.GetChineseContent(500110, false);
                int num3 = 0;
                if (tianFuDengJiGuiZeRow2.describeValue.get_Count() > 0)
                {
                    num3 = (int)tianFuDengJiGuiZeRow2.describeValue.get_Item(0);
                }
                child.FindChild("texSkillDescNext").GetComponent <Text>().set_text(string.Format(chineseContent2, num2, num3));
            }
        }
        else
        {
            rowId = chongWuTianFuRow.lvRuleId + "_" + 1;
            tianFuDengJiGuiZeRow = PetEvoGlobal.GetTianFuDengJiGuiZeRow(rowId);
            int num4 = 0;
            if (tianFuDengJiGuiZeRow != null && tianFuDengJiGuiZeRow.describeValue.get_Count() > 0)
            {
                num4 = (int)tianFuDengJiGuiZeRow.describeValue.get_Item(0);
            }
            if (chongWuTianFuRow.describe != 0)
            {
                string chineseContent3 = GameDataUtils.GetChineseContent(chongWuTianFuRow.describe, false);
                child.FindChild("texSkillDescCurr").GetComponent <Text>().set_text(string.Format(chineseContent3, num4));
            }
            child.FindChild("texSkillDescNext").GetComponent <Text>().set_text("该技能已提升到满级");
        }
    }
Пример #4
0
    public static List <PetAttribute> ManualSkill(int petId)
    {
        List <PetAttribute> list       = new List <PetAttribute>();
        List <int>          talentIds  = PetEvoGlobal.GetTalentIds(petId, 11);
        List <int>          talentIds2 = PetEvoGlobal.GetTalentIds(petId, 15);
        List <int>          talentIds3 = PetEvoGlobal.GetTalentIds(petId, 21);
        int num = -1;

        if (talentIds.get_Count() == 0)
        {
            return(list);
        }
        int num2 = 0;

        while (num2 < talentIds.get_Count() && num == -1)
        {
            ChongWuTianFu chongWuTianFuRow = PetEvoGlobal.GetChongWuTianFuRow(talentIds.get_Item(num2));
            int           skillLv          = PetEvoGlobal.GetSkillLv(petId, talentIds.get_Item(num2));
            for (int i = 0; i < talentIds3.get_Count(); i++)
            {
                ChongWuTianFu chongWuTianFuRow2 = PetEvoGlobal.GetChongWuTianFuRow(talentIds3.get_Item(i));
                if (chongWuTianFuRow2.parameter.get_Item(0) == talentIds.get_Item(num2))
                {
                    num = chongWuTianFuRow2.parameter2.get_Item(0);
                }
            }
            int num3 = 0;
            while (num3 < talentIds2.get_Count() && num == -1)
            {
                ChongWuTianFu chongWuTianFuRow3 = PetEvoGlobal.GetChongWuTianFuRow(talentIds2.get_Item(num3));
                if (chongWuTianFuRow3.parameter.get_Item(0) == talentIds.get_Item(num2))
                {
                    num = chongWuTianFuRow3.parameter2.get_Item(0);
                }
                num3++;
            }
            if (num == -1)
            {
                num = chongWuTianFuRow.parameter.get_Item(0);
            }
            list.Add(new PetAttribute
            {
                petSkillId   = num,
                petSkillLv   = skillLv,
                petSkillSlot = chongWuTianFuRow.parameter2.get_Item(1),
                roleSkillId  = chongWuTianFuRow.parameter2.get_Item(0),
                roleSkillLv  = 1
            });
            num2++;
        }
        return(list);
    }
Пример #5
0
    protected override void OnPlaySKill(GameObject go)
    {
        int           talentIdByName   = base.GetTalentIdByName(go.get_transform().get_parent().get_name());
        ChongWuTianFu chongWuTianFuRow = PetEvoGlobal.GetChongWuTianFuRow(talentIdByName);

        if (chongWuTianFuRow.parameter.get_Count() > 0)
        {
            int num = chongWuTianFuRow.parameter.get_Item(0);
            Debug.LogError("SkillId=" + num);
            this.PlayPetSKill(num);
        }
        else
        {
            Debug.LogError("技能ID不存在, row.parameter[0]");
        }
    }
Пример #6
0
    public void Init(int talentId)
    {
        int           skillLv          = PetEvoGlobal.GetSkillLv(PetBasicUIViewModel.PetID, talentId);
        int           num              = skillLv + 1;
        Text          component        = base.get_transform().FindChild("texName").GetComponent <Text>();
        Text          component2       = base.get_transform().FindChild("texLv").GetComponent <Text>();
        Text          component3       = base.get_transform().FindChild("texDesc").GetComponent <Text>();
        Text          component4       = base.get_transform().FindChild("texLvNext").GetComponent <Text>();
        Text          component5       = base.get_transform().FindChild("texDescNext").GetComponent <Text>();
        ChongWuTianFu chongWuTianFuRow = PetEvoGlobal.GetChongWuTianFuRow(talentId);
        int           describe         = chongWuTianFuRow.describe;
        string        chineseContent   = GameDataUtils.GetChineseContent(describe, false);
        string        rowId            = chongWuTianFuRow.lvRuleId + "_" + skillLv;
        List <float>  describeValue    = PetEvoGlobal.GetTianFuDengJiGuiZeRow(rowId).describeValue;

        component.set_text(PetEvoGlobal.GetName(talentId));
        component2.set_text("当前");
        if (describe != 0)
        {
            component3.set_text(this.ReplaceDesc(chineseContent, describeValue));
        }
        else
        {
            component3.set_text(string.Empty);
        }
        if (PetEvoGlobal.IsMaxSkillLv(talentId, skillLv))
        {
            component4.set_text("该技能已提升到满级");
            component5.set_text(string.Empty);
        }
        else
        {
            component4.set_text("下一级");
            string rowId2 = chongWuTianFuRow.lvRuleId + "_" + num;
            describeValue = PetEvoGlobal.GetTianFuDengJiGuiZeRow(rowId2).describeValue;
            if (describe != 0)
            {
                component5.set_text(this.ReplaceDesc(chineseContent, describeValue));
            }
            else
            {
                component5.set_text(string.Empty);
            }
        }
    }
Пример #7
0
    public static int GetMaxTalentLv(int talentId)
    {
        int lvRuleId = PetEvoGlobal.GetChongWuTianFuRow(talentId).lvRuleId;
        int num      = 0;

        using (List <TianFuDengJiGuiZe> .Enumerator enumerator = DataReader <TianFuDengJiGuiZe> .DataList.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                TianFuDengJiGuiZe current = enumerator.get_Current();
                if (current.lvRule.IndexOf(lvRuleId.ToString()) != -1)
                {
                    num++;
                }
            }
        }
        return(num);
    }
Пример #8
0
    private static List <int> GetIds(int petId, int type)
    {
        List <int> list   = new List <int>();
        Pet        petRow = PetEvoGlobal.GetPetRow(petId);
        List <int> talent = petRow.talent;

        using (List <int> .Enumerator enumerator = talent.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                int           current          = enumerator.get_Current();
                ChongWuTianFu chongWuTianFuRow = PetEvoGlobal.GetChongWuTianFuRow(current);
                if (chongWuTianFuRow.type == type)
                {
                    list.Add(current);
                }
            }
        }
        return(list);
    }
Пример #9
0
    public static TianFuDengJiGuiZe GetMaterial(int talentId, int talentLv)
    {
        string rowId = PetEvoGlobal.GetChongWuTianFuRow(talentId).lvRuleId.ToString() + "_" + talentLv.ToString();

        return(PetEvoGlobal.GetTianFuDengJiGuiZeRow(rowId));
    }
Пример #10
0
    public static string GetName(int talentId)
    {
        int name = PetEvoGlobal.GetChongWuTianFuRow(talentId).name;

        return(GameDataUtils.GetChineseContent(name, false));
    }
Пример #11
0
    public static SpriteRenderer GetSprite(int talentId)
    {
        string picture = PetEvoGlobal.GetChongWuTianFuRow(talentId).picture;

        return(ResourceManager.GetIconSprite(picture));
    }
Пример #12
0
    public static string GetDesc(int talentId)
    {
        ChongWuTianFu chongWuTianFuRow = PetEvoGlobal.GetChongWuTianFuRow(talentId);

        return(GameDataUtils.GetChineseContent(chongWuTianFuRow.describe, false));
    }
Пример #13
0
 public static int GetEffect(int talentId)
 {
     return(PetEvoGlobal.GetChongWuTianFuRow(talentId).effect);
 }
Пример #14
0
    public static List <PetAttribute> GetSkills(int petId, int effect)
    {
        List <PetAttribute> list   = new List <PetAttribute>();
        PetInfo             onePet = PetEvoGlobal.GetOnePet(petId);

        if (onePet == null || onePet.petTalents == null)
        {
            return(list);
        }
        using (List <PetTalent> .Enumerator enumerator = onePet.petTalents.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                PetTalent     current          = enumerator.get_Current();
                ChongWuTianFu chongWuTianFuRow = PetEvoGlobal.GetChongWuTianFuRow(current.talentId);
                int           skillLv          = PetEvoGlobal.GetSkillLv(petId, current.talentId);
                if (chongWuTianFuRow != null)
                {
                    if (skillLv != 0)
                    {
                        if (chongWuTianFuRow.effect == effect)
                        {
                            if (chongWuTianFuRow.effect == 10)
                            {
                                List <int> talentIds  = PetEvoGlobal.GetTalentIds(petId, 15);
                                List <int> talentIds2 = PetEvoGlobal.GetTalentIds(petId, 21);
                                int        num        = -1;
                                if (talentIds2.get_Count() > 0)
                                {
                                    num = talentIds2.get_Item(0);
                                }
                                else if (talentIds.get_Count() > 0)
                                {
                                    num = talentIds.get_Item(0);
                                }
                                if (num != -1)
                                {
                                    ChongWuTianFu chongWuTianFuRow2 = PetEvoGlobal.GetChongWuTianFuRow(num);
                                    int           num2 = chongWuTianFuRow2.parameter.get_Item(0);
                                    if (num2 == current.talentId)
                                    {
                                        for (int i = 0; i < chongWuTianFuRow2.parameter2.get_Count(); i++)
                                        {
                                            list.Add(new PetAttribute
                                            {
                                                petSkillId   = chongWuTianFuRow2.parameter2.get_Item(i),
                                                petSkillLv   = skillLv,
                                                petSkillSlot = chongWuTianFuRow.parameter2.get_Item(i)
                                            });
                                        }
                                        continue;
                                    }
                                }
                                for (int j = 0; j < chongWuTianFuRow.parameter.get_Count(); j++)
                                {
                                    list.Add(new PetAttribute
                                    {
                                        petSkillId   = chongWuTianFuRow.parameter.get_Item(j),
                                        petSkillLv   = skillLv,
                                        petSkillSlot = chongWuTianFuRow.parameter2.get_Item(j)
                                    });
                                }
                            }
                            else if (chongWuTianFuRow.effect == 12)
                            {
                                PetAttribute petAttribute = new PetAttribute
                                {
                                    templateIds = PetEvoGlobal.GetAttributeTemplateIDs(chongWuTianFuRow.parameter, skillLv)
                                };
                                list.Add(petAttribute);
                            }
                            else if (chongWuTianFuRow.effect == 13)
                            {
                                PetAttribute petAttribute2 = new PetAttribute
                                {
                                    templateIds  = chongWuTianFuRow.parameter,
                                    templateIds2 = PetEvoGlobal.GetAttributeTemplateIDs(chongWuTianFuRow.parameter2, skillLv)
                                };
                                list.Add(petAttribute2);
                            }
                            else if (chongWuTianFuRow.effect == 14)
                            {
                                PetAttribute petAttribute3 = new PetAttribute
                                {
                                    templateIds  = chongWuTianFuRow.parameter,
                                    templateIds2 = PetEvoGlobal.GetAttributeTemplateIDs(chongWuTianFuRow.parameter2, skillLv)
                                };
                                list.Add(petAttribute3);
                            }
                            else
                            {
                                Debug.LogError("!!! row.effect=" + chongWuTianFuRow.effect);
                            }
                        }
                    }
                }
            }
        }
        return(list);
    }
Пример #15
0
    private List <string> GetAttrVals(int talentId, int talentLv)
    {
        Debug.LogError(string.Concat(new object[]
        {
            "talentId=",
            talentId,
            " talentLv=",
            talentLv
        }));
        int maxTalentLv = PetEvoGlobal.GetMaxTalentLv(talentId);

        if (talentLv == 0)
        {
            List <string> list = new List <string>();
            list.Add("无");
            return(list);
        }
        if (talentLv > maxTalentLv)
        {
            List <string> list = new List <string>();
            list.Add("已达最大等级");
            return(list);
        }
        ChongWuTianFu chongWuTianFuRow = PetEvoGlobal.GetChongWuTianFuRow(talentId);

        Debug.LogError("effect=" + chongWuTianFuRow.effect);
        if (chongWuTianFuRow.effect == 12)
        {
            string attributeId         = chongWuTianFuRow.parameter.get_Item(0) + "_" + talentLv;
            int    attributeTemplateID = PetEvoGlobal.GetTianFuShuXingRow(attributeId).attributeTemplateID;
            return(PetEvoGlobal.GetAttrTexts(attributeTemplateID));
        }
        if (chongWuTianFuRow.effect == 13)
        {
            string text = chongWuTianFuRow.parameter2.get_Item(0) + "_" + talentLv;
            Debug.LogError("attributeId=" + text);
            int attributeTemplateID2 = PetEvoGlobal.GetTianFuShuXingRow(text).attributeTemplateID;
            Debug.LogError("attributeTemplateID=" + attributeTemplateID2);
            return(PetEvoGlobal.GetAttrTexts(attributeTemplateID2));
        }
        if (chongWuTianFuRow.effect == 14)
        {
            string text2 = chongWuTianFuRow.parameter2.get_Item(0) + "_" + talentLv;
            Debug.LogError("attributeId=" + text2);
            int attributeTemplateID3 = PetEvoGlobal.GetTianFuShuXingRow(text2).attributeTemplateID;
            Debug.LogError("attributeTemplateID=" + attributeTemplateID3);
            return(PetEvoGlobal.GetAttrTexts(attributeTemplateID3));
        }
        string rowId    = chongWuTianFuRow.lvRuleId + "_" + talentLv;
        int    describe = PetEvoGlobal.GetTianFuDengJiGuiZeRow(rowId).describe;

        if (describe == 0)
        {
            List <string> list = new List <string>();
            list.Add(string.Empty);
            return(list);
        }
        string chineseContent = GameDataUtils.GetChineseContent(describe, false);

        string[] array = chineseContent.Split(new char[]
        {
            '\n'
        });
        List <string> list2 = new List <string>();

        string[] array2 = array;
        for (int i = 0; i < array2.Length; i++)
        {
            string text3 = array2[i];
            list2.Add(text3);
        }
        return(list2);
    }