Пример #1
0
    // Token: 0x06002846 RID: 10310 RVA: 0x00446118 File Offset: 0x00444318
    public void UpdateLevelState()
    {
        PetManager instance    = PetManager.Instance;
        PetTbl     recordByKey = instance.PetTable.GetRecordByKey(this.ID);
        bool       flag        = true;

        for (int i = 0; i < 4; i++)
        {
            if (recordByKey.PetSkill[i] != 0)
            {
                PetSkillTbl recordByKey2 = instance.PetSkillTable.GetRecordByKey(recordByKey.PetSkill[i]);
                if (recordByKey2.UpLevel != 0 && this.SkillLv[i] < recordByKey2.UpLevel)
                {
                    flag = false;
                }
            }
        }
        if (flag && this.Level == 60)
        {
            this.AddState(PetManager.EPetState.Limit);
        }
        else
        {
            this.Remove(PetManager.EPetState.Limit);
            uint needExp = instance.GetNeedExp(this.Level, recordByKey.Rare);
            if (this.Level >= this.GetMaxLevel(false) && this.Level != 60 && this.Exp >= needExp - 1u)
            {
                this.AddState(PetManager.EPetState.LockLimit);
            }
            else
            {
                this.Remove(PetManager.EPetState.LockLimit);
            }
        }
    }
Пример #2
0
    // Token: 0x0600171C RID: 5916 RVA: 0x0027C960 File Offset: 0x0027AB60
    public void SetEffectExpText(byte lv)
    {
        PetManager instance = PetManager.Instance;
        PetData    petData  = instance.FindPetData(this.m_PetID);

        if (petData == null)
        {
            return;
        }
        PetTbl    recordByKey  = instance.PetTable.GetRecordByKey(petData.ID);
        PetExpTbl recordByKey2 = instance.PetExpTable.GetRecordByKey((ushort)lv);
        uint      num;

        if (this.m_UIType == UIPetLevelUp.EUIType.PetLvUp)
        {
            num = instance.GetNeedExp(lv, recordByKey.Rare);
        }
        else
        {
            num = instance.GetPetSkillMaxExp(this.m_PetID, this.m_Skillidx);
        }
        if (this.m_EffectTextLV != null && this.m_EffectTextExp != null)
        {
            this.m_Str[4].ClearString();
            if (lv == instance.m_PetBeginLv)
            {
                this.m_Str[4].IntToFormat((long)((ulong)(num - instance.m_BeginExp)), 1, false);
            }
            else if (lv == instance.m_PetEndLv)
            {
                this.m_Str[4].IntToFormat((long)((ulong)instance.m_EndExp), 1, false);
            }
            else
            {
                this.m_Str[4].IntToFormat((long)((ulong)num), 1, false);
            }
            this.m_Str[4].AppendFormat(DataManager.Instance.mStringTable.GetStringByID(55u));
            this.m_EffectTextExp.text = this.m_Str[4].ToString();
            this.m_EffectTextExp.SetAllDirty();
            this.m_EffectTextExp.cachedTextGenerator.Invalidate();
        }
    }