/// /// 判定是否为第16关的boss 属性克制 /// bool isGuide16Floor(Item curItem, BanBattleManager battleMgr) { bool found = false; NewFloor floor = Core.Data.newDungeonsManager.curFightingFloor; if (floor != null && floor.config.ID == 60116) { BanBattleRole curBattleRole = battleMgr.GetBattleRole(curItem.defenseIndex); if (curBattleRole != null) { if (curBattleRole.isBoss == (short)1) { if (curItem.period == Period.AttributeConflict) { AccountConfigManager accMgr = Core.Data.AccountMgr; if (accMgr.UserConfig.ShengWuZhe == (short)0) { ConsoleEx.DebugLog("isGuide16Floor is going", ConsoleEx.RED); accMgr.UserConfig.ShengWuZhe = 1; accMgr.save(); found = true; } } } } } return(found); }
void SaoDangSucess(BaseHttpRequest request, BaseResponse response) { ComLoading.Close(); if (response.status != BaseResponse.ERROR) { SaoDangResponse r = response as SaoDangResponse; HttpRequest htp = request as HttpRequest; SaoDangParam param = htp.ParamMem as SaoDangParam; if (r != null && r.data != null) { BattleSequence[] bsquesce = r.data.sweepList; List <BattleSequence> list_data = new List <BattleSequence> (); foreach (BattleSequence data in bsquesce) { list_data.Add(data); } JCPVESaoDangPanel.OpenUI(list_data); //同步通过次数 NewFloor floor = Core.Data.newDungeonsManager.GetFloorData(param.doorId); floor.passTimes = r.data.passCount; RefreshPanel(floor); } } else { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getNetworkErrorString(response.errorCode)); } }
//显示掉落奖励 void ShowDropReward(NewFloor floor) { List <int[]> rewards = floor.config.Reward; int count = rewards.Count; for (int i = 0; i < ListDropReward.Count; i++) { if (i < count) { ListDropReward[i].gameObject.SetActive(true); ItemOfReward reward = new ItemOfReward(); reward.pid = rewards[i][0]; ListDropReward[i].SetData(reward); } } float startx = -275f; float starty = -290f; foreach (JCPVEPlotDesMonsterHead head in ListDropReward) { head.transform.localPosition = new Vector3(startx, starty, 0); startx += head.CellWidth; } }
//建筑物被点击了 void OnBuildingClick(GameObject btn) { int buildingID = 0; int.TryParse(btn.name, out buildingID); NewFloor floorData = null; if (FloorList.TryGetValue(buildingID, out floorData)) { JCPVEPlotDes.OpenUI(floorData); } }
/// /// 网络不正常,则必须设定本地的星级为0 /// void SttleInLocalErr() { //告诉客户端,当前的状态(星级) TemporyData temp = Core.Data.temper; if (temp.currentBattleType == TemporyData.BattleType.BossBattle) { NewFloor newFloor = Core.Data.newDungeonsManager.curFightingFloor; if (newFloor != null && newFloor.isBoss) { newFloor.star = 0; } } }
/// <summary> /// 本地的通知, 这个必须网络正常的情况下,才能走。如果不正常,则必须设定本地的星级为0 /// </summary> void SettleInLocal() { //告诉客户端,当前的状态(星级) TemporyData temp = Core.Data.temper; if (temp.currentBattleType == TemporyData.BattleType.BossBattle) { NewFloor newFloor = Core.Data.newDungeonsManager.curFightingFloor; if (newFloor != null && newFloor.isBoss) { newFloor.star = Math.Max(newFloor.star, statictis.getRank(WarIsOver)); } } }
/// <summary> /// 新手引导第一关 /// </summary> IEnumerator showLevel1(Item curItem, BanBattleManager battleMgr, GuideManager mgr, TemporyData temp) { NewFloor floor = Core.Data.newDungeonsManager.curFightingFloor; #if NewGuide if (floor != null && floor.config.ID == 60103 && mgr.isGuiding) { #else if (floor != null && floor.config.ID == 60101 && mgr.isGuiding) { #endif if (isGuideLevel1(curItem, battleMgr)) { SkillData sd = Core.Data.skillManager.getSkillDataConfig(25037); battleMgr.AngryUI(true, sd, 1); yield return(new WaitForSeconds(BanTimeCenter.XiaoWuKong_Level1)); Time.timeScale = 0.0f; mgr.AutoRUN(); } } } bool isGuideLevel1(Item curItem, BanBattleManager battleMgr) { bool guide = false; int attNum = battleMgr.GetBattleRole(curItem.attackIndex).number; int defNum = battleMgr.GetBattleRole(curItem.defenseIndex).number; #if NewGuide if (attNum == 10142 && defNum == 10172) { #else if (attNum == 10142 && defNum == 10175) { #endif if (curItem.period == Period.AngrySkillReady) { guide = true; curStep = GuideStep.XiaoWuKong_OS_1; ConsoleEx.DebugLog("isGuideLevel1 is going", ConsoleEx.RED); } } return(guide); } #endregion }
public void ResetFloor(BaseHttpRequest request, BaseResponse response) { if (response != null && response.status != BaseResponse.ERROR) { HttpRequest req = request as HttpRequest; ResetFloorParam param = req.ParamMem as ResetFloorParam; ResetFloorResponse resp = response as ResetFloorResponse; NewFloor flr = GetFloorData(param.doorId); flr.passTimes = 0; flr.resetTimes = resp.data.resetCount; Core.Data.playerManager.RTData.curStone += resp.data.stone; } }
public static FateBtnItem CreatFateBtnItem(Transform root, NewFloor data, Vector3 pos) { UnityEngine.Object obj = WXLLoadPrefab.GetPrefab(WXLPrefabsName.UIFateBtnItem); if (obj != null) { GameObject go = Instantiate(obj) as GameObject; FateBtnItem uiH = go.GetComponent <FateBtnItem> (); uiH.fData = data; go.transform.parent = root; go.transform.localScale = Vector3.one; go.transform.localPosition = pos; return(uiH); } return(null); }
void OnBtnClick(string BtnName) { if (BtnName == "Btn_Close") { Close(); } else { if (Core.Data.playerManager.curJingLi < NeedEnergy) { JCRestoreEnergyMsg.OpenUI(110015, 110016); } else { int floorID = this.FristFloorID + int.Parse(BtnName); NewFloor floor = null; //如果关卡存在 if (Core.Data.newDungeonsManager.FloorList.TryGetValue(floorID, out floor)) { SelectFightPanelType _type = this.type == 0 ? SelectFightPanelType.EXP_BATTLE:SelectFightPanelType.GEM_BATTLE; FightRoleSelectPanel FPanel = FightRoleSelectPanel.OpenUI(floor.config.TeamSize, _type, floor.config.FightType); if (FPanel != null) { gameObject.SetActive(false); FPanel.CallBack_Fight = (int[] array, int teamID) => { if (array.Length == 0) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(9092)); } else { JCPVEFightLogic.Instance.Fight(floor.config.ID, array, teamID); } }; FPanel.OnClose = () => { gameObject.SetActive(true); }; } } else { SQYAlertViewMove.CreateAlertViewMove("[ff0000]Can't find floor:" + floorID.ToString() + "[-]"); } } } }
public static JCPVEPlotDes OpenUI(NewFloor floor) { if (Instance == null) { Object prefab = PrefabLoader.loadFromPack("JC/JCPVEPlotDes"); if (prefab != null) { GameObject obj = Instantiate(prefab) as GameObject; RED.AddChild(obj, DBUIController.mDBUIInstance._PVERoot.gameObject); Instance = obj.GetComponent <JCPVEPlotDes>(); Instance.RefreshPanel(floor); DBUIController.mDBUIInstance._PVERoot.AddPage("JCPVEPlotDes", obj); } } return(Instance); }
//建筑物被点击了 public void OnBuildingClick(string btnName) { int buildingID = 0; int.TryParse(btnName, out buildingID); NewFloor floorData = null; if (FloorList == null) { FloorList = Core.Data.newDungeonsManager.FloorList; } if (FloorList.TryGetValue(buildingID, out floorData)) { if (floorData.state != NewFloorState.Unlocked) { // wxl 打过的小关卡 要能点击 看漫画 if (buildingID <= Core.Data.newDungeonsManager.lastFloorId) { NewFloorData tNewData = Core.Data.newDungeonsManager.GetFloorData(buildingID).config; if (tNewData != null) { if (tNewData.isBoss != 1) { PVEDownloadCartoonController.CreateCartoonPanel(tNewData, true); Lab_Title.transform.parent.gameObject.SetActive(false); Debug.Log(" building click "); PVEDownloadCartoonController.Instance.HideDownBtn(false); return; } } } if (Core.Data.playerManager.RTData.curLevel >= floorData.config.Unlock) { Lab_Title.transform.parent.gameObject.SetActive(false); JCPVEPlotDes.OpenUI(floorData); } else { string strText = Core.Data.stringManager.getString(9094); strText = string.Format(strText, floorData.config.Unlock); SQYAlertViewMove.CreateAlertViewMove(strText); } } } }
void CreateElement() { Object prefab = PrefabLoader.loadFromPack("JC/JCPVEDifficultyElement"); if (prefab != null) { float x = -320; float y = 96f; float w = 320; float z = 196; int index = -1; for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { index++; GameObject obj = Instantiate(prefab) as GameObject; obj.name = index.ToString(); obj.transform.parent = uiGrid.transform; obj.transform.localScale = Vector3.one; obj.transform.localPosition = new Vector3(x + w * j, y - z * i, 0); JCPVEDifficultyElement element = obj.GetComponent <JCPVEDifficultyElement>(); UIButtonMessage message = obj.AddComponent <UIButtonMessage>(); if (message != null) { message.target = gameObject; message.functionName = "OnBtnClick"; } int floorID = this.FristFloorID + index; NewFloor floor = null; if (Core.Data.newDungeonsManager.FloorList.TryGetValue(floorID, out floor)) { element.SetTeamSize(floor.config.TeamSize); //设置解锁等级 element.SetUnlockLevel(floor.config.Unlock); } list_cells.Add(element); } } } }
void InitData() { //转换完整章节信息结构<包含网络信息> ChapterList = new Dictionary <int, NewChapter>(); FloorList = new Dictionary <int, NewFloor>(); //转换完整小关卡信息结构<包含网络信息> foreach (int key in FloorConfigList.Keys) { NewFloor floor = new NewFloor(); floor.config = FloorConfigList[key]; FloorList.Add(key, floor); } int ChapterPlotCount = 0; foreach (int key in ChapterConfigList.Keys) { if (key / 10000 == 3) { ChapterPlotCount++; } NewChapter chapter = new NewChapter(); chapter.config = ChapterConfigList[key]; ChapterList.Add(key, chapter); int[] floorid = chapter.config.floorID; foreach (int id in floorid) { NewFloor floordata = null; if (FloorList.TryGetValue(id, out floordata)) { floordata.BelongChapterID = key; } } } endChapterID = startChapterID + (ChapterPlotCount - 1) * 100; }
//查看地图是否达到解锁条件 public bool isUnlockMap(int MapID, bool ShowPrompt = true) { int TargetChapterID = GetChapterIDByMapID(MapID); NewChapter chapter = null; NewFloor floor = null; if (NDManager.ChapterList.TryGetValue(TargetChapterID, out chapter)) { if (chapter.config.floorID.Length > 0) { int floorID = chapter.config.floorID[0]; if (NDManager.FloorList.TryGetValue(floorID, out floor)) { if (Core.Data.playerManager.Lv >= floor.config.Unlock) { return(true); } } } } if (ShowPrompt) { if (chapter != null) { if (floor == null) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(9109)); } else { string temp_str = Core.Data.stringManager.getString(9110); temp_str = temp_str.Replace("{}", floor.config.Unlock.ToString()); SQYAlertViewMove.CreateAlertViewMove(temp_str); } } } return(false); }
public void SetJianTouPos(NewFloor curOpenFloor) { int TargetMapID = (curOpenFloor.BelongChapterID - 30100) / 100; if (TargetMapID < CurMapIndex - 1 || TargetMapID > CurMapIndex + 1) { if (BuildingJianTou.activeSelf) { BuildingJianTou.SetActive(false); } return; } if (Dic_Floors.ContainsKey(curOpenFloor.config.ID)) { if (!BuildingJianTou.activeSelf) { BuildingJianTou.SetActive(true); } JCPVEPlotFloor _Buliding = Dic_Floors[curOpenFloor.config.ID]; Transform parent = _Buliding.transform.parent; _Buliding.transform.parent = JianTouLayer.transform; Vector3 pos = _Buliding.transform.localPosition; _Buliding.transform.parent = parent; pos.y += _Buliding.Spr_Buliding.height; if (!curOpenFloor.isBoss && curOpenFloor.config.TextrueID[0] == "common-0014" && curOpenFloor.config.ID > Core.Data.newDungeonsManager.lastFloorId) { //如果当前是未开启的宝箱,箭头要再高一些 pos.y += 60f; } else { pos.y += 30f; } BuildingJianTou.transform.localPosition = pos; } }
void SetBuildingState(NewFloor data) { floorData = data; switch (data.state) { case NewFloorState.Current: if (data.isBoss) { Spr_Buliding.color = new Color(1f, 1f, 1f, 1f); Guang.gameObject.SetActive(true); Obj_TreasureBox.SetActive(false); } else { if (data.config.TextrueID[0] != chestName) { Spr_Buliding.spriteName = "xiaojianzhu-02"; Spr_Buliding.color = new Color(1f, 1f, 1f, 1f); Spr_Buliding.GetComponent <BoxCollider>().enabled = true; Obj_TreasureBox.SetActive(false); } else { //假设都是宝箱 Spr_Buliding.autoResizeBoxCollider = false; BoxCollider box = Spr_Buliding.GetComponent <BoxCollider>(); box.enabled = true; box.center = new Vector3(0, 50f, 0); box.size = new Vector3(80f, 100f, 0); Spr_Buliding.spriteName = "xiaojianzhu-04"; Spr_Buliding.color = new Color(1f, 1f, 1f, 1f); Obj_TreasureBox.SetActive(true); Spr_light.enabled = true; Spr_floating.spriteName = chestName; Spr_floating.MakePixelPerfect(); Spr_floating.transform.localPosition = Vector3.zero; PlayBaoXiangAnimation(true); } } Spr_Buliding.GetComponent <BoxCollider>().enabled = true; break; case NewFloorState.Pass: PlayBaoXiangAnimation(false); if (data.isBoss) { Spr_Buliding.color = new Color(1f, 1f, 1f, 1f); Spr_Buliding.GetComponent <BoxCollider>().enabled = true; Guang.gameObject.SetActive(true); Obj_TreasureBox.SetActive(false); } else { if (data.config.TextrueID[0] != chestName) { Spr_Buliding.spriteName = "xiaojianzhu-01"; Spr_Buliding.color = new Color(1f, 1f, 1f, 1f); Spr_Buliding.GetComponent <BoxCollider>().enabled = true; Obj_TreasureBox.SetActive(false); } else { //假设都是宝箱 Spr_Buliding.autoResizeBoxCollider = false; BoxCollider box = Spr_Buliding.GetComponent <BoxCollider>(); box.enabled = true; box.center = new Vector3(0, 38f, 0); box.size = new Vector3(80f, 80f, 0); Spr_Buliding.spriteName = "xiaojianzhu-04"; Spr_Buliding.color = new Color(1f, 1f, 1f, 1f); Obj_TreasureBox.SetActive(true); Spr_light.enabled = false; TRotation.enabled = false; Spr_floating.spriteName = "kulou"; Spr_floating.MakePixelPerfect(); Spr_floating.transform.localPosition = new Vector3(0, -10f, 0); } } break; case NewFloorState.Unlocked: PlayBaoXiangAnimation(false); if (data.isBoss) { Spr_Buliding.color = new Color(0, 0, 0, 1f); Obj_TreasureBox.SetActive(false); } else { if (data.config.TextrueID[0] != chestName) { Spr_Buliding.spriteName = "xiaojianzhu-03"; Obj_TreasureBox.SetActive(false); Spr_light.enabled = false; } else { //假设都是宝箱 Spr_Buliding.autoResizeBoxCollider = false; BoxCollider box = Spr_Buliding.GetComponent <BoxCollider>(); box.enabled = true; box.center = new Vector3(0, 50f, 0); box.size = new Vector3(80f, 100f, 0); Spr_Buliding.spriteName = "xiaojianzhu-04"; Spr_Buliding.color = new Color(1f, 1f, 1f, 1f); Obj_TreasureBox.SetActive(true); Spr_light.enabled = true; Spr_floating.spriteName = chestName; Spr_floating.MakePixelPerfect(); Spr_floating.transform.localPosition = Vector3.zero; PlayBaoXiangAnimation(true); } } break; } Spr_Buliding.MakePixelPerfect(); }
public void SetMap(NewChapter chapterData) { if (chapterData == null) { gameObject.SetActive(false); return; } if (!gameObject.activeSelf) { gameObject.SetActive(true); } int MapID = (chapterData.config.ID - 30100) / 100; gameObject.name = MapID.ToString(); NewChapterData configdata = chapterData.config; //JCPVEPlotController.Instance.Lab_Title.text = configdata.name; Spr_Map.spriteName = configdata.mapID; Spr_MapPath.spriteName = configdata.pathMapID; Spr_MapPath.MakePixelPerfect(); Spr_MapPath.transform.localScale = new Vector3(2.048081f, 2.048081f, 1f); mask.color = chapterData.color; int[] floorID = configdata.floorID; Spr_MapPath.transform.localPosition = chapterData.pathPosition; #region 建筑物 if (bulidings.Count < floorID.Length) { int cha = floorID.Length - bulidings.Count; Object prefab = PrefabLoader.loadFromPack("JC/JCPVEPlotBuilding"); for (int i = 0; i < cha; i++) { if (prefab != null) { GameObject buliding = Instantiate(prefab) as GameObject; buliding.transform.parent = MapGrid.transform; buliding.transform.localScale = Vector3.one; JCPVEPlotFloor script = buliding.GetComponent <JCPVEPlotFloor>(); bulidings.Add(script); } } } if (floorID.Length > 0) { Dictionary <int, NewFloor> FloorList = Core.Data.newDungeonsManager.FloorList; int i = 0; for (; i < floorID.Length; i++) { NewFloor floorData = null; if (FloorList.TryGetValue(floorID[i], out floorData)) { bulidings[i].name = floorID[i].ToString(); if (bulidings[i] != null) { bulidings[i].SetData(floorData); if (!JCPVEPlotController.Instance.Dic_Floors.ContainsKey(floorID[i])) { JCPVEPlotController.Instance.Dic_Floors.Add(floorID[i], bulidings[i]); } else { JCPVEPlotController.Instance.Dic_Floors[floorID[i]] = bulidings[i]; } } } } for (; i < bulidings.Count; i++) { bulidings[i].SetData(null); } } #endregion #region 一切没有解锁的或不能访问的状态一律隐藏 if (!JCPVEPlotController.Instance.isUnlockMap((chapterData.config.ID - 30100) / 100, false)) { gameObject.SetActive(false); } if (MapID > 0) { //如果之前一关没有通关 if (!JCPVEPlotController.Instance.isPassCurMap(MapID - 1)) { gameObject.SetActive(false); } } #endregion }
/// <summary> /// 保存战斗结果的数据 /// </summary> /// <param name="battleResp">Battle resp.</param> private void storeWarResult(BattleResponse battleResp) { //把服务器过来的战斗结算消息赋值 TemporyData temp = Core.Data.temper; NewDungeonsManager ddMgr = Core.Data.newDungeonsManager; if (temp.warBattle == null) { temp.warBattle = new BattleSequence() { //战斗同步数据 sync = battleResp.data.sync, // 系统奖励 reward = battleResp.data.reward, // 掠夺奖励 ext = battleResp.data.ext, //赌博结果 gambleResult = battleResp.data.gambleResult, //雷达组队神秘大奖 radarReward = battleResp.data.radarReward, //战斗序列 battleData = battleResp.data.battleData, //PVE活动副本倒计时 explorDoors = battleResp.data.explorDoors, //已打通的次数 passCount = battleResp.data.passCount, //连击 comboReward = battleResp.data.comboReward, }; } else { //战斗同步数据 temp.warBattle.sync = battleResp.data.sync; // 系统奖励 temp.warBattle.reward = battleResp.data.reward; // 掠夺奖励 temp.warBattle.ext = battleResp.data.ext; //赌博结果 temp.warBattle.gambleResult = battleResp.data.gambleResult; //雷达组队神秘大奖 temp.warBattle.radarReward = battleResp.data.radarReward; // 战斗序列 temp.warBattle.battleData.stars = battleResp.data.battleData.stars; //技能副本的引导需要这个值 temp.warBattle.battleData.isfirst = battleResp.data.battleData.isfirst; temp.warBattle.explorDoors = battleResp.data.explorDoors; //已打通的次数 temp.warBattle.passCount = battleResp.data.passCount; //连击 temp.warBattle.comboReward = battleResp.data.comboReward; } //PVE活动副本倒计时 if (battleResp.data.explorDoors != null) { ddMgr.explorDoors = battleResp.data.explorDoors; } //保存pvp挑战次数 NewFloor floor = ddMgr.GetFloorData(ddMgr.curFightingFloor.config.ID); if (floor != null) { floor.passTimes = battleResp.data.passCount; } }
//网络初始化 public override void fullfillByNetwork(BaseResponse response) { if (response != null && response.status != BaseResponse.ERROR) { LoginResponse loginResp = response as LoginResponse; if (loginResp != null && loginResp.data != null && loginResp.data.floor != null) { InitData(); lastFloorId = loginResp.data.floor.end; if (lastFloorId == 0) { lastFloorId = startFloorID; } DungeonsInfo dungeonse = loginResp.data.floor; if (dungeonse != null && dungeonse.pro != null) { foreach (int[] oneFloor in dungeonse.pro) { int floorId = oneFloor[0]; int star = oneFloor[1]; NewFloor floor = null; if (FloorList.TryGetValue(floorId, out floor)) { floor.star = star; } } } //设置各个小关卡的状态 NewFloor floordata = null; int floorid = startFloorID; for (; floorid <= lastFloorId; floorid++) { if (FloorList.TryGetValue(floorid, out floordata)) { floordata.state = NewFloorState.Pass; } } Debug.Log("CurrentID=" + floorid.ToString()); //设置开启的下一关<当前关卡> if (FloorList.TryGetValue(floorid, out floordata)) { floordata.state = NewFloorState.Current; } //开启PVE副本倒计时 if (loginResp.data.explorDoors != null) { explorDoors = loginResp.data.explorDoors; AsyncTask.QueueOnMainThread(() => { JCPVETimerManager.Instance.AutoOpenPVESystemTimer(); }); } Analysis(); // AnaylizeFloor(); } //挑战次数和重置次数 if (loginResp != null && loginResp.data != null && loginResp.data.doorDayStatus != null) { for (int i = 0; i < loginResp.data.doorDayStatus.Length; i++) { DoorDayStatus doorStatus = loginResp.data.doorDayStatus [i]; NewFloor newflr = GetFloorData(doorStatus.doorId); if (newflr != null) { newflr.passTimes = doorStatus.passCount; newflr.resetTimes = doorStatus.resetCount; } else { RED.LogWarning(doorStatus.doorId + "not find floor data"); } } } } //更新招募和位置2是否解锁 PlayerManager playerMgr = Core.Data.playerManager; if (playerMgr.RTData != null && playerMgr.RTData.curTeam != null) { Core.Data.BuildingManager.ZhaoMuUnlock = (playerMgr.RTData.curTeam.getMember(1) != null); //|| lastFloorId >= 60104); } }
void OnEnable() { if(Instance == null)Instance = this; //初始化特殊副本是否解锁 NewDungeonsManager newDM = Core.Data.newDungeonsManager; ExploreConfigData exploreConfig = newDM.GetExploreData (3); PVEType_Exp.isLock = (newDM.lastFloorId < exploreConfig.openfloor); string strText = Core.Data.stringManager.getString (9095); NewFloor floor = newDM.GetFloorData (exploreConfig.openfloor); if(floor != null) { int chapID = floor.BelongChapterID % 30000 / 100; string strLock = string.Format (strText, RED.GetChineseNum(chapID)); PVEType_Exp.SetLockTxt (strLock); } exploreConfig = newDM.GetExploreData (1); PVEType_Skill.isLock = (newDM.lastFloorId < exploreConfig.openfloor); floor = newDM.GetFloorData (exploreConfig.openfloor); if(floor != null) { int chapID = floor.BelongChapterID % 30000 / 100; string strLock = string.Format (strText, RED.GetChineseNum(chapID)); PVEType_Skill.SetLockTxt (strLock); } exploreConfig = newDM.GetExploreData (2); PVEType_FightSoul.isLock = (newDM.lastFloorId < exploreConfig.openfloor); floor = newDM.GetFloorData (exploreConfig.openfloor); if(floor != null) { int chapID = floor.BelongChapterID % 30000 / 100; string strLock = string.Format (strText, RED.GetChineseNum(chapID)); PVEType_FightSoul.SetLockTxt (strLock); } JCPVETimerManager m = JCPVETimerManager.Instance; NewDungeonsManager dm = Core.Data.newDungeonsManager; int SkillCount = 0; int SkillPassCount = 2; int FightCount = 0; int FightPassCount = 2; if(dm.explorDoors!= null) { //技能副本 if(dm.explorDoors.skill != null) { SkillPassCount = dm.explorDoors.skill.passCount; SkillCount = dm.explorDoors.skill.count; if(SkillPassCount < SkillCount) { m.SkillFBCoding = SkillFBCoding; SkillFBCoding(Core.Data.temper.SkillDJS); if(!JCPVETimerManager.Instance.isSkillFBCoding) PVEType_Skill.SetProgress(SkillPassCount,SkillCount,dm.explorDoors.skill.needStone); } else PVEType_Skill.SetProgress(SkillPassCount,SkillCount,dm.explorDoors.skill.needStone); } //战魂副本 if(dm.explorDoors.souls != null) { FightCount = dm.explorDoors.souls.count; FightPassCount = dm.explorDoors.souls.passCount; if(FightPassCount < FightCount) { m.FightSoulFBCoding = FightSoulFBCoding; FightSoulFBCoding(Core.Data.temper.FightSoulDJS); if(!JCPVETimerManager.Instance.isFightSoulFBCoding) PVEType_FightSoul.SetProgress(FightPassCount,FightCount,dm.explorDoors.souls.needStone); } else PVEType_FightSoul.SetProgress(FightPassCount,FightCount,dm.explorDoors.souls.needStone); } int ExpAndGemCount = 0; if(dm.explorDoors.exp != null) ExpAndGemCount+=dm.explorDoors.exp.count; if(dm.explorDoors.gems != null) ExpAndGemCount+=dm.explorDoors.gems.count; int ExpAndGemPassCount = 0; if(dm.explorDoors.exp != null) ExpAndGemPassCount+=dm.explorDoors.exp.passCount; if(dm.explorDoors.gems != null) ExpAndGemPassCount+=dm.explorDoors.gems.passCount; PVEType_Exp.SetProgress2(ExpAndGemPassCount.ToString()+"/"+ExpAndGemCount.ToString()); } }
void RefreshPanel(NewFloor floor) { floordata = floor; ShowDropReward(floor); Stars.SetStar(floor.star); ExploreConfigData explore = Core.Data.newDungeonsManager.GetExploreData(5); leftTime = floordata.config.times - floordata.passTimes; string strText = ""; if (floor.config.isBoss > 0) { strText = Core.Data.stringManager.getString(9079); } else { strText = Core.Data.stringManager.getString(9104); } lab_GetTip.text = strText; if (Core.Data.newDungeonsManager.lastFloorId >= explore.openfloor) { RED.SetActive(true, btn_saoDangs.transform.parent.gameObject); CanSaoDang = ((floor.star >= floor.config.Sweep) && (leftTime > 0)); Lab_Des.width = 800; } else { CanSaoDang = false; RED.SetActive(false, btn_saoDangs.transform.parent.gameObject); Lab_Des.width = 1000; } Lab_Des.text = " " + floor.config.Des; Lab_Title.text = floor.config.name; NeedEnergy = floor.config.NeedEnergy; FightType = floor.config.FightType; TeamSize = floor.config.TeamSize; lab_PassTime.text = "[f4cd8b]" + Core.Data.stringManager.getString(9105) + "[-] " + leftTime.ToString() + "/" + floordata.config.times.ToString(); if (LuaTest.Instance.OpenCartoon) { if (Core.Data.playerManager.Lv == 1 || !Core.Data.guideManger.isGuiding) { if (floordata != null) { if (floordata.config.ID - 1 == Core.Data.newDungeonsManager.lastFloorId) { if (Core.Data.usrManager.UserConfig.cartoon == 1) { #if NewGuide if (!Core.Data.guideManger.isGuiding) { pveCartoonCtrl = PVEDownloadCartoonController.CreateCartoonPanel(floordata.config, true); } #else pveCartoonCtrl = PVEDownloadCartoonController.CreateCartoonPanel(floordata.config, true); #endif } else { pveCartoonCtrl = PVEDownloadCartoonController.CreateCartoonPanel(floordata.config); } } else { pveCartoonCtrl = PVEDownloadCartoonController.CreateCartoonPanel(floordata.config); } } } } else { if (Core.Data.playerManager.Lv == 1 && Core.Data.guideManger.isGuiding) { if (floordata != null) { if (floordata.config.ID - 1 == Core.Data.newDungeonsManager.lastFloorId) { pveCartoonCtrl = PVEDownloadCartoonController.CreateCartoonPanel(floordata.config, true); } } } } // PrepareCartoonPanel(); RED.SetActive(leftTime <= 0, btn_Buy.gameObject); UILabel lab_saodang = btn_saoDangs.GetComponentInChildren <UILabel>(); if (lab_saodang != null) { lab_saodang.text = string.Format(Core.Data.stringManager.getString(9106), leftTime); //{"ID":9106,"txt":"扫荡{0}次"} } }
public void SetData(NewFloor flrData) { if (flrData == null) { gameObject.SetActive(false); return; } if (!gameObject.activeSelf) { gameObject.SetActive(true); } Guang.gameObject.SetActive(false); floorData = flrData; Spr_Buliding.autoResizeBoxCollider = true; Spr_Buliding.pivot = UIWidget.Pivot.Bottom; transform.localPosition = floorData.localPosition; Spr_Buliding.spriteName = floorData.config.TextrueID[0]; Spr_Buliding.MakePixelPerfect(); UIButtonMessage message = gameObject.AddComponent <UIButtonMessage>(); if (message != null) { message.target = JCPVEPlotController.Instance.gameObject; message.functionName = "OnBuildingClick"; } stars.SetStar(floorData.star); SetBuildingState(floorData); int i = 1; bool needCreate = false; for (; i <= 5; i++) { ExploreConfigData explore = Core.Data.newDungeonsManager.GetExploreData(i); if (explore != null) { if (explore.openfloor == floorData.config.ID && Core.Data.newDungeonsManager.lastFloorId < explore.openfloor) { needCreate = true; break; } } } if (needCreate) { if (lockFb == null) { CreateLockFB(i); } else { lockFb.SetFBType(i); } } else if (lockFb != null) { Destroy(lockFb.gameObject); lockFb = null; } }
void SetItem() { TemporyData temp = Core.Data.temper; List <BanBattleRole> atksidelist = BanBattleManager.Instance.GetRoleList(BanBattleRole.Group.Attack); List <BanBattleRole> defsidelist = BanBattleManager.Instance.GetRoleList(BanBattleRole.Group.Defense); NewFloor floor = Core.Data.newDungeonsManager.curFightingFloor; bool side = false; if (floor != null) { side = floor.config.FightType == 0; } int itemNum = atksidelist.Count > defsidelist.Count ? atksidelist.Count : defsidelist.Count; RED.RemoveChildsImmediate(_grid.transform); for (int i = 0; i < itemNum; ++i) { GameObject pbitem = FhjLoadPrefab.GetPrefab(_prefabItem); UIConflictItem item = NGUITools.AddChild(_grid.gameObject, pbitem).GetComponent <UIConflictItem>(); item.gameObject.name = "item" + i; if (atksidelist.Count > i) { if (temp.currentBattleType == TemporyData.BattleType.BossBattle) { item._atkPart.SetData(atksidelist [i], side); } else if (temp.currentBattleType == TemporyData.BattleType.FinalTrialBuou) { item._atkPart.SetData(atksidelist [i], false); } else if (temp.currentBattleType == TemporyData.BattleType.PVPVideo) { bool att = temp.PvpVideo_AttackOrDefense == 1; item._atkPart.SetData(atksidelist [i], att); } else { item._atkPart.SetData(atksidelist [i], true); } } else { item._atkPart.gameObject.SetActive(false); } if (defsidelist.Count > i) { if (temp.currentBattleType == TemporyData.BattleType.BossBattle) { item._defPart.SetData(defsidelist [i], !side); } else if (temp.currentBattleType == TemporyData.BattleType.FinalTrialBuou) { item._defPart.SetData(defsidelist [i], true); } else if (temp.currentBattleType == TemporyData.BattleType.PVPVideo) { bool def = temp.PvpVideo_AttackOrDefense == 1; item._defPart.SetData(defsidelist [i], !def); } else { item._defPart.SetData(defsidelist [i], false); } } else { item._defPart.gameObject.SetActive(false); } } _grid.Reposition(); }
void LeftIsAttOrDef() { TemporyData temp = Core.Data.temper; string spriteName = string.Empty; if (IsAttack) //右边 { if (temp.currentBattleType == TemporyData.BattleType.FinalTrialShalu) { spriteName = "BattleUI_Attack"; } else if (temp.currentBattleType == TemporyData.BattleType.FinalTrialBuou) { spriteName = "BattleUI_Defense"; } else if (temp.currentBattleType == TemporyData.BattleType.BossBattle) { #if NEWPVE NewFloor floor = Core.Data.newDungeonsManager.curFightingFloor; bool att = floor.config.FightType == 0; #else Floor floor = CityFloorData.Instance.currFloor; bool att = floor.config.gf == 1; #endif spriteName = att ? "BattleUI_Attack" : "BattleUI_Defense"; } else if (temp.currentBattleType == TemporyData.BattleType.PVPVideo) { if (temp.PvpVideo_AttackOrDefense == 1) { spriteName = "BattleUI_Attack"; } else { spriteName = "BattleUI_Defense"; } } else { spriteName = "BattleUI_Attack"; } for (int i = 0; i < atkDefIcon.Length; i++) { atkDefIcon[i].spriteName = spriteName; } //wxl // if (spriteName == "BattleUI_Defense"){ // if (hpBar != null) { // hpBar.SpriteHp.spriteName = "nvqitiao"; // if (_topHpBar != null) { // _topHpBar.SpriteHp.spriteName = "nvqitiao"; // _topHpBar.SpriteHp.color = Color.gray; // } // } // } this.SpriteName = spriteName; } else { if (temp.currentBattleType == TemporyData.BattleType.FinalTrialShalu) { spriteName = "BattleUI_Defense"; } else if (temp.currentBattleType == TemporyData.BattleType.FinalTrialBuou) { spriteName = "BattleUI_Attack"; } else if (temp.currentBattleType == TemporyData.BattleType.BossBattle) { #if NEWPVE NewFloor floor = Core.Data.newDungeonsManager.curFightingFloor; bool att = floor.config.FightType == 0; #else Floor floor = CityFloorData.Instance.currFloor; bool att = floor.config.gf == 1; #endif spriteName = att ? "BattleUI_Defense" : "BattleUI_Attack"; } else if (temp.currentBattleType == TemporyData.BattleType.PVPVideo) { if (temp.PvpVideo_AttackOrDefense == 1) { spriteName = "BattleUI_Defense"; } else { spriteName = "BattleUI_Attack"; } } else { spriteName = "BattleUI_Defense"; } for (int i = 0; i < atkDefIcon.Length; i++) { atkDefIcon[i].spriteName = spriteName; } //wxl // if (spriteName == "BattleUI_Defense") { // if (hpBar != null) { // hpBar.SpriteHp.spriteName = "nvqitiao"; // if (_topHpBar != null) { // _topHpBar.SpriteHp.spriteName = "nvqitiao"; // _topHpBar.SpriteHp.color = Color.gray; // } // } // // } this.SpriteName = spriteName; } if (SpriteName == "BattleUI_Attack") { BgTeam.spriteName = "gongjidi"; BgAttOrDef.spriteName = "gongjitiao"; text_CurRoleBattlePoint.color = Color.white; //new Color(1.0f, 0.4f, 0, 1.0f); } else { BgTeam.spriteName = "fangyudi"; BgAttOrDef.spriteName = "fangyutiao"; text_CurRoleBattlePoint.color = Color.white; //new Color(0, 0.792f, 1.0f, 1.0f); } }
/*显示右边具体任务描述 * */ public void ShowRightPanel(TaskData data) { curTaskData = data; MissionName.text = data.Title; MissionDescription.text = data.Content; if (data.Count > 60000) { NewFloor nfd = Core.Data.newDungeonsManager.FloorList[data.Count]; if (nfd != null) { CompleteCondition.text = data.Require.Replace("{}", nfd.config.name) + " [ffff00](" + data.curProgress.ToString() + "/" + data.Progress.ToString() + ")[-]"; } } else { CompleteCondition.text = data.Require.Replace("{}", data.Count.ToString()) + " [ffff00](" + data.curProgress.ToString() + "/" + data.Progress.ToString() + ")[-]"; } string str_content = ""; for (int i = 0; i < rewards.Length; i++) { UITaskRewardData rewardData = null; if (i < data.Reward_ItemID.Count) { rewardData = new UITaskRewardData(); rewardData.Reward_ItemID = data.Reward_ItemID[i][0]; rewardData.Reward_ItemCount = data.Reward_ItemID[i][1]; } rewards[i].SetTaskReward(rewardData); if (rewardData != null) { str_content += rewardData.Reward_ItemCount.ToString() + "[-]" + Core.Data.stringManager.getString(6011) + rewards[i].Lab_Name.text; } } // reward.SetTaskReward(data); /* * {"ID":9066,"txt":"随机获得{}颗宝石"} * {"ID":9067,"txt":"获得{}钻石"} * {"ID":9068,"txt":"随机获得{}名武者的魂魄"} * */ rewardDes.text = Core.Data.stringManager.getString(9079) + "[ffff00]" + str_content; SetGetRewardButtonEnable(data.curProgress == data.Progress); switch (data.TASKTYPE) { case 7: case 8: case 9: case 6: case 11: Btn_Go.SetActive(false); break; default: Btn_Go.SetActive(false); // yangchenguang 隐藏GO按钮 break; } }
public void SetViewState(EMViewState vs, EMBoxType bt = EMBoxType.NONE, object obj = null) { switch (vs) { case EMViewState.MainView: break; case EMViewState.S_ShenLong: DBUIController.mDBUIInstance.HiddenFor3D_UI(); UIShenLongManager.setShenLongManagerRoot(_bottomRoot); break; case EMViewState.S_FuBen: #if NEWPVE UIMiniPlayerController.ElementShowArray = new bool[] { true, false, true, true, true }; if (!_PVERoot.gameObject.activeSelf) { _PVERoot.gameObject.SetActive(true); } pveView.SetActive(true); TopMenuUI.OpenUI(); #else chapterView.SetActive(true); #endif DBUIController.mDBUIInstance.HiddenFor3D_UI(); break; case EMViewState.S_QiangDuo: UIMiniPlayerController.ElementShowArray = new bool[] { true, true, false, true, true }; FinalTrialMgr.GetInstance().getAllData(); // DBUIController.mDBUIInstance.HiddenFor3D_UI (); break; case EMViewState.S_Team_NoSelect: TeamUI.OpenUI(); HiddenFor3D_UI(false); break; case EMViewState.H_Bag: petBoxView.viewWillHidden(); break; case EMViewState.S_Bag: petBoxView.viewWillShow(); DBUIController.mDBUIInstance.HiddenFor3D_UI(); break; case EMViewState.S_Team_Select: HiddenFor3D_UI(false); TeamUI.OpenUI(); break; case EMViewState.S_CityFloor: //更新PVE系统Timer JCPVETimerManager.Instance.AutoOpenPVESystemTimer(); NewFloor floordata = Core.Data.newDungeonsManager.curFightingFloor; if (floordata != null && Core.Data.temper.warBattle.battleData.iswin == 1) { floordata.state = NewFloorState.Pass; if (floordata.config.ID > Core.Data.newDungeonsManager.lastFloorId) { int nextId = ++Core.Data.newDungeonsManager.lastFloorId; NewFloor nextfloordata = null; if (Core.Data.newDungeonsManager.FloorList.TryGetValue(nextId + 1, out nextfloordata)) { nextfloordata.state = NewFloorState.Current; } } } SQYMainController.mInstance.OnBtnFuBen(); bool isOpenDescribe = false; if ("PVEType_Plot" == Core.Data.newDungeonsManager.curFightingFBType) { if (DBUIController.battleAgain == true) { DBUIController.battleAgain = false; if (DBUIController.battleAgainID <= Core.Data.newDungeonsManager.lastFloorId) { JCPVEPlotController.tempOpenFloorID = DBUIController.battleAgainID; isOpenDescribe = true; } } } JCPVEMainController.Instance.OnBtnClick(Core.Data.newDungeonsManager.curFightingFBType); if (isOpenDescribe) { JCPVEPlotController.Instance.OnBuildingClick(DBUIController.battleAgainID.ToString()); } break; case EMViewState.HIDE_TEAM_VIEW: if (TeamUI.mInstance != null) { TeamUI.mInstance.CloseUI(); } break; case EMViewState.S_ShangCheng: UIDragonMallMgr.GetInstance().OpenUINew(ShopItemType.HotSale); break; case EMViewState.S_HuoDong: if (UIWXLActivityMainController.Instance != null) { UIWXLActivityMainController.Instance.SetActive(true); } else { UIWXLActivityMainController.CreateActivityMainPanel(DBUIController.mDBUIInstance._TopRoot); } //mActPanel.SetActive (true); ActivityNetController.GetInstance().SendLoginMSG(Core.Data.playerManager.PlayerID, null); break; case EMViewState.S_MosterCome: MonsterComePanel.SetActive(true); break; case EMViewState.S_XiaoXi: MessageMgr.GetInstance().SetInfoPanel(true); break; case EMViewState.S_SevenDaysReward: UISevenDayRewardMain.OpenUI(); // DBUIController.mDBUIInstance.HiddenFor3D_UI (); break; case EMViewState.S_Friend: { Core.Data.FriendManager.initFriendListInfo(); Core.Data.FriendManager.initSuDiListInfo(); Core.Data.FriendManager.initFriendRequestListInfo(); UIMainFriend.Instance.getFriendList(); UIMainFriend.Instance.setMainFriendRoot(_bottomRoot); UIMainFriend.Instance.gameObject.SetActive(false); } break; } if (bt != EMBoxType.NONE) { petBoxView.SetPetBoxType(bt); } }