编队修改提交

dev_chengFeng
jiaoyangna 2021-05-25 20:37:12 +08:00
parent a112127db0
commit da6dd0283c
8 changed files with 62 additions and 103 deletions

View File

@ -372,6 +372,7 @@ function this.BattleEnd(result)
drop = {},
}
LogGreen("fightType:"..fightType)
-- 需要和服务器确认结果
if fightType == BATTLE_TYPE.MAP_FIGHT
or fightType == BATTLE_TYPE.MONSTER_CAMP
@ -480,9 +481,9 @@ function this.ShowBattleResult(result, msg)
--公会副本
elseif fightType == BATTLE_TYPE.GuildTranscript then
this.ShowBattleResultByGuildTranscript()
--无尽副本
elseif fightType == BATTLE_TYPE.MAP_FIGHT and CarbonManager.difficulty == CARBON_TYPE.ENDLESS then
this.ShowBattleResultByMapFight()
-- --无尽副本
-- elseif fightType == BATTLE_TYPE.MAP_FIGHT and CarbonManager.difficulty == CARBON_TYPE.ENDLESS then
-- this.ShowBattleResultByMapFight()
--新回放功能(判断上次战斗是什么类型并做什么内容 逻辑和正常战斗处理一样)
elseif fightType == BATTLE_TYPE.BACK_BATTLE then
if BattleManager.GetLastBattleType() == BATTLE_TYPE.GuildTranscript then-- 公会副本结算界面特殊显示
@ -589,25 +590,8 @@ function this.ShowBattleResultByGuildTranscript()
end
--无尽结算界面特殊显示
function this.ShowBattleResultByMapFight()
Timer.New(function()
local bestData, allDamage= BattleRecordManager.GetBattleBestData()
FightPointPassManager.oldLevel = PlayerManager.level
if bestData then
UIManager.OpenPanel(UIName.BattleBestPopup, bestData.roleId,bestData.skinId, bestData.damage, allDamage, function(_BattleBestPopup)
-- 打开关卡奖励界面
UIManager.OpenPanel(UIName.RewardItemPopup, this.lastBattleResult.drop, 1,function()
if _BattleBestPopup then
_BattleBestPopup:ClosePanel()
end
-- if m_battlePanel then
-- m_battlePanel:ClosePanel()
-- end
this:ClosePanel()
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
end, nil, true, true)
end)
end
end, 0.1):Start()
local haveRecord = BattleRecordManager.isHaveRecord()
UIManager.OpenPanel(UIName.BattleFailPopup, this, haveRecord,nil,fightType)
end
-- 踏碎凌霄结算界面特殊显示
function this.ShowBattleResultByTaSuiLingXiao()

View File

@ -123,8 +123,6 @@ function EndLessCarbonPanel:OnShow()
this.ShowCountTime()
-- 界面打开时刷新队伍血量数据
-- 刷新无尽副本编队数据
EndLessMapManager.RrefreshFormation()
hadClikcBuy = false
end
@ -146,9 +144,10 @@ end
function this.EnterMap()
-- 进入地图编队,重新赋值一遍
EndLessMapManager.RrefreshFormation()
CarbonManager.difficulty = CARBON_TYPE.ENDLESS
--UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.CARBON, MapManager.curMapId)
if not EndLessMapManager.IsMapTeamAlive() then
if EndLessMapManager.CheckFormationIsEmpty() then
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.CARBON, MapManager.curMapId)
else
MapManager.curMapId = EndLessMapManager.openMapId

View File

@ -253,6 +253,10 @@ function this:OnShow()
end
function this:OnClose()
if this.curFormationIndex == FormationTypeDef.FORMATION_ENDLESS_MAP then
LogGreen("EndLessMapManager.teamInfo:"..#EndLessMapManager.formation)
FormationManager.formationList[FormationTypeDef.FORMATION_ENDLESS_MAP].teamHeroInfos = EndLessMapManager.formation
end
tempPowerNum = 0
this.formationPower = 0
oldPowerNum = 0

View File

@ -61,15 +61,22 @@ end
-- [3] = 28,
-- }
--编队了i去掉死亡的英雄
function this.RrefreshFormation()
if CarbonManager.difficulty ~= CARBON_TYPE.ENDLESS then return end
local tempList = {}
local curFormation = FormationManager.GetFormationByID(index)
for k,v in pairs(curFormation.teamHeroInfos) do
if EndLessMapManager.GetSingleCanUseHeroData(v.heroId) then
table.insert(tempList,v)
local curTeam = EndLessMapManager.formation
for i = 1, #curTeam do
local roleData = curTeam[i]
-- 如果队员没死翘翘了
local curRoleHp = EndLessMapManager.GetHeroLeftBlood(roleData.heroId)
if curRoleHp > 0 then
-- 编队界面数据重组
table.insert(tempList, roleData)
end
end
FormationManager.formationList[index].teamHeroInfos = tempList
FormationManager.formationList[FormationTypeDef.FORMATION_ENDLESS_MAP].teamHeroInfos = tempList
end
-- 进入地图
@ -78,6 +85,8 @@ function this.On_Btn2_Click()
if this.root.order>=1 then
FormationManager.RefreshFormation(this.root.curFormationIndex, this.root.choosedList,
FormationManager.formationList[this.root.curFormationIndex].teamPokemonInfos)
LogGreen("#FormationManager.formationList[this.root.curFormationIndex].teamHeroInfos:"..#FormationManager.formationList[this.root.curFormationIndex].teamHeroInfos)
EndLessMapManager.formation = FormationManager.formationList[this.root.curFormationIndex].teamHeroInfos
this.root:ClosePanel()
else
PopupTipPanel.ShowTip(Language[10712])

View File

@ -12,7 +12,6 @@ local endlessMorale = ConfigManager.GetConfig(ConfigName.endlessMorale)
local endlessTreasure = ConfigManager.GetConfig(ConfigName.endlessTreasure)
this.limiteLevel = 0
function this.Initialize()
this.isCanNote = false -- 是否进入可标记状态
this.PointNoteDataList = {} -- 标记列表
@ -135,59 +134,6 @@ function this.RefershMapTeam()
end
end
-- 无尽副本删除编队中某一个成员的数据
function this.DeleteDeadRole()
if CarbonManager.difficulty ~= CARBON_TYPE.ENDLESS then Log(Language[11225]) return end
Log("删除死掉的人!")
-- 死人后重组
local newMapTeam = {} -- 地图中的编队数据
local newFormation = {} -- 编队界面的编队数据
local curTeam = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_ENDLESS_MAP)
-- 编队界面的数据
newFormation.teamHeroInfos = {}
newFormation.teamPokemonInfos = {}
newFormation.teamId = FormationTypeDef.FORMATION_ENDLESS_MAP
newFormation.teamName = curTeam.teamName
newFormation.teamPokemonInfos = curTeam.teamPokemonInfos
--Log("成员数量 -- " .. #curTeam.teamHeroInfos)
-- 成员数据
for i = 1, #curTeam.teamHeroInfos do
local roleData = curTeam.teamHeroInfos[i]
-- 如果队员没死翘翘了
local curRoleHp = this.GetHeroLeftBlood(roleData.heroId)
if curRoleHp > 0 then
-- 地图数据重组
local allProp = HeroManager.CalculateWarAllProVal(roleData.heroId)
allProp[2] = curRoleHp
newMapTeam[#newMapTeam + 1] = {
heroId = roleData.heroId,
allProVal = allProp,
}
-- 编队界面数据重组
table.insert(newFormation.teamHeroInfos, roleData)
end
end
return newFormation, newMapTeam
end
-- 刷新编队界面得到的编队以及地图中的编队数据, 只有打开编队界面才刷新地图编队
function this.RrefreshFormation()
if CarbonManager.difficulty == CARBON_TYPE.ENDLESS then
local teamId = FormationTypeDef.FORMATION_ENDLESS_MAP
local newFormation, newMapTeam = this.DeleteDeadRole()
FormationManager.formationList[teamId] = newFormation
Log("刷新一次地图编队数据")
MapManager.formationList = newMapTeam
end
end
-- =============================================================================================
-- ==================== 地图标记 ===============================================================
-- 无尽副本是否进入了可标记状态
@ -346,6 +292,9 @@ function this.InitAllEndlessHero(heroList,isClear)
this.moraleLv = lv
-- LogGreen("this.moraleLv:"..this.moraleLv)
this.moraleId = id
this.RrefreshFormation()
this.formation = FormationManager.formationList[FormationTypeDef.FORMATION_ENDLESS_MAP].teamHeroInfos
end
function this.InitSingleEndlessHero(_msgHeroData)
@ -707,6 +656,26 @@ function this.IsMapTeamAlive()
return true
end
end
--刷新英雄,去掉使用的自己的英雄
function this.RrefreshFormation()
local tempList = {}
local curFormation = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_ENDLESS_MAP)
for k,v in pairs(curFormation.teamHeroInfos) do
if EndLessMapManager.GetSingleCanUseHeroData(v.heroId) then
table.insert(tempList,v)
end
end
FormationManager.formationList[FormationTypeDef.FORMATION_ENDLESS_MAP].teamHeroInfos = tempList
end
function this.CheckFormationIsEmpty()
if LengthOfTable(this.formation) < 1 then
return true
else
return false
end
end
---------------------------------------------------------任务-----------------------------------
function this.InitMissionData()
this.mission = {}

View File

@ -102,8 +102,6 @@ function this:BindEvent()
PopupTipPanel.ShowTip(Language[11258])
return
end
--this:ClosePanel()
this.SetEliteBackShow()
this.SetEndlessShow()
end)
@ -152,17 +150,12 @@ function this:BindEvent()
end
-- ================ 点击回城时一些稀里糊涂的操作 ======
-- 精英副本
function this.SetEliteBackShow()
if CarbonManager.difficulty == 3 then
eliteMissionView:OnBackBtnClick()
end
end
-- 无尽副本
function this.SetEndlessShow()
-- 无尽副本的回城设置
if CarbonManager.difficulty == 4 then
endLessMapView:OnClose()
-- 先发更新事件点协议
MapManager.MapUpdateEvent(-1000, function ()
Log("出图同步位置")

View File

@ -295,7 +295,7 @@ function EndLessMapView:OnShow()
-- this:GetBagEnergy()
-- EndLessMapManager.isUpdateOnClose = false
--end
-- 如果全屏界面打开时刷新过,重新激活界面需要刷新一次
if EndLessMapManager.isUpdateOnClose then
this:GetBagEnergy()
@ -314,7 +314,9 @@ function EndLessMapView:OnShow()
-- 刷新倒计时显示
this:ShowCountTime()
this:RefreshTargetRoote()
this:ShowHeroData()
NetManager.RequestAllHeroHp(function ()
this:ShowHeroData()
end)
end
function EndLessMapView:ShowHeroData()
@ -322,13 +324,14 @@ function EndLessMapView:ShowHeroData()
if not this.heroList then
this.heroList = {}
end
LogGreen("#this.heroList:"..#this.heroList)
for k = 1, #this.heroList do
if this.heroList[k] and this.heroList[k].go then
this.heroList[k].go.gameObject:SetActive(false)
end
end
for i, v in ipairs(curFormation.teamHeroInfos) do
if not this.heroList[i] then
if not this.heroList[i] then
this.heroList[i] = {}
this.heroList[i].go = newObjToParent(this.selectPre,this.selectHeroGrid)
this.heroList[i].go.name="pre"..i
@ -665,15 +668,14 @@ end
function EndLessMapView:OnClose()
if not this:IsEndLessMap() then return end
-- this.warn:SetActive(false)
Util.ClearChild(this.selectHeroGrid.transform)
this.heroList = {}
this.isPanelClose = true
EndLessMapManager.isUpdateOnClose = false
if this.timer then
this.timer:Stop()
this.timer = nil
end
Util.ClearChild(this.selectHeroGrid.transform)
this.heroList = {}
LogGreen("this.heroList:"..#this.heroList)
end
function EndLessMapView:OnDestroy()
@ -681,7 +683,6 @@ function EndLessMapView:OnDestroy()
if not this:IsEndLessMap() then return end
ClearRedPointObject(RedPointType.wujinTreasure,this.endLessTreasureRed)
ClearRedPointObject(RedPointType.wujinMission,this.btnNoteRed)
end
return EndLessMapView

View File

@ -33,7 +33,7 @@ function this.InitTypeTaskList(_userMissionList)
userMissionList.takeTimes = _userMissionList[i].takeTimes
userMissionList.heroId = _userMissionList[i].heroId
userMissionList.lock = _userMissionList[i].lock
LogRed("任务 类型:"..userMissionList.type.." ID:"..userMissionList.missionId.." 状态:"..userMissionList.state.." lock "..userMissionList.lock.. " progress:".._userMissionList[i].progress)
--LogRed("任务 类型:"..userMissionList.type.." ID:"..userMissionList.missionId.." 状态:"..userMissionList.state.." lock "..userMissionList.lock.. " progress:".._userMissionList[i].progress)
if not TypeTaskData[_userMissionList[i].type] then
TypeTaskData[_userMissionList[i].type] = {}
end
@ -68,7 +68,7 @@ function this.SetTypeTaskList(type, data)
t.heroId = data[i].heroId
t.lock = data[i].lock
table.insert(TypeTaskData[type], t)
-- LogRed("任务 类型:"..data[i].type.." 类型:"..data[i].missionId.." 状态:"..data[i].state)
-- --LogRed("任务 类型:"..data[i].type.." 类型:"..data[i].missionId.." 状态:"..data[i].state)
end
this.SetDirty()
end
@ -206,7 +206,7 @@ end
function this.RefreshTypeTaskInfo(taskInfoList)
for i = 1, #taskInfoList do
local taskInfo = taskInfoList[i]
LogRed("服务器推送任务刷新type:"..taskInfo.type.."missionId:"..taskInfo.missionId.."state:"..taskInfo.state.."progress:"..taskInfo.progress.."takeTimes:"..taskInfo.takeTimes)
--LogRed("服务器推送任务刷新type:"..taskInfo.type.."missionId:"..taskInfo.missionId.."state:"..taskInfo.state.."progress:"..taskInfo.progress.."takeTimes:"..taskInfo.takeTimes)
this.SetTypeTaskInfo(taskInfo.type, taskInfo.missionId, taskInfo.state, taskInfo.progress, taskInfo.takeTimes,taskInfo.heroId,taskInfo.lock)
end
Game.GlobalEvent:DispatchEvent(GameEvent.MissionDaily.OnMissionDailyChanged)
@ -314,7 +314,7 @@ function this.ResetTreasureTaskInfo(taskList)
local taskInfoList = TypeTaskData[TaskTypeDef.TreasureOfSomeBody]
for k = #taskInfoList, 1, -1 do
if taskInfoList[k].missionId == 0 then
LogRed("服务器传来了id为0的青龙秘宝任务")
--LogRed("服务器传来了id为0的青龙秘宝任务")
else
local taskConfig = ConfigManager.GetConfigData(ConfigName.TreasureSunLongTaskConfig, taskInfoList[k].missionId)
if taskConfig.Type == taskList[i].type then