Ejemplo n.º 1
0
        public Dictionary <int, List <int> > GetPartnerCanLearnSkill()
        {
            Dictionary <int, List <int> > fellowlearnskill = new Dictionary <int, List <int> >();

            for (int i = 0; i < ContainerSize; i++)
            {
                Fellow fellow = GetFellowByIndex(i);
                if (fellow != null && fellow.IsValid() && fellow.Called && !fellowlearnskill.ContainsKey(fellow.DataId))
                {
                    for (int j = 0; j < Fellow.FELLOW_ELEMENTSKILL_COUNT && j < Fellow.FELLOW_ELEMENTSKILL_OPENCOUNT; j++)
                    {
                        if (fellow.GetElementSkillId(j) == GlobeVar.INVALID_ID && j > -1 &&
                            j < Fellow.FELLOW_ELEMENTSKILL_LEVELNEED.Length && fellow.Level >= Fellow.FELLOW_ELEMENTSKILL_LEVELNEED[j])
                        {
                            List <Tab_CabalFellowElementSkillBook> books = GameManager.gameManager.PlayerDataPool.BackPack.GetSkillLearnBooksByElementType(fellow.ElementAttr);
                            if (books != null && books.Count > j && GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(books[j].Id) > 0)
                            {
                                List <int> skills;
                                if (!fellowlearnskill.TryGetValue(fellow.DataId, out skills))
                                {
                                    skills = new List <int>();
                                }
                                skills.Add(j);
                            }
                        }
                    }
                }
            }
            return(fellowlearnskill);
        }
Ejemplo n.º 2
0
 public bool IsHaveBabyFellow()
 {
     for (int i = 0; i < m_Fellows.Count; ++i)
     {
         Fellow fellow = m_Fellows[i];
         if (fellow.IsValid() && fellow.IsBabyFellow())
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 3
0
        public static List <Fellow> FellowBabyFilter(FellowContainer container)
        {
            List <Fellow> resultList = new List <Fellow>();

            for (int i = 0; i < container.ContainerSize; i++)
            {
                Fellow fellow = container.GetFellowByIndex(i);
                if (fellow != null && fellow.IsValid() && fellow.IsBabyFellow())
                {
                    resultList.Add(container.GetFellowByIndex(i));
                }
            }
            return(resultList);
        }
Ejemplo n.º 4
0
        public static List <Fellow> FellowCanBreedingFilter(FellowContainer container)
        {
            List <Fellow> resultList = new List <Fellow>();

            for (int i = 0; i < container.ContainerSize; i++)
            {
                Fellow fellow = container.GetFellowByIndex(i);
                if (fellow != null && fellow.IsValid() && false == fellow.Called && fellow.IsBabyFellow() && fellow.ProcreateCount >= 1)
                {
                    resultList.Add(container.GetFellowByIndex(i));
                }
            }
            return(resultList);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 取得伙伴数量
        /// </summary>
        /// <returns></returns>
        public int GetFellowCount()
        {
            int count = 0;

            for (int i = 0; i < m_Fellows.Count; ++i)
            {
                Fellow fellow = m_Fellows[i];
                if (fellow.IsValid())
                {
                    ++count;
                }
            }
            return(count);
        }
Ejemplo n.º 6
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);
        }