四灵战力计算修改

dev_chengFeng
jiaoyangna 2021-03-15 19:14:30 +08:00
parent 1e19dfe3d5
commit 6d9de6a496
9 changed files with 128 additions and 32 deletions

View File

@ -620,6 +620,8 @@ HELPFIGHTLIST_TRAILTYPE_FIELD = protobuf.FieldDescriptor();
HELPFIGHTLIST_HERO_FIELD = protobuf.FieldDescriptor();
HELPFIGHTLIST_STATE_FIELD = protobuf.FieldDescriptor();
HELPFIGHTLIST_JEWELS_FIELD = protobuf.FieldDescriptor();
HELPFIGHTLIST_TREELEVEL_FIELD = protobuf.FieldDescriptor();
HELPFIGHTLIST_FOURTOTAL_FIELD = protobuf.FieldDescriptor();
ERRORRESPONSE_ERRCODE_FIELD.name = "errCode"
ERRORRESPONSE_ERRCODE_FIELD.full_name = ".rpc.protocols.ErrorResponse.errCode"
@ -6495,11 +6497,31 @@ HELPFIGHTLIST_JEWELS_FIELD.message_type = EQUIP
HELPFIGHTLIST_JEWELS_FIELD.type = 11
HELPFIGHTLIST_JEWELS_FIELD.cpp_type = 10
HELPFIGHTLIST_TREELEVEL_FIELD.name = "treeLevel"
HELPFIGHTLIST_TREELEVEL_FIELD.full_name = ".rpc.protocols.HelpFightList.treeLevel"
HELPFIGHTLIST_TREELEVEL_FIELD.number = 8
HELPFIGHTLIST_TREELEVEL_FIELD.index = 7
HELPFIGHTLIST_TREELEVEL_FIELD.label = 1
HELPFIGHTLIST_TREELEVEL_FIELD.has_default_value = false
HELPFIGHTLIST_TREELEVEL_FIELD.default_value = 0
HELPFIGHTLIST_TREELEVEL_FIELD.type = 5
HELPFIGHTLIST_TREELEVEL_FIELD.cpp_type = 1
HELPFIGHTLIST_FOURTOTAL_FIELD.name = "fourTotal"
HELPFIGHTLIST_FOURTOTAL_FIELD.full_name = ".rpc.protocols.HelpFightList.fourTotal"
HELPFIGHTLIST_FOURTOTAL_FIELD.number = 9
HELPFIGHTLIST_FOURTOTAL_FIELD.index = 8
HELPFIGHTLIST_FOURTOTAL_FIELD.label = 1
HELPFIGHTLIST_FOURTOTAL_FIELD.has_default_value = false
HELPFIGHTLIST_FOURTOTAL_FIELD.default_value = 0
HELPFIGHTLIST_FOURTOTAL_FIELD.type = 5
HELPFIGHTLIST_FOURTOTAL_FIELD.cpp_type = 1
HELPFIGHTLIST.name = "HelpFightList"
HELPFIGHTLIST.full_name = ".rpc.protocols.HelpFightList"
HELPFIGHTLIST.nested_types = {}
HELPFIGHTLIST.enum_types = {}
HELPFIGHTLIST.fields = {HELPFIGHTLIST_UID_FIELD, HELPFIGHTLIST_USERNAME_FIELD, HELPFIGHTLIST_GUILDNAME_FIELD, HELPFIGHTLIST_TRAILTYPE_FIELD, HELPFIGHTLIST_HERO_FIELD, HELPFIGHTLIST_STATE_FIELD, HELPFIGHTLIST_JEWELS_FIELD}
HELPFIGHTLIST.fields = {HELPFIGHTLIST_UID_FIELD, HELPFIGHTLIST_USERNAME_FIELD, HELPFIGHTLIST_GUILDNAME_FIELD, HELPFIGHTLIST_TRAILTYPE_FIELD, HELPFIGHTLIST_HERO_FIELD, HELPFIGHTLIST_STATE_FIELD, HELPFIGHTLIST_JEWELS_FIELD, HELPFIGHTLIST_TREELEVEL_FIELD, HELPFIGHTLIST_FOURTOTAL_FIELD}
HELPFIGHTLIST.is_extendable = false
HELPFIGHTLIST.extensions = {}

View File

@ -763,6 +763,10 @@ function this.InitSingleTreasureData(_singleData)
single.refineLv=_singleData.rebuildLevel
single.maxLv=currJewel.Max[1]
single.maxRefineLv=currJewel.Max[2]
single.maxTreeLv = currJewel.GodHoodMaxlv
single.treeLv = single.maxTreeLv or 0
single.fourTotal = 0
LogGreen("_treeLevel:"..single.treeLv.." single.fourTotal:"..single.fourTotal)
single.upHeroDid=""
local quantity=currJewel.Level
single.quantity=quantity

View File

@ -361,6 +361,19 @@ function GoodFriendMainPanel:FriendListDataShow(isTop,isAni)
end
end)
end
-- for i = 1 ,100 do
-- local friendData = GoodFriendManager.CreateFriendData()
-- friendData.id = i
-- friendData.name = i.."name"
-- friendData.lv = i
-- friendData.offLineTime = 0
-- friendData.haveReward = 0
-- friendData.isGive = 0
-- friendData.head = 0
-- friendData.frame = 0
-- friendData.soulVal = 0
-- table.insert(list,friendData)
-- end
this.ScrollView1:SetData(list, function(index, item)
local itemData = list[index]
this:FriendListRefreshData(item, itemData)

View File

@ -637,7 +637,7 @@ function this.UpdateHeroSingleSoulPrint(heroDId, hasEquipSoulPrintId)
end
--获取单个英雄数据
function this.GetSingleHeroData(heroDId)
LogGreen("heroDId"..tostring(heroDId))
--LogGreen("heroDId"..tostring(heroDId))
if heroDatas[heroDId] then
return heroDatas[heroDId]
elseif ExpeditionManager.GetSingleHeroData(heroDId) then
@ -880,7 +880,7 @@ end
function this.UpdateHeroPowerProfession()
for _, v in pairs(heroDatas) do
if GuildSkillManager.UpdataHeroProList[v.heroConfig.Profession] then
LogGreen("v.dynamicId "..v.dynamicId)
--LogGreen("v.dynamicId "..v.dynamicId)
v.warPower = this.CalculateHeroAllProValList(1, v.dynamicId, false)[HeroProType.WarPower]
end
end
@ -1188,7 +1188,7 @@ local function CalculateEquipTreaSureAddVal(_heroId)
end
end
--神应属性
local tLv = SacredTreeManager.treeLevel <= curEuipTreaSureConfig.GodHoodMaxlv and SacredTreeManager.treeLevel or curEuipTreaSureConfig.GodHoodMaxlv
local tLv = curEuipTreaSureData.treeLv
if
configInfo.PoolID == curEuipTreaSureConfig.GodHoodPool and configInfo.Type == 3 and
configInfo.Level == tLv
@ -1655,14 +1655,7 @@ end
--_type==1 计算当前英雄的所有属性 _type==2 根据_heroDid之后_breakId传过来的值进行计算 _isAllHeroProVal==true 团体加成综合 用字段_allHeroProVal
function this.CalculateHeroAllProValList(_type, _heroDid, isWar, _breakId, _upStarId, _isAllHeroProVal, _allHeroProVal,formationHeroNum)
local curHeroData = this.GetSingleHeroData(_heroDid) or _heroDid
LogGreen("curHeroData:"..tostring(curHeroData).." curHeroData.dynamicId:"..tostring(curHeroData.dynamicId))
local curLvNum = curHeroData.lv -- heroLevelConfig[curHeroData.lv].CharacterLevelPara
--local speedNum = heroLevelConfig[curHeroData.lv].SpeedLevelPara
--if _type == 1 then
-- LogError("计算战力英雄数据打印1 lv _breakId _upStarId "..curHeroData.lv.." "..curHeroData.breakId.." "..curHeroData.upStarId)
--else
-- LogError("计算战力英雄数据打印2 lv _breakId _upStarId "..curHeroData.lv.." ".._breakId.." ".._upStarId)
--end
local curLvNum = curHeroData.lv
--添加该英雄装备的属性
local allEquipScore = PlayerManager.GetSingHeroAllEquipSkillListScore(curHeroData)
--获取单个英雄装备被动技能累计评分

View File

@ -147,16 +147,67 @@ function GMPanel:BindEvent()
end
function this.GetManyItems(text)
local list = string.split(text, "|")
local cor = coroutine.start(function()
for _, str in ipairs(list) do
local str = "1#" .. str
Log(str)
NetManager.GMEvent(str)
coroutine.wait(0.1)
end
LogGreen("物品批量生成完成")
end)
if text == "一键装备" then
local config = ConfigPairs(ConfigManager.GetConfig(ConfigName.EquipConfig))
local cor = coroutine.start(function()
for k,v in (config) do
if v.Position < 5 then
local str = "1#" .. v.Id .."#" .. 1
NetManager.GMEvent(str)
coroutine.wait(0.1)
end
end
end)
return
end
if text == "一键宝器" then
local config = ConfigPairs(ConfigManager.GetConfig(ConfigName.JewelConfig))
local cor = coroutine.start(function()
for k,v in (config) do
local str = "1#" .. v.Id .."#" .. 10
NetManager.GMEvent(str)
coroutine.wait(0.1)
end
end)
return
end
if text == "一键魂印" then
local config = ConfigPairs(ConfigManager.GetConfig(ConfigName.EquipConfig))
local cor = coroutine.start(function()
for k,v in (config) do
if v.Position == 5 then
local str = "1#" .. v.Id .."#" .. 1
NetManager.GMEvent(str)
coroutine.wait(0.1)
end
end
end)
return
end
if text and text ~= "" then
local list = string.split(text, "|")
local cor = coroutine.start(function()
for _, str in ipairs(list) do
local item = string.split(str, "#")
local itemid = tonumber(item[1])
if not itemid then
local config = ConfigManager.GetConfigDataByKey(ConfigName.ItemConfig,"Name",item[1])
if config then
itemid = config.Id
else
itemid = nil
end
end
if itemid then
local str = "1#" .. itemid .."#" .. item[2]
Log(str)
NetManager.GMEvent(str)
coroutine.wait(0.1)
end
end
LogGreen("物品批量生成完成")
end)
end
end
function this.GetManyHeros(text)

View File

@ -281,7 +281,7 @@ function this.UpdateHeroDatas(_msgHeroData,_msgPlayerData)
EquipManager.SetEquipUpHeroDid(heroData.equipIdList[i],heroData.dynamicId)
end
heroData.jewels=_msgHeroData.jewels
this.InitBaoDatas(_msgPlayerData.jewels)
this.InitBaoDatas(_msgPlayerData.jewels,_msgPlayerData.fourTotal,_msgPlayerData.treeLevel)
for i = 1 , #heroData.jewels do
this.SetEquipTreasureUpHeroDid(heroData.jewels[i],heroData.dynamicId)
end
@ -315,24 +315,24 @@ function this.UpdateHeroDatas(_msgHeroData,_msgPlayerData)
end
heroData.name = _configData.ReadingName
heroData.property = _configData.PropertyName
heroData.warPower = HeroManager.CalculateHeroAllProValList(1, heroData, false)[HeroProType.WarPower]
heroData.createtype = 1
heroData.warPower = 0
return heroData
end
--宝器
local jewelConfig = ConfigManager.GetConfig(ConfigName.JewelConfig)
function this.InitBaoDatas(_soulEquips)
function this.InitBaoDatas(_soulEquips,_fourTotal,_treeLevel)
if not this.allTreasures then
this.allTreasures = {}
end
if not _soulEquips then return end
for i = 1, #_soulEquips do
this.InitSingleTreasureData(_soulEquips[i])
this.InitSingleTreasureData(_soulEquips[i],_fourTotal,_treeLevel)
end
end
--初始化单个宝物的数据
function this.InitSingleTreasureData(_singleData)
function this.InitSingleTreasureData(_singleData,_fourTotal,_treeLevel)
if not _singleData or not _singleData.equipId then
return
end
@ -349,7 +349,9 @@ function this.InitSingleTreasureData(_singleData)
single.maxRefineLv=currJewel.Max[2]
single.upHeroDid=""
single.maxTreeLv = currJewel.GodHoodMaxlv
single.treeLv = SacredTreeManager.treeLevel <= single.maxTreeLv and SacredTreeManager.treeLevel or single.maxTreeLv
single.treeLv = _treeLevel
single.fourTotal = _fourTotal
LogGreen("_treeLevel:"..single.treeLv.." single.fourTotal:"..single.fourTotal)
local quantity=currJewel.Level
single.quantity=quantity
single.frame=GetQuantityImageByquality(quantity)
@ -405,6 +407,8 @@ function this.GetFriendHelpHeros(trailType,func)
tempdata.player = v
tempdata.hero = this.UpdateHeroDatas(v.hero,v)
table.insert(this.friendHelpHeros[v.trailType],tempdata)
local allAddProVal = HeroManager.CalculateHeroAllProValList(1, tempdata.hero, false)
tempdata.hero.warPower = allAddProVal[HeroProType.WarPower]
end
if func then
func(this.friendHelpHeros[trailType])
@ -427,6 +431,8 @@ function this.SetFriendHelpHero(helpFightList,trailType)
end
this.friendHelpHero[v.trailType].player = v
this.friendHelpHero[v.trailType].hero = this.UpdateHeroDatas(v.hero,v)
local allAddProVal = HeroManager.CalculateHeroAllProValList(1, this.friendHelpHero[v.trailType].hero, false)
this.friendHelpHero[v.trailType].hero.warPower = allAddProVal[HeroProType.WarPower]
end
else
if not this.friendHelpHero then
@ -439,6 +445,8 @@ function this.SetFriendHelpHero(helpFightList,trailType)
if helpFightList then
this.friendHelpHero[trailType].player = helpFightList
this.friendHelpHero[trailType].hero = this.UpdateHeroDatas(helpFightList.hero,helpFightList)
local allAddProVal = HeroManager.CalculateHeroAllProValList(1, this.friendHelpHero[trailType].hero, false)
this.friendHelpHero[trailType].hero.warPower = allAddProVal[HeroProType.WarPower]
else
this.friendHelpHero[trailType] = nil
end

View File

@ -150,7 +150,7 @@ function RoleInfoPopup:OnOpen(...)
this.selsectSkillImage:SetActive(false)
local arg = { ... }
curHeroData = arg[1]
this.isOther = arg[2]
this.isOther = arg[2]
choosedList = arg[3] or nil
formationHeroNum = arg[4] or nil
end

View File

@ -35,8 +35,11 @@ function this.InitSingleTreasureData(_singleData)
single.maxRefineLv = currJewel.Max[2]
single.maxTreeLv = currJewel.GodHoodMaxlv
single.upHeroDid = ""
single.treeLv = SacredTreeManager.treeLevel <= single.maxTreeLv and SacredTreeManager.treeLevel or single.maxTreeLv
single.TreeLv = function()
return SacredTreeManager.treeLevel <= single.maxTreeLv and SacredTreeManager.treeLevel or single.maxTreeLv
end
single.treeLv = single.TreeLv()
single.fourTotal = MonsterCampManager.GetFourElementTotalWave()
local quantity = currJewel.Level
single.quantity = quantity
single.race = currJewel.Race
@ -45,7 +48,7 @@ function this.InitSingleTreasureData(_singleData)
single.itemConfig = itemConfig[staticId]
single.levelPool = currJewel.LevelupPool
single.proIcon = GetProStrImageByProNum(currJewel.Race)
single.refinePool = currJewel.RankupPool
single.refinePool = currJewel.RankupPool
single.treePool = currJewel.GodHoodPool
single.equipType = currJewel.Location
if currJewel.Location == 1 then

View File

@ -61,6 +61,8 @@ function FourTrailSingleHelpHero:OnShow(curType,...)
self.proIcon.sprite = Util.LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName))
SetHeroStars(self.starGrid , heroData.star)
self.name.text = itemConfig[heroData.heroConfig.Id].Name
local allAddProVal = HeroManager.CalculateHeroAllProValList(1, heroData, false)
--LogGreen(heroData.dynamicId.." allAddProVal[HeroProType.WarPower]:"..allAddProVal[HeroProType.WarPower])
self.num.text = heroData.warPower
if curType == 1 then
local from = ""