public static int GetExpRewardNum(int taskid) { TaskTemplate taskTpl = TaskTemplateManager.Instance.GetTask(taskid); if (taskTpl == null) { return(0); } if (taskTpl.xp.Length <= 0) { return(0); } int A = taskTpl.xp[0]; if (taskTpl.xp.Length >= 2) { int B = taskTpl.xp[1]; int lvl = BalanceResourceUtil.GetUserLevel(); return(A + B * lvl); } else { return(A); } }
/// <summary> /// 初始化初始选择Item /// </summary> private void InitSelect() { int maxLevel = 0; DataLookupsCache.Instance.SearchIntByID("userCampaignStatus.challengeChapters.bigFloor", out maxLevel); maxLevel += 1; Hotfix_LT.Data.LostChallengeChapter temp = Hotfix_LT.Data.SceneTemplateManager.Instance.GetCheckPointChapterByChapter(maxLevel); if (temp == null)//满层通关 { maxCheckPointLevel = 1000; temp = Hotfix_LT.Data.SceneTemplateManager.Instance.GetCheckPointChapterByChapter(maxLevel - 1); } else { maxCheckPointLevel = temp.Level; } CurSelectLevel = temp.Level; List <Hotfix_LT.Data.LostChallengeChapter> list = Hotfix_LT.Data.SceneTemplateManager.Instance.GetLostChallengeCheckPointChapterList(); int index = list.IndexOf(temp); DynamicScroll.MoveInternalNow((index - 4 < 0) ? 0 : index - 4); InitDrop(); BlitzObj.CustomSetActive(GetShowBlitzObj()); RecommendLevelLabel.gameObject.CustomSetActive(temp.RecommendLevel > 0 && maxCheckPointLevel <= CurSelectLevel); if (temp.RecommendLevel > 0 && maxCheckPointLevel <= CurSelectLevel) { RecommendLevelLabel.text = string.Format("{0}:{1}", EB.Localizer.GetString("ID_CHALLENGE_RECOMMEND"), temp.RecommendLevel); int userLevel = BalanceResourceUtil.GetUserLevel(); RecommendBGSprite.spriteName = (userLevel >= temp.RecommendLevel) ? "Ty_Welfare_Label_5" : "Welfare_Label_6"; } }
public void OpenChatTalkUI() { ChatRule.CHAT_CHANNEL channelType = ChatRule.CHAT_CHANNEL.CHAT_CHANNEL_WORLD; int userlevel = BalanceResourceUtil.GetUserLevel(); int chatlevel = BalanceResourceUtil.GetChatLevel(); if (userlevel < chatlevel) { var ht = Johny.HashtablePool.Claim(); ht.Add("0", chatlevel); MessageTemplateManager.ShowMessage(902014, ht, null); return; } string channelStr = ChatRule.CHANNEL2STR[channelType]; float leftTime = SparxHub.Instance.ChatManager.GetLastSendTime(channelStr) + GetSendInterval(channelType) - Time.realtimeSinceStartup; if (leftTime > 0) { var ht = Johny.HashtablePool.Claim(); ht.Add("0", Mathf.CeilToInt(leftTime).ToString()); MessageTemplateManager.ShowMessage(902100, ht, null); EB.Debug.LogWarning("OpenChatTalkUI: time limited"); return; } talkUI.CustomSetActive(true); StartRecord(); }
/// <summary> /// 根据战斗类型获得可上阵的最大索引,从0开始 /// </summary> /// <param name="type"></param> /// <returns></returns> public static int GetTeamMaxIndex(eBattleType type) { if (type == eBattleType.LegionMercenary) { return(0); } if (type == eBattleType.HeroBattle)//英雄交锋只能4个 { return(3); } int maxIndex = 2; int level = BalanceResourceUtil.GetUserLevel(); for (int i = 0; i < OpenTeamFuncID.Count; ++i) { var func = Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(OpenTeamFuncID[i]); if (func != null && func.IsConditionOK()) { maxIndex++; } } return(maxIndex); }
public static List <LTShowItemData> GetItemRewardList(int taskid) { TaskTemplate taskTpl = TaskTemplateManager.Instance.GetTask(taskid); if (taskTpl == null) { return(null); } List <LTShowItemData> dataList = new List <LTShowItemData>(); int expnum = GetExpRewardNum(taskid); int goldnum = GetGoldRewardNum(taskid); int hcnum = GetHcRewardNum(taskid); if (expnum > 0) { if (BalanceResourceUtil.GetUserLevel() >= CharacterTemplateManager.Instance.GetMaxPlayerLevel()) { dataList.Add(new LTShowItemData("poten-gold", expnum, LTShowItemType.TYPE_RES)); } else { dataList.Add(new LTShowItemData("exp", expnum, LTShowItemType.TYPE_RES)); } } if (goldnum > 0) { dataList.Add(new LTShowItemData("gold", goldnum, LTShowItemType.TYPE_RES)); } if (hcnum > 0) { dataList.Add(new LTShowItemData("hc", hcnum, LTShowItemType.TYPE_RES)); } if (!string.IsNullOrEmpty(taskTpl.res_type) && taskTpl.res_count > 0) { dataList.Add(new LTShowItemData(taskTpl.res_type, taskTpl.res_count, LTShowItemType.TYPE_RES)); } foreach (var reward in taskTpl.rewards.Items) { dataList.Add(new LTShowItemData(reward.Key.ToString(), reward.Value, LTShowItemType.TYPE_GAMINVENTORY)); } int heroshardid = taskTpl.hero_shard; int count = taskTpl.shard_count * 1; if (heroshardid > 0 && count > 0) { dataList.Add(new LTShowItemData(heroshardid.ToString(), count, LTShowItemType.TYPE_HEROSHARD)); } return(dataList); }
/// <summary> /// 根据章节ID判定能否进入章节 /// </summary> public static bool GetChapterIsPassByChapterId(string chapterId) { Data.LostMainChapterTemplate chapterData = Data.SceneTemplateManager.Instance.GetLostMainChatpterTplById(chapterId); if (chapterData == null) { return(false); } return(BalanceResourceUtil.GetUserLevel() >= chapterData.LevelLimit && IsPreChapterComplete(chapterId)); }
public void CheckLevelUp(System.Action callBack = null) { if (EB.Sparx.Hub.Instance.LevelRewardsManager.IsLevelUp) { GlobalMenuManager.Instance.Open("LTPlayerLevelUpUI", callBack); //升级时重置 if (BalanceResourceUtil.GetUserLevel() > 7) { PlayerVigourTip.isShow = true; } } }
bool IsBigThanMaxLevel() { int level = BalanceResourceUtil.GetUserLevel(); if (level > END_LEVEL) { EB.Debug.Log("IsBigThanMaxLevel Guide End ={0}", level); JumToEnd(); return(true); } return(false); }
public override void OnEnable() { //base.OnEnable(); if (updataUI) { updataUI = false; if (level != BalanceResourceUtil.GetUserLevel()) { EB.Coroutines.Run(UpdateUI()); } } }
private bool IsLevelOk(int level) { int userlevel = BalanceResourceUtil.GetUserLevel(); if (userlevel >= level) { return(true); } else { return(false); } }
/// <summary> /// 设置玩家信息 /// </summary> /// <param name="selfInfo">我的信息</param> /// <param name="otherInfo">对手的信息</param> private void SetPlayerInfo(SidePlayerInfoData selfInfo, SidePlayerInfoData otherInfo) { LTUIUtil.SetText(selfNameLabel, selfInfo.name); LTUIUtil.SetText(OtherNameLabel, otherInfo.name); m_LevelInfo[0].F_SetInfo(selfInfo); m_LevelInfo[1].F_SetInfo(otherInfo); // LTUIUtil.SetText(selfLevelLabel, BalanceResourceUtil.GetUserLevel().ToString() /*data.selfInfo.level.ToString()*/); LTUIUtil.SetText(otherLevelLabel, otherInfo.level.ToString()); selfHeadIconSpt.spriteName = LTMainHudManager.Instance.UserHeadIcon; selfFrameIconSpt.spriteName = LTMainHudManager.Instance.UserLeaderHeadFrame.iconId; otherHeadIconSpt.spriteName = otherInfo.portrait; otherFrameIconSpt.spriteName = otherInfo.frame; }
/// <summary> /// 可搜索列表进行自身数据维护 /// </summary> private void SearchItemDatasProcess() { int userLevel = BalanceResourceUtil.GetUserLevel(); if (searchItemDatas == null) { return; } for (int i = 0; i < searchItemDatas.Length; i++) { searchItemDatas[i].isHasApplyed = false; searchItemDatas[i].isReachCondition = true; if (applyItemDatas != null) //对已申请的做判断 { for (int j = 0; j < applyItemDatas.Length; j++) { if (applyItemDatas[j].legionID == searchItemDatas[i].id) { searchItemDatas[i].isReachCondition = false; searchItemDatas[i].isHasApplyed = true; break; } } } if (searchItemDatas[i].isHasApplyed) //如果已经申请过的 { continue; } if (searchItemDatas[i].conditionLevel > userLevel) { searchItemDatas[i].isReachCondition = false; continue; } if (searchItemDatas[i].currentPeopleNum >= searchItemDatas[i].maxPeopleNum) { searchItemDatas[i].isReachCondition = false; continue; } } if (LegionEvent.NotifyUpdateSearchItemDatas != null) { LegionEvent.NotifyUpdateSearchItemDatas(searchItemDatas); } }
public RoleData CreateRoleData(int code, int level) { RoleData roleData = new RoleData(); roleData.code = code; roleData.roleGid = LoginManager.Instance.Account.AccountId.ToString(); roleData.roleId = LoginManager.Instance.LocalUser.Id.ToString(); roleData.roleName = LoginManager.Instance.LocalUser.Name; roleData.roleLevel = code == 2 ? level : BalanceResourceUtil.GetUserLevel();//升级需要传回调里的参数 roleData.serverId = LoginManager.Instance.LocalUser.WorldId.ToString(); roleData.serverName = LoginManager.Instance.GetDefaultGameWorld(LoginManager.Instance.LocalUser.WorldId).Name; roleData.coinNum = BalanceResourceUtil.GetUserDiamond(); EB.Debug.Log(string.Format("OnReportInfo:code:{0},level{1},coinnum:{2}", code, roleData.roleLevel, roleData.coinNum)); return(roleData); }
/// <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="evt"></param> public void OnLevelSelect(int level) { if (level != CurSelectLevel) { CurSelectLevel = level; Hotfix_LT.Data.LostChallengeChapter temp = Hotfix_LT.Data.SceneTemplateManager.Instance.GetCheckPointChapter(CurSelectLevel); InitDrop(); BlitzObj.CustomSetActive(GetShowBlitzObj()); RecommendLevelLabel.gameObject.CustomSetActive(temp.RecommendLevel > 0 && maxCheckPointLevel <= CurSelectLevel); if (temp.RecommendLevel > 0 && maxCheckPointLevel <= CurSelectLevel) { RecommendLevelLabel.text = string.Format("{0}:{1}", EB.Localizer.GetString("ID_CHALLENGE_RECOMMEND"), temp.RecommendLevel); int userLevel = BalanceResourceUtil.GetUserLevel(); RecommendBGSprite.spriteName = (userLevel >= temp.RecommendLevel) ? "Ty_Welfare_Label_5" : "Welfare_Label_6"; } } }
IEnumerator UpdateUI() { yield return(null); IDictionary cachedata; IDictionary extraCachedata; level = BalanceResourceUtil.GetUserLevel(); if (!DataLookupsCache.Instance.SearchDataByID <IDictionary>("user_prize_data.level_reward", out cachedata)) { yield break; } DataLookupsCache.Instance.SearchDataByID <IDictionary>("user_prize_data.level_reward_extra", out extraCachedata); List <Hotfix_LT.Data.TimeLimitActivityStageTemplate> stages = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivityStages(m_ActivityId); if (stages != null) { List <TimeActivityExchangeTypeScrollItemData> datas = new List <TimeActivityExchangeTypeScrollItemData>(stages.Count); for (int i = 0; i < stages.Count; i++) { TimeActivityExchangeTypeScrollItemData data = new TimeActivityExchangeTypeScrollItemData(); data.id = stages[i].id; data.sort = stages[i].sort; data.stage_template = stages[i]; bool had = false; bool extraHad = false; had = EB.Dot.Bool(data.id.ToString(), cachedata, had); extraHad = EB.Dot.Bool(data.id.ToString(), extraCachedata, extraHad); if (had) { data.had++; } if (extraHad) { data.had++; } data.current = level; data.total = level; datas.Add(data); } InitLevelList(datas); } }
public static bool IsStoreEnable(int storeId) { var tpl = Hotfix_LT.Data.ShopTemplateManager.Instance.GetShop(storeId); if (tpl == null) { return(true); } int level = BalanceResourceUtil.GetUserLevel(); if (level < tpl.level_limit) { return(false); } else { return(true); } }
protected override void UpdateUI(ArrayList array) { rankdatas = new List <PersonalArenaRankItemData>(); long localPlayerId = LoginManager.Instance.LocalUserId.Value; m_localPlayerRankData = null; for (int i = 0; i < array.Count; i++) { var data = new PersonalArenaRankItemData(array[i] as Hashtable, i); if (data.m_Uid == localPlayerId) { m_localPlayerRankData = data; } else if (data.m_Rank >= 0) { rankdatas.Add(data); } } if (m_localPlayerRankData != null && m_localPlayerRankData.m_Rank >= 0) { rankdatas.Add(m_localPlayerRankData); } rankdatas.Sort((x, y) => { return(x.m_Rank - y.m_Rank); }); //rankdatas.Sort(new PersonalArenaRankItemDataComparer()); rankdatas = rankdatas.GetRange(0, Mathf.Min(100, rankdatas.Count)); if (rankdatas.Count > 0) { m_firstPlayerRankData = rankdatas[0]; } else { m_firstPlayerRankData = null; } m_gridScroll.dataItems = rankdatas.ToArray(); isDataReady = true; defaultocalPlayerRankLabelData = BalanceResourceUtil.GetUserLevel().ToString(); UpdateInfo(); }
public static bool GetTeamOpen(string teamName) { int userLevel = BalanceResourceUtil.GetUserLevel(); if (teamName == "team1") { return(true); } else if (teamName == "team2") { return(Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(10061).IsConditionOK()); } else if (teamName == "team3") { return(Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(10062).IsConditionOK()); } else { return(true); } }
private void ShowPersonage() { nameLab.text = mData.memberName; levelLab.text = mData.level.ToString(); legionNameLab.text = string.Format("【{0}】", legionData.legionName); headIcon.spriteName = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(mData.templateId, mData.skin).icon; headFrame.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(mData.headFrame).iconId; SetBtnView(); int level = BalanceResourceUtil.GetUserLevel(); int funLevel = Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(10057).NeedLevel; LTUIUtil.SetGreyButtonEnable(talkBtn, mData.level >= funLevel && level >= funLevel); if (FriendManager.Instance.MyFriends.Find(_choiceUid) != null) { LTUIUtil.SetGreyButtonEnable(addFriendBtn, false); } else { LTUIUtil.SetGreyButtonEnable(addFriendBtn, true); } //FriendManager.Instance.Search("#" + _choiceUid, delegate (Hashtable result) { // if (result == null) // { // EB.Debug.LogError("Search result=null"); // return; // } // bool isFriend = EB.Dot.Bool("friendsInfo.search." + _choiceUid + ".isFriend", result, false); // if (isFriend) // { // LTUIUtil.SetGreyButtonEnable(addFriendBtn, false); // } // else // { // LTUIUtil.SetGreyButtonEnable(addFriendBtn, true); // } //}); }
public void ShowLevelupVigourTip() { mDMono.gameObject.CustomSetActive(false); if (isShow) { int curVigour; int VigourLimit; DataLookupsCache.Instance.SearchIntByID("res.vigor.v", out curVigour); DataLookupsCache.Instance.SearchIntByID("res.vigor.max", out VigourLimit); //大于或等于体力上限时并且等级大于7 if (curVigour >= VigourLimit && BalanceResourceUtil.GetUserLevel() > 7) { mDMono.gameObject.CustomSetActive(true); } else { mDMono.gameObject.CustomSetActive(false); isShow = false; } } }
public override void Fill(LTHeroBattleListData itemData) { if (itemData == null) { Clear(); return; } this.itemData = itemData; NameLabel.text = itemData.Name; NameLabel.gameObject.CustomSetActive(!string.IsNullOrEmpty(itemData.Name)); RuleBtn.gameObject.CustomSetActive(!string.IsNullOrEmpty(itemData.desc)); if (string.IsNullOrEmpty(itemData.Name)) { //第{0}组 IndexNameLabel.transform.localPosition = highT; IndexNameLabel.text = string.Format(EB.Localizer.GetString("ID_HERO_GROUP_NAME"), itemData.showindex); } else { //第{0}关 IndexNameLabel.transform.localPosition = newbieT; IndexNameLabel.text = string.Format(EB.Localizer.GetString("ID_LEVEL_TEXT_FORMAT"), itemData.showindex); } switch (itemData.state) { case 0: //lock LockLabel.transform.parent.gameObject.CustomSetActive(true); ATKBtn.gameObject.CustomSetActive(false); WinObj.CustomSetActive(false); // 通关前置关卡\n等级{0}级解锁 LockLabel.text = string.Format(EB.Localizer.GetString("ID_HERO_CHANGLLER_CONDITION"), itemData.limitLevel); break; case 1: //challenge if (BalanceResourceUtil.GetUserLevel() < itemData.limitLevel) { LockLabel.transform.parent.gameObject.CustomSetActive(true); ATKBtn.gameObject.CustomSetActive(false); WinObj.CustomSetActive(false); LockLabel.text = string.Format(EB.Localizer.GetString("ID_HERO_CHANGLLER_CONDITION"), itemData.limitLevel); } else { LockLabel.transform.parent.gameObject.CustomSetActive(false); ATKBtn.gameObject.CustomSetActive(true); WinObj.CustomSetActive(false); } break; case 2: //win LockLabel.transform.parent.gameObject.CustomSetActive(false); ATKBtn.gameObject.CustomSetActive(false); WinObj.CustomSetActive(true); break; } for (int i = 0; i < itemData.emenyList.Count; i++) { EmenyList[i].Fill(itemData.emenyList[i]); } for (int i = itemData.emenyList.Count; i < EmenyList.Count; i++) { EmenyList[i].Clear(); } }
public void ShowUI(object info) { Container.CustomSetActive(true); FusionAudio.PostEvent("UI/New/JueDou", true); InfoData data = info as InfoData; string myName; if (data == null) { if (!DataLookupsCache.Instance.SearchDataByID <string>("user.name", out myName)) { myName = string.Empty; } LTUIUtil.SetText(MyNameLabel, EB.Localizer.GetString(myName)); LTUIUtil.SetText(MyScoreLabel, LadderManager.Instance.Info.Point.ToString()); MyPortrait.spriteName = LTMainHudManager.Instance.UserHeadIcon; MyFrame.spriteName = LTMainHudManager.Instance.UserLeaderHeadFrame.iconId; string playerName = EB.Dot.String("ladder.match_result.playerName", info, ""); int score = EB.Dot.Integer("ladder.match_result.point", info, 0); string portrait = EB.Dot.String("ladder.match_result.portrait", info, ""); int skin = EB.Dot.Integer("ladder.match_result.skin", info, 0); string frame = EB.Dot.String("ladder.match_result.headFrame", info, null); LTUIUtil.SetText(YourNameLabel, EB.Localizer.GetString(playerName)); LTUIUtil.SetText(YourScoreLabel, score.ToString()); //记录天梯分值 LTHeroBattleModel.GetInstance().choiceData.selfInfo.score = LadderManager.Instance.Info.Point; LTHeroBattleModel.GetInstance().choiceData.otherInfo.score = score; // if (!string.IsNullOrEmpty(portrait)) { YourPortrait.spriteName = portrait; } else { YourPortrait.spriteName = "Partner_Head_Sidatuila"; } YourFrame.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(frame).iconId; StartCoroutine(TimingSkip()); } else { switch (data.type) { case 0: if (!DataLookupsCache.Instance.SearchDataByID <string>("user.name", out myName)) { myName = string.Empty; } LTUIUtil.SetText(MyNameLabel, EB.Localizer.GetString(myName)); LTUIUtil.SetText(MyScoreLabel, LadderManager.Instance.Info.Point.ToString()); MyPortrait.spriteName = LTMainHudManager.Instance.UserHeadIcon; MyFrame.spriteName = LTMainHudManager.Instance.UserLeaderHeadFrame.iconId; string playerName = EB.Dot.String("ladder.match_result.playerName", data.info, ""); int score = EB.Dot.Integer("ladder.match_result.point", data.info, 0); string portrait = EB.Dot.String("ladder.match_result.portrait", data.info, ""); int skin = EB.Dot.Integer("ladder.match_result.skin", data.info, 0); string frame = EB.Dot.String("ladder.match_result.headFrame", data.info, null); LTUIUtil.SetText(YourNameLabel, EB.Localizer.GetString(playerName)); LTUIUtil.SetText(YourScoreLabel, score.ToString()); //记录天梯分值 LTHeroBattleModel.GetInstance().choiceData.selfInfo.score = LadderManager.Instance.Info.Point; LTHeroBattleModel.GetInstance().choiceData.otherInfo.score = score; // if (!string.IsNullOrEmpty(portrait)) { YourPortrait.spriteName = portrait; } else { YourPortrait.spriteName = "Partner_Head_Sidatuila"; } YourFrame.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(frame).iconId; StartCoroutine(TimingSkip()); break; case 1: HeroBattleChoiceData choiceData = data.info as HeroBattleChoiceData; LTUIUtil.SetText(TypeLabel, EB.Localizer.GetString("ID_codefont_in_LadderMatchSuccessUIController_3473")); LTUIUtil.SetText(YourTypeLabel, EB.Localizer.GetString("ID_codefont_in_LadderMatchSuccessUIController_3473")); StartCoroutine(OpenHeroBattleHud()); if (!DataLookupsCache.Instance.SearchDataByID <string>("user.name", out myName)) { myName = string.Empty; } LTUIUtil.SetText(MyNameLabel, EB.Localizer.GetString(myName)); MyPortrait.spriteName = LTMainHudManager.Instance.UserHeadIcon; MyFrame.spriteName = LTMainHudManager.Instance.UserLeaderHeadFrame.iconId; LTUIUtil.SetText(MyScoreLabel, BalanceResourceUtil.GetUserLevel().ToString()); LTUIUtil.SetText(YourNameLabel, EB.Localizer.GetString(choiceData.otherInfo.name)); YourPortrait.spriteName = choiceData.otherInfo.portrait; YourFrame.spriteName = choiceData.otherInfo.frame; LTUIUtil.SetText(YourScoreLabel, choiceData.otherInfo.level.ToString()); break; } } }
//点击立马交互处理函数 private void OnImmediatelyIntactFunc(GameObject player, GameObject interactable) { //if (SceneLogicManager.isCampaign())return; //在这里区分 玩家之间交互, 玩家与NPC之间的交互 if (interactable == null)//点击地面 { FusionAudio.PostEvent("UI/MainView/ShowSelfSelection", true); } else if (interactable.GetComponent <PlayerController>() != null) { FusionAudio.PostEvent("UI/MainView/ShowSelfSelection", true); if (interactable != null) { //目标可被点击 long uid = interactable.GetComponent <PlayerController>().playerUid; string playerName; if (GetIsTargetInFightState(uid) || GetIsTargetInDartState(uid)) { //目标是否处于战斗等不可交互状态 MessageTemplateManager.ShowMessage(902069); return; } else if (GetIsRedName(uid.ToString(), out playerName)) { //目标是否是可被攻击的(红名玩家) if (BalanceResourceUtil.GetUserLevel() < AlliancesManager.Instance.DartConfig.AttackRedNameLevelLimit) { //目标当前等级过高不可被攻击 Hashtable h = Johny.HashtablePool.Claim(); h.Add("0", AlliancesManager.Instance.DartConfig.AttackRedNameLevelLimit); MessageTemplateManager.ShowMessage(902096, h, null); } else { //目标可被攻击 int aid = 0; DataLookupsCache.Instance.SearchIntByID("mainlands.pl." + uid + ".aid", out aid); if (aid > 0 && AllianceUtil.GetIsInAlliance(uid)) { //不可攻击同军团玩家 MessageTemplateManager.ShowMessage(902095); } else { //是否要发起攻击 MessageTemplateManager.ShowMessage(902058, playerName, delegate(int result) { if (result == 0) { if (!LegionModel.GetInstance().isJoinedLegion) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_NOT_JOIN_ALLIANCE"))); return; } string pn; if (GetIsRedName(AllianceUtil.GetLocalUid().ToString(), out pn)) { MessageTemplateManager.ShowMessage(902103); } else { AlliancesManager.Instance.AttackRedName(uid); } } }); } } return; } DataLookupsCache.Instance.SetCache("intact.player", uid, true); if (UIStack.Instance.GetBackStackCount() > 1) { EB.Debug.LogWarning("Don't Open OtherPlayerInfoView"); EB.Debug.Log(UIStack.Instance.GetBackStackItem()); return; } EB.Debug.Log(UIStack.Instance.GetBackStackItem()); GlobalMenuManager.Instance.Open("OtherPlayerInfoView"); //if (null != PlayerIntactUI.Instance) // PlayerIntactUI.Instance.Uid = uid; } } else { if (IsGhost(interactable)) { FusionAudio.PostEvent("SFX_CombatView_BattleStart"); } } }
/// <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); } }
public void Init() { if (curType == LTParGradeStarUp.StarUp && curParData.Star > 3) { LTChargeManager.Instance.CheckLimitedTimeGiftTrigger(Hotfix_LT.Data.LTGTriggerType.StarUp, BalanceResourceUtil.GetUserLevel().ToString()); } isShowOpenProficiency = false; Show(); if (curType == LTParGradeStarUp.GradeUp) { IsAwakening = true; ShowGradeUp(); } else if (curType == LTParGradeStarUp.StarUp) { IsAwakening = false; isShowOpenProficiency = (curParData.Star == LTPartnerConfig.MAX_STAR); ShowStarUp(); } else if (curType == LTParGradeStarUp.MaxLevel) { ShowMaxLevel(); PlayMaxLevelAnimation(); return; } ShowAttri(); PlayAnimation(); }
public static bool GetChapterIsOpen(int chapterId) { Hashtable chapterData = Johny.HashtablePool.Claim(); DataLookupsCache.Instance.SearchHashtableByID("userCampaignStatus.normalChapters", out chapterData); int maxChapterId = 101; foreach (DictionaryEntry data in chapterData) { int chapterIntId = int.Parse(data.Key.ToString()); if (chapterIntId > maxChapterId) { maxChapterId = chapterIntId; } } Hotfix_LT.Data.LostMainChapterTemplate tpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetNextChapter(maxChapterId.ToString()); if (tpl != null && LTInstanceUtil.IsChapterComplete(maxChapterId.ToString()) && BalanceResourceUtil.GetUserLevel() >= tpl.LevelLimit && LTInstanceUtil.GetIsChapterLimitConditionComplete(tpl, out int num)) { maxChapterId = int.Parse(tpl.Id); } return(chapterId <= maxChapterId); }
public void OnChapterClick() { if (m_ChapterData.IsBoxRewardType()) { if (!LTInstanceUtil.IsChapterComplete(m_ChapterData.ForwardChapterId)) { int FC = 0; int.TryParse(m_ChapterData.ForwardChapterId, out FC); MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_INSTANCE_MAP_BOX_REWRAD_TIP2"), FC % 100)); return; } if (LTInstanceMapModel.Instance.GetMainChapterRewardState(m_ChapterData.Id)) { return; } LTInstanceMapModel.Instance.RequestMainChapterReward(m_ChapterData.Id, delegate { ContainerObj.CustomSetActive(false); GlobalMenuManager.Instance.Open("LTShowRewardView", m_ChapterData.RewardDataDic[0]); }); return; } FusionAudio.PostEvent("UI/General/ButtonClick", true); if (AllianceUtil.GetIsInTransferDart("ID_CAMPAGIN")) { return; } //此处判断进阶条件是否满足 if (!LTInstanceUtil.GetIsChapterLimitConditionComplete(m_ChapterData, out int currNum)) { //打开跳转界面 GlobalMenuManager.Instance.Open("PlayerUpgradeTipView", new int[3] { m_ChapterData.Limitparam2, m_ChapterData.Limitparam1, currNum }); return; } if (BalanceResourceUtil.GetUserLevel() < m_ChapterData.LevelLimit) { MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, string.Format(EB.Localizer.GetString("ID_codefont_in_LTInstanceMapChapterCtrl_2697"), m_ChapterData.LevelLimit)); //GlobalMenuManager.Instance.Open("LTPlayerLevelUpTipView", "Levelup"); return; } //主线章节入口 if (LTInstanceMapHudController.curChapterID != null && LTInstanceMapHudController.curChapterID != m_ChapterData.Id) { return; } LTInstanceMapHudController.curChapterID = m_ChapterData.Id; if (!string.IsNullOrEmpty(m_ChapterData.BeforeChapter)) { string flagStr = PlayerPrefs.GetString(LoginManager.Instance.LocalUserId.Value + m_ChapterData.BeforeChapter); if (string.IsNullOrEmpty(flagStr)) { LTStoryController.OpenStory(OnChapterClick, m_ChapterData.BeforeChapter); PlayerPrefs.SetString(LoginManager.Instance.LocalUserId.Value + m_ChapterData.BeforeChapter, "True");//本地临时保存,等服务器做好了会保存到服务器 PlayerPrefs.Save(); return; } } Action act = new Action(delegate { LTMainInstanceHudController.EnterInstance(m_ChapterData.Id); LTInstanceMapHudController.curChapterID = null; }); Hotfix_LT.Messenger.Raise(Hotfix_LT.EventName.PlayCloudFxEvent, act); }
private void SetChargeDataDelay(int seq) { EB.Sparx.Hub.Instance.mBaseSdkManager.SetRoleData(CreateRoleData(2, BalanceResourceUtil.GetUserLevel())); }
public bool IsLevelEnough(Hotfix_LT.Data.SpecialActivityLevelTemplate level) { return(BalanceResourceUtil.GetUserLevel() >= level.level); }