Beispiel #1
0
        public static string GetFellowElementLevelText(int skillid)
        {
            Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);

            if (tabSkill == null)
            {
                return("");
            }
            return(tabSkill.Level.ToString());

//             switch ((FELLOWELEMENTSKILL)tabSkill.Level)
//             {
//                 case FELLOWELEMENTSKILL.WHITE_0:
//                 case FELLOWELEMENTSKILL.GREEN_0:
//                 case FELLOWELEMENTSKILL.BLUE_0:
//                 case FELLOWELEMENTSKILL.PURPLE_0:
//                 case FELLOWELEMENTSKILL.ORANGE_0:
//                     return "";
//                 case FELLOWELEMENTSKILL.GREEN_1:
//                 case FELLOWELEMENTSKILL.BLUE_1:
//                 case FELLOWELEMENTSKILL.PURPLE_1:
//                     return "+1";
//                 case FELLOWELEMENTSKILL.GREEN_2:
//                 case FELLOWELEMENTSKILL.BLUE_2:
//                 case FELLOWELEMENTSKILL.PURPLE_2:
//                     return "+2";
//                 case FELLOWELEMENTSKILL.BLUE_3:
//                 case FELLOWELEMENTSKILL.PURPLE_3:
//                     return "+3";
//                 case FELLOWELEMENTSKILL.PURPLE_4:
//                     return "+4";
//                 default:
//                     return "";
//             }
        }
    public void InitElementSkill(int skillid)
    {
        Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);

        if (tabSkill == null)
        {
            return;
        }

        Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(skillid, 0);

        if (tabSkillEx == null)
        {
            return;
        }

        Tab_SkillBase tabBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);

        if (tabBase == null)
        {
            return;
        }

        m_TallentSkillId = GlobeVar.INVALID_ID;
        m_ElementSkillId = skillid;

        m_SkillIcon.spriteName = tabBase.Icon;
        //取消品质
        //m_QualityPic.spriteName = FellowTool.GetChatFellowElementSkillQualityPic(skillid);
        m_TallentBgPic.gameObject.SetActive(false);
        //  m_LevelLabel.text = FellowTool.GetFellowElementLevelText(skillid);
    }
Beispiel #3
0
    public void updateElementRemindPoint(int skillid)
    {
        Tab_CabalFellowElementSkill tabElementSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);

        if (tabElementSkill == null)
        {
            return;
        }
        Tab_CabalFellowElementSkill tabNextSkill = TableManager.GetCabalFellowElementSkillByID(tabElementSkill.NextSkillId, 0);

        if (tabNextSkill == null)
        {
            return;
        }
        int packHaveBookNum      = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(tabNextSkill.NeedBookId);
        int nextSkillNeedBookNum = tabNextSkill.NeedBookCount;

        if (packHaveBookNum >= nextSkillNeedBookNum)
        {
            m_RemindPoint.gameObject.SetActive(true);
        }
        else
        {
            m_RemindPoint.gameObject.SetActive(false);
        }
    }
    /// <summary>
    /// 打开选择学习技能书界面
    /// </summary>
    /// <param name="go"></param>
    void OpenChooseSkillBookDialog(GameObject go)
    {
        Utils.CleanGrid(m_SkillChooseGrid);

        List <Tab_CabalFellowElementSkillBook> FellowSkillBookList = GameManager.gameManager.PlayerDataPool.BackPack.GetSkillLearnBooksByElementType(m_Fellow.ElementAttr);

        if (FellowSkillBookList.Count <= 0)
        {
            GUIData.AddNotifyData("#{11500}");
            return;
        }
        //选择技能书界面
        m_SkillChooseWindow.SetActive(true);

        int index = 0;

        //foreach (Tab_CabalFellowElementSkillBook book in GameManager.gameManager.PlayerDataPool.BackPack.GetSkillLearnBooksByElementType(m_Fellow.ElementAttr))
        foreach (Tab_CabalFellowElementSkillBook book in FellowSkillBookList)
        {
            if (m_Fellow.IsHaveSkillId(book.SkillId))
            {
                continue;
            }
            Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(book.SkillId, 0);
            if (tabSkill == null)
            {
                continue;
            }

            Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(book.SkillId, 0);
            if (tabSkillEx == null)
            {
                continue;
            }

            Tab_SkillBase tabBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);
            if (tabBase == null)
            {
                continue;
            }
            string     itemName  = index < 10 ? "0" + index.ToString() : index.ToString();
            GameObject SkillItem = Utils.BindObjToParent(m_SkillChooseItem, m_SkillChooseGrid, itemName);
            if (SkillItem != null && SkillItem.GetComponent <PartnerSkillChooseItemLogic>() != null)
            {
                SkillItem.GetComponent <PartnerSkillChooseItemLogic>().Init(book);
            }
            index += 1;
        }

        if (m_SkillChooseGrid.GetComponent <UIGrid>() != null)
        {
            m_SkillChooseGrid.GetComponent <UIGrid>().Reposition();
        }

        if (PartnerFrameLogic.Instance().NewPlayerGuideFlag_Step == 4)
        {
            PartnerFrameLogic.Instance().NewPlayerGuide(5);
        }
    }
    void InitElementSkill_Info(int skillid)
    {
        Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);

        if (tabSkill == null)
        {
            return;
        }

        Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(skillid, 0);

        if (tabSkillEx == null)
        {
            return;
        }

        Tab_SkillBase tabBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);

        if (tabBase == null)
        {
            return;
        }

        m_TallentSkillId = GlobeVar.INVALID_ID;
        m_ElementSkillId = skillid;

        Tab_CabalFellowElementSkill tabNextSkill = TableManager.GetCabalFellowElementSkillByID(tabSkill.NextSkillId, 0);

        if (tabNextSkill == null)
        {
            lblSkillLv.text = "MAX";
        }
        sprSkillIcon.spriteName = tabBase.Icon;
        sprSkillIcon.gameObject.SetActive(true);

        lblSkillLv.text = FellowTool.GetFellowElementLevelText(skillid);
        lblSkillLv.transform.parent.gameObject.SetActive(true);
        lblSkillName.text = tabBase.Name;
        lblSkillDesc.text = tabBase.SkillIntro;
        objLock.SetActive(false);
        enhanceSkill.SetActive(true);
        UIEventListener.Get(enhanceSkill).onClick = ShowEnhanceDialog;
        if (PartnerFrameLogic.Instance() != null)
        {
            PartnerFrameLogic.Instance().UpdateDevelopRemindPoint();
        }
    }
    /// <summary>
    /// 打开元素技能升级界面
    /// </summary>
    /// <param name="skillid"></param>
    public void OnElementSkillLevelUpClick(int skillid)
    {
        Tab_CabalFellowElementSkill tabCurSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);

        if (tabCurSkill == null)
        {
            return;
        }

        m_SkillLevelUpWindow.SetActive(true);
        m_LevelUpWindowType = LEVELUP_WINDOWTYPE.TYPE_ELEMENT;

        //m_TalentSkillBookBtn.SetActive(false);

        m_SkillCurLevel.InitElementSkill(skillid);

        m_SkillLevelUpCostName.text = StrDictionary.GetClientDictionaryString("#{10193}");

        int           nNextSkillId = tabCurSkill.NextSkillId;
        UIImageButton upgradeBtn   = skillbookArea.transform.parent.FindChild("OKButton").GetComponent <UIImageButton>();

        if (nNextSkillId == GlobeVar.INVALID_ID)
        {
            // 满级
            m_SkillNextLevel.InitElementSkill(skillid);
            skillbookArea.SetActive(false);
            upgradeBtn.isEnabled = false;
        }
        else
        {
            // 非满级
            skillbookArea.SetActive(true);
            upgradeBtn.isEnabled = true;
            m_SkillBookSlot.InitInfo_Item(tabCurSkill.NeedBookId, ItemSlotLogic.OnClickOpenTips);
            if (tabCurSkill.NeedBookCount > 0)
            {
                m_SkillLevelUpCostSprite.value = (float)GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(tabCurSkill.NeedBookId) / (float)tabCurSkill.NeedBookCount;
            }
            m_SkillLevelUpCostLabel.text = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(tabCurSkill.NeedBookId).ToString() + "/" + tabCurSkill.NeedBookCount.ToString();

            m_SkillNextLevel.InitElementSkill(tabCurSkill.NextSkillId);
            InitGetInfoDialog(tabCurSkill.NeedBookId);
        }

        m_LevelUpSkillChooseBuffer = skillid;
    }
Beispiel #7
0
        public Dictionary <int, List <int> > GetPartnerCanUpdateSkill()
        {
            Dictionary <int, List <int> > fellowupdateskill = new Dictionary <int, List <int> >();

            for (int i = 0; i < ContainerSize; i++)
            {
                Fellow fellow = GetFellowByIndex(i);
                if (fellow != null && fellow.IsValid() && !fellowupdateskill.ContainsKey(fellow.DataId))
                {
                    for (int j = 0; j < Fellow.FELLOW_ELEMENTSKILL_COUNT; j++)
                    {
                        int fellowElementSkillId = fellow.GetElementSkillId(j);
                        if (fellowElementSkillId != GlobeVar.INVALID_ID)
                        {
                            Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(fellowElementSkillId, 0);
                            if (tabSkill != null)
                            {
                                Tab_CabalFellowElementSkill tabNextSkill = TableManager.GetCabalFellowElementSkillByID(tabSkill.NextSkillId, 0);
                                {
                                    if (tabNextSkill != null)
                                    {
                                        int packHaveBookNum      = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(tabNextSkill.NeedBookId);
                                        int nextSkillNeedBookNum = tabNextSkill.NeedBookCount;
                                        if (packHaveBookNum >= nextSkillNeedBookNum)
                                        {
                                            List <int> skilllist;
                                            if (!fellowupdateskill.TryGetValue(fellow.DataId, out skilllist))
                                            {
                                                skilllist = new List <int>();
                                            }
                                            skilllist.Add(fellowElementSkillId);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(fellowupdateskill);
        }
Beispiel #8
0
        public bool IsHaveSkillId(int skillId)
        {
            for (int index = 0; index < FELLOW_ELEMENTSKILL_COUNT && index < FELLOW_ELEMENTSKILL_OPENCOUNT; index++)
            {
                Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(m_ElementSkill[index], 0);
                if (tabSkill == null)
                {
                    continue;
                }

                if (m_ElementSkill[index] == skillId)
                {
                    return(true);
                }

                if (tabSkill.BaseSkill == skillId)
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #9
0
        public static string GetChatFellowElementSkillQualityPic(int skillid)
        {
            Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);

            if (tabSkill == null)
            {
                return("white-jinengkuang");
            }

            switch ((FELLOWELEMENTSKILL)tabSkill.Level)
            {
            case FELLOWELEMENTSKILL.WHITE_0:
                return("white-jinengkuang");

            case FELLOWELEMENTSKILL.GREEN_0:
            case FELLOWELEMENTSKILL.GREEN_1:
            case FELLOWELEMENTSKILL.GREEN_2:
                return("green-jinengkuang");

            case FELLOWELEMENTSKILL.BLUE_0:
            case FELLOWELEMENTSKILL.BLUE_1:
            case FELLOWELEMENTSKILL.BLUE_2:
            case FELLOWELEMENTSKILL.BLUE_3:
                return("bule-jinengkuang");

            case FELLOWELEMENTSKILL.PURPLE_0:
            case FELLOWELEMENTSKILL.PURPLE_1:
            case FELLOWELEMENTSKILL.PURPLE_2:
            case FELLOWELEMENTSKILL.PURPLE_3:
            case FELLOWELEMENTSKILL.PURPLE_4:
                return("purple-jinengkuang");

            case FELLOWELEMENTSKILL.ORANGE_0:
                return("orange-jinengkuang");

            default:
                return("white-jinengkuang");
            }
        }
    void UpdateFellowInfo_Skill(Fellow fellow)
    {
        Utils.CleanGrid(m_TalentSkillGrid);
        Utils.CleanGrid(m_ElementSkillGrid);

        int index = 0;

        int nValidTalentSkillCount = 0;

        foreach (KeyValuePair <int, int> pair in fellow.TallentSkill)
        {
            int skillid = pair.Key;
            if (skillid <= 0)
            {
                break;
            }

            Tab_CabalFellowTallentSkill tabTallentSkill = TableManager.GetCabalFellowTallentSkillByID(skillid, 0);
            if (tabTallentSkill == null)
            {
                break;
            }

            string     itemName  = index < 10 ? "0" + index.ToString() : index.ToString();
            GameObject skillitem = Utils.BindObjToParent(m_PartnerSkillItem, m_TalentSkillGrid, itemName);
            if (skillitem == null || skillitem.GetComponent <PartnerSkillItemLogic>() == null)
            {
                break;
            }

            skillitem.GetComponent <PartnerSkillItemLogic>().InitTallentSkill(skillid);
            AddSkillItemListener(skillitem);
            index += 1;

            nValidTalentSkillCount += 1;
        }

        int nValidElementSkillCount = 0;

        if (false == fellow.IsBabyFellow())
        {
            for (int i = 0; i < Fellow.FELLOW_ELEMENTSKILL_COUNT && i < Fellow.FELLOW_ELEMENTSKILL_OPENCOUNT; i++)
            {
                int skillid = fellow.GetElementSkillId(i);
                if (skillid <= 0)
                {
                    continue;
                }

                Tab_CabalFellowElementSkill tabElementSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);
                if (tabElementSkill == null)
                {
                    continue;
                }

                string     itemName  = index < 10 ? "0" + index.ToString() : index.ToString();
                GameObject skillitem = Utils.BindObjToParent(m_PartnerSkillItem, m_ElementSkillGrid, itemName);
                if (skillitem == null || skillitem.GetComponent <PartnerSkillItemLogic>() == null)
                {
                    continue;
                }

                skillitem.GetComponent <PartnerSkillItemLogic>().InitElementSkill(skillid);
                AddSkillItemListener(skillitem);
                index += 1;

                nValidElementSkillCount += 1;
            }
        }

        //int nEmptySlotCount = Fellow.FELLOW_TALLENTSKILL_OPENCOUNT + Fellow.FELLOW_ELEMENTSKILL_OPENCOUNT - nValidTalentSkillCount - nValidElementSkillCount;
        int nEmptySlotCount = Fellow.FELLOW_ELEMENTSKILL_OPENCOUNT - nValidElementSkillCount;
        int nLockSlotCount  = Fellow.FELLOW_ELEMENTSKILL_LEVELNEED.Length;

        if (false == fellow.IsBabyFellow())
        {
            for (int i = 0; i < Fellow.FELLOW_ELEMENTSKILL_LEVELNEED.Length; i++)
            {
                if (fellow.Level >= Fellow.FELLOW_ELEMENTSKILL_LEVELNEED[i])
                {
                    nLockSlotCount -= 1;
                }
            }
        }

        for (int i = 0; i < nEmptySlotCount; i++)
        {
            string     itemName  = index < 10 ? "0" + index.ToString() : index.ToString();
            GameObject skillitem = Utils.BindObjToParent(m_PartnerSkillItem, m_ElementSkillGrid, itemName);
            if (skillitem == null || skillitem.GetComponent <PartnerSkillItemLogic>() == null)
            {
                break;
            }

            skillitem.GetComponent <PartnerSkillItemLogic>().InitEmptySkill(i >= nEmptySlotCount - nLockSlotCount);
            AddSkillItemListener(skillitem);
            index += 1;
        }
        m_TalentSkillGrid.GetComponent <UIGrid>().Reposition();
        m_ElementSkillGrid.GetComponent <UIGrid>().Reposition();
    }
Beispiel #11
0
    public void InitElementSkill_Info(int skillid)
    {
        Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);

        if (tabSkill == null)
        {
            return;
        }

        Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(skillid, 0);

        if (tabSkillEx == null)
        {
            return;
        }

        Tab_SkillBase tabBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);

        if (tabBase == null)
        {
            return;
        }

        m_TallentSkillId = GlobeVar.INVALID_ID;
        m_ElementSkillId = skillid;

        m_NameLabel.text = tabBase.Name;
        m_NameLabel.gameObject.SetActive(true);

        Tab_CabalFellowElementSkill tabNextSkill = TableManager.GetCabalFellowElementSkillByID(tabSkill.NextSkillId, 0);

        if (tabNextSkill == null)
        {
            m_ExpLabel.text = "MAX";
        }
        else
        {
            m_ExpLabel.text = StrDictionary.GetClientDictionaryString("#{10321}", GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(tabNextSkill.NeedBookId), tabNextSkill.NeedBookCount);
        }
        m_ExpLabel.gameObject.SetActive(true);

        m_SkillIcon.spriteName = tabBase.Icon;
        m_SkillIcon.gameObject.SetActive(true);

        m_QualityPic.spriteName = FellowTool.GetFellowElementSkillQualityPic(skillid);

        m_LevelLabel.text = FellowTool.GetFellowElementLevelText(skillid);
        m_LevelLabel.gameObject.SetActive(true);

        m_FlagLabel.gameObject.SetActive(false);
        m_LockSprite.SetActive(false);

        if (m_LevelUpButton != null)
        {
            m_LevelUpButton.SetActive(tabSkill.NextSkillId != GlobeVar.INVALID_ID);
        }

        updateElementRemindPoint(skillid);
        if (PartnerFrameLogic.Instance() != null)
        {
            PartnerFrameLogic.Instance().UpdateDevelopRemindPoint();
        }
    }
    void SetSkills(Fellow fellow)
    {
        Utils.CleanGrid(gridElementSkills.gameObject);
        Utils.CleanGrid(gridTalentSkills.gameObject);

        int index = 0;

        int nValidTalentSkillCount = 0;

        foreach (KeyValuePair <int, int> pair in fellow.TallentSkill)
        {
            int skillid = pair.Key;
            if (skillid <= 0)
            {
                break;
            }
            Tab_CabalFellowTallentSkill tabTallentSkill = TableManager.GetCabalFellowTallentSkillByID(skillid, 0);
            if (tabTallentSkill == null)
            {
                break;
            }
            string     itemName  = index < 10 ? "0" + index.ToString() : index.ToString();
            GameObject skillitem = Utils.BindObjToParent(skillTemplate, gridTalentSkills.gameObject, itemName);
            if (skillitem == null || skillitem.GetComponent <PartnerSkillItemLogic>() == null)
            {
                break;
            }
            skillitem.GetComponent <PartnerSkillItemLogic>().InitTallentSkill(skillid);
            index += 1;
            nValidTalentSkillCount += 1;
        }

        int nValidElementSkillCount = 0;

        for (int i = 0; i < Fellow.FELLOW_ELEMENTSKILL_COUNT && i < Fellow.FELLOW_ELEMENTSKILL_OPENCOUNT; i++)
        {
            int skillid = fellow.GetElementSkillId(i);
            if (skillid <= 0)
            {
                break;
            }
            Tab_CabalFellowElementSkill tabElementSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);
            if (tabElementSkill == null)
            {
                break;
            }
            string     itemName  = index < 10 ? "0" + index.ToString() : index.ToString();
            GameObject skillitem = Utils.BindObjToParent(skillTemplate, gridElementSkills.gameObject, itemName);
            if (skillitem == null || skillitem.GetComponent <PartnerSkillItemLogic>() == null)
            {
                break;
            }
            skillitem.GetComponent <PartnerSkillItemLogic>().InitElementSkill(skillid);
            index += 1;
            nValidElementSkillCount += 1;
        }

        int nEmptySlotCount = Fellow.FELLOW_ELEMENTSKILL_OPENCOUNT - nValidElementSkillCount;
        int nLockSlotCount  = Fellow.FELLOW_ELEMENTSKILL_LEVELNEED.Length;

        for (int i = 0; i < Fellow.FELLOW_ELEMENTSKILL_LEVELNEED.Length; i++)
        {
            if (fellow.Level >= Fellow.FELLOW_ELEMENTSKILL_LEVELNEED[i])
            {
                nLockSlotCount -= 1;
            }
        }

        for (int i = 0; i < nEmptySlotCount; i++)
        {
            string     itemName  = index < 10 ? "0" + index.ToString() : index.ToString();
            GameObject skillitem = Utils.BindObjToParent(skillTemplate, gridElementSkills.gameObject, itemName);
            if (skillitem == null || skillitem.GetComponent <PartnerSkillItemLogic>() == null)
            {
                break;
            }

            skillitem.GetComponent <PartnerSkillItemLogic>().InitEmptySkill(i >= nEmptySlotCount - nLockSlotCount);
            index += 1;
        }
        gridTalentSkills.Reposition();
        gridElementSkills.Reposition();
    }
    public void UpdateFellow_SkillInfo(Fellow fellow)
    {
        Utils.CleanGrid(m_SkillItemGrid);

        int index = 0;

        foreach (KeyValuePair <int, int> pair in fellow.TallentSkill)
        {
            int skillid = pair.Key;
            if (skillid <= 0)
            {
                continue;
            }

            Tab_CabalFellowTallentSkill tabTallentSkill = TableManager.GetCabalFellowTallentSkillByID(skillid, 0);
            if (tabTallentSkill == null)
            {
                continue;
            }

            string     itemName  = index < 10 ? "0" + index.ToString() : index.ToString();
            GameObject skillitem = Utils.BindObjToParent(m_PartnerSkillItem, m_SkillItemGrid, itemName);
            if (skillitem == null || skillitem.GetComponent <ChatInfoLinkFellowItemLogic>() == null)
            {
                continue;
            }

            skillitem.GetComponent <ChatInfoLinkFellowItemLogic>().InitTallentSkill(skillid);

            index += 1;
        }

        for (int i = 0; i < Fellow.FELLOW_ELEMENTSKILL_COUNT && i < Fellow.FELLOW_ELEMENTSKILL_OPENCOUNT; i++)
        {
            int skillid = fellow.GetElementSkillId(i);
            if (skillid <= 0)
            {
                break;
            }

            Tab_CabalFellowElementSkill tabElementSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);
            if (tabElementSkill == null)
            {
                break;
            }

            string     itemName  = index < 10 ? "0" + index.ToString() : index.ToString();
            GameObject skillitem = Utils.BindObjToParent(m_PartnerSkillItem, m_SkillItemGrid, itemName);
            if (skillitem == null || skillitem.GetComponent <ChatInfoLinkFellowItemLogic>() == null)
            {
                break;
            }

            skillitem.GetComponent <ChatInfoLinkFellowItemLogic>().InitElementSkill(skillid);

            index += 1;
        }

        if (m_SkillItemGrid.GetComponent <UIGrid>() != null)
        {
            m_SkillItemGrid.GetComponent <UIGrid>().Reposition();
        }
    }
    public void Init(int skillid, int index, int fellowlevel)
    {
        if (skillid == GlobeVar.INVALID_ID)
        {
            if (index < 0 || index >= Fellow.FELLOW_ELEMENTSKILL_LEVELNEED.Length)
            {
                return;
            }

            m_SkillIcon.gameObject.SetActive(false);
            //m_QualityPic.spriteName = "white-jinengkuang";
            m_UnLockButton.SetActive(false);
            int LvValue = Fellow.FELLOW_ELEMENTSKILL_LEVELNEED[index];
            m_Level.text = LvValue.ToString();
            if (fellowlevel >= LvValue)
            {
                m_LockButton.SetActive(true);
                m_NoHoldSprite.SetActive(false);
                m_bValidSlot = true;
                m_bLocked    = false;
            }
            else
            {
                m_LockButton.SetActive(false);
                m_NoHoldSprite.SetActive(true);
                m_bValidSlot = false;
                m_bLocked    = true;
            }
        }
        else
        {
            Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);
            if (tabSkill == null)
            {
                return;
            }

            Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(skillid, 0);
            if (tabSkillEx == null)
            {
                return;
            }

            Tab_SkillBase tabBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);
            if (tabBase == null)
            {
                return;
            }

            m_SkillIcon.spriteName = tabBase.Icon;
            m_SkillIcon.gameObject.SetActive(true);
            Tab_CabalFellowElementSkill tabNextSkill = TableManager.GetCabalFellowElementSkillByID(tabSkill.NextSkillId, 0);
            if (tabNextSkill == null)
            {
                m_Level.text = "MAX";
            }
            m_Level.text = FellowTool.GetFellowElementLevelText(skillid);

            m_LockButton.SetActive(true);
            m_UnLockButton.SetActive(false);

            m_NoHoldSprite.SetActive(false);

            m_bValidSlot = true;
            m_bLocked    = false;
        }
    }
Beispiel #15
0
    public int GetPartnerSkillCanLevelUpCount()
    {
        //遍历伙伴容器
        FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer;

        if (container == null)
        {
            return(0);
        }
        List <Fellow> fellowlist = FellowTool.FellowSort(container);

        for (int i = 0; i < fellowlist.Count; ++i)
        {
            Fellow fellow = fellowlist[i];
            if (fellow.IsValid())
            {
                //天赋技能
                foreach (KeyValuePair <int, int> pair in fellow.TallentSkill)
                {
                    if (pair.Key != GlobeVar.INVALID_ID)
                    {
                        int talentSkillId = pair.Key;
                        Tab_CabalFellowTallentSkill tabTalentSkill = TableManager.GetCabalFellowTallentSkillByID(talentSkillId, 0);
                        if (tabTalentSkill == null)
                        {
                            return(0);
                        }
                        int needTalentBookId = tabTalentSkill.SkillBook;
                        if (tabTalentSkill.NextSkillId != GlobeVar.INVALID_ID)
                        {
                            if (GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(needTalentBookId) > 0)
                            {
                                return(1);
                            }
                        }
                        else
                        {
                            return(0);
                        }
                    }
                }
                //培养技能
                for (int j = 0; j < Fellow.FELLOW_ELEMENTSKILL_COUNT; j++)
                {
                    int fellowElementSkillId = fellow.GetElementSkillId(i);
                    int fellowLevel          = fellow.Level;
                    int index = j;
                    if (fellowElementSkillId == GlobeVar.INVALID_ID)//空位还没有开启的话
                    {
                        if (index < 0 || index >= Fellow.FELLOW_ELEMENTSKILL_LEVELNEED.Length)
                        {
                            return(0);
                        }
                        if (fellowLevel == Fellow.FELLOW_ELEMENTSKILL_LEVELNEED[index])
                        {
                            return(0);
                        }
                    }
                    else //开启了
                    {
                        Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(fellowElementSkillId, 0);
                        if (tabSkill == null)
                        {
                            return(0);
                        }
                        Tab_CabalFellowElementSkill tabNextSkill = TableManager.GetCabalFellowElementSkillByID(tabSkill.NextSkillId, 0);
                        {
                            if (tabNextSkill == null)
                            {
                                return(0);
                            }
                            else
                            {
                                int packHaveBookNum      = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(tabNextSkill.NeedBookId);
                                int nextSkillNeedBookNum = tabNextSkill.NeedBookCount;
                                if (packHaveBookNum >= nextSkillNeedBookNum)
                                {
                                    return(1);
                                }
                            }
                        }
                    }
                }
            }
        }

        return(0);
    }