【新战力计算】 添加刷新编队时 设置编队脏数据

dev_chengFeng
zhangqiang 2021-01-24 22:11:18 +08:00
parent c8d8e4f167
commit 3275e46515
7 changed files with 74 additions and 4 deletions

View File

@ -49,4 +49,45 @@ function LogColor(...)
elseif #args==4 then
Log("<color="..args[1]..">"..args[2].."</color>".." <color="..args[3]..">"..args[4].."</color>")
end
end
function PrintBattleTable(tb)
local s = "{"
for k, v in pairs(tb) do
-- k
if type(k) == "number" then
s = s..string.format("[%s]=", k)
elseif type(k) == "string" then
s = s..string.format("%s=", k)
elseif type(k) == "table" then
s = s..string.format("[%s]=", "table")
end
-- v
if type(v) == "number" or type(k) == "string" then
s = s..v..","
elseif type(k) == "table" then
s = s..PrintBattleTable(k)
end
end
return s.."}"
end
-- 打印表
function LogGreenTable(t)
LogGreen(PrintBattleTable(t))
end
-- 打印表
function LogRedTable(t)
LogRed(PrintBattleTable(t))
end
-- 打印表
function LogBlueTable(t)
LogBlue(PrintBattleTable(t))
end
-- 打印表
function LogPinkTable(t)
LogPink(PrintBattleTable(t))
end

View File

@ -98,6 +98,7 @@ function this.UpdateTemporaryFormation(TeamPosInfo)
end
end
this.formationList[FormationTypeDef.FORMATION_TEMPORARY] = curFormation
-- HeroPropManager.SetDirtyByType(heroDId, Hero_Prop_Type.Base)
end
-- function this.SetCurFormationIndex()
-- local curIndex = 1
@ -161,6 +162,8 @@ function this.RefreshFormation(index, roleList, pokemonList,isDiffmonster)
this.CheckHeroIdExist()
--设置战斗力脏数据
HeroPropManager.SetFormationPropDirty(index)
end
-- 获取所有正在编队的英雄id
@ -249,8 +252,13 @@ function this.GetFormationPower(formationId)
local power = 0
for i = 1, 6 do
if formationList.teamHeroInfos[i] then
-- local heroData = HeroManager.GetSingleHeroData(formationList.teamHeroInfos[i].heroId)
-- power = power + HeroPowerManager.GetHeroPower(heroData.dynamicId, formationId)
local heroData = HeroManager.GetSingleHeroData(formationList.teamHeroInfos[i].heroId)
power = power + HeroPowerManager.GetHeroPower(heroData.dynamicId, formationId)
--1, curHeroData.dynamicId, false,nil,nil,true,allHeroTeamAddProVal)
local allHeroTeamAddProVal = HeroManager.GetAllHeroTeamAddProVal(formationList.teamHeroInfos,formationList.teamHeroInfos[i].heroId)
local allEquipAddProVal = HeroManager.CalculateHeroAllProValList(1, heroData.dynamicId,false,nil,nil,true,allHeroTeamAddProVal)
power = power + allEquipAddProVal[HeroProType.WarPower]
end
end
LogRed("原方式战斗力:"..power)
@ -266,7 +274,7 @@ function this.GetFormationPower(formationId)
ThinkingAnalyticsManager.SetSuperProperties({
fighting_capacity = power,
})
return power
return power2
end
--某个妖灵师战力发生变化检查是否在任何一个编队
@ -575,6 +583,7 @@ function this.GetFormationElementAdd(type)
end
propList[propId] = propList[propId] + value
end
LogPinkTable_Prop(propList)
return propList
end

View File

@ -113,7 +113,6 @@ function this.GetHeroPower(dId, formationId)
this.HeroPowerList[dId] = {}
end
this.HeroPowerList[dId].allPower = allPower
LogGreen("allPower "..allPower)
return this.HeroPowerList[dId].allPower
end
-- 获取英雄战斗力

View File

@ -527,6 +527,7 @@ function this.EquipWearRequest(_heroId, _equipIds,_type, func)
local data = buffer:DataByte()
--local msg = HeroInfoProto_pb.GetAllEquipResponse()
--msg:ParseFromString(data)
--设置战斗力脏数据
HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.Equip)
if func then
func(msg)
@ -546,6 +547,7 @@ function this.EquipUnLoadOptRequest(_heroId, _equipIds, _type,func)
local data = buffer:DataByte()
--local msg = HeroInfoProto_pb.GetAllEquipResponse()
--msg:ParseFromString(data)
--设置战斗力脏数据
HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.Equip)
if func then
func(msg)

View File

@ -477,6 +477,24 @@ function this.GetSingleTreasureByIdDyn(_idDyn)
return allTreasures[_idDyn]
end
--根据动态id获取宝物
function this.GetTreasuresBydIds(ids)
local list = {}
if allTreasures then
for _, did in ipairs(ids) do
local treasure = allTreasures[did]
-- 没有数据尝试去大闹天宫获取
if not treasure then
treasure = ExpeditionManager.GetSingleTreasureByIdDyn(did)
end
if treasure then
table.insert(list, treasure)
end
end
end
return list
end
--计算战斗力
function this.CalculateWarForceBySid(sId, lv, rlv)
return this.CalculateWarForceBase(sId, lv, rlv)

View File

@ -107,7 +107,7 @@ function TalismanInfoPanel:BindEvent()
end
NetManager.TalismanUpStarRequest(tostring(curHeroData.dynamicId),function (msg)
HeroManager.SetTalismanLv(curHeroData.dynamicId,curHeroData.talismanList+1)--本地标记等级
LogGreen("请求法宝升星 ssssssss ")
--设置战斗力脏数据
HeroPropManager.SetDirtyByType(curHeroData.dynamicId, Hero_Prop_Type.Talisman)
UIManager.OpenPanel(UIName.TalismanUpStarSuccessPanel,curHeroData,function ()
self:OnShowPanelData()

View File

@ -492,6 +492,7 @@ function VipPanelV2:OnBtnLvUpClicked()
NetManager.RequestVipLevelUp(function(respond)
self:OnShow()
SoundManager.PlaySound(SoundConfig.Sound_VipUpLevel)
--设置战斗力脏数据
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.Vip)
end)
end