//主线任务打开副本界面 public static void StartTaskCampaignFinding(string taskid, bool isMainCampaign) { if (AllianceUtil.IsInTransferDart) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_TaskSystem_5855")); return; } if (isMainCampaign) { string campaign_name = Hotfix_LT.Data.TaskTemplateManager.Instance.GetTask(taskid).target_parameter_1; Hotfix_LT.Data.LostMainCampaignsTemplate campaignData = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainCampaignTplById(campaign_name); if (!LTInstanceUtil.GetChapterIsOpen(int.Parse(campaignData.ChapterId))) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_TaskSystem_17027")); return; } Action act = new Action(delegate { LTMainInstanceHudController.EnterInstance(campaignData.ChapterId); }); UIStack.Instance.ShowLoadingScreen(act, false, true, true); } else { Hotfix_LT.Data.FuncTemplate ft = Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(10065); if (ft != null && !ft.IsConditionOK()) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, ft.GetConditionStr()); return; } GlobalMenuManager.Instance.Open("LTChallengeInstanceSelectHud"); } }
private void InitUI() { if (campaignId <= 0) { return; } mainTpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainCampaignTplById(campaignId.ToString()); if (mainTpl == null) { return; } DataLookupsCache.Instance.SearchIntByID(string.Format("userCampaignStatus.normalChapters.{0}.campaigns.{1}.star", mainTpl.ChapterId, campaignId), out m_StarNum); DataLookupsCache.Instance.SearchDataByID <bool>(string.Format("userCampaignStatus.normalChapters.{0}.campaigns.{1}.complete", mainTpl.ChapterId, campaignId), out m_IsComplete); TitleLabel.text = mainTpl.Name; DescLabel.text = mainTpl.Desc; for (int i = 0; i < StarList.Count; i++) { if (i < m_StarNum) { StarList[i].gameObject.CustomSetActive(true); } else { StarList[i].gameObject.CustomSetActive(false); } } isShowFree = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("DungeonFirstPassFree") > 0 && m_StarNum <= 0; FreeObj.CustomSetActive(isShowFree); CostObj.CustomSetActive(!isShowFree); VigorCostLabel.text = mainTpl.CostVigor.ToString(); for (int i = 0; i < DropItemList.Count; i++) { if (i < mainTpl.AwardIconList.Count) { DropItemList[i].mDMono.gameObject.CustomSetActive(true); int tempID = int.Parse(mainTpl.AwardIconList[i]); string id = tempID < 1000 ? BalanceResourceUtil.GetResStrID(tempID) : tempID.ToString(); string type = tempID < 1000 ? LTShowItemType.TYPE_RES : LTShowItemType.TYPE_GAMINVENTORY; DropItemList[i].LTItemData = new LTShowItemData(id, 0, type, false); } else { DropItemList[i].mDMono.gameObject.CustomSetActive(false); } } bool isCanBlitz = m_IsComplete && m_StarNum >= 3; BlitzLabel.gameObject.CustomSetActive(!isCanBlitz); BlitzBtn.gameObject.CustomSetActive(isCanBlitz); MultiBlitzBtn.gameObject.CustomSetActive(isCanBlitz); BattleBtn.transform.localPosition = isCanBlitz ? RightBattlePos : LeftBattlePos; BattleBtn.gameObject.CustomSetActive(true); }
/// <summary> /// 计算当前章节是否完成 /// </summary> /// <param name="chapterId"></param> /// <returns></returns> public static bool IsChapterComplete(string chapterId) { Hotfix_LT.Data.LostMainCampaignsTemplate bossCampaignData = Hotfix_LT.Data.SceneTemplateManager.Instance.GetBossLostMainCampaignTplByChapterId(chapterId); if (bossCampaignData == null) { return(false); } int isComplete = 0; DataLookupsCache.Instance.SearchIntByID(string.Format("userCampaignStatus.normalChapters.{0}.campaigns.{1}.complete", chapterId, bossCampaignData.Id), out isComplete); return(isComplete > 0); }
private static int IsVigorEnough(int times, int CampaignId) { int curVigor = 0; DataLookupsCache.Instance.SearchIntByID("res.vigor.v", out curVigor); Hotfix_LT.Data.LostMainCampaignsTemplate mainTpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainCampaignTplById(CampaignId.ToString()); if (curVigor >= (mainTpl.CostVigor * times)) { return(times); } else { return(curVigor / mainTpl.CostVigor); } }
/// <summary> /// 根据关卡ID判定关卡所在章节能否进入 /// </summary> /// <param name="campaignId"></param> /// <returns></returns> public static bool GetChapterIsPassByCampaignId(string campaignId) { Hotfix_LT.Data.LostMainCampaignsTemplate campaignData = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainCampaignTplById(campaignId); if (campaignData == null) { return(false); } Hotfix_LT.Data.LostMainChapterTemplate chapterData = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainChatpterTplById(campaignData.ChapterId); if (chapterData == null) { return(false); } return(BalanceResourceUtil.GetUserLevel() >= chapterData.LevelLimit && LTInstanceUtil.IsPreChapterComplete(campaignData.ChapterId) && GetIsChapterLimitConditionComplete(chapterData, out int num)); }
/// <summary> /// 获取当前章节完成度 /// </summary> /// <param name="chapterId"></param> /// <param name="allStarNum"></param> /// <param name="completeNum"></param> public static int GetChapterCurStarNum(string chapterId) { int allStarNum = 0; Hashtable campaignList = Johny.HashtablePool.Claim(); DataLookupsCache.Instance.SearchDataByID <Hashtable>(string.Format("userCampaignStatus.normalChapters.{0}.campaigns", chapterId), out campaignList); if (campaignList != null) { foreach (DictionaryEntry campaignData in campaignList) { Hotfix_LT.Data.LostMainCampaignsTemplate tpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostMainCampaignTplById(campaignData.Key.ToString()); if (tpl != null) { int starNum = EB.Dot.Integer("star", campaignData.Value, 0); allStarNum += starNum; } } } return(allStarNum); }