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_NameLabel.text       = tabBase.Name;
        m_LevelLabel.text      = FellowTool.GetFellowElementLevelText(skillid);
        m_DescLabel.text       = tabSkillEx.SkillDesc;
        m_SkillIcon.spriteName = tabBase.Icon;
        //m_QualityPic.spriteName = FellowTool.GetFellowElementSkillQualityPic(skillid);
    }
Example #2
0
    void OnFriendFellowPress()
    {
        if (false == GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.IsValid())
        {
            return;
        }

        Tab_CabalFellowAttr tabFellow = TableManager.GetCabalFellowAttrByID(GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.DataId, 0);

        if (tabFellow == null)
        {
            return;
        }

        Tab_CabalFellowTallentSkill tabTalent = TableManager.GetCabalFellowTallentSkillByID(GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.TalentSkill, 0);

        if (tabTalent == null)
        {
            return;
        }

        m_PartnerAttrWindow.SetActive(true);
        m_PartnerAttrWindow.transform.localPosition = new Vector3(200, 0, 0);

        m_PartnerAttr_HeadIcon.spriteName      = tabFellow.Icon;
        m_PartnerAttr_Quality.spriteName       = FellowTool.GetFellowQualityFrame(GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.Quality);
        m_PartnerAttr_Name.text                = GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.Name;
        m_PartnerAttr_Lucky.text               = GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.Lucky.ToString();
        m_PartnerAttr_Level.text               = GameManager.gameManager.PlayerDataPool.FriendBreedingFellowInfo.Level.ToString();
        m_PartnerAttr_TalentIcon.spriteName    = tabTalent.Icon;
        m_PartnerAttr_TalentQuality.spriteName = FellowTool.GetFellowTallentSkillQualityPic(tabTalent.Id);
        m_PartnerAttr_TalentName.text          = tabTalent.Name;
        m_PartnerAttr_TalentDesc.text          = tabTalent.SkillDesc;
    }
    public void SetData(Fellow fellow)
    {
        sprHead.spriteName        = fellow.GetIcon();
        sprHeadQuality.spriteName = FellowTool.GetFellowQualityFrame(fellow.Quality);
        lblName.text         = fellow.Name;
        lblLv.text           = fellow.Level.ToString();
        sprTalent.spriteName = FellowTool.GetFellowElementPic(fellow.ElementAttr);
        lblType.text         = FellowTool.GetFellowTypeText(fellow.GetFellowType(), fellow.GetEvolveLevel());

        if (fellow.IsBabyFellow())
        {
            skillArea.SetActive(false);
            m_cloneArea.SetActive(true);
            SetStarState(false);
            SetCloneInfo(fellow);
        }
        else
        {
            skillArea.SetActive(true);
            m_cloneArea.SetActive(false);
            SetStarState(true);
            SetSkills(fellow);
        }
        UpdateFellowInfo_CurStar(fellow);
    }
    void UpdateFellowInfo_Attr(Fellow fellow)
    {
        m_NameLabel.text        = fellow.Name;
        m_CombatValueLabel.text = fellow.GetCombatValue().ToString();
        m_TypeLabel.text        = FellowTool.GetFellowTypeText(fellow.GetFellowType(), fellow.GetEvolveLevel());
        m_BattleLevelLabel.text = fellow.GetCallLevel().ToString();
        m_LevelLabel.text       = fellow.Level.ToString();
        m_ExpLabel.text         = StrDictionary.GetClientDictionaryString("#{10316}", fellow.Exp, fellow.GetFellowLevelUpNeedExp());
        //m_GrowUpLabel.text = fellow.GrowUp.ToString();

        m_AttackLabel.text   = fellow.GetAttackValue().ToString();
        m_HitLabel.text      = fellow.GetHitValue().ToString();
        m_CriticalLabel.text = fellow.GetCriticalValue().ToString();
        m_GuardLabel.text    = fellow.GetGuardValue().ToString();
        m_BlessLabel.text    = fellow.GetBlessValue().ToString();

        if (fellow.GetFellowType() == (int)FELLOWTYPE.BABY)
        {
            m_ProCreateLabel.text = fellow.ProcreateCount.ToString();
            m_LuckyLabel.text     = fellow.Lucky.ToString();
            m_BabyAttr.SetActive(true);
            m_SkillArea.SetActive(false);
        }
        else
        {
            m_BabyAttr.SetActive(false);
            m_SkillArea.SetActive(true);
        }

        m_ElementPic.spriteName = FellowTool.GetFellowElementPic(fellow.ElementAttr);
        // m_QualityIcon.spriteName = FellowTool.GetFellowQualityIcon(fellow.Quality);
    }
Example #5
0
    /// <summary>
    /// 点击添加宝宝
    /// </summary>
    void OnChoosePartnerClick()
    {
        NewPlayerGuidLogic.CloseWindow();
        FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer;

        if (container == null)
        {
            return;
        }

        List <Fellow> babylist = FellowTool.FellowCanBreedingFilter(container);

        //List<Fellow> babylist = FellowTool.FellowBabyFilter(container);

        if (babylist.Count <= 0)
        {
            GUIData.AddNotifyData("#{10330}");
            return;
        }

        m_FellowIndexBuffer = m_FellowIndex;

        m_PartnerChooseWindow.SetActive(true);
        ShowChooseBabyFellow(babylist);
    }
 private void SetQuality(Fellow fellow)
 {
     if (m_QualitySprite != null)
     {
         m_QualitySprite.spriteName = FellowTool.GetFellowQualityFrame(fellow.Quality);
     }
 }
    public override void Init(ChatInfoSelectLinkLogic.Data data, int index)
    {
        base.Init(data, index);

        this.name = index.ToString();

        FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer;

        if (container == null)
        {
            return;
        }
        Fellow fellow = container.GetFellowByGuid(data.guid);

        if (null == fellow)
        {
            return;
        }

        m_fellowIcon.spriteName    = fellow.GetIcon();
        m_fellowName.text          = fellow.Name;
        m_level.text               = fellow.Level.ToString();
        m_combatValue.text         = fellow.GetCombatValue().ToString();
        m_fellowQuality.spriteName = FellowTool.GetFellowQualityFrame(fellow.Quality);
        this.m_fellowGuid          = data.guid;
    }
    /// <summary>
    /// 选择被吃的宝宝
    /// </summary>
    /// <param name="item"></param>
    public void OnChooseMaterialClick(MaterialPartnerItemLogic item)
    {
        if (item.Choose)
        {
            m_ChoosePartnerGuid.Add(item.GetGuid());
            m_ChoosePartnerExp += item.StarExp;
        }
        else
        {
            m_ChoosePartnerGuid.Remove(item.GetGuid());
            m_ChoosePartnerExp -= item.StarExp;
        }
        ShowFellowDetail(item.m_fellow);

        int nTotalStarExp = m_ChoosePartnerExp + m_Fellow.StarExp;

        m_ChooseMaterialExpSprite.fillAmount = (float)nTotalStarExp / (float)m_Fellow.GetCurStarExpMax();

        int addLevel = FellowTool.GetFellowAddStarLevel(m_Fellow.StarLevel, nTotalStarExp);

        if (addLevel > 0)
        {
            m_ChooseMaterialExpCount.gameObject.SetActive(true);
            m_ChooseMaterialExpCount.text = "x" + addLevel.ToString();
        }
        else
        {
            m_ChooseMaterialExpCount.gameObject.SetActive(false);
        }

        if (PartnerFrameLogic.Instance().NewPlayerGuideFlag_Step == 17)
        {
            PartnerFrameLogic.Instance().NewPlayerGuide(18);
        }
    }
    void UpdateFellowInfo_NextStar(Fellow fellow, int addExp)
    {
        int nNewStarExp = fellow.StarExp + addExp;
//        int nTotalStarExp = nNewStarExp;
        int addLevel = FellowTool.GetFellowAddStarLevel(fellow.StarLevel, nNewStarExp);

//        int nNewStarLevel = fellow.StarLevel + addLevel;

        if (fellow.GetCurStarExpMax() > 0)
        {
            //m_MaterialPartnerExpLabel.text = nNewStarExp.ToString() + "/" + fellow.GetCurStarExpMax();
            m_MaterialPartnerExpSprite.fillAmount = (float)nNewStarExp / (float)fellow.GetCurStarExpMax();
        }
        else
        {
            //m_MaterialPartnerExpLabel.text = "";
            m_MaterialPartnerExpSprite.fillAmount = 0;
        }

        if (addLevel > 0)
        {
            m_MaterialPartnerExpCount.gameObject.SetActive(true);
            m_MaterialPartnerExpCount.text = "x" + addLevel.ToString();
        }
        else
        {
            m_MaterialPartnerExpCount.gameObject.SetActive(false);
        }
    }
Example #10
0
 private void SetQuality(Fellow fellow)
 {
     if (m_QualitySprite != null)
     {
         m_QualitySprite.spriteName = FellowTool.GetFellowQualityFrame(fellow.Quality);
         m_QualitySprite.gameObject.SetActive(true);
     }
 }
Example #11
0
 public void SetDate(Fellow fellow)
 {
     lblName.text               = fellow.Name;
     lblLv.text                 = fellow.Level.ToString();
     lblPropBreed.text          = fellow.ProcreateCount.ToString();
     lblPropLucky.text          = fellow.Lucky.ToString();
     sprHead.spriteName         = fellow.GetIcon();
     sprQualityFrame.spriteName = FellowTool.GetFellowQualityFrame(fellow.Quality);
     sprQualityStone.spriteName = FellowTool.GetFellowQualityIcon(fellow.Quality);
 }
Example #12
0
 void UpdateFellowInfo_Attr(Fellow fellow)
 {
     m_NameLabel.text           = fellow.Name;
     m_IconSprite.spriteName    = fellow.GetIcon();
     m_QualitySprite.spriteName = FellowTool.GetFellowQualityFrame(fellow.Quality);
     // m_QualityIcon.spriteName = FellowTool.GetFellowQualityIcon(fellow.Quality);
     m_CombatValueLabel.text = fellow.GetCombatValue().ToString();
     m_LevelLabel.text       = fellow.Level.ToString();
     m_ExpLabel.text         = StrDictionary.GetClientDictionaryString("#{10316}", fellow.Exp, fellow.GetFellowLevelUpNeedExp());
 }
Example #13
0
    public void Init(Tab_CabalFellowElementSkillBook book)
    {
        Tab_CommonItem bookShowInfo = TableManager.GetCommonItemByID(book.Id, 0);

        mBook                   = bookShowInfo;
        m_NameLabel.text        = bookShowInfo.Name;
        m_SkillIcon.spriteName  = bookShowInfo.Icon;
        m_ElementPic.spriteName = FellowTool.GetFellowElementPic(book.ElementAttr);
        m_ElementLabel.text     = FellowTool.GetFellowElementText(book.ElementAttr);
    }
    public void UpdateFellow_AttrInfo(Fellow fellow)
    {
        m_headPic.spriteName    = fellow.GetIcon();
        m_NameLabel.text        = fellow.Name;
        m_CombatValueLabel.text = fellow.CombatValue.ToString();
        if (fellow.GetFellowType() == (int)FELLOWTYPE.ALIEN)
        {
            m_TypeLabel.text = FellowTool.GetFellowTypeText(fellow.GetFellowType(), fellow.GetEvolveLevel());
        }
        else
        {
            m_TypeLabel.text = FellowTool.GetFellowTypeText(fellow.GetFellowType());
        }
        m_BattleLevelLabel.text = fellow.GetCallLevel().ToString();
        m_LevelLabel.text       = "LV" + fellow.Level.ToString();
        // m_ExpLabel.text = StrDictionary.GetClientDictionaryString("#{10316}", fellow.Exp, fellow.GetFellowLevelUpNeedExp());
        // m_GrowUpLabel.text = fellow.GrowUp.ToString();

        m_AttackLabel.text   = fellow.CombatAttr_Attack.ToString();
        m_HitLabel.text      = fellow.CombatAttr_Hit.ToString();
        m_CriticalLabel.text = fellow.CombatAttr_Critical.ToString();
        m_GuardLabel.text    = fellow.CombatAttr_Guard.ToString();
        m_BlessLabel.text    = fellow.CombatAttr_Bless.ToString();

        if (fellow.GetFellowType() == (int)FELLOWTYPE.BABY)
        {
            m_ProCreateLabel.text = fellow.ProcreateCount.ToString();
            m_LuckyLabel.text     = fellow.Lucky.ToString();
            m_BabyAttr.SetActive(true);
        }
        else
        {
            m_BabyAttr.SetActive(false);
        }

        if (fellow.GetFellowType() == (int)FELLOWTYPE.ADULT || fellow.GetFellowType() == (int)FELLOWTYPE.ALIEN)
        {
            m_ElementPic.spriteName = FellowTool.GetFellowElementPic(fellow.ElementAttr);
            m_ElementAttr.SetActive(true);
        }
        else
        {
            m_ElementAttr.SetActive(false);
        }

        if (fellow.GetFellowType() == (int)FELLOWTYPE.ALIEN)
        {
            m_AlienLabel.text = fellow.GetEvolveLevel().ToString();
            m_AlienAttr.SetActive(true);
        }
        else
        {
            m_AlienAttr.SetActive(false);
        }
    }
 public void Init(Fellow fellow)
 {
     m_fellow = fellow;
     //m_NameLabel.text = Utils.GetFellowNameColor(fellow.Quality);
     m_NameLabel.text        = fellow.Name;
     m_LevelLabel.text       = fellow.Level.ToString();
     m_IconSprite.spriteName = fellow.GetIcon();
     //m_IconSprite.MakePixelPerfect();
     m_QualitySprite.spriteName = FellowTool.GetFellowQualityFrame(fellow.Quality);
     m_CombatValueLabel.text    = fellow.GetCombatValue().ToString();
     m_ProCreateLabel.text      = fellow.ProcreateCount.ToString();
     m_LuckyLabel.text          = fellow.Lucky.ToString();
 }
 private void SetFellowType(Fellow fellow)
 {
     if (m_TypeLabel != null)
     {
         if (fellow.GetFellowType() == (int)FELLOWTYPE.ALIEN)
         {
             m_TypeLabel.text = FellowTool.GetFellowTypeText(fellow.GetFellowType(), fellow.GetEvolveLevel());
         }
         else
         {
             m_TypeLabel.text = FellowTool.GetFellowTypeText(fellow.GetFellowType());
         }
     }
 }
    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();
        }
    }
Example #18
0
    private List <Data> GetDataListFellow_3()
    {
        List <Data> res = new List <Data>();

        FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer;

        if (container == null)
        {
            return(res);
        }

        List <Fellow> babylist = new List <Fellow>();
//        int nFellowCount = container.GetFellowCount();
        List <Fellow> fellowList = FellowTool.FellowSort(container);

        if (M_OPEN_TYPE == OPEN_TYPE.NORMAL)
        {
            for (int i = 0; i < fellowList.Count; ++i)
            {
                //有效槽位
                Fellow fellow = fellowList[i];
                if (fellow.IsValid())
                {
                    babylist.Add(fellow);
                }
            }
        }
        else if (M_OPEN_TYPE == OPEN_TYPE.PROPAGATE)
        {
            babylist = FellowTool.FellowCanBreedingFilter(container);
        }


        if (babylist.Count <= 0)
        {
            return(res);
        }

        for (int i = 0; i < babylist.Count; i++)
        {
            Data data = new Data();
            data.guid = babylist[i].Guid;
            res.Add(data);
        }
        return(res);
    }
Example #19
0
    void OnPlayerFellowPress()
    {
        if (m_BabyFellow == null)
        {
            return;
        }

        Tab_CabalFellowTallentSkill tabTalent = null;

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

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

            tabTalent = tabTallentSkill;
            break;
        }

        if (tabTalent == null)
        {
            return;
        }

        m_PartnerAttrWindow.SetActive(true);
        m_PartnerAttrWindow.transform.localPosition = new Vector3(-200, 0, 0);

        m_PartnerAttr_HeadIcon.spriteName      = m_BabyFellow.GetIcon();
        m_PartnerAttr_Quality.spriteName       = FellowTool.GetFellowQualityFrame(m_BabyFellow.Quality);
        m_PartnerAttr_Name.text                = m_BabyFellow.Name;
        m_PartnerAttr_Lucky.text               = m_BabyFellow.Lucky.ToString();
        m_PartnerAttr_Level.text               = m_BabyFellow.Level.ToString();
        m_PartnerAttr_TalentIcon.spriteName    = tabTalent.Icon;
        m_PartnerAttr_TalentQuality.spriteName = FellowTool.GetFellowTallentSkillQualityPic(tabTalent.Id);
        m_PartnerAttr_TalentName.text          = tabTalent.Name;
        m_PartnerAttr_TalentDesc.text          = tabTalent.SkillDesc;
    }
Example #20
0
    public void RefreshPartnerList(Predicate <Fellow> filter = null)
    {
        if (m_PartnerListGrid != null)
        {
            //先清空
            Utils.CleanGrid(m_PartnerListGrid);

            m_PartnerList.SetActive(true);

            FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer;
            if (container == null)
            {
                return;
            }
            //遍历伙伴容器
            List <Fellow> fellowList = FellowTool.FellowSort(container);
            for (int i = 0; i < fellowList.Count; ++i)
            {
                //有效槽位
                Fellow fellow = fellowList[i];
                if (fellow.IsValid())
                {
                    if (filter != null && !filter(fellow))
                    {
                        continue;
                    }
                    string objectName = "";
                    if (i < 10)
                    {
                        objectName += "0";
                    }
                    objectName += i.ToString();
                    GameObject fellowobject = Utils.BindObjToParent(m_PartnerListItem, m_PartnerListGrid, objectName);
                    if (fellowobject != null && fellowobject.GetComponent <PartnerFrameItemLogic>() != null)
                    {
                        fellowobject.GetComponent <PartnerFrameItemLogic>().UpdateFellowInfo(fellow);
                    }
                }
            }
            m_PartnerListGrid.GetComponent <UIGrid>().Reposition();
            ShowSelectFun();            //升星后列表的选中
        }
    }
Example #21
0
    public void InitTallentSkill(int skillid, int curexp)
    {
        Tab_CabalFellowTallentSkill tabSkill = TableManager.GetCabalFellowTallentSkillByID(skillid, 0);

        if (tabSkill == null)
        {
            return;
        }

        m_TallentSkillId = skillid;
        m_ElementSkillId = GlobeVar.INVALID_ID;

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

        m_ExpLabel.text = tabSkill.NextSkillId != GlobeVar.INVALID_ID ? StrDictionary.GetClientDictionaryString("#{10321}", curexp, tabSkill.LevelUpExp) : "MAX";
        m_ExpLabel.gameObject.SetActive(true);

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

        m_QualityPic.spriteName = FellowTool.GetFellowTallentSkillQualityPic(skillid);

        m_LevelLabel.text = "LV" + tabSkill.Level.ToString();
        m_LevelLabel.gameObject.SetActive(true);

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

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

        updateTalentRemindPoint(skillid);
        if (PartnerFrameLogic.Instance() != null)
        {
            PartnerFrameLogic.Instance().UpdateDevelopRemindPoint();
        }
    }
Example #22
0
    public void OnRebirthClick(Fellow fellow)
    {
        if (fellow == null)
        {
            return;
        }

        if (false == fellow.IsValid())
        {
            return;
        }

        Tab_CabalFellowAttr tabAttr = TableManager.GetCabalFellowAttrByID(fellow.DataId, 0);

        if (tabAttr == null)
        {
            return;
        }

        Tab_CabalFellowAttr tabBaby = TableManager.GetCabalFellowAttrByID(tabAttr.BabyFellowId, 0);

        if (tabBaby == null)
        {
            LogModule.ErrorLog("The fellow has not baby state, fellow id = " + fellow.DataId);
            return;
        }

        m_CurFellowIcon.spriteName         = fellow.GetIcon();
        m_CurFellowQualityFrame.spriteName = FellowTool.GetFellowQualityFrame(fellow.Quality);
        m_CurFellowNameLabel.text          = fellow.Name;
        m_RebirthFellowIcon.spriteName     = tabBaby.Icon;
        m_RebirthFellowNameLabel.text      = tabBaby.Name;
        m_RebirthItemSlot.InitInfo_Yuanbao(null, GlobeVar.PARTNER_REBIRTH_YUANBAO.ToString(), true);

        m_RebirthWindow.SetActive(true);

        m_FellowBuffer = fellow;
    }
    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;
        }
    }
    /// <summary>
    /// 自动筛选宠物
    /// </summary>
    /// <param name="quality"></param>
    void InitMaterialPartnerGrid_Auto(int quality)
    {
        Utils.CleanGrid(m_ChooseMaterialGrid);
        m_ChoosePartnerGuid.Clear();
        m_ChoosePartnerExp = 0;
        FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer;

        if (container == null)
        {
            return;
        }

        //遍历伙伴容器
        List <Fellow> fellowList   = FellowTool.FellowSort(container);
        bool          gotFTEFellow = false;

        for (int i = 0; i < fellowList.Count; ++i)
        {
            //有效槽位
            Fellow fellow = fellowList[i];
            if (false == fellow.IsValid() || fellow.Guid == m_Fellow.Guid || fellow.Locked)
            {
                continue;
            }

            string objectName = string.Empty;
            if (!gotFTEFellow && PartnerFrameLogic.Instance().NewPlayerGuideFlag_Step == 16 && fellow.DataId == 41)// 宠物升星引导狗粮宠
            {
                gotFTEFellow = true;
                objectName   = "a" + fellow.DataId;
            }
            else
            {
                objectName = "b" + i;
            }

            GameObject fellowobject = Utils.BindObjToParent(m_MaterialPartnerItem, m_ChooseMaterialGrid, objectName);
            var        logic        = fellowobject.GetComponent <MaterialPartnerItemLogic>();
            if (fellowobject == null || logic == null)
            {
                continue;
            }

            logic.Init(fellow);
            if (fellow.Quality < quality)
            {
                logic.Choose = true;
                m_ChoosePartnerGuid.Add(fellow.Guid);
                m_ChoosePartnerExp += logic.StarExp;
            }
        }

        if (fellowList.Count < FELLOW_PACK_DEFAULT_NUM)
        {
            for (int i = fellowList.Count; i <= FELLOW_PACK_DEFAULT_NUM; i++)
            {
                string objectName = "c" + i;
                Utils.BindObjToParent(m_MaterialPartnerItem, m_ChooseMaterialGrid, objectName);
            }
        }

        UIHexagonGrid grid = m_ChooseMaterialGrid.GetComponent <UIHexagonGrid>();

        if (grid != null)
        {
            grid.sorted = true;
            grid.Reposition();
        }

        int nTotalStarExp = m_ChoosePartnerExp + m_Fellow.StarExp;

        m_ChooseMaterialExpSprite.fillAmount = (float)nTotalStarExp / (float)m_Fellow.GetCurStarExpMax();

        int addLevel = FellowTool.GetFellowAddStarLevel(m_Fellow.StarLevel, nTotalStarExp);

        if (addLevel > 0)
        {
            m_ChooseMaterialExpCount.gameObject.SetActive(true);
            m_ChooseMaterialExpCount.text = "x" + addLevel.ToString();
        }
        else
        {
            m_ChooseMaterialExpCount.gameObject.SetActive(false);
        }
    }
Example #25
0
    public void InitPartnerList(UInt64 defaultGuid = GlobeVar.INVALID_GUID, Predicate <Fellow> filter = null)
    {
        if (m_PartnerListGrid != null)
        {
            //先清空
            Utils.CleanGrid(m_PartnerListGrid);

            m_PartnerList.SetActive(true);

            FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer;
            if (container == null)
            {
                return;
            }
            //遍历伙伴容器
            bool                  bFirst         = true;
            List <Fellow>         fellowList     = FellowTool.FellowSort(container);
            PartnerFrameItemLogic firstOneCache  = null;
            bool                  needReSelect   = false;
            bool                  needToTopReset = false;
            int firstOneCacheIndex = 0;
            for (int i = 0; i < fellowList.Count; ++i)
            {
                //有效槽位
                Fellow fellow = fellowList[i];
                if (fellow.IsValid())
                {
                    if (filter != null && !filter(fellow))
                    {
                        if (firstOneCache == null)
                        {
                            firstOneCacheIndex += 1;
                        }
                        if (fellow.Guid == defaultGuid)
                        {
                            needReSelect = true;
                        }
                        continue;
                    }
                    string objectName = "";
                    if (i < 10)
                    {
                        objectName += "0";
                    }
                    objectName += i.ToString();
                    GameObject fellowobject = Utils.BindObjToParent(m_PartnerListItem, m_PartnerListGrid, objectName);
                    if (fellowobject != null && fellowobject.GetComponent <PartnerFrameItemLogic>() != null)
                    {
                        fellowobject.GetComponent <PartnerFrameItemLogic>().UpdateFellowInfo(fellow);
                        if (i == firstOneCacheIndex)
                        {
                            firstOneCache = fellowobject.GetComponent <PartnerFrameItemLogic>();
                        }
                        if (defaultGuid == GlobeVar.INVALID_GUID)
                        {
                            if (bFirst)
                            {
                                fellowobject.GetComponent <PartnerFrameItemLogic>().OnFellowClick();
                                bFirst         = false;
                                needToTopReset = true;
                            }
                        }
                        else
                        {
                            if (fellow.Guid == defaultGuid)
                            {
                                fellowobject.GetComponent <PartnerFrameItemLogic>().OnFellowClick();
                            }
                        }
                    }
                }
            }

            if (needReSelect && firstOneCache != null)
            {
                needToTopReset = true;
                firstOneCache.OnFellowClick();
            }

            // add cloning fellow in info view
            if (filter == null && GameManager.gameManager.PlayerDataPool.IsProcreateGoing())
            {
                GameObject fellowobject = Utils.BindObjToParent(m_PartnerListItem, m_PartnerListGrid, "z00");
                if (fellowobject != null && fellowobject.GetComponent <PartnerFrameItemLogic>() != null)
                {
                    fellowobject.GetComponent <PartnerFrameItemLogic>().ShowCloningInfo();
                    if (fellowList.Count == 0)
                    {
                        fellowobject.GetComponent <PartnerFrameItemLogic>().OnFellowClick();
                    }
                }
            }

            m_PartnerListGrid.GetComponent <UIGrid>().Reposition();
            if (needToTopReset)
            {
                m_PartnerListGrid.GetComponent <UITopGrid>().Recenter(true);
            }
            m_PartnerCapacity.text = container.GetCapacityStr();
        }
        UpdateFellowTip();
    }
Example #26
0
    void UpdateChooseFellowInfo(bool forward)
    {
        FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer;

        if (container == null)
        {
            return;
        }

        List <Fellow> babylist = FellowTool.FellowCanBreedingFilter(container);

        if (babylist.Count <= 0)
        {
            return;
        }

        Fellow updatefellow = null;

        if (forward)
        {
            for (int i = (m_FellowIndexBuffer + 1) % babylist.Count; i < babylist.Count; i++)
            {
                Fellow fellow = babylist[i];
                if (false == fellow.IsValid())
                {
                    continue;
                }

                if (m_BabyFellowBuffer == null)
                {
                    updatefellow        = fellow;
                    m_FellowIndexBuffer = i;
                    break;
                }
                else
                {
                    if (fellow.Guid != m_BabyFellowBuffer.Guid)
                    {
                        updatefellow        = fellow;
                        m_FellowIndexBuffer = i;
                        break;
                    }
                }
            }
        }
        else
        {
            for (int i = (m_FellowIndexBuffer + babylist.Count - 1) % babylist.Count; i >= 0; i--)
            {
                Fellow fellow = babylist[i];
                if (false == fellow.IsValid())
                {
                    continue;
                }

                if (m_BabyFellowBuffer == null)
                {
                    updatefellow        = fellow;
                    m_FellowIndexBuffer = i;
                    break;
                }
                else
                {
                    if (fellow.Guid != m_BabyFellowBuffer.Guid)
                    {
                        updatefellow        = fellow;
                        m_FellowIndexBuffer = i;
                        break;
                    }
                }
            }
        }

        if (updatefellow == null || false == updatefellow.IsValid() || false == updatefellow.IsBabyFellow())
        {
            return;
        }

//         m_PartnerChooseIcon.spriteName = updatefellow.GetIcon();
//         m_PartnerChooseNameLabel.text = updatefellow.Name;
//         m_PartnerChooseLevelLabel.text = "LV" + updatefellow.Level.ToString();
//         m_PartnerChooseCombatValueLabel.text = updatefellow.GetCombatValue().ToString();
//         m_PartnerChooseProcreateLabel.text = updatefellow.ProcreateCount.ToString();
//         m_PartnerChooseLuckyLabel.text = updatefellow.Lucky.ToString();

        m_BabyFellowBuffer = updatefellow;
    }
Example #27
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();
        }
    }
Example #28
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);
    }