Exemplo n.º 1
0
 // Token: 0x0600171A RID: 5914 RVA: 0x0027C7D0 File Offset: 0x0027A9D0
 public void SetLvText()
 {
     if (this.m_UIType == UIPetLevelUp.EUIType.PetLvUp)
     {
         if (this.m_PetLv != null)
         {
             this.m_Str[0].ClearString();
             this.m_Str[0].IntToFormat((long)this.m_BeginLv, 1, false);
             this.m_Str[0].AppendFormat("Lv.{0}");
             this.m_PetLv.text = this.m_Str[0].ToString();
             this.m_PetLv.SetAllDirty();
             this.m_PetLv.cachedTextGenerator.Invalidate();
         }
     }
     else if (this.m_SkillName != null)
     {
         PetSkillTbl recordByKey = PetManager.Instance.PetSkillTable.GetRecordByKey(this.m_PetSkillID);
         this.m_Str[2].ClearString();
         this.m_Str[2].IntToFormat((long)this.m_BeginLv, 1, false);
         this.m_Str[2].StringToFormat(DataManager.Instance.mStringTable.GetStringByID((uint)recordByKey.Name));
         this.m_Str[2].AppendFormat(DataManager.Instance.mStringTable.GetStringByID(268u));
         this.m_SkillName.text = this.m_Str[2].ToString();
         this.m_SkillName.SetAllDirty();
         this.m_SkillName.cachedTextGenerator.Invalidate();
     }
 }
Exemplo n.º 2
0
    // Token: 0x060016A8 RID: 5800 RVA: 0x002718FC File Offset: 0x0026FAFC
    public void UpDateRowItem(GameObject item, int dataIdx, int panelObjectIdx, int panelId)
    {
        if (dataIdx < 0 || dataIdx >= PetBuff.PetSkills.Count || panelObjectIdx >= this.m_panel.Length)
        {
            return;
        }
        if (!this.m_panel[panelObjectIdx].Init)
        {
            this.m_panel[panelObjectIdx].Init = true;
            this.m_panel[panelObjectIdx].Item = item;
            item.transform.GetChild(9).GetChild(2).gameObject.GetComponent <UIButton>().m_Handler = this;
            if (UIPetSkill.nowSkillId == 0)
            {
            }
        }
        this.m_panel[panelObjectIdx].ID = dataIdx;
        item.transform.GetChild(8).gameObject.SetActive(false);
        item.transform.GetChild(9).gameObject.SetActive(true);
        item.transform.GetChild(9).GetChild(2).gameObject.GetComponent <UIButton>().m_BtnID2 = dataIdx + 1;
        item.transform.GetChild(9).GetChild(2).GetChild(2).gameObject.SetActive(this.currentBtnID > 0 && this.currentBtnID <= PetBuff.PetSkills.Count && this.currentBtnID == dataIdx);
        this.SetPanelItem(panelObjectIdx, true);
        this.m_CrownBack = item.transform.GetChild(9).GetChild(2).gameObject.GetComponent <Image>();
        PetSkillTbl recordByKey = PetManager.Instance.PetSkillTable.GetRecordByKey((ushort)PetBuff.PetSkills[dataIdx].ID);
        CString     cstring     = StringManager.Instance.StaticString1024();

        cstring.IntToFormat((long)recordByKey.Icon, 5, false);
        cstring.AppendFormat("s{0}");
        this.m_Defeater           = this.m_CrownBack.transform.GetChild(0).GetComponent <Image>();
        this.m_Defeater.sprite    = this.GM.LoadFrameSprite("sk");
        this.m_Defeater.material  = this.GM.GetFrameMaterial();
        this.m_CrownBack.sprite   = this.GM.LoadSkillSprite(cstring);
        this.m_CrownBack.material = this.GM.GetSkillMaterial();
    }
Exemplo n.º 3
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);
            }
        }
    }
Exemplo n.º 4
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);
    }
Exemplo n.º 5
0
 // Token: 0x060016BD RID: 5821 RVA: 0x0027315C File Offset: 0x0027135C
 public void OnButtonClick(UIButton sender)
 {
     if (sender.m_BtnID1 > 0)
     {
         this.UpdateUI(11, 1);
         return;
     }
     if (sender.m_BtnID2 > 0 && sender.m_BtnID2 <= PetBuff.PetSkills.Count)
     {
         this.currentBtnID     = sender.m_BtnID2;
         UIPetSkill.nowPetId   = PetBuff.PetSkills[sender.m_BtnID2 - 1].Pet;
         UIPetSkill.nowSkillId = (ushort)PetBuff.PetSkills[sender.m_BtnID2 - 1].ID;
         PetSkillTbl recordByKey = PetManager.Instance.PetSkillTable.GetRecordByKey((ushort)PetBuff.PetSkills[sender.m_BtnID2 - 1].ID);
         this.onSelect(PetManager.Instance.MapDamageEffTable.GetRecordByKey(recordByKey.DamageRange).RangeTbID);
         this.m_CrownBack = base.transform.GetChild(1).GetChild(26).GetChild(3).gameObject.GetComponent <Image>();
         CString cstring = StringManager.Instance.StaticString1024();
         cstring.IntToFormat((long)recordByKey.Icon, 5, false);
         cstring.AppendFormat("s{0}");
         this.m_Defeater           = this.m_CrownBack.transform.GetChild(0).GetComponent <Image>();
         this.m_Defeater.sprite    = this.GM.LoadFrameSprite("sk");
         this.m_Defeater.material  = this.GM.GetFrameMaterial();
         this.m_CrownBack.sprite   = this.GM.LoadSkillSprite(cstring);
         this.m_CrownBack.material = this.GM.GetSkillMaterial();
         this.UpdateUI(5, 0);
         return;
     }
     if (sender.m_BtnID3 > 0)
     {
         this.SkillInfo.ClearString();
         this.SkillInfo.Append(this.DM.mStringTable.GetStringByID(12585u));
         this.SkillInfo.Append("\n");
         this.SkillInfo.Append(this.DM.mStringTable.GetStringByID(12586u));
         this.SkillInfo.Append("\n");
         this.SkillInfo.Append(this.DM.mStringTable.GetStringByID(12591u));
         this.SkillInfo.Append("\n");
         this.SkillInfo.Append(this.DM.mStringTable.GetStringByID(12583u));
         this.GM.OpenMessageBoxEX(this.DM.mStringTable.GetStringByID(12562u), this.SkillInfo.ToString(), null, null, 0, 0, true, true);
         return;
     }
     this.UpdateUI(0, 0);
 }
Exemplo n.º 6
0
 // Token: 0x060016A5 RID: 5797 RVA: 0x00271288 File Offset: 0x0026F488
 private void RefreshSkill()
 {
     PetBuff.PetSkills.Clear();
     for (int i = 0; i < PetBuff.PetSkillList.Length; i++)
     {
         if (PetBuff.PetSkillList[i] == null)
         {
             PetBuff.PetSkillList[i] = new List <PetBuff.PetSkillData>();
         }
         else
         {
             PetBuff.PetSkillList[i].Clear();
         }
     }
     for (int j = 0; j < (int)PetManager.Instance.PetDataCount; j++)
     {
         PetData petData = PetManager.Instance.GetPetData((int)((byte)j));
         if (petData != null)
         {
             PetTbl recordByKey = PetManager.Instance.PetTable.GetRecordByKey(petData.ID);
             byte   b           = 0;
             while (recordByKey.PetSkill != null && (int)b < recordByKey.PetSkill.Length)
             {
                 if (recordByKey.PetSkill[(int)b] > 0 && petData.SkillLv != null && (int)b < petData.SkillLv.Length && petData.SkillLv[(int)b] > 0)
                 {
                     PetSkillTbl recordByKey2 = PetManager.Instance.PetSkillTable.GetRecordByKey(recordByKey.PetSkill[(int)b]);
                     if (recordByKey2.Type > 0 && recordByKey2.Subject == 1 && recordByKey2.Class >= 1 && (int)recordByKey2.Class <= PetBuff.PetSkillList.Length)
                     {
                         PetBuff.PetSkillList[(int)(recordByKey2.Class - 1)].Add(new PetBuff.PetSkillData((uint)recordByKey.PetSkill[(int)b], b, recordByKey2.Subject, petData.ID));
                     }
                 }
                 b += 1;
             }
         }
     }
 }
Exemplo n.º 7
0
 // Token: 0x060016B5 RID: 5813 RVA: 0x00271EA4 File Offset: 0x002700A4
 public override void UpdateUI(int arg1, int arg2)
 {
     if (arg1 == 5)
     {
         if (this.currentBtnID > 0 && this.currentBtnID <= PetBuff.PetSkills.Count)
         {
             PetData     petData     = PetManager.Instance.FindPetData(PetBuff.PetSkills[this.currentBtnID - 1].Pet);
             PetSkillTbl recordByKey = PetManager.Instance.PetSkillTable.GetRecordByKey((ushort)PetBuff.PetSkills[this.currentBtnID - 1].ID);
             if (this.m_panel != null)
             {
                 for (int i = 0; i < this.m_panel.Length; i++)
                 {
                     if (this.m_panel[i].Init && this.m_panel[i].Item && this.m_panel[i].ID >= 0 && this.m_panel[i].ID < PetBuff.PetSkills.Count)
                     {
                         this.m_panel[i].Item.transform.GetChild(9).GetChild(2).GetChild(2).gameObject.SetActive(PetBuff.PetSkills[this.currentBtnID - 1].ID == PetBuff.PetSkills[this.m_panel[i].ID].ID);
                     }
                 }
             }
             this.GM.ChangeHeroItemImg(base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(0).GetChild(0).transform, eHeroOrItem.Item, recordByKey.Diamond, 0, 0, 0);
             if (petData != null && petData.SkillLv != null)
             {
                 this.m_Str[1].ClearString();
                 this.m_Str[1].IntToFormat((long)petData.SkillLv[(int)PetBuff.PetSkills[this.currentBtnID - 1].Slot], 1, false);
                 this.m_Str[1].StringToFormat(this.DM.mStringTable.GetStringByID((uint)recordByKey.Name));
                 this.m_Str[1].AppendFormat(this.DM.mStringTable.GetStringByID(268u));
                 base.transform.GetChild(1).GetChild(26).GetChild(0).GetComponent <Text>().text = this.m_Str[1].ToString();
                 this.PM.FormatSkillContent(UIPetSkill.nowSkillId, petData.SkillLv[(int)PetBuff.PetSkills[this.currentBtnID - 1].Slot], this.m_Str[2], 0);
             }
             else
             {
                 base.transform.GetChild(1).GetChild(26).GetChild(0).GetComponent <Text>().text = this.DM.mStringTable.GetStringByID((uint)recordByKey.Name);
             }
             base.transform.GetChild(1).GetChild(26).GetChild(0).GetComponent <Text>().SetAllDirty();
             base.transform.GetChild(1).GetChild(26).GetChild(0).GetComponent <Text>().cachedTextGenerator.Invalidate();
             base.transform.GetChild(1).GetChild(26).GetChild(1).GetComponent <Text>().text = this.m_Str[2].ToString();
             base.transform.GetChild(1).GetChild(26).GetChild(1).GetComponent <Text>().SetAllDirty();
             base.transform.GetChild(1).GetChild(26).GetChild(1).GetComponent <Text>().cachedTextGenerator.Invalidate();
             ushort curItemQuantity = this.DM.GetCurItemQuantity(recordByKey.Diamond, 0);
             base.transform.GetChild(1).GetChild(26).GetChild(4).GetComponent <Text>().text = string.Format(this.DM.mStringTable.GetStringByID(12559u), curItemQuantity);
             base.transform.GetChild(1).GetChild(26).GetChild(4).gameObject.SetActive(recordByKey.Diamond > 0);
             base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(0).gameObject.SetActive(recordByKey.Diamond == 0);
             base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).gameObject.SetActive(recordByKey.Diamond > 0);
             base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(2).gameObject.SetActive(curItemQuantity > 0);
             base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(4).gameObject.SetActive(curItemQuantity == 0);
             this.UpdateUI(10, 1);
         }
     }
     else if (arg1 == 6)
     {
         UIPetSkill.Scrolling   = this.SkillRect.anchoredPosition.x;
         UIPetSkill.Positioning = this.m_scroll.GetTopIdx();
         this.Refresh(0);
     }
     else if (arg1 == 10)
     {
         long num = PetBuff.CheckSkillCD(UIPetSkill.nowSkillId);
         if (this.currentBtnID > 0 && this.currentBtnID <= PetBuff.PetSkills.Count && num == 0L)
         {
             if (arg2 > 0 || !base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(1).gameObject.activeSelf)
             {
                 PetSkillTbl     recordByKey2 = PetManager.Instance.PetSkillTable.GetRecordByKey(UIPetSkill.nowSkillId);
                 PetSkillCoolTbl recordByKey3 = this.PM.PetSkillCoolTable.GetRecordByKey(recordByKey2.CoolDown);
                 PetData         petData2     = PetManager.Instance.FindPetData(UIPetSkill.nowPetId);
                 if (petData2 != null && petData2.SkillLv != null)
                 {
                     byte b = petData2.SkillLv[(int)PetBuff.PetSkills[this.currentBtnID - 1].Slot];
                     if (b > 0 && (int)b <= recordByKey3.CoolBySkillLv.Length)
                     {
                         this.m_Str[3].ClearString();
                         this.PM.FormatCoolTime(recordByKey3.CoolBySkillLv[(int)(b - 1)], this.m_Str[3], 0);
                         base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(1).GetChild(0).GetComponent <Text>().text = this.m_Str[3].ToString();
                         base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(1).GetChild(0).GetComponent <Text>().cachedTextGenerator.Invalidate();
                         base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(1).GetChild(0).GetComponent <Text>().SetAllDirty();
                     }
                 }
             }
         }
         else
         {
             this.m_Str[3].ClearString();
             GameConstants.GetTimeString(this.m_Str[3], (uint)num, false, true, false, false, true);
             base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(0).GetChild(0).GetComponent <Text>().text = this.m_Str[3].ToString();
             base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(0).GetChild(0).GetComponent <Text>().cachedTextGenerator.Invalidate();
             base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(0).GetChild(0).GetComponent <Text>().SetAllDirty();
         }
         if (num > 0L || base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(4).gameObject.activeSelf)
         {
             base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(1).gameObject.SetActive(false);
             base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(3).gameObject.SetActive(true);
         }
         else
         {
             base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(3).gameObject.SetActive(false);
             base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(1).gameObject.SetActive(true);
         }
         if (base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(0).GetChild(0).childCount > 1)
         {
             base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(0).GetChild(0).GetChild(0).GetComponent <Image>().color = ((num <= 0L) ? Color.white : Color.gray);
             base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(0).GetChild(0).GetChild(1).GetComponent <Image>().color = ((num <= 0L) ? Color.white : Color.gray);
         }
         base.transform.GetChild(1).GetChild(26).GetChild(5).GetComponent <Image>().color = ((num <= 0L) ? Color.white : Color.gray);
         base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(1).GetComponent <Text>().color = base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(1).GetChild((num <= 0L) ? 0 : 1).GetComponent <Text>().color;
         base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(2).GetComponent <Text>().color = base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(2).GetChild((num <= 0L) ? 0 : 1).GetComponent <Text>().color;
         base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(3).GetComponent <Text>().color = base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(3).GetChild((num <= 0L) ? 0 : 1).GetComponent <Text>().color;
         base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(4).GetComponent <Text>().color = base.transform.GetChild(1).GetChild(26).GetChild(5).GetChild(1).GetChild(4).GetChild((num <= 0L) ? 0 : 1).GetComponent <Text>().color;
         base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(1).gameObject.SetActive(num == 0L);
         base.transform.GetChild(1).GetChild(26).GetChild(6).GetChild(0).gameObject.SetActive(num > 0L);
         if (this.m_UIHint)
         {
             this.m_UIHint.Parm1 = ((num <= 0L) ? 0 : 1);
         }
     }
     else if (arg1 == 11)
     {
         if (UIPetSkill.nowSkillId > 0)
         {
             PetSkillTbl recordByKey4 = PetManager.Instance.PetSkillTable.GetRecordByKey(UIPetSkill.nowSkillId);
             if (recordByKey4.Type == 1 && recordByKey4.Class >= 1 && (int)recordByKey4.Class <= PetBuff.PetSkillList.Length && this.PM.CoolDownData != null && this.PM.BuffInfoData != null)
             {
                 if (this.PM.CDFinder != null && this.PM.CDFinder.ContainsKey(UIPetSkill.nowSkillId))
                 {
                     this.GM.AddHUDMessage(this.DM.mStringTable.GetStringByID(12575u), 255, true);
                 }
                 else if (this.PM.m_PetMarchEventData.PetID > 0 && (ulong)this.PM.m_PetMarchEventData.MarchEventTime.RequireTime + (ulong)this.PM.m_PetMarchEventData.MarchEventTime.BeginTime >= (ulong)this.DM.ServerTime)
                 {
                     this.GM.AddHUDMessage(this.DM.mStringTable.GetStringByID(12576u), 255, true);
                 }
                 else if (recordByKey4.Diamond > 0 && this.DM.GetCurItemQuantity(recordByKey4.Diamond, 0) == 0)
                 {
                     this.GM.MsgStr.ClearString();
                     this.GM.MsgStr.StringToFormat(this.DM.mStringTable.GetStringByID(14654u));
                     this.GM.MsgStr.AppendFormat(this.DM.mStringTable.GetStringByID(1545u));
                     this.GM.OpenMessageBox(this.GM.MsgStr.ToString(), this.DM.mStringTable.GetStringByID(12571u), this.DM.mStringTable.GetStringByID(3968u), this, (int)recordByKey4.Diamond, (int)UIPetSkill.nowSkillId, true, false, false, false, false);
                 }
                 else if (this.PM.BuffImmune.BeginTime > 0L && arg2 > 0)
                 {
                     this.GM.OpenOKCancelBox(this, this.DM.mStringTable.GetStringByID(4840u), this.DM.mStringTable.GetStringByID(12573u), 0, 0, null, null);
                 }
                 else
                 {
                     this.onUse(UIPetSkill.nowPetId, UIPetSkill.nowSkillId);
                     this.UpdateUI(0, 0);
                 }
             }
         }
     }
     else if (arg1 != 12 || arg2 == UIPetSkill.nowMapPoint)
     {
         GUIManager.Instance.CloseMenu(this.m_eWindow);
         GUIManager.Instance.UIQueueLockRelease(EGUIQueueLock.UIQL_UI_notAllowPopUps);
     }
 }
Exemplo n.º 8
0
 // Token: 0x0600171F RID: 5919 RVA: 0x0027D18C File Offset: 0x0027B38C
 public void SetExpValue()
 {
     if (this.m_PetID != 0)
     {
         this.m_BeginLv = PetManager.Instance.m_PetBeginLv;
         this.m_EndLv   = PetManager.Instance.m_PetEndLv;
         uint beginExp = PetManager.Instance.m_BeginExp;
         uint endExp   = PetManager.Instance.m_EndExp;
         this.m_PetSkillID = PetManager.Instance.m_PetSkillLvUpID;
         PetTbl recordByKey = PetManager.Instance.PetTable.GetRecordByKey(this.m_PetID);
         uint   num;
         uint   num2;
         if (this.m_UIType == UIPetLevelUp.EUIType.PetLvUp)
         {
             num  = PetManager.Instance.GetNeedExp(this.m_BeginLv, recordByKey.Rare);
             num2 = PetManager.Instance.GetNeedExp(this.m_EndLv, recordByKey.Rare);
         }
         else
         {
             num  = PetManager.Instance.GetPetSkillMaxExpByID(this.m_PetSkillID, this.m_BeginLv);
             num2 = PetManager.Instance.GetPetSkillMaxExpByID(this.m_PetSkillID, this.m_EndLv);
             byte b = 0;
             while ((int)b < recordByKey.PetSkill.Length)
             {
                 if (recordByKey.PetSkill[(int)b] == this.m_PetSkillID)
                 {
                     this.m_Skillidx = b;
                 }
                 b += 1;
             }
         }
         if (num > 0u && num2 > 0u)
         {
             this.m_BeginExpRate = beginExp / num;
             this.m_EndExpRate   = endExp / num2;
         }
         else
         {
             this.m_BeginExpRate = 0f;
             this.m_EndExpRate   = 0f;
         }
         uint num3 = 0u;
         for (byte b2 = this.m_BeginLv; b2 <= this.m_EndLv; b2 += 1)
         {
             if (b2 == this.m_BeginLv)
             {
                 uint num4;
                 if (this.m_UIType == UIPetLevelUp.EUIType.PetLvUp)
                 {
                     num4 = PetManager.Instance.GetNeedExp(b2, recordByKey.Rare);
                 }
                 else
                 {
                     num4 = PetManager.Instance.GetPetSkillMaxExpByID(this.m_PetSkillID, b2);
                 }
                 num3 += num4 - beginExp;
             }
             else if (b2 == this.m_EndLv)
             {
                 num3 += endExp;
             }
             else if (this.m_UIType == UIPetLevelUp.EUIType.PetLvUp)
             {
                 num3 += PetManager.Instance.GetNeedExp(b2, recordByKey.Rare);
             }
             else
             {
                 num3 += PetManager.Instance.GetPetSkillMaxExpByID(this.m_PetSkillID, b2);
             }
         }
         if (this.m_EffectTextLV != null && this.m_EffectTextExp != null)
         {
             this.m_EffectTextLV.rectTransform.anchoredPosition  = this.BEGIN;
             this.m_EffectTextExp.rectTransform.anchoredPosition = this.EXP_BEGIN;
             this.m_EffectTextExp.gameObject.SetActive(true);
             this.m_Str[4].ClearString();
             this.m_Str[4].IntToFormat((long)((ulong)num3), 1, true);
             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();
         }
         PetSkillTbl recordByKey2 = PetManager.Instance.PetSkillTable.GetRecordByKey(this.m_PetSkillID);
         CString     cstring      = StringManager.Instance.StaticString1024();
         cstring.Append('s');
         cstring.IntToFormat((long)recordByKey2.Icon, 5, false);
         cstring.AppendFormat("{0}");
         this.m_Skill.sprite        = GUIManager.Instance.LoadSkillSprite(cstring);
         this.m_Skill.material      = GUIManager.Instance.GetSkillMaterial();
         this.m_SkillFrame.sprite   = GUIManager.Instance.LoadFrameSprite("sk");
         this.m_SkillFrame.material = GUIManager.Instance.GetFrameMaterial();
         this.m_State      = UIPetLevelUp.ExpState.Begin;
         this.m_State_Lv   = UIPetLevelUp.ELvState.None;
         this.m_State_Exp2 = UIPetLevelUp.EExpState.Move;
     }
 }
Exemplo n.º 9
0
    // Token: 0x060016CA RID: 5834 RVA: 0x002735F8 File Offset: 0x002717F8
    public static bool UpdateSkill(int arg = 0)
    {
        Door door = GUIManager.Instance.FindMenu(EGUIWindow.Door) as Door;

        if (door)
        {
            door.m_PetSkillBtnFlashGO.GetComponent <uTweener>().enabled = !PetBuff.Refreshed;
            door.m_PetSkillBtnFlashGO.GetComponent <Image>().color      = Color.white;
        }
        if (arg > 0 || !PetBuff.SkillInit)
        {
            PetBuff.SkillInit = true;
            for (int i = 0; i < PetBuff.ActiveSkill.Length; i++)
            {
                PetBuff.ActiveSkill[i] = 0;
            }
            for (int j = 0; j < PetBuff.PetSkillList.Length; j++)
            {
                if (PetBuff.PetSkillList[j] == null)
                {
                    PetBuff.PetSkillList[j] = new List <PetBuff.PetSkillData>();
                }
                else
                {
                    PetBuff.PetSkillList[j].Clear();
                }
            }
            for (int k = 0; k < (int)PetManager.Instance.PetDataCount; k++)
            {
                PetData petData = PetManager.Instance.GetPetData((int)((byte)k));
                if (petData != null)
                {
                    PetTbl recordByKey = PetManager.Instance.PetTable.GetRecordByKey(petData.ID);
                    byte   b           = 0;
                    while (recordByKey.PetSkill != null && (int)b < recordByKey.PetSkill.Length)
                    {
                        if (recordByKey.PetSkill[(int)b] > 0 && petData.SkillLv != null && (int)b < petData.SkillLv.Length && petData.Enhance >= b)
                        {
                            PetSkillTbl recordByKey2 = PetManager.Instance.PetSkillTable.GetRecordByKey(recordByKey.PetSkill[(int)b]);
                            if (recordByKey2.Subject > 0 && recordByKey2.Type == 1 && recordByKey2.Class >= 1 && (int)recordByKey2.Class <= PetBuff.PetSkillList.Length && (int)recordByKey2.Subject <= PetBuff.ActiveSkill.Length)
                            {
                                PetBuff.PetSkillList[(int)(recordByKey2.Class - 1)].Add(new PetBuff.PetSkillData((uint)recordByKey.PetSkill[(int)b], b, recordByKey2.Subject, petData.ID));
                            }
                        }
                        b += 1;
                    }
                }
            }
            if (arg > 0)
            {
                PetBuff.Update(6, 0, true);
            }
        }
        for (int l = 0; l < PetBuff.ActiveSkill.Length; l++)
        {
            if (PetBuff.ActiveSkill[l] > 0)
            {
                return(true);
            }
        }
        return(false);
    }
Exemplo n.º 10
0
    // Token: 0x06001C0D RID: 7181 RVA: 0x0031A124 File Offset: 0x00318324
    public override void SetContent(int kind, int fontsize, float width, int Parm1, int Parm2 = 0)
    {
        PetManager  instance     = PetManager.Instance;
        GUIManager  instance2    = GUIManager.Instance;
        StringTable mStringTable = DataManager.Instance.mStringTable;

        this.Kind    = (PetSkillHint.eKind)kind;
        this.SkillID = (ushort)(Parm1 & 255);
        this.PetID   = (ushort)(Parm1 >> 16);
        this.Level   = (byte)Parm2;
        byte        b           = 0;
        float       num         = 0f;
        PetData     petData     = instance.FindPetData(this.PetID);
        PetSkillTbl recordByKey = instance.PetSkillTable.GetRecordByKey(this.SkillID);

        if (this.Level == 0)
        {
            this.Level = 1;
        }
        if (recordByKey.UpLevel < this.Level)
        {
            this.Level = recordByKey.UpLevel;
        }
        if (this.Kind == PetSkillHint.eKind.State)
        {
            this.SetStateContent(mStringTable.GetStringByID((uint)recordByKey.Name), this.SkillID, this.Level);
            this.HintFrameSprite = this.BackSprite[3];
            this.StateObj.SetActive(true);
            this.OthersObj.SetActive(false);
            return;
        }
        this.StateObj.SetActive(false);
        this.OthersObj.SetActive(true);
        CString cstring = StringManager.Instance.StaticString1024();

        cstring.Append('s');
        cstring.IntToFormat((long)recordByKey.Icon, 5, false);
        cstring.AppendFormat("{0}");
        this.SkillImg.sprite   = instance2.LoadSkillSprite(cstring);
        this.SkillImg.material = instance2.GetSkillMaterial();
        this.NameText.text     = mStringTable.GetStringByID((uint)recordByKey.Name);
        if (recordByKey.Diamond > 0)
        {
            this.CrystalObj.SetActive(true);
            b += 1;
        }
        else
        {
            this.CrystalObj.SetActive(false);
        }
        byte type = recordByKey.Type;

        if (type != 1)
        {
            if (type != 2)
            {
                this.KindText.text = string.Empty;
            }
            else
            {
                this.KindText.text = mStringTable.GetStringByID(10091u);
            }
        }
        else if (recordByKey.Subject == 1)
        {
            this.KindText.text = mStringTable.GetStringByID(10083u);
        }
        else if (recordByKey.Subject == 2)
        {
            this.KindText.text = mStringTable.GetStringByID(10084u);
        }
        else if (recordByKey.Subject == 3)
        {
            this.KindText.text = mStringTable.GetStringByID(10085u);
        }
        else
        {
            this.KindText.text = string.Empty;
        }
        switch (this.Kind)
        {
        case PetSkillHint.eKind.Normal:
        {
            byte needEnhance = this.GetNeedEnhance(petData);
            this.LineObj.SetActive(true);
            this.Contents[0].SetActive(true);
            this.Contents[0].SetData(ref recordByKey, this.Level, PetSkillHint._Content._ShowType.ShowNone, needEnhance, 0, PetSkillHint._Content.eFlag.None);
            if (petData != null && petData.Enhance < needEnhance)
            {
                this.Note.activeSelf = false;
                this.Contents[1].SetActive(true);
                num = 25f;
                this.Contents[1].SetData(ref recordByKey, recordByKey.UpLevel, PetSkillHint._Content._ShowType.ShowMax, needEnhance, this.GetNeedLv(recordByKey.UpLevel, recordByKey.OpenLevel, petData), PetSkillHint._Content.eFlag.None);
            }
            else
            {
                if (recordByKey.Type == 2)
                {
                    this.Note.activeSelf = true;
                }
                else
                {
                    this.Note.activeSelf = false;
                }
                if (this.Level < recordByKey.UpLevel)
                {
                    this.Contents[1].SetActive(true);
                    this.Contents[1].SetData(ref recordByKey, this.Level += 1, PetSkillHint._Content._ShowType.ShowNext, needEnhance, this.GetNeedLv(this.Level, recordByKey.OpenLevel, petData), PetSkillHint._Content.eFlag.None);
                }
                else
                {
                    this.Contents[1].SetActive(false);
                    this.LineObj.SetActive(false);
                }
            }
            break;
        }

        case PetSkillHint.eKind.MaxLv:
            this.Note.activeSelf = false;
            this.LineObj.SetActive(true);
            this.Contents[0].SetActive(true);
            this.Contents[0].SetData(ref recordByKey, this.Level, PetSkillHint._Content._ShowType.ShowNone, 0, 0, PetSkillHint._Content.eFlag.None);
            this.Contents[1].SetActive(true);
            this.Contents[1].SetData(ref recordByKey, recordByKey.UpLevel, PetSkillHint._Content._ShowType.ShowMax, this.GetNeedEnhance(petData), this.GetNeedLv(recordByKey.UpLevel, recordByKey.OpenLevel, petData), PetSkillHint._Content.eFlag.None);
            break;

        case PetSkillHint.eKind.Lv1AndMax:
            this.Note.activeSelf = false;
            this.LineObj.SetActive(true);
            this.Contents[0].SetActive(true);
            this.Contents[0].SetData(ref recordByKey, 1, PetSkillHint._Content._ShowType.ShowNone, 0, 0, PetSkillHint._Content.eFlag.ShowLvOne);
            this.Contents[1].SetActive(true);
            this.Contents[1].SetData(ref recordByKey, recordByKey.UpLevel, PetSkillHint._Content._ShowType.ShowMax, this.GetNeedEnhance(petData), this.GetNeedLv(recordByKey.UpLevel, recordByKey.OpenLevel, petData), PetSkillHint._Content.eFlag.SkipLvCheck);
            break;

        case PetSkillHint.eKind.CurentLv:
            this.LineObj.SetActive(false);
            this.Contents[0].SetActive(true);
            this.Contents[0].SetData(ref recordByKey, this.Level, PetSkillHint._Content._ShowType.ShowNone, 0, 0, PetSkillHint._Content.eFlag.None);
            this.Contents[1].SetActive(false);
            break;

        case PetSkillHint.eKind.Mail:
            this.Note.activeSelf = false;
            this.LineObj.SetActive(false);
            this.Contents[0].SetActive(true);
            this.Contents[0].SetData(ref recordByKey, this.Level, PetSkillHint._Content._ShowType.ShowNone, 0, 0, PetSkillHint._Content.eFlag.Mail);
            this.Contents[1].SetActive(false);
            break;

        default:
            this.Note.activeSelf = false;
            this.LineObj.SetActive(false);
            this.Contents[0].SetActive(false);
            this.Contents[1].SetActive(false);
            break;
        }
        if (this.Contents[0].CoolTime())
        {
            b += 1;
        }
        this.HintFrameSprite = this.BackSprite[(int)b];
        this.DefHeight       = this.DefHeights[(int)b];
        this.Contents[0].rectTransfrom.anchoredPosition = new Vector2(this.Contents[0].rectTransfrom.anchoredPosition.x, -this.DefHeight);
        if (this.LineObj.activeSelf)
        {
            this.LineRect.anchoredPosition = new Vector2(this.LineRect.anchoredPosition.x, this.Contents[0].rectTransfrom.anchoredPosition.y - this.Contents[0].Height - 25f + num);
        }
        if (this.Contents[1].activeSelf)
        {
            this.Contents[1].rectTransfrom.anchoredPosition = new Vector2(this.Contents[1].rectTransfrom.anchoredPosition.x, this.LineRect.anchoredPosition.y - this.LineRect.sizeDelta.y - 13f);
        }
        if (this.Note.activeSelf)
        {
            if (this.Contents[1].activeSelf)
            {
                this.Note.rectTransform.anchoredPosition = new Vector2(this.Note.rectTransform.anchoredPosition.x, this.Contents[1].rectTransfrom.anchoredPosition.y - this.Contents[1].Height);
            }
            else
            {
                this.Note.rectTransform.anchoredPosition = new Vector2(this.Note.rectTransform.anchoredPosition.x, this.Contents[0].rectTransfrom.anchoredPosition.y - this.Contents[0].Height);
            }
        }
        if (this.CanvasRect.sizeDelta.y < this.GetSize().y)
        {
            int num2 = 0;
            while (this.CanvasRect.sizeDelta.y < this.GetSize().y)
            {
                for (int i = 0; i < this.Contents.Length; i++)
                {
                    if (this.Contents[i].activeSelf)
                    {
                        num2 = this.Contents[i].FontShrink();
                    }
                }
                if (this.LineObj.activeSelf)
                {
                    this.LineRect.anchoredPosition = new Vector2(this.LineRect.anchoredPosition.x, this.Contents[0].rectTransfrom.anchoredPosition.y - this.Contents[0].Height - 25f);
                }
                if (this.Contents[1].activeSelf)
                {
                    this.Contents[1].rectTransfrom.anchoredPosition = new Vector2(this.Contents[1].rectTransfrom.anchoredPosition.x, this.LineRect.anchoredPosition.y - this.LineRect.sizeDelta.y - 13f);
                }
                if (num2 == 8)
                {
                    break;
                }
            }
        }
        if (this.Contents[1].activeSelf && (num > 0f || this.Kind == PetSkillHint.eKind.MaxLv || this.Kind == PetSkillHint.eKind.Lv1AndMax))
        {
            this.MaxBackRect.gameObject.SetActive(true);
            this.MaxBackRect.anchoredPosition = new Vector2(this.MaxBackRect.anchoredPosition.x, this.LineRect.anchoredPosition.y - 5f);
            this.MaxBackRect.sizeDelta        = new Vector2(this.MaxBackRect.sizeDelta.x, this.Contents[1].Height + 24f);
        }
        else
        {
            this.MaxBackRect.gameObject.SetActive(false);
        }
    }
Exemplo n.º 11
0
        // Token: 0x06001C13 RID: 7187 RVA: 0x0031AF98 File Offset: 0x00319198
        public void SetData(ref PetSkillTbl skillData, byte level, PetSkillHint._Content._ShowType type, byte needEnhance, sbyte NeedLv, PetSkillHint._Content.eFlag Flag = PetSkillHint._Content.eFlag.None)
        {
            this.ContStr.ClearString();
            this.CooldownStr.ClearString();
            this.ContText.fontSize = this.DefFontSize;
            StringTable mStringTable = DataManager.Instance.mStringTable;

            this.TitleText.color = new Color32(byte.MaxValue, 201, 97, byte.MaxValue);
            if (type == PetSkillHint._Content._ShowType.ShowNext)
            {
                if (needEnhance > 0)
                {
                    this.DefHeight       = 0f;
                    this.TitleText.color = new Color32(byte.MaxValue, 132, 109, byte.MaxValue);
                    this.TitleText.text  = mStringTable.GetStringByID(10085u + (uint)needEnhance);
                    this.ContText.text   = string.Empty;
                    this.ContText.SetAllDirty();
                    this.ContText.cachedTextGenerator.Invalidate();
                    this.ContText.cachedTextGeneratorForLayout.Invalidate();
                    this.ContText.rectTransform.sizeDelta = new Vector2(this.ContText.rectTransform.sizeDelta.x, this.ContText.preferredHeight);
                    return;
                }
                this.TitleText.text         = mStringTable.GetStringByID(480u);
                this.CooldownText.alignment = TextAnchor.LowerRight;
            }
            else if (type == PetSkillHint._Content._ShowType.ShowMax)
            {
                this.TitleStr.ClearString();
                this.TitleStr.IntToFormat((long)skillData.UpLevel, 1, false);
                this.TitleStr.AppendFormat(mStringTable.GetStringByID(10137u));
                this.TitleText.color = new Color32(0, byte.MaxValue, byte.MaxValue, byte.MaxValue);
                this.TitleText.text  = this.TitleStr.ToString();
                this.TitleText.SetAllDirty();
                this.TitleText.cachedTextGenerator.Invalidate();
                this.CooldownText.alignment = TextAnchor.LowerRight;
                if ((int)NeedLv < 0 && Flag == PetSkillHint._Content.eFlag.SkipLvCheck)
                {
                    NeedLv = (sbyte)((int)NeedLv * -1);
                }
            }
            else if (type == PetSkillHint._Content._ShowType.ShowNone)
            {
                if (Flag == PetSkillHint._Content.eFlag.ShowLvOne)
                {
                    this.TitleText.gameObject.SetActive(true);
                    this.TitleStr.ClearString();
                    this.TitleStr.IntToFormat(1L, 1, false);
                    this.TitleStr.AppendFormat(mStringTable.GetStringByID(10136u));
                    this.TitleText.text = this.TitleStr.ToString();
                    this.TitleText.SetAllDirty();
                    this.TitleText.cachedTextGenerator.Invalidate();
                }
                else
                {
                    this.TitleText.gameObject.SetActive(false);
                }
            }
            else
            {
                this.TitleText.text         = string.Empty;
                this.CooldownText.alignment = TextAnchor.UpperRight;
            }
            this.CooldownStr.Append(mStringTable.GetStringByID(10082u));
            this.CooldownStr.Append(" ");
            ushort num = 0;

            if (skillData.CoolDown > 0)
            {
                num = PetManager.Instance.PetSkillCoolTable.GetRecordByKey(skillData.CoolDown).CoolBySkillLv[(int)(level - 1)];
            }
            Vector2 anchoredPosition = new Vector2(this.ContText.rectTransform.anchoredPosition.x, this.OriContTop);

            if (num == 0 || Flag == PetSkillHint._Content.eFlag.Mail)
            {
                this.IsCoolTime        = false;
                this.CooldownText.text = string.Empty;
                if (type != PetSkillHint._Content._ShowType.ShowNone && this.TitleText.gameObject.activeSelf)
                {
                    anchoredPosition = new Vector2(this.ContText.rectTransform.anchoredPosition.x, this.CooldownText.rectTransform.anchoredPosition.y);
                }
            }
            else
            {
                this.IsCoolTime = true;
                PetManager.Instance.FormatCoolTime(num, this.CooldownStr, (!GUIManager.Instance.IsArabic) ? 0 : 1);
                this.CooldownText.text = this.CooldownStr.ToString();
                this.CooldownText.SetAllDirty();
                this.CooldownText.cachedTextGenerator.Invalidate();
                anchoredPosition = new Vector2(this.ContText.rectTransform.anchoredPosition.x, this.OriContTop);
            }
            if (Flag == PetSkillHint._Content.eFlag.ShowLvOne)
            {
                anchoredPosition.y -= 30f;
            }
            this.ContText.rectTransform.anchoredPosition = anchoredPosition;
            PetManager.Instance.FormatSkillContent(skillData.ID, level, this.ContStr, (Flag != PetSkillHint._Content.eFlag.State) ? 0 : 1);
            if (type != PetSkillHint._Content._ShowType.ShowNone && (int)NeedLv != 0)
            {
                this.ContStr.Append('\n');
                if ((int)NeedLv < 0)
                {
                    this.ContStr.Append("<color=#ff6278ff>");
                    this.ContStr.IntToFormat((long)(-(long)((int)NeedLv)), 1, false);
                }
                else
                {
                    this.ContStr.IntToFormat((long)NeedLv, 1, false);
                }
                this.ContStr.AppendFormat(mStringTable.GetStringByID(10089u));
                if ((int)NeedLv < 0)
                {
                    this.ContStr.Append("</color>");
                }
            }
            if (type == PetSkillHint._Content._ShowType.ShowNone)
            {
                if (needEnhance > 0)
                {
                    this.ContStr.Append('\n');
                    this.ContStr.Append('\n');
                    this.ContStr.Append("<color=#ff6278ff>");
                    this.ContStr.Append(mStringTable.GetStringByID(10085u + (uint)needEnhance));
                    this.ContStr.Append("</color>");
                }
                if (level == skillData.UpLevel)
                {
                    this.ContStr.Append('\n');
                    this.ContStr.Append("<color=#ffc961ff>");
                    this.ContStr.Append(mStringTable.GetStringByID(481u));
                    this.ContStr.Append("</color>");
                }
            }
            this.ContText.text = this.ContStr.ToString();
            this.ContText.SetAllDirty();
            this.ContText.cachedTextGenerator.Invalidate();
            this.ContText.cachedTextGeneratorForLayout.Invalidate();
            this.ContText.rectTransform.sizeDelta = new Vector2(this.ContText.rectTransform.sizeDelta.x, this.ContText.preferredHeight);
            if (this.IsCoolTime)
            {
                if (this.TitleText.gameObject.activeSelf)
                {
                    this.DefHeight = this.CooldownText.rectTransform.sizeDelta.y + this.TitleText.rectTransform.sizeDelta.y;
                }
                else
                {
                    this.DefHeight = this.CooldownText.rectTransform.sizeDelta.y;
                }
            }
            else if (Flag == PetSkillHint._Content.eFlag.ShowLvOne)
            {
                this.DefHeight = this.CooldownText.rectTransform.sizeDelta.y + 30f;
            }
            else
            {
                this.DefHeight = this.CooldownText.rectTransform.sizeDelta.y;
            }
        }