コード例 #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 int GetPetQuality(int petId)
    {
        PetInfo onePet = PetEvoGlobal.GetOnePet(petId);

        if (onePet != null)
        {
            return(onePet.quality);
        }
        return(0);
    }
コード例 #3
0
    public static int GetPetStar(int petId)
    {
        PetInfo onePet = PetEvoGlobal.GetOnePet(petId);

        if (onePet != null)
        {
            return(onePet.star);
        }
        return(0);
    }
コード例 #4
0
ファイル: PetEvo.cs プロジェクト: unseen-code/tianqi_src
    private void SetButtons(Transform cell)
    {
        ButtonCustom component = cell.FindChild("btnLvUp").GetComponent <ButtonCustom>();
        PetInfo      onePet    = PetEvoGlobal.GetOnePet(PetBasicUIViewModel.PetID);

        if (onePet != null)
        {
            if (component.onClickCustom == null)
            {
                component.onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnBtnLvUp);
            }
        }
        else
        {
            component.set_interactable(false);
            ImageColorMgr.SetImageColor(component.GetComponent <Image>(), true);
        }
    }
コード例 #5
0
    public static int GetSkillLv(int petId, int talentId)
    {
        PetInfo onePet = PetEvoGlobal.GetOnePet(petId);

        if (onePet == null || onePet.petTalents == null)
        {
            return(1);
        }
        using (List <PetTalent> .Enumerator enumerator = onePet.petTalents.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                PetTalent current = enumerator.get_Current();
                if (current.talentId == talentId)
                {
                    return(current.talentLv);
                }
            }
        }
        return(1);
    }
コード例 #6
0
    protected override void SetOneSkill(int cellIndex, int talentId, int talentLv, int nextTalentLv)
    {
        Transform child = base.get_transform().GetChild(cellIndex);

        child.FindChild("texName").GetComponent <Text>().set_text(PetEvoGlobal.GetName(talentId));
        child.FindChild("texLv").GetComponent <Text>().set_text("Lv" + talentLv);
        if (PetEvoGlobal.GetOnePet(PetBasicUIViewModel.PetID) == null)
        {
            base.Locked(child, talentId);
        }
        else if (PetEvoGlobal.IsMaxSkillLv(talentId, talentLv))
        {
            base.MaxLv(child);
        }
        else if (PetEvoGlobal.IsSkillCanLvUp(PetBasicUIViewModel.PetID, talentId, nextTalentLv))
        {
            base.CanLvUp(child, talentId, nextTalentLv);
        }
        else
        {
            base.CanNotLvUp(child, talentId, nextTalentLv);
        }
        this.SetSkillDesc(cellIndex, talentId);
    }
コード例 #7
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);
    }
コード例 #8
0
    public static int GetPetLv(int petId)
    {
        PetInfo onePet = PetEvoGlobal.GetOnePet(petId);

        return((onePet == null) ? 0 : onePet.lv);
    }