LingMaiMiJingManager = {} local this = LingMaiMiJingManager local lodeConfig = ConfigManager.GetConfig(ConfigName.LodeConfig) local monsterGroup = ConfigManager.GetConfig(ConfigName.MonsterGroup) local monsterConfig = ConfigManager.GetConfig(ConfigName.MonsterConfig) function this.Initialize() this.state = 1--当前状态 this.startTime = 0--我开始占领此矿脉的时间 this.endTime = 1638460800--结束时间 this.myPlaceId = 1--当前我占领的矿脉的id this.fightTime = 0--我的剩余挑战次数 this.curPage = 0 this.lingmaiData = {} this.battleResult = {} this.recordData = {} end --获取manager中的信息 function this.GetData() local data = {} data.state = this.state data.startTime = this.startTime data.endTime = this.endTime data.myPlaceId = this.myPlaceId data.lingmaiData = {} for i = 1, 5 do data.lingmaiData[i] = {} -- LogGreen("placeId:"..tostring(this.lingmaiData[i].id).." playerId:"..tostring(this.lingmaiData[i].uid).." Name:"..tostring(this.lingmaiData[i].name)) if not this.lingmaiData[i] then LogError("服务器发来的灵脉Id为0") -- Game.GlobalEvent:DispatchEvent(GameEvent.LingMaiMiJing.ClosePanel) return nil end data.lingmaiData[i].Id = this.lingmaiData[i].lingmaiId local curId = data.lingmaiData[i].Id data.lingmaiData[i].No = lodeConfig[curId].No data.lingmaiData[i].PageNo = lodeConfig[curId].PageNo data.lingmaiData[i].Group = lodeConfig[curId].Group data.lingmaiData[i].Quality = lodeConfig[curId].Quality data.lingmaiData[i].RewardList = lodeConfig[curId].RewardList data.lingmaiData[i].Guard = lodeConfig[curId].Guard data.lingmaiData[i].veinName = lodeConfig[curId].Name local monsterGroupData = monsterGroup[data.lingmaiData[i].Guard].Contents --拼接玩家数据 if this.lingmaiData[i].uid ~= 0 then data.lingmaiData[i].uid = this.lingmaiData[i].uid data.lingmaiData[i].name = this.lingmaiData[i].name data.lingmaiData[i].servername = this.lingmaiData[i].servername data.lingmaiData[i].head = this.lingmaiData[i].head data.lingmaiData[i].headFrame = this.lingmaiData[i].headFrame else data.lingmaiData[i].uid = 0 data.lingmaiData[i].name = "宝岛" data.lingmaiData[i].servername = "" data.lingmaiData[i].head = 0 data.lingmaiData[i].headFrame = 0 data.lingmaiData[i].level = 100 data.lingmaiData[i].teamInfo = {} data.lingmaiData[i].teamInfo.totalForce = lodeConfig[curId].GuardCombatNum data.lingmaiData[i].teamInfo.team = {} for j = 1, 6 do if monsterGroupData[1] then local monsterData = monsterConfig[monsterGroupData[1][j]] local herodata = {} -- LogBlue(data.lingmaiData[i].Guard.." "..monsterGroupData[1][j].." "..monsterData.MonsterId.." "..monsterData.Star.." "..monsterData.Level) herodata.heroTid = monsterData.MonsterId herodata.star = monsterData.Star herodata.level = monsterData.Level herodata.position = j herodata.skinId = 0 herodata.godSoulLv = 0 table.insert(data.lingmaiData[i].teamInfo.team,herodata) end end end end return data end --获取服务器发来的信息 function this.GetLingMaiServerData(msg,func) this.state = msg.state this.myPlaceId = msg.myOccupyId this.startTime = msg.myOccupyTime this.fightTime = msg.remainChangeTimes this.endTime = msg.timePoint this.lingmaiData = msg.lingmaiData for i = 1, #msg.lingmaiData do this.curPage = lodeConfig[msg.lingmaiData[i].lingmaiId].PageNo -- LogYellow("id:"..tostring(msg.lingmaiData[i].lingmaiId).." uid:"..tostring(msg.lingmaiData[i].uid).." name:"..tostring(msg.lingmaiData[i].name) -- .." practiceLevel:"..tostring(msg.lingmaiData[i].practiceLevel).." servername:"..tostring(msg.lingmaiData[i].servername)) msg.lingmaiData[i].name = PracticeManager.SetNameColor(msg.lingmaiData[i].name,msg.lingmaiData[i].practiceLevel) end Log("灵脉秘境:state:"..tostring(msg.state).." myPlaceId:"..tostring(msg.myOccupyId).." startTime:"..tostring(msg.myOccupyTime) .." fightTime:"..tostring(msg.remainChangeTimes).." lingmaiData:"..tostring(#msg.lingmaiData).." curPage:"..tostring(this.curPage).." timePoint:"..tostring(msg.timePoint)) if func then func() end end function this.OpenRecord() NetManager.LingMaiRecordRequest(function () UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.LingMaiRecord) end) end function this.CheckPrivilage(func) if PrivilegeManager.GetPrivilegeRemainValue(2030) <= 0 then if PrivilegeManager.GetPrivilegeRemainValue(2031) > 0 then local costId, finalNum, oriCostNum = ShopManager.calculateBuyCost(SHOP_TYPE.FUNCTION_SHOP,10044, 1) local itemName = ConfigManager.GetConfigData(ConfigName.ItemConfig,costId).Name MsgPanel.ShowTwo(string.format( Language[10516],finalNum,itemName), nil, function() --买东西 ShopManager.RequestBuyShopItem(SHOP_TYPE.FUNCTION_SHOP,10044,1,function() PopupTipPanel.ShowTip(Language[10517]) PrivilegeManager.RefreshPrivilegeUsedTimes(2031, 1)--更新特权 func() end,0) end) else PopupTipPanel.ShowTip("今日已无挑战次数!") end else func() end end function this.CheckRedPoint() --判断功能是否开启 if not ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.LINGMAIMIJING) then return false end --判断世界等级是否够 local conFigWorldLevel = ConfigManager.GetConfigData(ConfigName.MServerLodeSetting,1).WorldLevel if PlayerManager.worldLeve < conFigWorldLevel then --如果世界等级不足 return false end -- 跨服相关判断 if not JumpServerManager.GetLingMaiIsStart() then return false elseif not JumpServerManager.GetHightLadderDataIsGroup() then return false end if this.state ~= 1 then return false end if this.myPlaceId <= 0 then return true end if #this.recordData > 0 then if not PlayerPrefs.GetString(PlayerManager.uid.."LingMai") then PlayerPrefs.SetString(PlayerManager.uid.."LingMai", "") end for i = 1, #this.recordData do if this.recordData[i].type == 1 then return PlayerPrefs.GetString(PlayerManager.uid.."LingMai") ~= tostring(this.recordData[i].time) end end end return false end function this.CheckRecord() for i = 1, #this.recordData do if this.recordData[i].type == 1 then return PlayerPrefs.GetString(PlayerManager.uid.."LingMai") ~= tostring(this.recordData[i].time) end end return false end function this.CheckQiJieJump(funcType,SettingNum,func) --判断功能是否开启 if not ActTimeCtrlManager.IsQualifiled(funcType) then PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(funcType)) return end --判断世界等级是否够 local conFigWorldLevel = ConfigManager.GetConfigData(ConfigName.MServerLodeSetting,SettingNum).WorldLevel if PlayerManager.worldLeve < conFigWorldLevel then --如果世界等级不足 PopupTipPanel.ShowTip(string.format("世界等级到达%s后开启!",conFigWorldLevel)) return end -- 跨服相关判断 JumpServerManager.GetWorldArenaInfoRequest(function() if not JumpServerManager.GetQiJieIsStart() then PopupTipPanel.ShowTip(string.format("开服第%s周开放!",ConfigManager.GetConfigData(ConfigName.MServerArenaSetting,SettingNum).OpenWeek)) return elseif not JumpServerManager.GetHightLadderDataIsGroup() then PopupTipPanel.ShowTip("未划分跨服分组,无法参与!") return end if func then func() end end) end return LingMaiMiJingManager