Example #1
0
        public void OnChallengeBtnClick()
        {
            int Index = itemData.index;

            if (Index < 0)
            {
                return;
            }
            if (AutoRefreshingManager.Instance.GetRefreshed(AutoRefreshingManager.RefreshName.HeroBattleRefresh))
            {
                if (Index < 100)
                {
                    Messenger.Raise(EventName.HeroBattleUpdateUI, 2);
                }
                return;
            }
            InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f);
            System.Action startCombatCallback = delegate()
            {
                if (LTNewHeroBattleManager.GetInstance().CurrentType != HeroBattleType.High)
                {
                    List <int> temp = new List <int>();
                    foreach (var VARIABLE in LTFormationDataManager.Instance.HeroBattleTempPartner)
                    {
                        temp.Add(VARIABLE.Value);
                    }
                    LTNewHeroBattleManager.GetInstance().GetNewHeroBattleChallenge(temp, Index, delegate(bool isSuccessful) { });
                }
                else
                {
                    LTNewHeroBattleManager.GetInstance().GetNewHeroBattleChallenge(Index, delegate(bool isSuccessful) { });
                }
            };
            BattleReadyHudController.Open(eBattleType.HeroBattle, startCombatCallback);
        }
Example #2
0
 //heroBattleMaxCost最大花费
 public override void SetMenuData(object param)
 {
     base.SetMenuData(param);
     UpdateUI((int)LTNewHeroBattleManager.GetInstance().CurrentType);
     FusionTelemetry.GamePlayData.PostEvent(FusionTelemetry.GamePlayData.clash_topic,
                                            FusionTelemetry.GamePlayData.clash_event_id, FusionTelemetry.GamePlayData.clash_umengId, "open");
 }
Example #3
0
        void SetData()
        {
            int type = (int)LTNewHeroBattleManager.GetInstance().GetCacheCurrentType();

            cupUITexture.SetTexture(CupTextures[type]);
            starLabel.gradientBottom = LTNewHeroBattleHudController.colorList[type];
            int maxCount;
            int winCount = 0;

            if (type < 2)
            {
                maxCount = LTNewHeroBattleHudController.MaxLay;
                int id = LTNewHeroBattleManager.GetInstance().GetCacheFinishLayer();
                winCount = EventTemplateManager.Instance.GetNextHeroBattleData(id).Stage - 1;
                if (isWon)
                {
                    winCount++;
                }
            }
            else
            {
                maxCount = EventTemplateManager.Instance.GetClashOfHeroesRewardTpls().Count;
                winCount = LTNewHeroBattleManager.GetInstance().NewHeroBattleCurWinCount;
            }

            if (isWon)
            {
                float value = (float)(winCount - 1) / (float)maxCount;
                winProgressBar.value = value;
                LTUIUtil.SetText(starLabel, (winCount - 1).ToString());
                LTUIUtil.SetText(victoryLabel, string.Format("{0}/{1}", (winCount - 1), maxCount));
                if (LTNewHeroBattleManager.GetInstance().IsTodayWinOneTeam())
                {
                    LTDailyDataManager.Instance.SetDailyDataRefreshState();
                }
                if (winCount > 0)
                {
                    StartCoroutine(StartProgressGrowAnim(winCount - 1, maxCount));
                }
                else
                {
                    if (onShownAnimCompleted != null)
                    {
                        onShownAnimCompleted();
                    }
                }
            }
            else
            {
                float value = (float)winCount / (float)maxCount;
                winProgressBar.value = value;
                LTUIUtil.SetText(starLabel, winCount.ToString());
                LTUIUtil.SetText(victoryLabel, string.Format("{0}/{1}", winCount, maxCount));

                if (onShownAnimCompleted != null)
                {
                    onShownAnimCompleted();
                }
            }
        }
Example #4
0
 public static LTNewHeroBattleManager GetInstance()
 {
     if (_instance == null)
     {
         _instance = LTHotfixManager.GetManager <LTNewHeroBattleManager>();
     }
     return(_instance);
 }
Example #5
0
        private bool OnComplete()
        {
            if (!sceneLoaded || !hudLoaded)
            {
                return(false);
            }

            if (!DataLookupsCache.Instance.SearchDataByID <string>("playstate.state", out playState))
            {
                EB.Debug.LogWarning("DataLookupsCache ===> playstate.state can't find!");
            }

            if (string.Compare(playState, PlayState.PlayState_Combat) == 0) //若是战斗场景就进入战斗场景
            {
                int combat_session_id = -1;
                DataLookupsCache.Instance.SearchIntByID("playstate.Combat.combat_id", out combat_session_id);
                MainLandLogic.GetInstance().RequestResumeCombat(combat_session_id);
                int type = -1;
                DataLookupsCache.Instance.SearchIntByID("playstate.Combat.origin.combatType", out type);
                BattleReadyHudController.SetBattleType((eBattleType)type);
                if (type == (int)eBattleType.HeroBattle)
                {
                    LTNewHeroBattleManager.GetInstance().OnLoggedIn();
                }
                return(false);
            }
            else if (string.Compare(playState, PlayState.PlayState_InitCombat) == 0) //(合服状态也会变为init,因此新增新手引导字段判断)若是首次登录就申请开场大战
            {
                UIStack.Instance.ShowLoadingScreen(() =>
                {
                    CombatCamera.isBoss = true;
                    if (GuideNodeManager.isFirstCombatGuide())
                    {
                        GuideNodeManager.GetInstance().GetGuideNodeCompleted(delegate(bool success)
                        {
                            if (success)
                            {
                                MainLandLogic.GetInstance().RequestFastCombatTransition(eBattleType.FastCampaignBattle, "1_1");
                            }
                            else
                            {
                                MainLandLogic.GetInstance().RequestTransfer(SceneManager.MainLandName, Vector3.zero, 0, SceneManager.MainLandName, SceneManager.HeroStart, 0);
                            }
                        });
                    }
                    else
                    {
                        MainLandLogic.GetInstance().RequestTransfer(SceneManager.MainLandName, Vector3.zero, 0, SceneManager.MainLandName, SceneManager.HeroStart, 0);
                    }
                }, false, true);
                return(false);
            }
            return(true);
        }
Example #6
0
        private void InitUI()
        {
            int MaxWinCount = EventTemplateManager.Instance.GetClashOfHeroesRewardTpls().Count;
            int CurWinCount = LTNewHeroBattleManager.GetInstance().NewHeroBattleCurWinCount;
            int curCost     = LTNewHeroBattleManager.GetInstance().NewHeroBattleCurCost;
            int maxCost     = LTNewHeroBattleManager.GetInstance().NewHeroBattleMaxCost;

            InitWinFaile(CurWinCount, MaxWinCount);
            InitReward(CurWinCount, MaxWinCount);
            InitCost(maxCost - curCost, maxCost);
            InitRewardView(CurWinCount);
        }
Example #7
0
        public void UpdateUI(int select)
        {
            ListCtrl.UpdateUI(select);
            cupUITexture.SetTexture(CupTextures[select]);
            RewardBtn.gameObject.CustomSetActive(select == 2);

            int id   = LTNewHeroBattleManager.GetInstance().GetCurrentFinishLayer();
            int type = (int)LTNewHeroBattleManager.GetInstance().CurrentType;

            StarLabel.gradientBottom = colorList[select];
            switch (select)
            {
            case 0:
            case 1:
                CostProgress.gameObject.CustomSetActive(false);
                if (type == select)
                {
                    int num = EventTemplateManager.Instance.GetNextHeroBattleData(id).Stage - 1;
                    StarLabel.text     = num.ToString();
                    SuccProgress.value = (float)num / (float)MaxLay;
                    SuccLabel.text     = string.Format("{0}/{1}", num, MaxLay);
                    InitNewBieReward(EventTemplateManager.Instance.GetNextHeroBattleData(id).Award);
                    HasGetTip.CustomSetActive(false);
                }
                else
                {
                    StarLabel.text     = MaxLay.ToString();
                    SuccProgress.value = 1;
                    SuccLabel.text     = string.Format("{0}/{1}", MaxLay, MaxLay);
                    OnInitReward(null);
                    HasGetTip.CustomSetActive(true);
                }
                break;

            case 2:
                CostProgress.gameObject.CustomSetActive(true);
                LTNewHeroBattleManager.GetInstance().GetNewHeroBattleInfo(delegate(bool isSuccessful)
                {
                    if (isSuccessful)
                    {
                        InitUI();
                    }
                });
                break;
            }
        }
Example #8
0
        public void Fill(string statId)
        {
            if (string.IsNullOrEmpty(statId))
            {
                Clear();
                return;
            }
            StatId = int.Parse(statId);
            var data = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfoByStatId(StatId);

            CostLabel.text        = LTNewHeroBattleManager.GetInstance().GetCostByRoleGrade(data.role_grade).ToString();
            HeroIcon.spriteName   = data.icon;
            CharSprite.spriteName = LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[data.char_type];
            // HotfixCreateFX.ShowCharTypeFX(charFx, efClip, CharSprite.transform, (PartnerGrade)data.role_grade, data.char_type);
            int quality  = 0;
            int addLevel = 0;

            LTPartnerDataManager.GetPartnerQuality(LTPartnerConfig.MAX_GRADE_LEVEL, out quality, out addLevel);

            FrameSprite.spriteName = LTPartnerConfig.OUT_LINE_SPRITE_NAME_DIC[quality];
            GameItemUtil.SetColorfulPartnerCellFrame(quality, FrameBGSprite);
            // HotfixCreateFX.ShowUpgradeQualityFX(upgradeFx, FrameBGSprite.transform, quality, upgradeefclip);
            if (addLevel > 0)
            {
                breakLebel.transform.parent.gameObject.CustomSetActive(true);
                breakLebel.text = "+" + addLevel.ToString();
            }
            else
            {
                breakLebel.transform.parent.gameObject.CustomSetActive(false);
            }
            mDMono.gameObject.CustomSetActive(true);

            if (m_Coroutine != null)
            {
                StopCoroutine(m_Coroutine);
                m_Coroutine = null;
            }
            m_Coroutine = StartCoroutine(LoadFx(data, quality));
        }
Example #9
0
        private List <LTHeroBattleListData> GetChangllerList(int type)
        {
            if (type == 2)
            {
                return(InitChallengeList());
            }
            List <LTHeroBattleListData> datas = new List <LTHeroBattleListData>();

            List <HeroBattleTemplate> temp = EventTemplateManager.Instance.GetHeroBattleData();

            for (int i = 0; i < temp.Count; i++)
            {
                if (temp[i].Type == type + 1)
                {
                    LTHeroBattleListData data = new LTHeroBattleListData();
                    data.desc       = temp[i].Desc;
                    data.index      = temp[i].Id;
                    data.showindex  = temp[i].Stage;
                    data.limitLevel = temp[i].Condition;
                    if (LTNewHeroBattleManager.GetInstance().JudgeFinish(temp[i].Id))
                    {
                        data.state = 2;
                    }
                    else if (LTNewHeroBattleManager.GetInstance().JudgeIsLock(temp[i].Id, temp[i].Stage))
                    {
                        data.state = 0;
                    }
                    else
                    {
                        data.state = 1;
                    }
                    data.Name      = temp[i].Name;
                    data.emenyList = temp[i].EnemyHeroConfig;
                    datas.Add(data);
                }
            }

            return(datas);
        }
Example #10
0
        public void UpdateUI(int select)
        {
            categoryTabs.SelectTab(select);
            List <LTHeroBattleListData> list = GetChangllerList(select);

            gridScroll.SetItemDatas(list.ToArray());
            if (select < 2)
            {
                int maxlay    = LTNewHeroBattleManager.GetInstance().GetCurrentFinishLayer();
                int showStage = EventTemplateManager.Instance.GetNextHeroBattleData(maxlay).Stage;
                var VS        = gridScroll.scrollView.GetComponent <UIPanel>().GetViewSize();
                //最大可见的物品数量
                int ActinCount = (int)(VS.y / gridScroll.mDMono.transform.GetComponent <UIGrid>().cellHeight);
                showStage = Math.Min(showStage - 1, list.Count - 1 - ActinCount);
                if (select < 1 && !GetIsLock(1))
                {
                    gridScroll.MoveTo(list.Count - 1 - ActinCount);
                }
                else
                {
                    gridScroll.MoveTo(showStage);
                }
            }
        }
Example #11
0
        private bool GetIsLock(int type)
        {
            HeroBattleType i = (HeroBattleType)type;

            return(LTNewHeroBattleManager.GetInstance().GetHeroBattleTypeIsLock(i));
        }
Example #12
0
        public int GetActivityCount(int activityID)//仅用于活动是否需要提示以及日常界面显示,部分活动次数不准确
        {
            Hotfix_LT.Data.SpecialActivityTemplate curAct = Hotfix_LT.Data.EventTemplateManager.Instance.GetSpecialActivity(activityID);

            if (curAct == null)
            {
                return(0);
            }

            if (activityID == 9001 || activityID == 9002 || activityID == 9007)
            {
                //经验副本,金币副本,夺宝奇兵
                int    times = 0;
                string path  = string.Format("special_activity.{0}.c_times", activityID);
                DataLookupsCache.Instance.SearchDataByID(path, out times);
                return(curAct.times - times);
            }
            else if (activityID == 9003)
            {
                DataLookupsCache.Instance.SearchDataByID("world_boss.fightTimes", out int ChallengeTime);
                DataLookupsCache.Instance.SearchDataByID("world_boss.buyTimes", out int BuyTimes);
                int Maxtime = (int)Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("worldBossChallengeMaxTimes");
                return(Maxtime + BuyTimes - ChallengeTime);
            }
            else if (activityID == 9004)
            {//军团战
                //EB.Debug.LogError("军团战数据获取");
                if (!LTLegionWarManager.Instance.IsOpenWarTime())
                {
                    return(0);
                }
                LegionWarTimeLine status = LTLegionWarManager.GetLegionWarStatus();
                if (status == LegionWarTimeLine.QualifyGame)
                {
                    if (!AllianceUtil.IsJoinedAlliance)
                    {
                        return(1);
                    }
                    int myScore = LTLegionWarManager.Instance.QualifyEnemyList.MyScore;
                    return(myScore >= LTLegionWarManager.Instance.MaxScore ? 0 : 1);
                }
                else if (status == LegionWarTimeLine.SemiFinal)
                {
                    return(1);
                }
                else if (status == LegionWarTimeLine.Final)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            else if (activityID == 9005)
            {
                //军团护送
                if (AlliancesManager.Instance.Account.State != eAllianceState.Joined)
                {
                    return(curAct.times + GetVIPAdditionTimes(activityID));
                }
                return(AllianceEscortUtil.GetResidueTransferDartNum());
            }
            else if (activityID == 9006)
            {
                //军团拦截
                if (AlliancesManager.Instance.Account.State != eAllianceState.Joined)
                {
                    return(curAct.times + GetVIPAdditionTimes(activityID));
                }
                return(AllianceEscortUtil.GetResidueRobDartNum());
            }
            else if (activityID == 9009)
            {
                //极限试炼
                int dayDisCountTime = 0;
                int oldVigor        = 0;
                int NewVigor        = 0;
                int times           = LTUltimateTrialDataManager.Instance.GetCurrencyTimes();
                NewGameConfigTemplateManager.Instance.GetEnterVigor(eBattleType.InfiniteChallenge, out dayDisCountTime, out NewVigor, out oldVigor);
                int curDisCountTime = dayDisCountTime - times;
                return(Mathf.Max(0, curDisCountTime));
                //if (!DataLookupsCache.Instance.SearchIntByID("infiniteChallenge.info.challengeTimes", out times))
                //{
                //    times = curAct.times;
                //}
                //return Mathf.Max(0, times + GetVIPAdditionTimes(activityID));
            }
            else if (activityID == 9010)
            {//天梯
                LTDailyData tempdailydata = GetDailyDataByActivityID(9010);
                if (tempdailydata == null)
                {
                    return(0);
                }
                else
                {
                    return(tempdailydata.OpenTimeValue < LTDailyDataManager.TimeNow && tempdailydata.StopTimeValue > LTDailyDataManager.TimeNow ? 1 : 0);
                }
            }
            else if (activityID == 9011)
            {//英雄交锋
                //今天赢了或者达到最大胜场 0 就不显示红点
                return(LTNewHeroBattleManager.GetInstance().GetHeroBattleTipNum());
            }
            else if (activityID == 9013)
            {
                return(IsCouldReceiveVit()?1:0);
            }
            else if (activityID == 9014)
            {
                //幸运悬赏
                int times = LTBountyTaskHudController.CurHantTimes;
                return(times);
            }
            else if (activityID == 9015)
            {
                //角斗场
                int totalTimes = VIPTemplateManager.Instance.GetTotalNum(VIPPrivilegeKey.ArenaTimes) + ArenaManager.Instance.Info.buyTimes;
                int times      = Mathf.Max(0, totalTimes - ArenaManager.Instance.Info.usedTimes);
                return(times);
            }
            else if (activityID == 9016)
            {
                //荣耀角斗场
                int freetimes = HonorArenaManager.Instance.GetHonorArenaFreeTimes();
                int usetimes  = HonorArenaManager.Instance.Info.usedTimes;
                return(freetimes - usetimes);
            }
            return(0);
        }
Example #13
0
        public void SetItem(LTPartnerData itemData)
        {
            //itemData为空的时候也把ItemData置空,其他地方使用ItemData需要判空
            ItemData = itemData;

            if (itemData == null || (itemData.StatId == 0 && itemData.InfoId == 0))
            {
                mDMono.gameObject.CustomSetActive(false);
                return;
            }

            RecommendSprite.CustomSetActive(false);
            SleepPS.CustomSetActive(false);


            if (BattleReadyHudController.sBattleType == eBattleType.SleepTower && LTClimingTowerHudController.Instance != null)
            {
                SleepPS.CustomSetActive(!LTClimingTowerHudController.Instance.CanUpTeam(ItemData.HeroId));
            }

            IconSprite.spriteName = ItemData.HeroInfo.icon;
            if (ItemData.HeroId <= 0 && !ItemData.IsHeroBattle || ItemData.IsHeroBattle && LTNewHeroBattleManager.GetInstance().CurrentType == HeroBattleType.High && LTNewHeroBattleManager.GetInstance().HasChallengeHeroInfoID.Contains(ItemData.StatId))
            {
                SetGrey(IconSprite);
                SetGrey(FrameSprite);
                SetDark(FrameBGSprite);
                HideObj.CustomSetActive(false);
                return;
            }
            else
            {
                SetNormal(IconSprite);
                SetNormal(FrameSprite);
                HideObj.CustomSetActive(true);
            }
            int quality  = 0;
            int addLevel = 0;

            LTPartnerDataManager.GetPartnerQuality(ItemData.UpGradeId, out quality, out addLevel);

            FrameSprite.spriteName = LTPartnerConfig.OUT_LINE_SPRITE_NAME_DIC[quality];
            GameItemUtil.SetColorfulPartnerCellFrame(quality, FrameBGSprite);
            HotfixCreateFX.ShowUpgradeQualityFX(upgradeFx, FrameSprite.transform, quality, upgradeefclip);
            //FrameBGSprite.color = LTPartnerConfig.QUANTITY_BG_COLOR_DIC[quality];
            LTPartnerConfig.SetLevelSprite(LevelSprite, ItemData.HeroInfo.char_type, ItemData.ArtifactLevel >= 0);
            int index = QualitySettings.GetQualityLevel();

            if (index < 1)
            {
                HotfixCreateFX.ShowCharTypeFX(charFx, efClip, LevelSprite.transform, (PartnerGrade)ItemData.HeroInfo.role_grade, ItemData.HeroInfo.char_type);
            }
            LTUIUtil.SetLevelText(LevelBGSprite, LevelLabel, ItemData);
            if (itemData.IsHeroBattle)
            {
                LevelBGSprite.spriteName = "Ty_Brand_Di1";
            }
            //英雄交锋特殊处理 其他布阵需要考虑觉醒后星星颜色变化
            if (BattleReadyHudController.sBattleType == eBattleType.HeroBattle)
            {
                StarController.SetSrarList(ItemData.Star, ItemData.HeroBattleAwakenLevel);
            }
            else
            {
                //天梯选人界面特殊处理
                if (ItemData.IsHire)
                {
                    StarController.SetSrarList(ItemData.Star, ItemData.HireAwakeLevel);
                }
                else
                {
                    StarController.SetSrarList(ItemData.Star, ItemData.IsAwaken);
                }
            }
            if (addLevel > 0)
            {
                breakLebel.transform.parent.gameObject.CustomSetActive(true);
                breakLebel.text = "+" + addLevel.ToString();
            }
            else
            {
                breakLebel.transform.parent.gameObject.CustomSetActive(false);
            }

            if (itemData.Level > 0 && LTResourceInstanceHudController.mChooseLevel != null)
            {
                for (int i = 0; i < LTResourceInstanceHudController.mChooseLevel.recommend_partners_id.Length; i++)
                {
                    if (LTResourceInstanceHudController.mChooseLevel.recommend_partners_id[i] != 0 && ItemData.HeroInfo.id == LTResourceInstanceHudController.mChooseLevel.recommend_partners_id[i])
                    {
                        RecommendSprite.CustomSetActive(true);
                        break;
                    }
                }
            }

            DeathSprite.gameObject.CustomSetActive(false);
            if ((BattleReadyHudController.sBattleType == eBattleType.ChallengeCampaign || BattleReadyHudController.sBattleType == eBattleType.AlienMazeBattle) && !FormationUtil.IsAlive(itemData.HeroId, itemData.IsHire) && itemData.uid <= 0)
            {
                DeathSprite.gameObject.CustomSetActive(true);
            }

            if (HireSprite)
            {
                HireSprite.CustomSetActive(itemData.IsHire && ItemData.uid <= 0);
            }

            MercenaryUseFlag.CustomSetActive(false);
            MercenaryUseFlag.CustomSetActive(ShowUseFlag());

            mDMono.gameObject.CustomSetActive(true);
        }
Example #14
0
 public void Show(bool isWon)
 {
     this.isWon = isWon;
     LTNewHeroBattleManager.GetInstance().GetNewHeroBattleInfo((bol) => SetData());
 }