Commit 821e270496d39babf7ecb6b00acc1164d91c37b2
1 parent
598bd73f
heros 增加 supports
Showing
6 changed files
with
24 additions
and
20 deletions
Show diff stats
src/actions/HangAction.lua
| @@ -613,7 +613,7 @@ function _M.endBonusBattleRpc(agent, data) | @@ -613,7 +613,7 @@ function _M.endBonusBattleRpc(agent, data) | ||
| 613 | -- 胜利扣除次数 | 613 | -- 胜利扣除次数 |
| 614 | 614 | ||
| 615 | local bTeam = role:getTeamFormatByType(TeamSystemType.BonusBattle) | 615 | local bTeam = role:getTeamFormatByType(TeamSystemType.BonusBattle) |
| 616 | - local herosInfo = role:getTeamHerosInfo(bTeam.heros) | 616 | + local herosInfo = role:getTeamHerosInfo(bTeam).heros |
| 617 | 617 | ||
| 618 | local check = {} | 618 | local check = {} |
| 619 | -- 1 通关 | 619 | -- 1 通关 |
src/actions/PvpAction.lua
| @@ -135,7 +135,7 @@ local function getMatchInfo(role, pvpList, battleCache, dbKey, infoFuncName, inf | @@ -135,7 +135,7 @@ local function getMatchInfo(role, pvpList, battleCache, dbKey, infoFuncName, inf | ||
| 135 | if k == "battleInfo" then | 135 | if k == "battleInfo" then |
| 136 | battleCache[curInfo.roleId] = v | 136 | battleCache[curInfo.roleId] = v |
| 137 | else | 137 | else |
| 138 | - if (k == "heros" or k == "battleV") and infoCache then | 138 | + if (k == "team" or k == "battleV") and infoCache then |
| 139 | infoCache[curInfo.roleId] = infoCache[curInfo.roleId] or {} | 139 | infoCache[curInfo.roleId] = infoCache[curInfo.roleId] or {} |
| 140 | infoCache[curInfo.roleId][k] = v | 140 | infoCache[curInfo.roleId][k] = v |
| 141 | end | 141 | end |
| @@ -705,12 +705,12 @@ function _M.endBattleHRpc(agent, data) | @@ -705,12 +705,12 @@ function _M.endBattleHRpc(agent, data) | ||
| 705 | info.winId = info.isWin and roleId or match.id | 705 | info.winId = info.isWin and roleId or match.id |
| 706 | info.isWin = nil | 706 | info.isWin = nil |
| 707 | selfTeam[_idx] = { | 707 | selfTeam[_idx] = { |
| 708 | - heros = role:getTeamHerosInfo(_pvpStartBattleCacheH.pvpTH[_idx].heros), | 708 | + team = role:getTeamHerosInfo(_pvpStartBattleCacheH.pvpTH[_idx]), |
| 709 | battleV = role:getTeamBattleValue(_pvpStartBattleCacheH.pvpTH[_idx].heros) | 709 | battleV = role:getTeamBattleValue(_pvpStartBattleCacheH.pvpTH[_idx].heros) |
| 710 | } | 710 | } |
| 711 | if match.t == 1 and _pvpStartBattleCacheH.enemyT then | 711 | if match.t == 1 and _pvpStartBattleCacheH.enemyT then |
| 712 | enemyTeam[_idx] = { | 712 | enemyTeam[_idx] = { |
| 713 | - heros = _pvpStartBattleCacheH.enemyT["heros"][_idx], | 713 | + team = _pvpStartBattleCacheH.enemyT["team"][_idx], |
| 714 | battleV = _pvpStartBattleCacheH.enemyT["battleV"][_idx] | 714 | battleV = _pvpStartBattleCacheH.enemyT["battleV"][_idx] |
| 715 | } | 715 | } |
| 716 | end | 716 | end |
src/adv/Adv.lua
| @@ -820,7 +820,7 @@ function Adv:over(success, rewardRatio, overType) | @@ -820,7 +820,7 @@ function Adv:over(success, rewardRatio, overType) | ||
| 820 | lv = self.owner:getProperty("level"), | 820 | lv = self.owner:getProperty("level"), |
| 821 | batteV = self.owner:getTeamBattleValue(team.heros), | 821 | batteV = self.owner:getTeamBattleValue(team.heros), |
| 822 | chapter = self.chapterId, | 822 | chapter = self.chapterId, |
| 823 | - format = self.owner:getTeamHerosInfo(team.heros), | 823 | + format = self.owner:getTeamHerosInfo(team).heros, |
| 824 | } | 824 | } |
| 825 | redisproxy:pipelining(function (red) | 825 | redisproxy:pipelining(function (red) |
| 826 | red:zadd(self.owner:getAdvRankKey(), score, roleId) --更新分数 | 826 | red:zadd(self.owner:getAdvRankKey(), score, roleId) --更新分数 |
src/models/RoleBattle.lua
| @@ -59,7 +59,7 @@ function Role:checkBattle(battleType, params) | @@ -59,7 +59,7 @@ function Role:checkBattle(battleType, params) | ||
| 59 | end, | 59 | end, |
| 60 | tower = function() | 60 | tower = function() |
| 61 | local towerF = self:getTeamFormatByType(TeamSystemType.Tower) | 61 | local towerF = self:getTeamFormatByType(TeamSystemType.Tower) |
| 62 | - for slot, hero in pairs(self:getTeamHerosInfo(towerF.heros)) do | 62 | + for slot, hero in pairs(self:getTeamHerosInfo(towerF).heros) do |
| 63 | selflist[slot] = hero.type | 63 | selflist[slot] = hero.type |
| 64 | end | 64 | end |
| 65 | heroscore = self:getTeamBattleValue(towerF.heros) | 65 | heroscore = self:getTeamBattleValue(towerF.heros) |
| @@ -74,7 +74,7 @@ function Role:checkBattle(battleType, params) | @@ -74,7 +74,7 @@ function Role:checkBattle(battleType, params) | ||
| 74 | end, | 74 | end, |
| 75 | bonus = function() | 75 | bonus = function() |
| 76 | local bTeam = self:getTeamFormatByType(TeamSystemType.BonusBattle) | 76 | local bTeam = self:getTeamFormatByType(TeamSystemType.BonusBattle) |
| 77 | - for slot, hero in pairs(self:getTeamHerosInfo(bTeam.heros)) do | 77 | + for slot, hero in pairs(self:getTeamHerosInfo(bTeam).heros) do |
| 78 | selflist[slot] = hero.type | 78 | selflist[slot] = hero.type |
| 79 | end | 79 | end |
| 80 | heroscore = self:getTeamBattleValue(bTeam.heros) | 80 | heroscore = self:getTeamBattleValue(bTeam.heros) |
| @@ -88,7 +88,7 @@ function Role:checkBattle(battleType, params) | @@ -88,7 +88,7 @@ function Role:checkBattle(battleType, params) | ||
| 88 | end | 88 | end |
| 89 | end, | 89 | end, |
| 90 | act_battle = function() | 90 | act_battle = function() |
| 91 | - for slot, hero in pairs(self:getTeamHerosInfo(params.heros)) do | 91 | + for slot, hero in pairs(self:getTeamHerosInfo(params).heros) do |
| 92 | selflist[slot] = hero.type | 92 | selflist[slot] = hero.type |
| 93 | end | 93 | end |
| 94 | heroscore = self:getTeamBattleValue(params.heros) | 94 | heroscore = self:getTeamBattleValue(params.heros) |
src/models/RoleCross.lua
| @@ -36,7 +36,7 @@ RoleCross.bind = function (Role) | @@ -36,7 +36,7 @@ RoleCross.bind = function (Role) | ||
| 36 | level = self:getProperty("level"), | 36 | level = self:getProperty("level"), |
| 37 | headId = self:getProperty("headId"), | 37 | headId = self:getProperty("headId"), |
| 38 | battleV = self:getProperty("pvpTBVC"), | 38 | battleV = self:getProperty("pvpTBVC"), |
| 39 | - heros = self:getProperty("pvpTSC"), | 39 | + team = self:getProperty("pvpTSC"), |
| 40 | battleInfo = self:getProperty("pvpTBC") | 40 | battleInfo = self:getProperty("pvpTBC") |
| 41 | } | 41 | } |
| 42 | return info | 42 | return info |
| @@ -49,7 +49,7 @@ RoleCross.bind = function (Role) | @@ -49,7 +49,7 @@ RoleCross.bind = function (Role) | ||
| 49 | level = self:getProperty("level"), | 49 | level = self:getProperty("level"), |
| 50 | headId = self:getProperty("headId"), | 50 | headId = self:getProperty("headId"), |
| 51 | battleV = self:getProperty("pvpTBVH"), | 51 | battleV = self:getProperty("pvpTBVH"), |
| 52 | - heros = self:getProperty("pvpTSH"), | 52 | + team = self:getProperty("pvpTSH"), |
| 53 | battleInfo = self:getProperty("pvpTBH") | 53 | battleInfo = self:getProperty("pvpTBH") |
| 54 | } | 54 | } |
| 55 | return info | 55 | return info |
| @@ -281,7 +281,7 @@ function CMD.friendInfo(roleId) | @@ -281,7 +281,7 @@ function CMD.friendInfo(roleId) | ||
| 281 | headId = info.headId, | 281 | headId = info.headId, |
| 282 | ltime = info.ltime, | 282 | ltime = info.ltime, |
| 283 | battleV = info.pvpTBVC ~= 0 and info.pvpTBVC or info.hangTBV, | 283 | battleV = info.pvpTBVC ~= 0 and info.pvpTBVC or info.hangTBV, |
| 284 | - heros = info.pvpTBVC ~= 0 and info.pvpTSC or info.hangTS | 284 | + team = info.pvpTBVC ~= 0 and info.pvpTSC or info.hangTS |
| 285 | } | 285 | } |
| 286 | end | 286 | end |
| 287 | 287 | ||
| @@ -297,7 +297,7 @@ function CMD.pvpCInfo(roleId) | @@ -297,7 +297,7 @@ function CMD.pvpCInfo(roleId) | ||
| 297 | level = info.level, | 297 | level = info.level, |
| 298 | headId = info.headId, | 298 | headId = info.headId, |
| 299 | battleV = info.pvpTBVC, | 299 | battleV = info.pvpTBVC, |
| 300 | - heros = info.pvpTSC, | 300 | + team = info.pvpTSC, |
| 301 | battleInfo = info.pvpTBC | 301 | battleInfo = info.pvpTBC |
| 302 | } | 302 | } |
| 303 | end | 303 | end |
| @@ -309,7 +309,7 @@ function CMD.pvpHInfo(roleId) | @@ -309,7 +309,7 @@ function CMD.pvpHInfo(roleId) | ||
| 309 | level = info.level, | 309 | level = info.level, |
| 310 | headId = info.headId, | 310 | headId = info.headId, |
| 311 | battleV = info.pvpTBVH, | 311 | battleV = info.pvpTBVH, |
| 312 | - heros = info.pvpTSH, | 312 | + team = info.pvpTSH, |
| 313 | battleInfo = info.pvpTBH | 313 | battleInfo = info.pvpTBH |
| 314 | } | 314 | } |
| 315 | end | 315 | end |
src/models/RolePlugin.lua
| @@ -1177,7 +1177,7 @@ function RolePlugin.bind(Role) | @@ -1177,7 +1177,7 @@ function RolePlugin.bind(Role) | ||
| 1177 | lv = self:getProperty("level"), | 1177 | lv = self:getProperty("level"), |
| 1178 | batteV = battleV, | 1178 | batteV = battleV, |
| 1179 | level = level, | 1179 | level = level, |
| 1180 | - format = self:getTeamHerosInfo(towerTeam.heros), | 1180 | + format = self:getTeamHerosInfo(towerTeam).heros, |
| 1181 | } | 1181 | } |
| 1182 | local roleId = self:getProperty("id") | 1182 | local roleId = self:getProperty("id") |
| 1183 | redisproxy:pipelining(function (red) | 1183 | redisproxy:pipelining(function (red) |
| @@ -1325,9 +1325,10 @@ function RolePlugin.bind(Role) | @@ -1325,9 +1325,10 @@ function RolePlugin.bind(Role) | ||
| 1325 | return teamInfo | 1325 | return teamInfo |
| 1326 | end | 1326 | end |
| 1327 | 1327 | ||
| 1328 | - function Role:getTeamHerosInfo(heroIds) | 1328 | + function Role:getTeamHerosInfo(team) |
| 1329 | + local format = {} | ||
| 1329 | local heros = {} | 1330 | local heros = {} |
| 1330 | - for slot, heroId in pairs(heroIds or {}) do | 1331 | + for slot, heroId in pairs(team.heros or {}) do |
| 1331 | local hero = self.heros[heroId] | 1332 | local hero = self.heros[heroId] |
| 1332 | heros[slot] = { | 1333 | heros[slot] = { |
| 1333 | type = hero:getProperty("type"), | 1334 | type = hero:getProperty("type"), |
| @@ -1335,7 +1336,10 @@ function RolePlugin.bind(Role) | @@ -1335,7 +1336,10 @@ function RolePlugin.bind(Role) | ||
| 1335 | wakeL = hero:getProperty("wakeL"), | 1336 | wakeL = hero:getProperty("wakeL"), |
| 1336 | } | 1337 | } |
| 1337 | end | 1338 | end |
| 1338 | - return heros | 1339 | + format.heros = heros |
| 1340 | + format.supports = team.supports or {} | ||
| 1341 | + format.tactics = team.tactics or {} | ||
| 1342 | + return format | ||
| 1339 | end | 1343 | end |
| 1340 | 1344 | ||
| 1341 | function Role:getTeamBattleValue(heros) | 1345 | function Role:getTeamBattleValue(heros) |
| @@ -1353,7 +1357,7 @@ function RolePlugin.bind(Role) | @@ -1353,7 +1357,7 @@ function RolePlugin.bind(Role) | ||
| 1353 | if not team then return end | 1357 | if not team then return end |
| 1354 | 1358 | ||
| 1355 | self:setProperties({ | 1359 | self:setProperties({ |
| 1356 | - hangTS = self:getTeamHerosInfo(team.heros), | 1360 | + hangTS = self:getTeamHerosInfo(team), |
| 1357 | hangTB = self:getTeamBattleInfo(team), | 1361 | hangTB = self:getTeamBattleInfo(team), |
| 1358 | hangTBV = self:getTeamBattleValue(team.heros), | 1362 | hangTBV = self:getTeamBattleValue(team.heros), |
| 1359 | }) | 1363 | }) |
| @@ -1401,7 +1405,7 @@ function RolePlugin.bind(Role) | @@ -1401,7 +1405,7 @@ function RolePlugin.bind(Role) | ||
| 1401 | self:updateProperty({field = "pvpTC", value = team}) | 1405 | self:updateProperty({field = "pvpTC", value = team}) |
| 1402 | end | 1406 | end |
| 1403 | self:setProperties({ | 1407 | self:setProperties({ |
| 1404 | - pvpTSC = self:getTeamHerosInfo(team.heros), | 1408 | + pvpTSC = self:getTeamHerosInfo(team), |
| 1405 | pvpTBC = self:getTeamBattleInfo(team), | 1409 | pvpTBC = self:getTeamBattleInfo(team), |
| 1406 | pvpTBVC = self:getTeamBattleValue(team.heros), | 1410 | pvpTBVC = self:getTeamBattleValue(team.heros), |
| 1407 | }) | 1411 | }) |
| @@ -1417,7 +1421,7 @@ function RolePlugin.bind(Role) | @@ -1417,7 +1421,7 @@ function RolePlugin.bind(Role) | ||
| 1417 | local pvpTSH, pvpTBH, pvpTBVH = {}, {}, {} | 1421 | local pvpTSH, pvpTBH, pvpTBVH = {}, {}, {} |
| 1418 | for i = 1, 3 do | 1422 | for i = 1, 3 do |
| 1419 | if team[i] then | 1423 | if team[i] then |
| 1420 | - pvpTSH[i] = self:getTeamHerosInfo(team[i].heros) | 1424 | + pvpTSH[i] = self:getTeamHerosInfo(team[i]) |
| 1421 | pvpTBH[i] = self:getTeamBattleInfo(team[i]) | 1425 | pvpTBH[i] = self:getTeamBattleInfo(team[i]) |
| 1422 | pvpTBVH[i] = self:getTeamBattleValue(team[i].heros) | 1426 | pvpTBVH[i] = self:getTeamBattleValue(team[i].heros) |
| 1423 | end | 1427 | end |