无尽副本战力修改提交

dev_chengFeng
jiaoyangna 2021-05-26 11:52:32 +08:00
parent 06f4a3be80
commit e3c4ac2440
11 changed files with 144 additions and 148 deletions

View File

@ -1030,23 +1030,23 @@ end
-- 获取副本中编队的总血量
function this.GetMapTotalBlood()
local totalHp = 0
local curFormation = MapManager.formationList
for i = 1, 5 do
local heroData
if curFormation[i] then
heroData = HeroManager.GetSingleHeroData(curFormation[i].heroId)
if not heroData then
Log("heroData is not exist! error Did:" .. curFormation[i].heroId)
return
end
-- local totalHp = 0
-- local curFormation = MapManager.formationList
-- for i = 1, 5 do
-- local heroData
-- if curFormation[i] then
-- heroData = HeroManager.GetSingleHeroData(curFormation[i].heroId)
-- if not heroData then
-- Log("heroData is not exist! error Did:" .. curFormation[i].heroId)
-- return
-- end
if curFormation[i].allProVal[2] > 0 then
totalHp = totalHp + curFormation[i].allProVal[2]
end
end
end
return totalHp
-- if curFormation[i].allProVal[2] > 0 then
-- totalHp = totalHp + curFormation[i].allProVal[2]
-- end
-- end
-- end
-- return totalHp
end

View File

@ -351,8 +351,8 @@ function FormationSetPanel:FormationSureBtnClick()
else
PopupTipPanel.ShowTip(string.format(Language[10699], limitNum))
end
-- 无尽副本中换人刷新数据
EndLessMapManager.RefershMapTeam()
-- -- 无尽副本中换人刷新数据
-- EndLessMapManager.RefershMapTeam()
end
end

View File

@ -644,7 +644,9 @@ function this.GetSingleHeroData(heroDId)
heroData = ExpeditionManager.GetSingleHeroData(heroDId)
end
if not heroData then
--LogGreen("heroDId:"..heroDId)
heroData = EndLessMapManager.GetSingleHeroData(heroDId)
--LogGreen("heroData:"..heroData.dynamicId.." config:"..tostring(heroData.heroConfig))
end
return heroData
end

View File

@ -127,12 +127,12 @@ end
-- ================================== 妖灵师状态刷新 ========================================
-- 刷新地图中的队伍数据
function this.RefershMapTeam()
if CarbonManager.difficulty == CARBON_TYPE.ENDLESS and MapManager.Mapping then
MapManager.formationList = this.RefreshTeamInfo()
end
end
-- -- 刷新地图中的队伍数据
-- function this.RefershMapTeam()
-- if CarbonManager.difficulty == CARBON_TYPE.ENDLESS and MapManager.Mapping then
-- MapManager.formationList = this.RefreshTeamInfo()
-- end
-- end
-- =============================================================================================
-- ==================== 地图标记 ===============================================================
@ -305,7 +305,7 @@ function this.InitSingleEndlessHero(_msgHeroData)
heroData.star = _msgHeroData.star
heroData.lv = _msgHeroData.level
heroData.breakId = _msgHeroData.breakId
-- ----LogGreen("heroData.id:"..heroData.id.." heroData.breakId:"..heroData.breakId)
--LogGreen("heroData.id:"..heroData.id.." heroData.breakId:"..heroData.breakId)
heroData.upStarId = _msgHeroData.starBreakId
heroData.createTime = _msgHeroData.createTimelocal
heroData.lockState = _msgHeroData.lockState
@ -591,23 +591,23 @@ function this.InitHeroHp(msg, func)
if func then func() end
end
-- 换人后刷新队伍血量
function this.RefreshTeamInfo()
Log("换人后刷新队伍血量")
local mapTeam = {}
local curTeam = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_ENDLESS_MAP)
for i = 1, #curTeam.teamHeroInfos do
local roleData = curTeam.teamHeroInfos[i]
local allProp = HeroManager.CalculateWarAllProVal(roleData.heroId)
allProp[2] = this.allHeroBlood[roleData.heroId].curHp
mapTeam[i] = {
heroId = roleData.heroId,
allProVal = allProp,
}
end
-- -- 换人后刷新队伍血量
-- function this.RefreshTeamInfo()
-- Log("换人后刷新队伍血量")
-- local mapTeam = {}
-- local curTeam = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_ENDLESS_MAP)
-- for i = 1, #curTeam.teamHeroInfos do
-- local roleData = curTeam.teamHeroInfos[i]
-- local allProp = HeroManager.CalculateWarAllProVal(roleData.heroId)
-- allProp[2] = this.allHeroBlood[roleData.heroId].curHp
-- mapTeam[i] = {
-- heroId = roleData.heroId,
-- allProVal = allProp,
-- }
-- end
return mapTeam
end
-- return mapTeam
-- end
-- 无尽副本中得到某一个妖灵师的血量值, 传入动态ID
function this.GetHeroLeftBlood(heroId)
@ -623,9 +623,8 @@ end
-- 角色战斗失败,删除相应的地图队伍
function this.DeleteMapTeam()
for i = 1, #MapManager.formationList do
MapManager.formationList[i].allProVal[2] = 0
local heroId = MapManager.formationList[i].heroId
for i = 1, #this.formation do
local heroId = this.formation[i].heroId
this.allHeroBlood[heroId].curHp = 0
end
end
@ -642,9 +641,9 @@ end
-- 判断队伍是否还有活着的人
function this.IsMapTeamAlive()
local curFormation = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_ENDLESS_MAP)
local curFormation = this.formation
local tempList = {}
for k,v in pairs(curFormation.teamHeroInfos) do
for k,v in pairs(curFormation) do
if EndLessMapManager.GetSingleCanUseHeroData(v.heroId) then
--LogGreen("EndLessMapManager.allHeroBlood[v.heroId].percentHp:"..EndLessMapManager.allHeroBlood[v.heroId].percentHp)
if EndLessMapManager.allHeroBlood[v.heroId].percentHp > 0 then

View File

@ -74,30 +74,30 @@ function MapAwardPanel:OnOpen(...)
-- end)
--end
Util.ClearChild(this.heroGrid.transform)
for i=1, #MapManager.formationList do
local heroData = HeroManager.GetSingleHeroData(MapManager.formationList[i].heroId)
-- Util.ClearChild(this.heroGrid.transform)
-- for i=1, #MapManager.formationList do
-- local heroData = HeroManager.GetSingleHeroData(MapManager.formationList[i].heroId)
local go = newObject(this.item)
-- local go = newObject(this.item)
go.transform:SetParent(this.heroGrid.transform)
go.transform.localScale = Vector3.one
go.transform.localPosition = Vector3.zero
go:SetActive(true)
-- go.transform:SetParent(this.heroGrid.transform)
-- go.transform.localScale = Vector3.one
-- go.transform.localPosition = Vector3.zero
-- go:SetActive(true)
Util.GetGameObject(go,"frame"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality,heroData.star))
Util.GetGameObject(go,"icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(heroData.icon)
Util.GetGameObject(go, "lv/Text"):GetComponent("Text").text = heroData.lv
Util.GetGameObject(go,"icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(heroData.icon)
Util.GetGameObject(go, "pro/icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(heroData.professionIcon)
local starGrid = Util.GetGameObject(go, "star")
--local starPre = Util.GetGameObject(go, "starPre")
SetHeroStars(this.spLoader, starGrid, heroData.star)
-- Util.GetGameObject(go,"frame"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality,heroData.star))
-- Util.GetGameObject(go,"icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(heroData.icon)
-- Util.GetGameObject(go, "lv/Text"):GetComponent("Text").text = heroData.lv
-- Util.GetGameObject(go,"icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(heroData.icon)
-- Util.GetGameObject(go, "pro/icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(heroData.professionIcon)
-- local starGrid = Util.GetGameObject(go, "star")
-- --local starPre = Util.GetGameObject(go, "starPre")
-- SetHeroStars(this.spLoader, starGrid, heroData.star)
Util.AddOnceClick(go, function ()
UIManager.OpenPanel(UIName.MapRoleInfoPopup, heroData)
end)
end
-- Util.AddOnceClick(go, function ()
-- UIManager.OpenPanel(UIName.MapRoleInfoPopup, heroData)
-- end)
-- end
--英雄实例化
--[[
Util.ClearChild(this.heroGrid.transform)

View File

@ -481,12 +481,12 @@ function this.GetPosByMapPointId(mapPointId)
end
end
-- 设置血量的初始状态
function this.InitFormationHp()
for i=1, #MapManager.formationList do
MapManager.formationList[i].allProVal[2] = MapManager.formationList[i].allProVal[3]
end
end
-- -- 设置血量的初始状态
-- function this.InitFormationHp()
-- -- for i=1, #MapManager.formationList do
-- -- MapManager.formationList[i].allProVal[2] = MapManager.formationList[i].allProVal[3]
-- -- end
-- end
function this.MapUpdateEvent(pos, func)
NetManager.MapUpdateEvent(pos, function (eventId)
@ -992,23 +992,31 @@ end
-- 计算地图编队战力
function this.GetMapTeamPower()
local curFormation = MapManager.formationList
-- local curFormation = MapManager.formationList
-- local powerNum = 0
-- for i = 1, 5 do
-- local heroData
-- if curFormation[i] then
-- heroData = HeroManager.GetSingleHeroData(curFormation[i].heroId)
-- if not heroData then
-- Log("heroData is not exist! error Did:" .. curFormation[i].heroId)
-- return
-- end
-- LogGreen(curFormation[i].heroId.." curFormation[i].allProVal[2]:" .. tostring(curFormation[i].allProVal[2]))
-- if curFormation[i].allProVal[2] > 0 then
-- local allEquipAddProVal = 0
-- allEquipAddProVal = HeroManager.CalculateHeroAllProValList(1, heroData.dynamicId, false)
-- powerNum = powerNum + allEquipAddProVal[HeroProType.WarPower]
-- end
-- end
-- end
local curFormation = EndLessMapManager.formation
local powerNum = 0
for i = 1, 5 do
local heroData
if curFormation[i] then
heroData = HeroManager.GetSingleHeroData(curFormation[i].heroId)
if not heroData then
Log("heroData is not exist! error Did:" .. curFormation[i].heroId)
return
end
LogGreen(curFormation[i].heroId.." curFormation[i].allProVal[2]:" .. tostring(curFormation[i].allProVal[2]))
if curFormation[i].allProVal[2] > 0 then
local allEquipAddProVal = 0
allEquipAddProVal = HeroManager.CalculateHeroAllProValList(1, heroData.dynamicId, false)
powerNum = powerNum + allEquipAddProVal[HeroProType.WarPower]
end
end
for i = 1,#curFormation do
local heroData = HeroManager.GetSingleHeroData(curFormation[i].heroId)
local allHeroTeamAddProVal = HeroManager.GetAllHeroTeamAddProVal(curFormation,curFormation[i].heroId)
local allEquipAddProVal = HeroManager.CalculateHeroAllProValList(1, curFormation[i].heroId, false,nil,nil,true,allHeroTeamAddProVal)
powerNum = powerNum + allEquipAddProVal[HeroProType.WarPower]
end
return powerNum
end

View File

@ -55,7 +55,6 @@ function this:BindEvent()
end
if MapManager.curCarbonType == CarBonTypeId.ENDLESS then
local curFormation = MapManager.formationList
NetManager.QuickFightRequest(function(msg)
-- CarbonManager.InitQuickFightData(monsterGroupId, nil, msg)

View File

@ -53,7 +53,7 @@ function this.AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Map.Transport, this.OnPosTransport)
Game.GlobalEvent:AddEvent(GameEvent.FoodBuff.OnFoodBuffStart, this.OnFoodBuffStartRefresh)
Game.GlobalEvent:AddEvent(GameEvent.FoodBuff.OnFoodBuffEnd, this.RefreshRoleBuff)
Game.GlobalEvent:AddEvent(GameEvent.Formation.OnResetFormationHp, this.ResetRoleHp)
--Game.GlobalEvent:AddEvent(GameEvent.Formation.OnResetFormationHp, this.ResetRoleHp)
Game.GlobalEvent:AddEvent(GameEvent.Formation.OnMapTeamHpReduce, this.ReduceRoleHp)
end
@ -62,7 +62,7 @@ function this.RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Map.Transport, this.OnPosTransport)
Game.GlobalEvent:RemoveEvent(GameEvent.FoodBuff.OnFoodBuffStart, this.OnFoodBuffStartRefresh)
Game.GlobalEvent:RemoveEvent(GameEvent.FoodBuff.OnFoodBuffEnd, this.RefreshRoleBuff)
Game.GlobalEvent:RemoveEvent(GameEvent.Formation.OnResetFormationHp, this.ResetRoleHp)
-- Game.GlobalEvent:RemoveEvent(GameEvent.Formation.OnResetFormationHp, this.ResetRoleHp)
Game.GlobalEvent:RemoveEvent(GameEvent.Formation.OnMapTeamHpReduce, this.ReduceRoleHp)
end
@ -264,56 +264,56 @@ function this.InitRoleHp(relife)
end
end
function this.OnRefreshFormationHp()
-- 刷新队伍血量百分比
local curHp = 0
local maxHp = 0
LogRed("mapplayerView中的#MapManager.formationList"..#MapManager.formationList)
for i=1, #MapManager.formationList do
-- LogYellow(tostring(MapManager.formationList[i].allProVal[2]))
-- LogYellow(tostring(MapManager.formationList[i].allProVal[3]))
curHp = MapManager.formationList[i].allProVal[2] + curHp
maxHp = maxHp + MapManager.formationList[i].allProVal[3]
end
local percent = 0
-- function this.OnRefreshFormationHp()
-- -- 刷新队伍血量百分比
-- local curHp = 0
-- local maxHp = 0
-- LogRed("mapplayerView中的#MapManager.formationList"..#MapManager.formationList)
-- for i=1, #MapManager.formationList do
-- -- LogYellow(tostring(MapManager.formationList[i].allProVal[2]))
-- -- LogYellow(tostring(MapManager.formationList[i].allProVal[3]))
-- curHp = MapManager.formationList[i].allProVal[2] + curHp
-- maxHp = maxHp + MapManager.formationList[i].allProVal[3]
-- end
-- local percent = 0
if curHp > 0 and maxHp > 0 then
percent = curHp / maxHp
else
percent = 0
end
-- if curHp > 0 and maxHp > 0 then
-- percent = curHp / maxHp
-- else
-- percent = 0
-- end
Log(string.format("总血量%s", maxHp))
Log(string.format("剩余血量%s", curHp))
Log("剩余血量百分比" .. percent)
percent = percent <= 0 and 0 or percent
local isRedHp = percent <= 0.2
-- Log(string.format("总血量%s", maxHp))
-- Log(string.format("剩余血量%s", curHp))
-- Log("剩余血量百分比" .. percent)
-- percent = percent <= 0 and 0 or percent
-- local isRedHp = percent <= 0.2
this.roleRedHp.gameObject:SetActive(isRedHp)
this.roleYellowHp.gameObject:SetActive(not isRedHp)
-- this.roleRedHp.gameObject:SetActive(isRedHp)
-- this.roleYellowHp.gameObject:SetActive(not isRedHp)
if not isRedHp then
this.roleYellowHp.fillAmount = percent
else
this.roleRedHp.fillAmount = percent / 0.2
end
local len = lightLen.max - lightLen.min
len = len * percent
this.hpLight:GetComponent("RectTransform").anchoredPosition =Vector2.New(lightLen.min + len, 0)
end
-- if not isRedHp then
-- this.roleYellowHp.fillAmount = percent
-- else
-- this.roleRedHp.fillAmount = percent / 0.2
-- end
-- local len = lightLen.max - lightLen.min
-- len = len * percent
-- this.hpLight:GetComponent("RectTransform").anchoredPosition =Vector2.New(lightLen.min + len, 0)
-- end
-- 角色满血复活
function this.ResetRoleHp(intPos)
MapManager.InitFormationHp()
-- 检查一下队伍是否有人
if FormationManager.CheckFormationValid(FormationTypeDef.FORMATION_ENDLESS_MAP) then
this.InitRoleHp(true)
end
-- -- 角色满血复活
-- function this.ResetRoleHp(intPos)
-- MapManager.InitFormationHp()
-- -- 检查一下队伍是否有人
-- if FormationManager.CheckFormationValid(FormationTypeDef.FORMATION_ENDLESS_MAP) then
-- this.InitRoleHp(true)
-- end
-- 同时设置一下重置的位置
this.SetRolePos(intPos)
end
-- -- 同时设置一下重置的位置
-- this.SetRolePos(intPos)
-- end
---========================= 角色buff显示相关================
--
function this.OnFoodBuffStartRefresh(buffId)

View File

@ -310,21 +310,8 @@ local directFight = function(showType, eventId, showValues, options)
-- --如果英雄阵亡 无法选择其进行战斗
--先保存编队
if MapManager.curCarbonType == CarBonTypeId.ENDLESS then--无尽副本
-- body
-- LogPink("当前Mapmanager中的编队长度"..#MapManager.formationList)
-- LogBlue("当前FormationManager中的编队长度"..#FormationManager.formationList)
-- local curFormation = FormationManager.GetFormationByID(FormationTypeDef.FORMATION_ENDLESS_MAP)
local curFormation = MapManager.formationList
-- --LogGreen("战斗的编队长队:"..#curFormation)
-- FormationManager.RefreshFormation(FormationTypeDef.FORMATION_ENDLESS_MAP,curFormation,
-- FormationManager.formationList[FormationTypeDef.FORMATION_ENDLESS_MAP].teamPokemonInfos)
-- LogYellow("MapManager.curMapId22:"..MapManager.curMapId)
NetManager.QuickFightRequest(function(msg)
CarbonManager.InitQuickFightData(monsterGroupId, eventId, msg)
-- MapTrialManager.SetHeroHp(msg.remainHpList,MapTrialManager.selectHeroDid)
-- LogPink("战斗后Mapmanager中的编队长度"..#MapManager.formationList)
-- LogBlue("战斗后FormationManager中的编队长度"..#FormationManager.formationList)\
NetManager.RequestAllHeroHp(function ()
Game.GlobalEvent:DispatchEvent(GameEvent.EndLess.RefreshHeroData)
end)

View File

@ -727,6 +727,7 @@ function this.EndLessTeamChange(buffer)
msg:ParseFromString(data)
EndLessMapManager.UpDateTeamMaxHp(msg.info)
end
function this.DirectBuyGoods(buffer)
local data = buffer:DataByte()
local msg = PlayerInfoProto_pb.DirectBuyIndication()

View File

@ -4910,7 +4910,7 @@ end
function this.UseHeadFrameRequestFun(headFrameId,func)
local data = PlayerInfoProto_pb.UseHeadFrameRequest()
data.headFrameId = headFrameId
LogBlue("headFrameId "..headFrameId)
--LogBlue("headFrameId "..headFrameId)
local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.UseHeadFrameRequest, MessageTypeProto_pb.UseHeadFrameResponse, msg, function(buffer)
local data = buffer:DataByte()