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