Merge branch 'master_xma_local' of http://60.1.1.230/gaoxin/JL_Client into master_xma_local

dev_chengFeng
jiaoyangna 2020-11-19 18:31:19 +08:00
commit 1303495f3d
2 changed files with 66 additions and 29 deletions

View File

@ -867,9 +867,6 @@ end
function this.SetOneKeyGo()
--获取需要上阵的位置
local posArr=this.GetPosList()
-- for i = 1, #posArr do
-- Log("可上阵位置索引"..posArr[i])
-- end
if #posArr==0 then
PopupTipPanel.ShowTip(Language[10692])
return
@ -878,32 +875,12 @@ function this.SetOneKeyGo()
local heros = HeroManager.GetAllHeroDatas(limitLevel)
--按战力从大到小排序
table.sort(heros,function(a,b)
-- local aWarPower = HeroManager.CalculateHeroAllProValList(1,a.dynamicId,false)[HeroProType.WarPower]
-- local bWarPower = HeroManager.CalculateHeroAllProValList(1,b.dynamicId,false)[HeroProType.WarPower]
-- if aWarPower==bWarPower then
-- return a.id>b.id
-- else
-- return aWarPower>bWarPower
-- end
if a.warPower == b.warPower then
return a.id>b.id
else
return a.warPower > b.warPower
end
end)
--遍历英雄 去除已上阵英雄
-- for j = 1, #this.choosedList do
-- for k, v in ipairs(heros) do
-- if HeroManager.GetSingleHeroData(v.dynamicId).id== HeroManager.GetSingleHeroData(this.choosedList[j].heroId).id then
-- table.remove(heros,k)
-- break
-- end
-- end
-- end
-- if #heros == 0 then
-- return
-- end
--修改 upHeroSidTable 静态id 存储 有则跳过
local upHeroSidTable = {}
this.order = 0
@ -927,12 +904,72 @@ function this.SetOneKeyGo()
end
end
end
this.SetCardsData()
this.OnClickTabBtn(proId)
end
--缺几个空位 就上几个空位
-- for n = 1, #posArr do
-- table.insert(this.choosedList, {heroId = heros[n].dynamicId, position=posArr[n]})
-- end
-- this.order=this.order+#posArr
--设置轩辕宝镜一键上阵
function this.SetOneKeyGoWithCondition(Rules)
local rulesType = Rules[1][1]
local rulesNum = Rules[1][2]
local curNum = 0
--获取需要上阵的位置
local posArr=this.GetPosList()
if #posArr==0 then
PopupTipPanel.ShowTip(Language[10692])
return
end
local heros = HeroManager.GetAllHeroDatas(limitLevel)
--按战力从大到小排序
table.sort(heros,function(a,b)
if a.warPower == b.warPower then
return a.id>b.id
else
return a.warPower > b.warPower
end
end)
--修改 upHeroSidTable 静态id 存储 有则跳过
local upHeroSidTable = {}
this.order = 0
this.choosedList = {}
for j = 1, #this.choosedList do
local curSingleherodata = HeroManager.GetSingleHeroData(this.choosedList[j].heroId)
upHeroSidTable[curSingleherodata.id] = curSingleherodata.id
end
for k, v in ipairs(heros) do
local curSingleherodata = HeroManager.GetSingleHeroData(v.dynamicId)
if not upHeroSidTable[curSingleherodata.id] then
-- LogGreen("this.choosedList "..#this.choosedList)
if #this.choosedList < 6 then
for n = 1, #posArr do
if rulesType == v.heroConfig.PropertyName and curNum < rulesNum then
curNum = curNum + 1
upHeroSidTable[curSingleherodata.id] = curSingleherodata.id
table.insert(this.choosedList, {heroId = v.dynamicId, position=posArr[n]})
table.remove(posArr,n)
this.order = this.order + 1
break
end
end
end
end
end
for k, v in ipairs(heros) do
local curSingleherodata = HeroManager.GetSingleHeroData(v.dynamicId)
if not upHeroSidTable[curSingleherodata.id] then
-- LogGreen("this.choosedList "..#this.choosedList)
if #this.choosedList < 6 then
for n = 1, #posArr do
upHeroSidTable[curSingleherodata.id] = curSingleherodata.id
table.insert(this.choosedList, {heroId = v.dynamicId, position=posArr[n]})
table.remove(posArr,n)
this.order = this.order + 1
break
end
end
end
end
this.SetCardsData()
this.OnClickTabBtn(proId)
end

View File

@ -37,7 +37,7 @@ end
--- btn1点击回调事件
function this.On_Btn1_Click()
this.root.SetOneKeyGo()
this.root.SetOneKeyGoWithCondition(data.teamRules)
end
-- 进入地图