Пример #1
0
    // Token: 0x06001729 RID: 5929 RVA: 0x0027DDF8 File Offset: 0x0027BFF8
    private byte GetPetState(byte lockStone)
    {
        PetData petData     = this.PM.GetPetData((int)this.PM.sortPetData[this.sortIndex]);
        PetTbl  recordByKey = this.PM.PetTable.GetRecordByKey(this.ID);
        bool    flag        = petData.Level == petData.GetMaxLevel(false);
        bool    flag2;

        if (petData.Enhance == 2 || petData.CheckState(PetManager.EPetState.Evolution))
        {
            flag2 = (flag = false);
        }
        else
        {
            flag2 = (DataManager.Instance.GetCurItemQuantity(this.PetStoneID, 0) >= this.PM.GetEvoNeed_Stone(petData.Enhance, recordByKey.Rare));
        }
        if (flag && flag2)
        {
            return(1);
        }
        if (!flag && flag2)
        {
            return(2);
        }
        if (lockStone == 0)
        {
            DataManager instance        = DataManager.Instance;
            ushort      propertiesValue = instance.EquipTable.GetRecordByKey(instance.EquipTable.GetRecordByKey(this.PetStoneID).SyntheticParts[1].SyntheticItem).PropertiesInfo[0].PropertiesValue;
            int         num             = 3;
            if (petData.Enhance == 0)
            {
                num = 1;
            }
            else if (petData.Enhance == 1)
            {
                num = 2;
            }
            for (int i = 0; i < num; i++)
            {
                if (propertiesValue == 0)
                {
                    break;
                }
                if (recordByKey.PetSkill[i] != 0 && petData.SkillLv[i] != 0)
                {
                    PetSkillTbl recordByKey2 = this.PM.PetSkillTable.GetRecordByKey(recordByKey.PetSkill[i]);
                    if (recordByKey2.UpLevel != petData.SkillLv[i])
                    {
                        if ((int)petData.SkillLv[i] > recordByKey2.OpenLevel.Length || recordByKey2.OpenLevel[(int)(petData.SkillLv[i] - 1)] <= petData.Level || petData.SkillExp[i] != this.GetNeedSkillExp(recordByKey2.Experience, petData.SkillLv[i]) - 1u)
                        {
                            if (instance.GetCurItemQuantity(this.PetStoneID, 0) >= this.PM.PetUI_UpNeedStoneCount)
                            {
                                return(3);
                            }
                        }
                    }
                }
            }
        }
        return(0);
    }
Пример #2
0
    // Token: 0x06001728 RID: 5928 RVA: 0x0027DD18 File Offset: 0x0027BF18
    public void UpdateState(byte lockStone)
    {
        if (!this.gameobject.activeSelf || this.cellType != _PetItem._ItemType.Pet)
        {
            return;
        }
        if (this.sortIndex >= this.PM.sortPetData.Count)
        {
            this.gameobject.SetActive(false);
            return;
        }
        PetData petData = this.PM.GetPetData((int)this.PM.sortPetData[this.sortIndex]);

        Array.Clear(this.PetNoticeShow, 0, this.PetNoticeShow.Length);
        byte petState = this.GetPetState(lockStone);

        if (petState > 0 && petState <= 3)
        {
            this.PetNoticeShow[(int)(petState - 1)] = true;
        }
        this.PetNoticeShow[3] = petData.CheckState(PetManager.EPetState.Training);
        for (int i = 0; i < 4; i++)
        {
            this.PetNotice[i].SetActive(this.PetNoticeShow[i]);
        }
    }
Пример #3
0
 // Token: 0x06001727 RID: 5927 RVA: 0x0027DA9C File Offset: 0x0027BC9C
 public void SetData(ushort ID, int Index, _PetItem._ItemType Type)
 {
     this.ID        = ID;
     this.sortIndex = Index;
     this.cellType  = Type;
     if (this.cellType == _PetItem._ItemType.Item)
     {
         if (this.DefObj != null)
         {
             this.DefObj.SetActive(false);
         }
         this.PetObj.SetActive(false);
         this.ItemObj.SetActive(true);
         GUIManager.Instance.ChangeHeroItemImg(this.ItemTrans, eHeroOrItem.Item, ID, 0, 0, 0);
         this.ItemBtn.m_BtnID2 = (int)ID;
         this.ItemBtn.m_BtnID3 = this.sortIndex;
         this.NumStr.ClearString();
         ushort num = DataManager.Instance.GetCurItemQuantity(ID, 0);
         if (num > 999)
         {
             num = 999;
         }
         this.NumStr.IntToFormat((long)num, 1, false);
         this.NumStr.AppendFormat("{0}");
         this.NumText.text = this.NumStr.ToString();
         this.NumText.SetAllDirty();
         this.NumText.cachedTextGenerator.Invalidate();
         this.NameText.text = DataManager.Instance.mStringTable.GetStringByID((uint)DataManager.Instance.EquipTable.GetRecordByKey(ID).EquipName);
     }
     else if (this.cellType == _PetItem._ItemType.Pet)
     {
         if (this.DefObj != null)
         {
             this.DefObj.SetActive(false);
         }
         this.PetObj.SetActive(true);
         this.ItemObj.SetActive(false);
         this.PetBtn.m_BtnID2 = (int)ID;
         this.PetBtn.m_BtnID3 = this.sortIndex;
         PetData petData     = this.PM.GetPetData((int)this.PM.sortPetData[this.sortIndex]);
         PetTbl  recordByKey = this.PM.PetTable.GetRecordByKey(ID);
         GUIManager.Instance.ChangeHeroItemImg(this.PetTrans, eHeroOrItem.Pet, petData.ID, petData.Enhance, petData.Rare, (int)petData.Level);
         this.NameText.text = DataManager.Instance.mStringTable.GetStringByID((uint)recordByKey.Name);
         this.PetStoneID    = recordByKey.SoulID;
         this.NewObj.SetActive(petData.CheckState(PetManager.EPetState.NewPet));
     }
     else if (this.DefObj != null)
     {
         this.DefObj.SetActive(true);
         this.PetObj.SetActive(false);
         this.ItemObj.SetActive(false);
     }
 }