无尽副本优化提交
parent
848af2cbbe
commit
00497c7071
|
@ -496,7 +496,7 @@ end
|
||||||
|
|
||||||
--点击筛选
|
--点击筛选
|
||||||
function this.OnClickTabBtn(_proId, isTop,isAni)
|
function this.OnClickTabBtn(_proId, isTop,isAni)
|
||||||
local heros
|
local heros = {}
|
||||||
this.selectBtn:SetActive(proId ==_proId)
|
this.selectBtn:SetActive(proId ==_proId)
|
||||||
this.selectBtn.transform:SetParent(tabs[_proId].transform)
|
this.selectBtn.transform:SetParent(tabs[_proId].transform)
|
||||||
this.selectBtn.transform:DOAnchorPos(Vector3.zero,0)
|
this.selectBtn.transform:DOAnchorPos(Vector3.zero,0)
|
||||||
|
@ -511,6 +511,7 @@ function this.OnClickTabBtn(_proId, isTop,isAni)
|
||||||
end
|
end
|
||||||
elseif this.curFormationIndex == FormationTypeDef.FORMATION_ENDLESS_MAP then
|
elseif this.curFormationIndex == FormationTypeDef.FORMATION_ENDLESS_MAP then
|
||||||
heros = EndLessMapManager.GetHeroDataByProperty(_proId, limitLevel)
|
heros = EndLessMapManager.GetHeroDataByProperty(_proId, limitLevel)
|
||||||
|
heros = EndLessMapManager.GetHeroDataByProperty1(_proId, limitLevel,heros)
|
||||||
else
|
else
|
||||||
if _proId == ProIdConst.All then
|
if _proId == ProIdConst.All then
|
||||||
heros = HeroManager.GetAllHeroDatas(limitLevel)
|
heros = HeroManager.GetAllHeroDatas(limitLevel)
|
||||||
|
@ -532,10 +533,13 @@ function this.SetRoleList(_roleDatas, isTop,isAni)
|
||||||
this.SingleHeroDataShow(go, _roleDatas[index])
|
this.SingleHeroDataShow(go, _roleDatas[index])
|
||||||
end, not isTop,not isAni)
|
end, not isTop,not isAni)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--排序英雄数据
|
--排序英雄数据
|
||||||
function this.SortHeroDatas(_heroDatas)
|
function this.SortHeroDatas(_heroDatas)
|
||||||
local choosed = {}
|
local choosed = {}
|
||||||
local dieHeros = {}
|
local dieHeros = {}
|
||||||
|
local notExisted = {}
|
||||||
local curFormation = FormationManager.GetFormationByID(this.curFormationIndex)
|
local curFormation = FormationManager.GetFormationByID(this.curFormationIndex)
|
||||||
for i = 1, #_heroDatas do
|
for i = 1, #_heroDatas do
|
||||||
local heroHp = FormationManager.GetFormationHeroHp(this.curFormationIndex, _heroDatas[i].dynamicId)
|
local heroHp = FormationManager.GetFormationHeroHp(this.curFormationIndex, _heroDatas[i].dynamicId)
|
||||||
|
@ -545,6 +549,11 @@ function this.SortHeroDatas(_heroDatas)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
for i = 1, #_heroDatas do
|
||||||
|
if _heroDatas[i].exist and _heroDatas[i].exist == 0 then
|
||||||
|
notExisted[_heroDatas[i].dynamicId] = _heroDatas[i].dynamicId
|
||||||
|
end
|
||||||
|
end
|
||||||
for j = 1, #curFormation.teamHeroInfos do
|
for j = 1, #curFormation.teamHeroInfos do
|
||||||
local teamInfo = curFormation.teamHeroInfos[j]
|
local teamInfo = curFormation.teamHeroInfos[j]
|
||||||
if teamInfo then
|
if teamInfo then
|
||||||
|
@ -556,69 +565,79 @@ function this.SortHeroDatas(_heroDatas)
|
||||||
if (choosed[a.dynamicId] and choosed[b.dynamicId]) or
|
if (choosed[a.dynamicId] and choosed[b.dynamicId]) or
|
||||||
(not choosed[a.dynamicId] and not choosed[b.dynamicId])
|
(not choosed[a.dynamicId] and not choosed[b.dynamicId])
|
||||||
then
|
then
|
||||||
if (dieHeros[a.dynamicId] and dieHeros[b.dynamicId]) or
|
if (notExisted[a.dynamicId] and notExisted[b.dynamicId]) or
|
||||||
(not dieHeros[a.dynamicId] and not dieHeros[b.dynamicId])
|
(not notExisted[a.dynamicId] and not notExisted[b.dynamicId])
|
||||||
then
|
then
|
||||||
if sortType == SortTypeConst.Natural then
|
if (dieHeros[a.dynamicId] and dieHeros[b.dynamicId]) or
|
||||||
if a.heroConfig.Natural == b.heroConfig.Natural then
|
(not dieHeros[a.dynamicId] and not dieHeros[b.dynamicId])
|
||||||
if a.heroConfig.Quality == b.heroConfig.Quality then
|
then
|
||||||
if a.star == b.star then
|
return this.NaturalSort(sortType == SortTypeConst.Natural,a,b)
|
||||||
if a.lv == b.lv then
|
else
|
||||||
if a.warPower == b.warPower then
|
return not dieHeros[a.dynamicId] and dieHeros[b.dynamicId]
|
||||||
if a.id == b.id then
|
end
|
||||||
return a.sortId > b.sortId
|
else
|
||||||
else
|
return notExisted[a.dynamicId] and not notExisted[b.dynamicId]
|
||||||
return a.id > b.id
|
end
|
||||||
end
|
else
|
||||||
else
|
return choosed[a.dynamicId] and not choosed[b.dynamicId]
|
||||||
return a.warPower > b.warPower
|
end
|
||||||
end
|
end)
|
||||||
else
|
end
|
||||||
return a.lv > b.lv
|
|
||||||
end
|
function this.NaturalSort(isNature,a,b)
|
||||||
|
if isNature then
|
||||||
|
if a.heroConfig.Natural == b.heroConfig.Natural then
|
||||||
|
if a.heroConfig.Quality == b.heroConfig.Quality then
|
||||||
|
if a.star == b.star then
|
||||||
|
if a.lv == b.lv then
|
||||||
|
if a.warPower == b.warPower then
|
||||||
|
if a.id == b.id then
|
||||||
|
return a.sortId > b.sortId
|
||||||
else
|
else
|
||||||
return a.star > b.star
|
return a.id > b.id
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return a.heroConfig.Quality > b.heroConfig.Quality
|
return a.warPower > b.warPower
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return a.lv > b.lv
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return a.star > b.star
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return a.heroConfig.Quality > b.heroConfig.Quality
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return a.heroConfig.Natural > b.heroConfig.Natural
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if a.lv == b.lv then
|
||||||
|
if a.heroConfig.Quality == b.heroConfig.Quality then
|
||||||
|
if a.star == b.star then
|
||||||
|
if a.heroConfig.Natural == b.heroConfig.Natural then
|
||||||
|
if a.warPower == b.warPower then
|
||||||
|
if a.id == b.id then
|
||||||
|
return a.sortId > b.sortId
|
||||||
|
else
|
||||||
|
return a.id > b.id
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return a.warPower > b.warPower
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return a.heroConfig.Natural > b.heroConfig.Natural
|
return a.heroConfig.Natural > b.heroConfig.Natural
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if a.lv == b.lv then
|
return a.star > b.star
|
||||||
if a.heroConfig.Quality == b.heroConfig.Quality then
|
|
||||||
if a.star == b.star then
|
|
||||||
if a.heroConfig.Natural == b.heroConfig.Natural then
|
|
||||||
if a.warPower == b.warPower then
|
|
||||||
if a.id == b.id then
|
|
||||||
return a.sortId > b.sortId
|
|
||||||
else
|
|
||||||
return a.id > b.id
|
|
||||||
end
|
|
||||||
else
|
|
||||||
return a.warPower > b.warPower
|
|
||||||
end
|
|
||||||
else
|
|
||||||
return a.heroConfig.Natural > b.heroConfig.Natural
|
|
||||||
end
|
|
||||||
else
|
|
||||||
return a.star > b.star
|
|
||||||
end
|
|
||||||
else
|
|
||||||
return a.heroConfig.Quality > b.heroConfig.Quality
|
|
||||||
end
|
|
||||||
else
|
|
||||||
return a.lv > b.lv
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return not dieHeros[a.dynamicId] and dieHeros[b.dynamicId]
|
return a.heroConfig.Quality > b.heroConfig.Quality
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return choosed[a.dynamicId] and not choosed[b.dynamicId]
|
return a.lv > b.lv
|
||||||
end
|
end
|
||||||
end)
|
end
|
||||||
end
|
end
|
||||||
--设置每条英雄数据
|
--设置每条英雄数据
|
||||||
function this.SingleHeroDataShow(_go, _heroData)
|
function this.SingleHeroDataShow(_go, _heroData)
|
||||||
|
|
|
@ -66,7 +66,7 @@ function this.RrefreshFormation()
|
||||||
local curFormation = FormationManager.GetFormationByID(index)
|
local curFormation = FormationManager.GetFormationByID(index)
|
||||||
LogGreen("curFormation.teamHeroInfos:"..#curFormation.teamHeroInfos)
|
LogGreen("curFormation.teamHeroInfos:"..#curFormation.teamHeroInfos)
|
||||||
for k,v in pairs(curFormation.teamHeroInfos) do
|
for k,v in pairs(curFormation.teamHeroInfos) do
|
||||||
if EndLessMapManager.heroDataLists[v.heroId] then
|
if EndLessMapManager.GetSingleHeroData(v.heroId) then
|
||||||
table.insert(tempList,v)
|
table.insert(tempList,v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -201,34 +201,6 @@ function this.IniFormationSet(type)
|
||||||
this.IsNeedChangeFormation = type ~= CARBON_TYPE.ENDLESS
|
this.IsNeedChangeFormation = type ~= CARBON_TYPE.ENDLESS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- 普通,精英副本设置
|
|
||||||
-- function this.NormalCarbon()
|
|
||||||
-- this.root.bg:SetActive(true)
|
|
||||||
-- this.root.btn_1:SetActive(true)
|
|
||||||
-- this.root.btn_2:SetActive(true)
|
|
||||||
-- this.root.btn_1_lab.text = "扫 荡"
|
|
||||||
-- this.root.btn_2_lab.text = "进入副本"
|
|
||||||
-- -- 进入副本显示设置
|
|
||||||
-- MapManager.isCarbonEnter = true
|
|
||||||
|
|
||||||
-- -- 设置扫荡条件
|
|
||||||
-- local canSweep = CarbonManager.GetMapSweepState(this.curMapId)
|
|
||||||
-- local rgbValue = canSweep and 1 or 0.5
|
|
||||||
-- Util.SetColor(this.root.btn_1, Color.New(rgbValue, rgbValue, rgbValue, 1))
|
|
||||||
-- this.root.btn_1:GetComponent("Button").enabled = canSweep
|
|
||||||
-- this.SetTipShowByType(CarbonManager.difficulty, canSweep)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- -- 设置精英副本跟普通副本的提示显示
|
|
||||||
-- function this.SetTipShowByType(type, canSweep)
|
|
||||||
-- local isEliteCarbon = type == 3
|
|
||||||
-- this.root.mobTip:SetActive(not canSweep and not isEliteCarbon)
|
|
||||||
-- this.root.eliteTip:SetActive(not canSweep and isEliteCarbon)
|
|
||||||
-- -- 普通-精英副本得到的地图ID this.curMapId
|
|
||||||
-- this.root.eliteNumNeed.text = CarbonManager.EliteSweepCondition(this.curMapId)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- 试炼副本设置
|
-- 试炼副本设置
|
||||||
function this.TrialCarbon()
|
function this.TrialCarbon()
|
||||||
this.root.bg:SetActive(true)
|
this.root.bg:SetActive(true)
|
||||||
|
|
|
@ -642,7 +642,7 @@ function this.GetSingleHeroData(heroDId)
|
||||||
heroData = ExpeditionManager.GetSingleHeroData(heroDId)
|
heroData = ExpeditionManager.GetSingleHeroData(heroDId)
|
||||||
end
|
end
|
||||||
if not heroData then
|
if not heroData then
|
||||||
heroData = EndLessMapManager.heroDataLists[heroDId]
|
heroData = EndLessMapManager.GetSingleHeroData(heroDId)
|
||||||
end
|
end
|
||||||
return heroData
|
return heroData
|
||||||
end
|
end
|
||||||
|
|
|
@ -451,15 +451,12 @@ end
|
||||||
--------------------------------------------------------------------------------编队 神将-------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------编队 神将-------------------------------------------------------------------------------
|
||||||
this.heroDataLists = {}
|
this.heroDataLists = {}
|
||||||
function this.InitAllEndlessHero(heroList,isClear)
|
function this.InitAllEndlessHero(heroList,isClear)
|
||||||
if isClear then
|
if not this.heroDataLists then
|
||||||
this.heroDataLists = {}
|
this.heroDataLists = {}
|
||||||
end
|
end
|
||||||
for i = 1 ,#heroList do
|
for i = 1 ,#heroList do
|
||||||
this.InitSingleEndlessHero(heroList[i])
|
this.InitSingleEndlessHero(heroList[i])
|
||||||
end
|
end
|
||||||
for k,v in pairs(this.heroDataLists) do
|
|
||||||
LogGreen(v.dynamicId.." lv:"..v.lv.." heroData.star:"..v.star)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.InitSingleEndlessHero(_msgHeroData)
|
function this.InitSingleEndlessHero(_msgHeroData)
|
||||||
|
@ -673,21 +670,65 @@ function this.SetHeroFormationList(heroDid,teamId,isAddOrDel)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function this.GetSingleHeroData(heroDid)
|
||||||
|
if this.heroDataLists[heroDid] then
|
||||||
|
return this.heroDataLists[heroDid]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.GetCanUseHeroDatas()
|
||||||
|
if not this.canUseHeroDatas then
|
||||||
|
this.canUseHeroDatas = {}
|
||||||
|
end
|
||||||
|
for k,v in pairs(this.heroDataLists) do
|
||||||
|
if PlayerManager.GetHeroDataByStar(0,v.id) and not this.canUseHeroDatas[v.dynamicId] then
|
||||||
|
this.canUseHeroDatas[v.dynamicId] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function this.GetHeroDataByProperty(_proId, limitLevel)
|
function this.GetHeroDataByProperty(_proId, limitLevel)
|
||||||
|
this.GetCanUseHeroDatas()
|
||||||
local heros = {}
|
local heros = {}
|
||||||
local index = 1
|
local index = 1
|
||||||
for i, v in pairs(this.heroDataLists) do
|
if this.canUseHeroDatas then
|
||||||
if v.property == _proId or _proId == 0 then
|
for i, v in pairs(this.canUseHeroDatas) do
|
||||||
if v.lv >= limitLevel then
|
if v.property == _proId or _proId == 0 then
|
||||||
heros[index] = v
|
if v.lv >= limitLevel then
|
||||||
index = index + 1
|
heros[index] = v
|
||||||
|
heros[index].exist = 1
|
||||||
|
index = index + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return heros
|
return heros
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function this.GetHeroDataByProperty1(_proId, limitLevel,_heros)
|
||||||
|
local index = 0
|
||||||
|
local heros = {}
|
||||||
|
for i, v in pairs(this.heroDataLists) do
|
||||||
|
local isExist = false
|
||||||
|
for j, k in pairs(this.canUseHeroDatas) do
|
||||||
|
if (v.property == _proId or _proId == 0) and k.id == v.id then
|
||||||
|
isExist = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not isExist then
|
||||||
|
index = #heros + 1
|
||||||
|
heros[index] = v
|
||||||
|
heros[index].exist = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return heros
|
||||||
|
end
|
||||||
|
function this.SortHeroData(herolist)
|
||||||
|
table.sort(herolist,function(a,b)
|
||||||
|
|
||||||
|
end)
|
||||||
|
end
|
||||||
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
return this
|
return this
|
|
@ -126,15 +126,6 @@ function this.RegisterMessage(network)
|
||||||
socket:RegistNetMessage(MessageTypeProto_pb.RECHARGE_SUCCESS_INDICATION, this.RechargeSuccessOrder)
|
socket:RegistNetMessage(MessageTypeProto_pb.RECHARGE_SUCCESS_INDICATION, this.RechargeSuccessOrder)
|
||||||
-- 礼包拍脸推送
|
-- 礼包拍脸推送
|
||||||
socket:RegistNetMessage(MessageTypeProto_pb.PUSH_WELFARE_RESPONSE, this.BackPatFaceData)
|
socket:RegistNetMessage(MessageTypeProto_pb.PUSH_WELFARE_RESPONSE, this.BackPatFaceData)
|
||||||
socket:RegistNetMessage(MessageTypeProto_pb.ENDLESS_NEW_HERO_GET_INDICATION, this.EndlessNewHeroGetIndication)
|
|
||||||
end
|
|
||||||
|
|
||||||
function this.EndlessNewHeroGetIndication(buffer)
|
|
||||||
local data = buffer:DataByte()
|
|
||||||
local msg = HeroInfoProto_pb.GetEndlessHeroListInfoResponse()
|
|
||||||
msg:ParseFromString(data)
|
|
||||||
LogGreen("EndlessNewHeroGetIndication")
|
|
||||||
EndLessMapManager.InitAllEndlessHero(msg.heroList,false)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.OpenHongMengTowerGuideIndication(buffer)
|
function this.OpenHongMengTowerGuideIndication(buffer)
|
||||||
|
|
|
@ -5006,7 +5006,7 @@ function this.AllEndLessHeroDataResponse(_index,func)
|
||||||
func(msg)
|
func(msg)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
_index = _index + #msg.heroList
|
_index = _index + #msg.heroList
|
||||||
this.AllEndLessHeroDataResponse(_index,func)
|
this.AllEndLessHeroDataResponse(_index,func)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue