Пример #1
0
 public void SetDataByBuddy(Hotfix_LT.Data.HeroStatTemplate hero)
 {
     /*m_Inc_MaxHP = hero.inc_MaxHP ;
      * m_Inc_PDEF = hero.inc_PDEF;
      * m_Inc_MDEF = hero.inc_MDEF;
      * m_Inc_PATK = hero.inc_PATK;
      * m_Inc_MATK = hero.inc_MATK;
      * m_MaxHP = hero.base_MaxHP;
      * m_PDEF = hero.base_PDEF;
      * m_PATK = hero.base_PATK;
      * m_MDEF = hero.base_MDEF;
      * m_MATK = hero.base_MATK;
      * m_Speed = hero.speed;
      * m_Stun = hero.stun;
      * m_Critical = hero.critical;
      * m_CriticalHit = hero.critical_hit;
      * m_Penetration = hero.penetration;
      * m_Damage_Reduction = hero.damage_reduction;
      * m_Heal_Recover = hero.heal_recover;
      * m_Spell_Penetration = hero.spell_penetration;
      * m_Dodge_Rating = hero.dodge_rating;
      * m_Threaten = hero.threaten;
      *
      * m_Anti_Mu_Rating = hero.anti_mu_rating;
      * m_Anti_Jin_Rating = hero.anti_jin_rating;
      * m_Anti_Shui_Rating = hero.anti_shui_rating;
      * m_Anti_Huo_Rating = hero.anti_huo_rating;
      * m_Anti_Tu_Rating = hero.anti_tu_rating;
      *
      * m_Training_MaxHP += hero.training_MaxHP;
      * m_Training_PATK += hero.training_PATK;
      * m_Training_PDEF += hero.training_PDEF;
      * m_Training_MATK += hero.training_MATK;
      * m_Training_MDEF += hero.training_MDEF;*/
 }
Пример #2
0
        void ShowInfo(string id)
        {
            bool isCharacterid = Hotfix_LT.Data.CharacterTemplateManager.Instance.HasHeroInfo(int.Parse(id));

            if (isCharacterid)
            {
                var charTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(id);
                heroStat = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(int.Parse(id) + 1);
                if (charTpl != null)
                {
                    ShowItem.LTItemData = new LTShowItemData(id, 1, LTShowItemType.TYPE_HERO, true);
                    LTUIUtil.SetText(TypeLabel, string.Format("{0}", charTpl.role_profile == null ? EB.Localizer.GetString("ID_NATION_BATTLE_BUFF_FULL_CALL") : charTpl.role_profile));
                    TypeSprite.spriteName    = charTpl.role_profile_icon;
                    QualitySprite.spriteName = LTPartnerConfig.PARTNER_GRADE_SPRITE_NAME_DIC[(PartnerGrade)charTpl.role_grade];;
                    LTUIUtil.SetText(DescTextLabel, charTpl.role_profile_text == null ? EB.Localizer.GetString("ID_NATION_BATTLE_BUFF_FULL_CALL") : charTpl.role_profile_text);
                }
            }
            else //这里做兼容,之前小伙伴没有品级,所有的id 都是character_id 现在id有可能有template_id
            {
                heroStat = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(id);
                if (heroStat != null)
                {
                    var charTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(heroStat.character_id);
                    if (charTpl != null)
                    {
                        ShowItem.LTItemData      = new LTShowItemData(id, 1, LTShowItemType.TYPE_HERO, true);
                        TypeSprite.spriteName    = charTpl.role_profile_icon;
                        QualitySprite.spriteName = LTPartnerConfig.PARTNER_GRADE_SPRITE_NAME_DIC[(PartnerGrade)charTpl.role_grade];;
                        LTUIUtil.SetText(TypeLabel, string.Format("{0}", charTpl.role_profile == null ? EB.Localizer.GetString("ID_NATION_BATTLE_BUFF_FULL_CALL") : charTpl.role_profile));
                        LTUIUtil.SetText(DescTextLabel, charTpl.role_profile_text == null ? EB.Localizer.GetString("ID_NATION_BATTLE_BUFF_FULL_CALL") : charTpl.role_profile_text);
                    }
                }
            }
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dataID"> heroStats.11111</param>
        /// <param name="ishero"></param>
        /// <returns></returns>
        public static AttributesData GetAttributsByBuddyInventoryID(string dataID, bool ishero, int star = -1)
        {
            //通过dataID 获取角色配表id和等线
            string buddyid;
            int    level;
            //通过配表id获取所有的属怿

            //获取计算结果

            AttributesData attData = new AttributesData();
            //通过dataID 获取角色配表id和等线
            IDictionary inventorydata;

            if (!DataLookupsCache.Instance.SearchDataByID <IDictionary>(dataID, out inventorydata))
            {
                return(null);
            }
            else
            {
                buddyid = inventorydata["template_id"].ToString();
                if (!ishero)
                {
                    level = EB.Dot.Integer("stat.level", inventorydata, 1);
                }
                else
                {
                    if (!DataLookupsCache.Instance.SearchIntByID("level", out level))
                    {
                        level = 1;
                    }
                }

                if (star < 0)
                {
                    star = 0;
                    star = EB.Dot.Integer("star", inventorydata, 0);
                }
            }

            //通过配表id获取所有的属怿
            Hotfix_LT.Data.HeroStatTemplate hero = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(buddyid);
            if (hero == null)
            {
            }
            else
            {
                SetBaseAttribute(hero, star, level, ref attData);

                //将修为的数据计算进去
                GetTraningAttriButsByBuddyInventoryID(dataID, attData);
            }

            //计算升星
            {
                GetStarAttriButsByBuddyInventoryID(dataID, attData, star);
            }
            return(attData);
        }
Пример #4
0
 /// <summary>
 /// 基础属性和升星有关
 /// </summary>
 /// <param name="hero"></param>
 /// <param name="star"></param>
 /// <param name="level"></param>
 /// <param name="attData"></param>
 public static void SetBaseAttribute(Hotfix_LT.Data.HeroStatTemplate hero, int star, int level, ref AttributesData attData)
 {
     attData.SetDataByBuddy(hero);
     //获取计算结果
     attData.m_MaxHP = CalcBaseAttribute(attData.m_MaxHP * star_BR[star], attData.m_Inc_MaxHP, level);
     attData.m_PATK  = CalcBaseAttribute(attData.m_PATK * star_BR[star], attData.m_Inc_PATK, level);
     attData.m_MATK  = CalcBaseAttribute(attData.m_MATK * star_BR[star], attData.m_Inc_MATK, level);
     attData.m_PDEF  = CalcBaseAttribute(attData.m_PDEF * star_BR[star], attData.m_Inc_PDEF, level);
     attData.m_MDEF  = CalcBaseAttribute(attData.m_MDEF * star_BR[star], attData.m_Inc_MDEF, level);
 }
Пример #5
0
        public void SetMatchBase(LTHeroBattleAPI.HeroBattleMatchBase data)
        {
            matchData.isGetReward = data.IsGetReward;
            matchData.victoryNum  = data.VictoryCount;
            matchData.defeatNum   = data.DefeatCount;
            matchData.defeatMax   = (int)Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("heroBattleDefeatMaxCount");
            matchData.victoryMax  = (int)Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("heroBattleVictoryMaxCount");
            matchData.listLimitFreeHero.Clear();
            matchData.listLimitFreeCell.Clear();
            matchData.listBaseHero.Clear();
            matchData.listBaseHeroCell.Clear();
            for (int i = 0; i < data.FreeHeros.Count; i++)
            {
                int tplID = int.Parse((string)data.FreeHeros[i]);
                matchData.listLimitFreeHero.Add(tplID);
                Hotfix_LT.Data.HeroStatTemplate heroStat = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(tplID);
                if (heroStat != null)
                {
                    Hotfix_LT.Data.HeroInfoTemplate heroInfo   = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(heroStat.character_id);
                    HeroBattleChoiceCellData        choiceCell = new HeroBattleChoiceCellData(tplID, heroInfo, 0);
                    matchData.listLimitFreeCell.Add(choiceCell);
                }
                else
                {
                    EB.Debug.LogError("SetMatchBase.FreeHeros:heroStat is null tplID={0}", tplID);
                }
            }

            for (int i = 0; i < data.BaseHeroes.Count; i++)
            {
                int tplID = int.Parse((string)data.BaseHeroes[i]);
                matchData.listBaseHero.Add(tplID);
                Hotfix_LT.Data.HeroStatTemplate heroStat = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(tplID);
                if (heroStat != null)
                {
                    Hotfix_LT.Data.HeroInfoTemplate heroInfo   = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(heroStat.character_id);
                    HeroBattleChoiceCellData        choiceCell = new HeroBattleChoiceCellData(tplID, heroInfo, 0);
                    matchData.listBaseHeroCell.Add(choiceCell);
                }
                else
                {
                    EB.Debug.LogError("SetMatchBase.BaseHeroes:heroStat is null tplID={0}", tplID);
                }
            }

            choiceData.AddHeroPool();

            // if (LTHeroBattleEvent.NotifyRefreshMatchData != null)
            // {
            //     LTHeroBattleEvent.NotifyRefreshMatchData(matchData);
            // }
        }
Пример #6
0
 private HeroBattleChoiceCellData GetHeroCellCommon(int heroTplID)
 {
     Hotfix_LT.Data.HeroStatTemplate heroStat = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(heroTplID);
     if (heroStat != null)
     {
         Hotfix_LT.Data.HeroInfoTemplate heroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(heroStat.character_id);
         LTPartnerData            data            = LTPartnerDataManager.Instance.GetPartnerByStatId(heroTplID);
         HeroBattleChoiceCellData choiceCell      = new HeroBattleChoiceCellData(heroTplID, heroInfo, 0);
         int curskin = 0;
         if (data != null)
         {
             curskin = data.CurSkin;
             choiceCell.modelName = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(data.InfoId, curskin).model_name;
         }
         return(choiceCell);
     }
     else
     {
         EB.Debug.LogError("SetMatchBase:heroStat is null tplID={0}", heroTplID);
         return(null);
     }
 }
Пример #7
0
        private void Refresh()
        {
            LTUIUtil.SetLevelText(LevelLabSprite, levelLab, mData.level + mData.peak);
            int quality  = 0;
            int addLevel = 0;

            LTPartnerDataManager.GetPartnerQuality(mData.awakeLevel, out quality, out addLevel);

            frameSp.spriteName = LTPartnerConfig.OUT_LINE_SPRITE_NAME_DIC[quality];
            GameItemUtil.SetColorfulPartnerCellFrame(quality, frameBGSp);

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

            parentTypeSp.spriteName = LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[(Hotfix_LT.Data.eRoleAttr)mData.charType];

            starController.SetSrarList(mData.star, mData.isAwaken);

            Hotfix_LT.Data.HeroStatTemplate tempHeroStat = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(mData.templateId);

            if (tempHeroStat != null)
            {
                Hotfix_LT.Data.HeroInfoTemplate tempHeroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(tempHeroStat.character_id, mData.skin);
                if (tempHeroInfo != null)
                {
                    iconSp.spriteName = tempHeroInfo.icon;
                    HotfixCreateFX.ShowCharTypeFX(charFx, efClip, parentTypeSp.transform, (PartnerGrade)tempHeroInfo.role_grade, (Hotfix_LT.Data.eRoleAttr)mData.charType);
                    HotfixCreateFX.ShowUpgradeQualityFX(upgradeFx, frameSp.transform, quality, upgradeefclip);
                }
            }
        }
Пример #8
0
        IEnumerator StartDarw()
        {
            List <LTDrawCardData> Items = LTDrawCardDataManager.Instance.GetDrawCardData();

            if (itemData == null)
            {
                itemData = new List <LTShowItemData>();
            }
            else
            {
                itemData.Clear();
            }
            for (int i = 0; i < Items.Count; i++) //进行显示上的英雄与碎片转换
            {
                bool isHeroShard = false;
                for (int j = 0; j < i; j++)
                {
                    if (Items[i].data == Items[j].data && Items[i].type == LTShowItemType.TYPE_HERO && Items[j].type == LTShowItemType.TYPE_HERO)
                    {
                        isHeroShard = true;
                    }
                }
                if (Items[i].type == LTShowItemType.TYPE_HERO && LTDrawCardDataManager.Instance.isHeroShard(Items[i].data) || isHeroShard)
                {
                    int Cid = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(Items[i].data).character_id;
                    int Num = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(Cid).summon_shard;
                    itemData.Add(new LTShowItemData(Items[i].data, Num, LTShowItemType.TYPE_HEROSHARD));
                }
                else
                {
                    itemData.Add(new LTShowItemData(Items[i].data, Items[i].quantityNum, Items[i].type));

                    if (Items[i].type.Equals(LTShowItemType.TYPE_HERO))
                    {
                        Hotfix_LT.Data.HeroStatTemplate tempStat = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(Items[i].data);
                        if (tempStat != null)
                        {
                            Hotfix_LT.Data.HeroInfoTemplate tempInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(tempStat.character_id);
                            if (tempInfo != null)
                            {
                                if (tempInfo.cultivateGift == 1)
                                {
                                    LTChargeManager.Instance.IsShowDrawGift = true;
                                    EB.Debug.Log("LTGetItemUIController OnAddToStack Draw is Success!");
                                }
                            }
                            else
                            {
                                EB.Debug.LogError("LTGetItemUIController OnAddToStack Hotfix_LT.Data.HeroInfoTemplate is Null, id = {0}", tempStat.character_id);
                            }
                        }
                        else
                        {
                            EB.Debug.LogError("LTGetItemUIController OnAddToStack Hotfix_LT.Data.HeroStatTemplate is Null, id = {0}", Items[i].data);
                        }
                    }
                }
            }

            if (m_type == DrawCardType.hc)
            {
                Scroll.mDMono.GetComponent <UIGrid>().cellHeight = 650;
            }
            else
            {
                Scroll.mDMono.GetComponent <UIGrid>().cellHeight = 400;
            }

            Scroll.SetItemDatas(itemData, false);
            if (DrawCardEvent.HideFxParent != null)
            {
                DrawCardEvent.HideFxParent();
            }

            {//抽奖特效表现
                GameObject DrawingFx;
                if (m_type == DrawCardType.gold)
                {
                    DrawingFx = SliverDrawingFx;
                    long_wait = new WaitForSeconds(2.7f);
                    FusionAudio.PostEvent("UI/New/ChouJiang", true);
                    SkipBtn.CustomSetActive(true);
                }
                else if (m_type == DrawCardType.ur)
                {
                    DrawingFx = GoldDrawingFx;
                    long_wait = new WaitForSeconds(8.2f);
                    FusionAudio.PostEvent("UI/New/ChouJiangZuanShi", true);
                    SkipBtn.CustomSetActive(true);
                }
                else
                {
                    DrawingFx = GoldDrawingFx;
                    long_wait = new WaitForSeconds(8.2f);
                    FusionAudio.PostEvent("UI/New/ChouJiangZuanShi", true);
                    if (!GuideNodeManager.IsGuide)
                    {
                        SkipBtn.CustomSetActive(true);
                    }
                }
                DrawingFx.CustomSetActive(true);
                yield return(long_wait);

                if (isSkip)
                {
                    yield break;
                }
                MainHud.CustomSetActive(true);
            }

            if (isSkip)
            {
                yield break;
            }

            StartCoroutine(ShowItemAmi(itemData));
            yield return(small_wait);

            FxHud.CustomSetActive(false);
        }