Beispiel #1
0
    private void OnBtnLvUp(GameObject go)
    {
        Transform parent   = go.get_transform().get_parent();
        int       num      = int.Parse(parent.get_name());
        int       talentId = this.cellIds.get_Item(num);

        this.ClickedCellIndex = num;
        int skillLv = PetEvoGlobal.GetSkillLv(PetBasicUIViewModel.PetID, talentId);
        int num2    = skillLv + 1;

        if (num2 > PetManager.Instance.GetPetLevel(PetBasicUIViewModel.PetID))
        {
            UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(400005, false));
            return;
        }
        if (PetManager.Instance.GetSkillPoint() <= 0)
        {
            PetBasicUIViewModel.Instance.OnSPBtnBuyUp();
            return;
        }
        if (!PetEvoGlobal.IsEnoughMaterail(talentId, num2))
        {
            int materialId = PetEvoGlobal.GetMaterialId(talentId, num2);
            LinkNavigationManager.ItemNotEnoughToLink(materialId, true, null, true);
            return;
        }
        PetManager.Instance.SendPetTalentTrainReq(PetBasicUIViewModel.PetUID, talentId);
    }
Beispiel #2
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("该技能已提升到满级");
        }
    }
Beispiel #3
0
    private void SetCell(int cellIndex)
    {
        Transform child        = base.get_transform().GetChild(cellIndex);
        int       talentId     = this.cellIds.get_Item(cellIndex);
        int       skillLv      = PetEvoGlobal.GetSkillLv(PetBasicUIViewModel.PetID, talentId);
        int       nextTalentLv = skillLv + 1;

        this.SetImgIcon(child, talentId);
        this.SetButtons(child);
        this.SetOneSkill(cellIndex, talentId, skillLv, nextTalentLv);
    }
Beispiel #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);
    }
Beispiel #5
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);
            }
        }
    }
Beispiel #6
0
    public static bool IsSkillsCanLvUp(int petId)
    {
        List <int> skillIds = PetEvoGlobal.GetSkillIds(petId);

        using (List <int> .Enumerator enumerator = skillIds.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                int current      = enumerator.get_Current();
                int skillLv      = PetEvoGlobal.GetSkillLv(petId, current);
                int nextTalentLv = skillLv + 1;
                if (PetEvoGlobal.IsOneSkillCanLvUp(petId, current, skillLv, nextTalentLv))
                {
                    return(true);
                }
            }
        }
        return(false);
    }
Beispiel #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);
    }
Beispiel #8
0
 public static bool IsSkillLvLessThanPetLv(int petId, int talentId)
 {
     return(PetEvoGlobal.GetSkillLv(petId, talentId) < PetEvoGlobal.GetPetLv(petId));
 }