【无尽副本】一键上阵修改
parent
0c4e2e5bf6
commit
86a99f3344
|
|
@ -950,6 +950,53 @@ function this.SetOneKeyGo()
|
|||
this.OnClickTabBtn(proId,false,false)
|
||||
end
|
||||
|
||||
|
||||
--设置无尽副本一键上阵
|
||||
function this.SetOneKeyCarBonGo()
|
||||
--获取需要上阵的位置
|
||||
local posArr=this.GetPosList()
|
||||
if #posArr==0 then
|
||||
PopupTipPanel.ShowTip(Language[10689])
|
||||
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)
|
||||
local hp = FormationManager.GetFormationHeroHp(this.curFormationIndex,v.dynamicId)
|
||||
if not upHeroSidTable[curSingleherodata.id] and hp > 0 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,false,false)
|
||||
end
|
||||
|
||||
--设置轩辕宝镜一键上阵
|
||||
function this.SetOneKeyGoWithCondition(Rules)
|
||||
local rulesType = Rules[1][1]
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ end
|
|||
--- btn1点击回调事件
|
||||
function this.On_Btn1_Click()
|
||||
-- this.root.SetOneKeyGo()
|
||||
this.root.SetOneKeyGoExpedition()
|
||||
this.root.SetOneKeyCarBonGo()
|
||||
--以前的换成的一键上阵
|
||||
|
||||
-- if CarbonManager.difficulty == CARBON_TYPE.ENDLESS and MapManager.Mapping then
|
||||
|
|
|
|||
Loading…
Reference in New Issue