【无尽副本】战斗失败自动复位时,自动进行一次一键上阵
parent
df79f56b72
commit
8376d74230
|
|
@ -500,4 +500,31 @@ function this.GetCurFormationElementAddByType(type,heroDid)
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--自动一键上阵没有前端显示
|
||||||
|
function this.SetOneKeyGoWithoutUI(formationType,limitLevel)
|
||||||
|
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 = {}
|
||||||
|
local choosedList = {}
|
||||||
|
for i = 1, 6 do
|
||||||
|
if heros[i] then
|
||||||
|
local curSingleherodata = HeroManager.GetSingleHeroData(heros[i].dynamicId)
|
||||||
|
if not upHeroSidTable[curSingleherodata.id] then
|
||||||
|
upHeroSidTable[curSingleherodata.id] = curSingleherodata.id
|
||||||
|
table.insert(choosedList, {heroId = heros[i].dynamicId, position=i})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
--保存编队
|
||||||
|
FormationManager.RefreshFormation(formationType, choosedList,FormationManager.formationList[formationType].teamPokemonInfos)
|
||||||
|
end
|
||||||
|
|
||||||
return this
|
return this
|
||||||
|
|
@ -254,7 +254,6 @@ end
|
||||||
-- 复位设置
|
-- 复位设置
|
||||||
function this.ResetRoleState()
|
function this.ResetRoleState()
|
||||||
--if not this.CanClick() then return end
|
--if not this.CanClick() then return end
|
||||||
|
|
||||||
-- 重置角色位置(目前没有表现,做一下延迟)
|
-- 重置角色位置(目前没有表现,做一下延迟)
|
||||||
Timer.New(function ()
|
Timer.New(function ()
|
||||||
-- 通信一次
|
-- 通信一次
|
||||||
|
|
@ -263,21 +262,18 @@ function this.ResetRoleState()
|
||||||
-- 初始位置
|
-- 初始位置
|
||||||
local position = challengeMapConfig[MapManager.curMapId].Position
|
local position = challengeMapConfig[MapManager.curMapId].Position
|
||||||
local initPos = position[1] * 256 + position[2]
|
local initPos = position[1] * 256 + position[2]
|
||||||
|
|
||||||
-- 前端同步位置
|
-- 前端同步位置
|
||||||
MapManager.curPos = initPos
|
MapManager.curPos = initPos
|
||||||
|
|
||||||
-- 重置队伍以及妖灵师的血量, 同时重置位置
|
-- 重置队伍以及妖灵师的血量, 同时重置位置
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.Formation.OnResetFormationHp, initPos)
|
Game.GlobalEvent:DispatchEvent(GameEvent.Formation.OnResetFormationHp, initPos)
|
||||||
|
|
||||||
-- 请求一次血量, 复位之后请求一次血量
|
-- 请求一次血量, 复位之后请求一次血量
|
||||||
NetManager.RequestAllHeroHp(function ()
|
NetManager.RequestAllHeroHp(function ()
|
||||||
--Log("复位之后请求一次血量数据")
|
--Log("复位之后请求一次血量数据")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- 刷新迷雾
|
-- 刷新迷雾
|
||||||
local u,v = Map_Pos2UV(initPos)
|
local u,v = Map_Pos2UV(initPos)
|
||||||
TileMapView.UpdateWarFog(u, v, MapManager.fogSize)
|
TileMapView.UpdateWarFog(u, v, MapManager.fogSize)
|
||||||
|
FormationManager.SetOneKeyGoWithoutUI(FormationTypeDef.FORMATION_ENDLESS_MAP,20)
|
||||||
end)
|
end)
|
||||||
end, 0.2):Start()
|
end, 0.2):Start()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue