Exemple #1
0
        /// <summary>进阶数值</summary>
        private static LTAttributesData GetPartnerGradeAttributes(int heroStatId, int gradeId)
        {
            LTAttributesData attrData = new LTAttributesData();

            Hotfix_LT.Data.HeroStatTemplate heroTem = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(heroStatId);
            if (heroTem != null)
            {
                Hotfix_LT.Data.HeroInfoTemplate heroInfoTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(heroTem.character_id);
                if (heroInfoTpl == null)
                {
                    EB.Debug.LogError("伙伴信息为空,Characterid = {0}", heroTem.character_id);
                    return(attrData);
                }
                Hotfix_LT.Data.UpGradeInfoTemplate gradeInfoByGrade = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetUpGradeInfo(gradeId, heroInfoTpl.char_type);
                if (gradeInfoByGrade == null)
                {
                    EB.Debug.LogError("gradeInfoByGrade升阶信息为空,gradeid = {0}", gradeId);
                    return(attrData);
                }
                Hotfix_LT.Data.LevelUpInfoTemplate BaseAttr = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetLevelUpInfoByIDAndLevel(heroStatId, gradeInfoByGrade.level);
                if (gradeInfoByGrade != null)
                {
                    attrData.m_MaxHP = BaseAttr.maxHP * gradeInfoByGrade.inc_maxhp;
                    attrData.m_ATK   = BaseAttr.ATK * gradeInfoByGrade.inc_atk;
                    attrData.m_DEF   = BaseAttr.DEF * gradeInfoByGrade.inc_def;
                    attrData.m_Speed = BaseAttr.speed * gradeInfoByGrade.inc_speed;
                }
            }

            return(attrData);
        }
Exemple #2
0
        private FlowEnemyData Parse(object value, string uid)
        {
            if (value == null)
            {
                return(null);
            }

            long          Uid  = EB.Dot.Long("guid", value, 0);
            FlowEnemyData item = Find(uid) ?? new FlowEnemyData();//预赛敌人读取数据

            item.Uid   = EB.Dot.String("guid", value, item.Uid);
            item.TUid  = EB.Dot.String("uid", value, item.TUid);
            item.Score = EB.Dot.Integer("point", value, item.Score);
            string IconID = EB.Dot.String("charId", value, "10010");

            IconID = (IconID == "") ? "10010" : IconID;
            int skin = EB.Dot.Integer("skin", value, 0);

            Hotfix_LT.Data.HeroInfoTemplate heroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(IconID, skin);
            item.IconName   = (heroInfo != null) ? heroInfo.icon : "Partner_Head_Sugeladi";
            item.Name       = EB.Localizer.GetString(EB.Dot.String("name", value, item.Name));
            item.IsFightOut = EB.Dot.Bool("dead", value, false);
            string frameStr = EB.Dot.String("headFrame", value, null);

            item.FrameName = EconemyTemplateManager.Instance.GetHeadFrame(frameStr).iconId;
            return(item);
        }
Exemple #3
0
        private void ShowFriendUI(FriendData data)
        {
            ShowEmpty(data == null);

            if (data != null)
            {
                if (TabController.Type == eFriendType.Black)
                {
                    ShowBlacklist(data);
                }
                else
                {
                    controller.GObjects["FriendIconPartner"].CustomSetActive(true);
                    ShowFriendChatContent(data);
                    Hotfix_LT.Data.HeroInfoTemplate heroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(int.Parse(data.Head), data.Skin);
                    if (heroInfo != null)
                    {
                        controller.UiSprites["FriendIconSprite"].spriteName = heroInfo.icon;
                    }
                    controller.UiSprites["FriendFrameSprite"].spriteName = EconemyTemplateManager.Instance.GetHeadFrame(data.Frame).iconId;
                    controller.UiLabels["FriendNameLabel"].text          = data.Name;
                    controller.UiLabels["FriendLevelLabel"].text         = data.Level.ToString();

                    UpdateLikeState(data);
                }
            }
        }
Exemple #4
0
        public override void Fill(FriendData data)
        {
            Data = data;
            Hotfix_LT.Data.HeroInfoTemplate heroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(int.Parse(data.Head), data.Skin);
            if (heroInfo != null)
            {
                IconSprite.spriteName = heroInfo.icon;
            }
            FrameSprite.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(data.Frame).iconId;
            SetItemBG(DataIndex % 2);
            LTUIUtil.SetText(NameLabel, data.Name);
            LTUIUtil.SetText(LevelLabel, data.Level.ToString());
            if (data.OfflineTime != 0)
            {
                OnlineStateLabel.text = AlliancesManager.FormatOfflineDuration(data.OfflineTime);

                IconSprite.color = FrameSprite.color = Color.magenta;
            }
            else
            {
                OnlineStateLabel.text  = EB.Localizer.GetString("ID_ON_LINE");
                OnlineStateLabel.color = LT.Hotfix.Utility.ColorUtility.BrownColor;

                IconSprite.color = FrameSprite.color = LT.Hotfix.Utility.ColorUtility.WhiteColor;
            }

            UpdateVigorState();
            OnSelect(data.IsSelect);
            Redpoint.gameObject.CustomSetActive(FriendManager.Instance.Info.GetIsUnreadMessageId(data.Uid));
            if (Data.IsCanReceiveVigor && FriendManager.Instance.IsResidueVigorReceiveNum())
            {
                Redpoint.gameObject.CustomSetActive(true);
            }
        }
Exemple #5
0
        public void ShowUI(string heroId, bool isShowHp = false, bool isShowTempHp = false)
        {
            ResetStarGrid();
            int star        = 0;
            var tpl         = new Hotfix_LT.Data.HeroStatTemplate();
            var charTpl     = new Hotfix_LT.Data.HeroInfoTemplate();
            int upGradeId   = 0;
            int awakenLevel = 0;

            if (int.Parse(heroId) < 0)//hire
            {
                var hireInfo = LTInstanceHireUtil.GetHireInfoByHeroId(int.Parse(heroId));
                if (hireInfo == null)
                {
                    EB.Debug.Log("userTeam data heroID <= {0}", heroId);
                    mDMono.gameObject.CustomSetActive(false);
                    return;
                }
                int nInfoID = int.Parse(hireInfo.character_id);

                star      = hireInfo.star;
                tpl       = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStatByInfoId(nInfoID);
                charTpl   = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(nInfoID);
                upGradeId = hireInfo.upgrade;
                if (HireObj != null)
                {
                    HireObj.CustomSetActive(true);
                }
            }
            else
            {
                HireObj.CustomSetActive(false);
                Hashtable heroStatData = null;
                if (!DataLookupsCache.Instance.SearchDataByID <Hashtable>(SmallPartnerPacketRule.OWN_HERO_STATS + "." + heroId, out heroStatData))
                {
                    EB.Debug.LogError("not hero data for heroId ={0}", heroId);
                    mDMono.gameObject.CustomSetActive(false);
                    return;
                }

                string hero_templateid = EB.Dot.String("template_id", heroStatData, "");
                if (string.IsNullOrEmpty(hero_templateid))
                {
                    EB.Debug.LogError("hero_templateid is IsNullOrEmpty");
                    return;
                }

                star        = EB.Dot.Integer("star", heroStatData, 0);
                tpl         = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(hero_templateid);
                charTpl     = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(tpl.character_id, EB.Dot.Integer("skin", heroStatData, 0));
                upGradeId   = EB.Dot.Integer("stat.awake.level", heroStatData, 0);
                awakenLevel = EB.Dot.Integer("stat.awaken.level", heroStatData, 0);
            }

            OnShow(heroId, charTpl, star, upGradeId, awakenLevel, isShowHp, isShowTempHp);
        }
Exemple #6
0
 private void UpdatePartnerList()
 {
     for (int i = 0; i < mPartnerDataItems.Count; i++)
     {
         if (i < mChooseLevel.recommend_partners_id.Length)
         {
             Hotfix_LT.Data.HeroInfoTemplate data = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(mChooseLevel.recommend_partners_id[i]);
             mPartnerDataItems[i].Fill(data);
         }
         else
         {
             mPartnerDataItems[i].mDMono.gameObject.CustomSetActive(false);
         }
     }
 }
Exemple #7
0
 public void Parse(object value)
 {
     if (value != null)
     {
         this.uid        = EB.Dot.Long("uid", value, this.uid);
         this.LadderRank = EB.Dot.Integer("rank", value, -1) + 1;
         this.Name       = EB.Localizer.GetString(EB.Dot.String("name", value, this.Name));
         string IconID = EB.Dot.String("portrait", value, "10010");
         IconID = (IconID == "") ? "10010" : IconID;
         int skin = EB.Dot.Integer("skin", value, 0);
         Hotfix_LT.Data.HeroInfoTemplate heroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(IconID, skin);
         this.IconName = (heroInfo != null) ? heroInfo.icon : "Partner_Head_Sugeladi";
         string frameStr = EB.Dot.String("headFrame", value, null);
         this.FrameName = EconemyTemplateManager.Instance.GetHeadFrame(frameStr).iconId;
     }
 }
Exemple #8
0
        public override void Fill(ApplyFriendData data)
        {
            mData = data;
            //data.Head = "Partner_Head_Sidatuila";//Header_Sidatuilayitong";头像更改
            NameLabel.text        = NameLabel.transform.GetChild(0).GetComponent <UILabel>().text = mData.Name;
            LevelLabel.text       = mData.Level.ToString();
            OfflineTimeLabel.text = AlliancesManager.FormatOfflineDuration(mData.OfflineTime);
            //HeadSprite.spriteName = string.Format("{0}", data.Head);//_Main
            VerifyLabel.text = mData.VerifyInfo;
            SetItemBG(DataIndex % 2);

            Hotfix_LT.Data.HeroInfoTemplate heroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(int.Parse(data.Head), data.Skin);
            if (heroInfo != null)
            {
                HeadSprite.spriteName = heroInfo.icon;
            }
            FrameSprite.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(data.Frame).iconId;
        }
Exemple #9
0
        public override void Fill(RecommendFriendData data)
        {
            mData = data;
            SetItemBG(DataIndex % 2);

            NameLabel.text  = NameLabel.transform.GetChild(0).GetComponent <UILabel>().text = mData.Name;
            LevelLabel.text = mData.Level.ToString();

            Hotfix_LT.Data.HeroInfoTemplate heroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(int.Parse(data.Head), data.Skin);
            if (heroInfo != null)
            {
                HeadSprite.spriteName = heroInfo.icon;
            }
            else
            {
                HeadSprite.spriteName = "Partner_Head_Sidatuila";
            }
            FrameSprite.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(data.Frame).iconId;

            AddBtn.gameObject.SetActive(!mData.IsFriend);
        }