示例#1
0
        public override void SetData(object data)
        {
            base.SetData(data);
            activityId = EB.Dot.Integer("activity_id", data, 0);
            string desctext = EB.Dot.String("desc", data, "");

            SetTextShow(RichTextParser.ParseRichText(desctext), descpos, descpos);
            SetDrawCardState();
            int timetoend = fintime - EB.Time.Now;

            if (activityendtimer == 0 && timetoend > 0)
            {
                ILRTimerManager.instance.AddTimer(timetoend * 1000, 1, OnactivityEnd);
            }
            var activity = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivity(activityId);

            UrPartnerInfoid = activity.parameter1;
            int.TryParse(UrPartnerInfoid, out int infoid);
            HeroInfoTemplate infotemp = CharacterTemplateManager.Instance.GetHeroInfo(infoid);

            MaxRankValue = EventTemplateManager.Instance.GetURPartnerEventRewardMaxNum(infoid);
            if (infotemp != null)
            {
                urPartnerIcon.spriteName = infotemp.icon;
                urPartnerType.spriteName = LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[infotemp.char_type];
                HotfixCreateFX.ShowCharTypeFX(charFx, efClip, urPartnerType.transform, (PartnerGrade)infotemp.role_grade, infotemp.char_type);
            }
            ActivityUtil.RequestRankData((int)ActivityUtil.ActivityRankType.URPartnerRank, SetRankData);
        }
示例#2
0
 private void SetScoreRewardRPState(int seq = 0)
 {
     ActivityUtil.ResetRankRefreshRecord((int)ActivityUtil.ActivityRankType.URPartnerRank);
     ActivityUtil.RequestRankData((int)ActivityUtil.ActivityRankType.URPartnerRank, SetRankData);
     scoreRewardRp.CustomSetActive(GetScoreRewardRPState());
     scoreredtimer = 0;
     title.UpdateRedPoint();
 }
示例#3
0
        public override void SetMenuData(object param)
        {
            if (param == null)
            {
                return;
            }
            for (int i = 0; i < showitemArray.Length; i++)
            {
                showitemArray[i] = controller.transform.Find("Content/UpgradeMaterial/Grid/Material (" + i + ")").GetMonoILRComponent <ShowUpgradeMaterialState>();
            }

            curPartnerData = param as LTPartnerData;
            Hotfix_LT.Data.UpGradeInfoTemplate evoTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetUpGradeInfo(curPartnerData.UpGradeId + 1, curPartnerData.HeroInfo.char_type);
            materialList  = evoTpl.materialDic;
            isExDouble    = ActivityUtil.isTimeLimitActivityOpen(1003);
            isSceneDouble = ActivityUtil.isTimeLimitActivityOpen(1002);
        }
示例#4
0
        public static float GetTimeLimitActivityMul(int activityid)
        {
            float mul = 1;

            if (ActivityUtil.IsTimeLimitActivityOpen(activityid))
            {
                Hotfix_LT.Data.TimeLimitActivityTemplate tpl = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivity(activityid);
                if (tpl != null)
                {
                    int tpl_mul = 1;
                    if (int.TryParse(tpl.parameter1, out tpl_mul))
                    {
                        mul = ((float)tpl_mul) / 100;
                    }
                }
            }
            return(mul);
        }
示例#5
0
        static public void GotoRobDart()
        {
            if (!IsMeetRobCondition())
            {
                return;
            }

            //UIStack.Instance.ExitStack(false);
            Hotfix_LT.Data.SpecialActivityTemplate temp = Hotfix_LT.Data.EventTemplateManager.Instance.GetSpecialActivity(9005);
            switch (temp.nav_type)
            {
            case eActivityNavType.NpcFind:
                ActivityUtil.NpcFind(temp.nav_parameter, temp.id);
                break;

            case eActivityNavType.FunctionId:
                ActivityUtil.FunctionOpen(temp.nav_parameter, temp.id);
                break;
            }
        }
示例#6
0
 private void OpenFunc(Hotfix_LT.Data.FuncTemplate func)
 {
     if (func.ui_model == "SpecialActivity")
     {
         if (func.parameter == "9001")
         {
             if (!ActivityUtil.IsTimeOk(9001))
             {
                 MessageTemplateManager.ShowMessage(902139);
                 return;
             }
         }
         else if (func.parameter == "9002")
         {
             if (!ActivityUtil.IsTimeOk(9002))
             {
                 MessageTemplateManager.ShowMessage(902140);
                 return;
             }
         }
     }
     //Close();
     if (func.ui_model.Equals("TaskChase"))
     {
         EnemyController ec = MainLandLogic.GetInstance().GetEnemyController(npc);
         if (ec != null)
         {
             NpcTaskDataLookup task_datalookup = ec.GetComponentInChildren <NpcTaskDataLookup>();
             if (task_datalookup != null && task_datalookup.mDL.DefaultDataID != null)
             {
                 var ht = Johny.HashtablePool.Claim();
                 ht.Add("taskid", task_datalookup.mDL.DefaultDataID);
                 Hotfix_LT.Data.FuncTemplateManager.OpenFunc(func.id, ht);
             }
             else
             {
                 MessageTemplateManager.ShowMessage(902015, null, null);
             }
         }
     }
     else if (func.ui_model.Equals("task"))
     {
         System.Action callback = taskData["callback"] as System.Action;
         if (callback != null)
         {
             callback();
         }
     }
     else if (func.ui_model.Equals("DeliveryDart"))
     {
         DeliveryDart();
     }
     else
     {
         if (string.IsNullOrEmpty(func.parameter))
         {
             Hotfix_LT.Data.FuncTemplateManager.OpenFunc(func.id, null);
         }
         else
         {
             Hotfix_LT.Data.FuncTemplateManager.OpenFunc(func.id, func.parameter);
         }
     }
 }
示例#7
0
        //极限试炼获取途径处理
        private void SetExtremityTrialGet(int materialId, int NeedNum, bool isDouble)
        {
            Exrate = isDouble ? ActivityUtil.GetTimeLimitActivityMul(1003) : 1.0f;
            if (isDouble)
            {
                RateObj.CustomSetActive(true);
                RateLabel.text = "×" + Exrate.ToString();
            }
            else
            {
                RateObj.CustomSetActive(false);
            }
            //极限试炼分为可扫荡和不可扫荡
            //获取当最高通关卡
            int curlayer = GetExtremityTrialCurMaxLayer();

            dropList = Data.EconemyTemplateManager.Instance.GetItem(materialId).DropDatas;
            DataLookupsCache.Instance.SearchDataByID <int>("res.vigor.v", out curVigour);
            int approLayer = 1;

            if (GetApproLayer(curlayer, out approLayer))//可以扫荡,显示快速获取
            {
                CenterShowLabel.gameObject.CustomSetActive(false);
                QuicklyGet.CustomSetActive(true);
                LockObj.gameObject.CustomSetActive(false);
                sweepsNumber = Mathf.CeilToInt((NeedNum - materialNum) / (Exrate * 1));
                totalvigour  = GetTotalNeedVigour(sweepsNumber);
                if (ToGetButton.clickEvent != null)
                {
                    ToGetButton.clickEvent.Clear();
                }
                if (curVigour >= totalvigour)
                {
                    ToGetButton.clickEvent.Add(new EventDelegate());
                    showVigour = totalvigour;
                    ToGetButton.clickEvent.Add(new EventDelegate(() => OnQuicklyGetExtremityTrialDrop(approLayer, sweepsNumber, () => ShowReward())));
                    colorStr = LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal;
                }
                else if (curVigour < newVigor || (dayDisCountTimes <= 0 && curVigour < oldVigor))//一次都不能扫荡的
                {
                    showVigour = totalvigour;
                    colorStr   = LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;
                    ToGetButton.clickEvent.Add(new EventDelegate(() => BalanceResourceUtil.TurnToVigorGotView()));
                }
                else
                {
                    if (dayDisCountTimes > 0)
                    {
                        if (curVigour - dayDisCountTimes * newVigor >= 0)
                        {
                            sweepsNumber = dayDisCountTimes + Mathf.FloorToInt((curVigour - dayDisCountTimes * newVigor) / (float)oldVigor);
                            showVigour   = dayDisCountTimes * newVigor + (sweepsNumber - dayDisCountTimes) * oldVigor;
                        }
                        else
                        {
                            sweepsNumber = Mathf.FloorToInt(curVigour / (float)newVigor);
                            showVigour   = sweepsNumber * newVigor;
                        }
                    }
                    else
                    {
                        sweepsNumber = Mathf.FloorToInt(curVigour / (float)oldVigor);
                        showVigour   = sweepsNumber * oldVigor;
                    }
                    ToGetButton.clickEvent.Add(new EventDelegate(() => OnQuicklyGetExtremityTrialDrop(approLayer, sweepsNumber, () => ShowReward())));
                    colorStr = LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal;
                }
                VigourCost.text = VigourCost.transform.GetChild(0).GetComponent <UILabel>().text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat, colorStr, showVigour);
            }
            else//无法扫荡显示前往获取
            {
                CenterShowLabel.gameObject.CustomSetActive(true);
                CenterShowLabel.text = CenterShowLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_PARTNER_UPGRADE_TIP_1");
                if (ToGetButton.clickEvent != null)
                {
                    ToGetButton.clickEvent.Clear();
                }
                ToGetButton.clickEvent.Add(new EventDelegate(() => dropData.GotoDrop()));
                //ToGetButton.GetComponent<UISprite>().color = new Color(1, 1, 1);
                //ToGetButton.GetComponent<BoxCollider>().enabled = true;
                QuicklyGet.CustomSetActive(false);
                LockObj.gameObject.CustomSetActive(false);
            }
        }
示例#8
0
        /// <summary>
        /// 主线副本途径处理
        /// </summary>
        /// <param name="materialId"></param>
        /// <param name="NeedNum"></param>
        private void SetSceneGet(int materialId, int NeedNum, bool isDouble)
        {
            //双倍材料显示
            rate = isDouble ? ActivityUtil.GetTimeLimitActivityMulWithoutReLog(1002) : 1.0f;
            if (isDouble)
            {
                RateObj.CustomSetActive(true);
                RateLabel.text = "×" + rate.ToString();
            }
            else
            {
                RateObj.CustomSetActive(false);
            }
            SceneDropData tempDrop = dropData as SceneDropData;

            dropPath1 = EconemyTemplateManager.Instance.GetItem(materialId).DropChickId1;
            string[] chapterId = dropPath1.Split(':')[1].Split('_');
            LostMainChapterTemplate chapterData = SceneTemplateManager.Instance.GetLostMainChatpterTplById(chapterId[0]);

            DataLookupsCache.Instance.SearchDataByID <int>(string.Format("userCampaignStatus.normalChapters.{0}.campaigns.{1}.star", chapterId[0], chapterId[1]), out m_StarNum);
            DataLookupsCache.Instance.SearchDataByID <bool>(string.Format("userCampaignStatus.normalChapters.{0}.campaigns.{1}.complete", chapterId[0], chapterId[1]), out m_IsComplete);
            if (BalanceResourceUtil.GetUserLevel() < chapterData.LevelLimit || !LTInstanceUtil.GetIsChapterLimitConditionComplete(chapterData, out int num) || !LTInstanceUtil.IsPreChapterComplete(chapterId[0]) || !m_IsComplete)//等级未达到解锁条件,或者前置关卡未解锁
            {
                CenterShowLabel.gameObject.CustomSetActive(false);
                ToGetButton.GetComponent <UISprite>().spriteName = "Ty_Button_4";
                if (ToGetButton.clickEvent != null)
                {
                    ToGetButton.clickEvent.Clear();
                    ToGetButton.clickEvent.Add(new EventDelegate(ToCurMaxChapterTip));
                }
                QuicklyGet.CustomSetActive(false);
                LockObj.gameObject.CustomSetActive(true);
                UnLockChapter.text     = UnLockChapter.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_PARTNER_UPGRADE_TIP_2");
                UnlockChapterName.text = UnlockChapterName.transform.GetChild(0).GetComponent <UILabel>().text = string.Format(EB.Localizer.GetString("ID_PARTNER_UPGRADE_TIP_10"), chapterData.Name);
            }
            else if (m_IsComplete && m_StarNum < 3)
            {
                CenterShowLabel.gameObject.CustomSetActive(true);
                CenterShowLabel.text = CenterShowLabel.transform.GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_PARTNER_UPGRADE_TIP_1");
                if (ToGetButton.clickEvent != null)
                {
                    ToGetButton.clickEvent.Clear();
                }
                ToGetButton.clickEvent.Add(new EventDelegate(() => GotoSceneChapter(int.Parse(chapterId[1]), materialId.ToString())));
                //ToGetButton.GetComponent<UISprite>().color = new Color(1, 1, 1);
                //ToGetButton.GetComponent<BoxCollider>().enabled = true;
                QuicklyGet.CustomSetActive(false);
                LockObj.gameObject.CustomSetActive(false);
            }
            else if (m_IsComplete && m_StarNum == 3)//可以扫荡
            {
                CenterShowLabel.gameObject.CustomSetActive(false);
                //ToGetButton.GetComponent<UISprite>().color = new Color(1, 1, 1);
                //ToGetButton.GetComponent<BoxCollider>().enabled = true;
                costPerCam  = SceneTemplateManager.Instance.GetLostMainCampaignTplById(chapterId[1]).CostVigor;
                totalvigour = Mathf.CeilToInt((NeedNum - materialNum) / rate) * costPerCam;
                DataLookupsCache.Instance.SearchDataByID <int>("res.vigor.v", out curVigour);
                QuicklyGet.CustomSetActive(true);
                if (ToGetButton.clickEvent != null)
                {
                    ToGetButton.clickEvent.Clear();
                }
                if (curVigour >= totalvigour)
                {
                    sweepsNumber = Mathf.CeilToInt((NeedNum - materialNum) / (rate * 1));
                    ToGetButton.clickEvent.Add(new EventDelegate(() => OnQuicklyGetButtonClick(int.Parse(chapterId[1]))));
                    showVigour = totalvigour;
                    colorStr   = LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal;
                }
                else if (curVigour < totalvigour && curVigour >= costPerCam)
                {
                    sweepsNumber = curVigour / costPerCam;
                    showVigour   = sweepsNumber * costPerCam;
                    ToGetButton.clickEvent.Add(new EventDelegate(() => OnQuicklyGetButtonClick(int.Parse(chapterId[1]))));
                    colorStr = LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal;
                }
                else
                {
                    showVigour = totalvigour;
                    colorStr   = LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;
                    ToGetButton.clickEvent.Add(new EventDelegate(() => BalanceResourceUtil.TurnToVigorGotView()));
                }

                VigourCost.text = VigourCost.transform.GetChild(0).GetComponent <UILabel>().text = string.Format(LT.Hotfix.Utility.ColorUtility.ColorStringFormat, colorStr, showVigour);
                LockObj.gameObject.CustomSetActive(false);
            }
        }