From 8376d74230d88e7dd152c9183b08aa17e0d42471 Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Thu, 24 Dec 2020 14:13:58 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=97=A0=E5=B0=BD=E5=89=AF=E6=9C=AC?= =?UTF-8?q?=E3=80=91=E6=88=98=E6=96=97=E5=A4=B1=E8=B4=A5=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=A4=8D=E4=BD=8D=E6=97=B6=EF=BC=8C=E8=87=AA=E5=8A=A8=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=B8=80=E6=AC=A1=E4=B8=80=E9=94=AE=E4=B8=8A=E9=98=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Formation/FormationManager.lua | 27 +++++++++++++++++++ .../~Lua/Modules/Map/View/EndLessMapView.lua | 6 +---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua index f92a902961..765e45bd46 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationManager.lua @@ -500,4 +500,31 @@ function this.GetCurFormationElementAddByType(type,heroDid) return data 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 \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua b/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua index 637449ca07..89511a4a65 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua @@ -254,7 +254,6 @@ end -- 复位设置 function this.ResetRoleState() --if not this.CanClick() then return end - -- 重置角色位置(目前没有表现,做一下延迟) Timer.New(function () -- 通信一次 @@ -263,21 +262,18 @@ function this.ResetRoleState() -- 初始位置 local position = challengeMapConfig[MapManager.curMapId].Position local initPos = position[1] * 256 + position[2] - -- 前端同步位置 MapManager.curPos = initPos - -- 重置队伍以及妖灵师的血量, 同时重置位置 Game.GlobalEvent:DispatchEvent(GameEvent.Formation.OnResetFormationHp, initPos) - -- 请求一次血量, 复位之后请求一次血量 NetManager.RequestAllHeroHp(function () --Log("复位之后请求一次血量数据") end) - -- 刷新迷雾 local u,v = Map_Pos2UV(initPos) TileMapView.UpdateWarFog(u, v, MapManager.fogSize) + FormationManager.SetOneKeyGoWithoutUI(FormationTypeDef.FORMATION_ENDLESS_MAP,20) end) end, 0.2):Start()