diff --git a/src/actions/HangAction.lua b/src/actions/HangAction.lua index 4237854..a957d23 100644 --- a/src/actions/HangAction.lua +++ b/src/actions/HangAction.lua @@ -613,7 +613,7 @@ function _M.endBonusBattleRpc(agent, data) -- 胜利扣除次数 local bTeam = role:getTeamFormatByType(TeamSystemType.BonusBattle) - local herosInfo = role:getTeamHerosInfo(bTeam.heros) + local herosInfo = role:getTeamHerosInfo(bTeam).heros local check = {} -- 1 通关 diff --git a/src/actions/PvpAction.lua b/src/actions/PvpAction.lua index 8c8183d..1da85ec 100644 --- a/src/actions/PvpAction.lua +++ b/src/actions/PvpAction.lua @@ -135,7 +135,7 @@ local function getMatchInfo(role, pvpList, battleCache, dbKey, infoFuncName, inf if k == "battleInfo" then battleCache[curInfo.roleId] = v else - if (k == "heros" or k == "battleV") and infoCache then + if (k == "team" or k == "battleV") and infoCache then infoCache[curInfo.roleId] = infoCache[curInfo.roleId] or {} infoCache[curInfo.roleId][k] = v end @@ -705,12 +705,12 @@ function _M.endBattleHRpc(agent, data) info.winId = info.isWin and roleId or match.id info.isWin = nil selfTeam[_idx] = { - heros = role:getTeamHerosInfo(_pvpStartBattleCacheH.pvpTH[_idx].heros), + team = role:getTeamHerosInfo(_pvpStartBattleCacheH.pvpTH[_idx]), battleV = role:getTeamBattleValue(_pvpStartBattleCacheH.pvpTH[_idx].heros) } if match.t == 1 and _pvpStartBattleCacheH.enemyT then enemyTeam[_idx] = { - heros = _pvpStartBattleCacheH.enemyT["heros"][_idx], + team = _pvpStartBattleCacheH.enemyT["team"][_idx], battleV = _pvpStartBattleCacheH.enemyT["battleV"][_idx] } end diff --git a/src/adv/Adv.lua b/src/adv/Adv.lua index 63ab9c9..53e2bef 100644 --- a/src/adv/Adv.lua +++ b/src/adv/Adv.lua @@ -820,7 +820,7 @@ function Adv:over(success, rewardRatio, overType) lv = self.owner:getProperty("level"), batteV = self.owner:getTeamBattleValue(team.heros), chapter = self.chapterId, - format = self.owner:getTeamHerosInfo(team.heros), + format = self.owner:getTeamHerosInfo(team).heros, } redisproxy:pipelining(function (red) red:zadd(self.owner:getAdvRankKey(), score, roleId) --更新分数 diff --git a/src/models/RoleBattle.lua b/src/models/RoleBattle.lua index 50fbe48..57c58b6 100644 --- a/src/models/RoleBattle.lua +++ b/src/models/RoleBattle.lua @@ -59,7 +59,7 @@ function Role:checkBattle(battleType, params) end, tower = function() local towerF = self:getTeamFormatByType(TeamSystemType.Tower) - for slot, hero in pairs(self:getTeamHerosInfo(towerF.heros)) do + for slot, hero in pairs(self:getTeamHerosInfo(towerF).heros) do selflist[slot] = hero.type end heroscore = self:getTeamBattleValue(towerF.heros) @@ -74,7 +74,7 @@ function Role:checkBattle(battleType, params) end, bonus = function() local bTeam = self:getTeamFormatByType(TeamSystemType.BonusBattle) - for slot, hero in pairs(self:getTeamHerosInfo(bTeam.heros)) do + for slot, hero in pairs(self:getTeamHerosInfo(bTeam).heros) do selflist[slot] = hero.type end heroscore = self:getTeamBattleValue(bTeam.heros) @@ -88,7 +88,7 @@ function Role:checkBattle(battleType, params) end end, act_battle = function() - for slot, hero in pairs(self:getTeamHerosInfo(params.heros)) do + for slot, hero in pairs(self:getTeamHerosInfo(params).heros) do selflist[slot] = hero.type end heroscore = self:getTeamBattleValue(params.heros) diff --git a/src/models/RoleCross.lua b/src/models/RoleCross.lua index c13128f..6d0f5bd 100644 --- a/src/models/RoleCross.lua +++ b/src/models/RoleCross.lua @@ -36,7 +36,7 @@ RoleCross.bind = function (Role) level = self:getProperty("level"), headId = self:getProperty("headId"), battleV = self:getProperty("pvpTBVC"), - heros = self:getProperty("pvpTSC"), + team = self:getProperty("pvpTSC"), battleInfo = self:getProperty("pvpTBC") } return info @@ -49,7 +49,7 @@ RoleCross.bind = function (Role) level = self:getProperty("level"), headId = self:getProperty("headId"), battleV = self:getProperty("pvpTBVH"), - heros = self:getProperty("pvpTSH"), + team = self:getProperty("pvpTSH"), battleInfo = self:getProperty("pvpTBH") } return info @@ -281,7 +281,7 @@ function CMD.friendInfo(roleId) headId = info.headId, ltime = info.ltime, battleV = info.pvpTBVC ~= 0 and info.pvpTBVC or info.hangTBV, - heros = info.pvpTBVC ~= 0 and info.pvpTSC or info.hangTS + team = info.pvpTBVC ~= 0 and info.pvpTSC or info.hangTS } end @@ -297,7 +297,7 @@ function CMD.pvpCInfo(roleId) level = info.level, headId = info.headId, battleV = info.pvpTBVC, - heros = info.pvpTSC, + team = info.pvpTSC, battleInfo = info.pvpTBC } end @@ -309,7 +309,7 @@ function CMD.pvpHInfo(roleId) level = info.level, headId = info.headId, battleV = info.pvpTBVH, - heros = info.pvpTSH, + team = info.pvpTSH, battleInfo = info.pvpTBH } end diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 6b1a4bc..27ec48b 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -1177,7 +1177,7 @@ function RolePlugin.bind(Role) lv = self:getProperty("level"), batteV = battleV, level = level, - format = self:getTeamHerosInfo(towerTeam.heros), + format = self:getTeamHerosInfo(towerTeam).heros, } local roleId = self:getProperty("id") redisproxy:pipelining(function (red) @@ -1325,9 +1325,10 @@ function RolePlugin.bind(Role) return teamInfo end - function Role:getTeamHerosInfo(heroIds) + function Role:getTeamHerosInfo(team) + local format = {} local heros = {} - for slot, heroId in pairs(heroIds or {}) do + for slot, heroId in pairs(team.heros or {}) do local hero = self.heros[heroId] heros[slot] = { type = hero:getProperty("type"), @@ -1335,7 +1336,10 @@ function RolePlugin.bind(Role) wakeL = hero:getProperty("wakeL"), } end - return heros + format.heros = heros + format.supports = team.supports or {} + format.tactics = team.tactics or {} + return format end function Role:getTeamBattleValue(heros) @@ -1353,7 +1357,7 @@ function RolePlugin.bind(Role) if not team then return end self:setProperties({ - hangTS = self:getTeamHerosInfo(team.heros), + hangTS = self:getTeamHerosInfo(team), hangTB = self:getTeamBattleInfo(team), hangTBV = self:getTeamBattleValue(team.heros), }) @@ -1401,7 +1405,7 @@ function RolePlugin.bind(Role) self:updateProperty({field = "pvpTC", value = team}) end self:setProperties({ - pvpTSC = self:getTeamHerosInfo(team.heros), + pvpTSC = self:getTeamHerosInfo(team), pvpTBC = self:getTeamBattleInfo(team), pvpTBVC = self:getTeamBattleValue(team.heros), }) @@ -1417,7 +1421,7 @@ function RolePlugin.bind(Role) local pvpTSH, pvpTBH, pvpTBVH = {}, {}, {} for i = 1, 3 do if team[i] then - pvpTSH[i] = self:getTeamHerosInfo(team[i].heros) + pvpTSH[i] = self:getTeamHerosInfo(team[i]) pvpTBH[i] = self:getTeamBattleInfo(team[i]) pvpTBVH[i] = self:getTeamBattleValue(team[i].heros) end -- libgit2 0.21.2