Commit f7f26c154a952019e6568a2090cd2243c0a3c2a8
1 parent
a80fee7c
编队整理 增加 tactics战术
Showing
8 changed files
with
15 additions
and
85 deletions
Show diff stats
src/actions/GmAction.lua
| ... | ... | @@ -419,7 +419,6 @@ end |
| 419 | 419 | |
| 420 | 420 | table.insert(helpDes, {"挂机清除" , "idlec"}) |
| 421 | 421 | function _M.idlec(role, pms) |
| 422 | - role:updateProperty({field = "hangTeam", value = {}}) | |
| 423 | 422 | role:updateProperty({field = "hangInfo", value = {}}) |
| 424 | 423 | role:updateProperty({field = "hangBag", value = {}}) |
| 425 | 424 | role:mylog("gm_action", {desc = "idlec", key1 = pms.sender}) | ... | ... |
src/actions/HangAction.lua
| ... | ... | @@ -346,6 +346,9 @@ function _M.roleFormatRpc(agent , data) |
| 346 | 346 | team.leader = msg.leader |
| 347 | 347 | team.supports = supports |
| 348 | 348 | team.title = title |
| 349 | + if msg.tactics and globalCsv.tactics_skill_passive_cell[msg.tactics] then | |
| 350 | + team.tactics = msg.tactics | |
| 351 | + end | |
| 349 | 352 | |
| 350 | 353 | role:setTeamFormat(index, team) |
| 351 | 354 | |
| ... | ... | @@ -459,36 +462,6 @@ function _M.quickRpc(agent , data) |
| 459 | 462 | return true |
| 460 | 463 | end |
| 461 | 464 | |
| 462 | -function _M.bonusFormatRpc(agent , data) | |
| 463 | - local role = agent.role | |
| 464 | - local msg = MsgPack.unpack(data) | |
| 465 | - local bTeam = role:getProperty("bTeam") | |
| 466 | - for slot, heroId in pairs(msg.heros) do | |
| 467 | - if not role.heros[heroId] then | |
| 468 | - return | |
| 469 | - end | |
| 470 | - end | |
| 471 | - local supports = {} | |
| 472 | - for slot, support in pairs(msg.supports) do | |
| 473 | - if slot ~= 1 and slot ~= 2 then return end | |
| 474 | - local level = role.dinerData:getProperty("dishTree"):getv(support, 0) | |
| 475 | - if level <= 0 then return end | |
| 476 | - supports[slot] = support | |
| 477 | - end | |
| 478 | - if not checkLeader(msg.heros, msg.leader) then return end | |
| 479 | - | |
| 480 | - table.clear(bTeam) | |
| 481 | - bTeam.heros = {} | |
| 482 | - for slot, heroId in pairs(msg.heros) do | |
| 483 | - bTeam.heros[slot] = heroId | |
| 484 | - end | |
| 485 | - bTeam.leader = msg.leader | |
| 486 | - bTeam.supports = supports | |
| 487 | - | |
| 488 | - role:updateProperty({field = "bTeam", value = bTeam}) | |
| 489 | - SendPacket(actionCodes.Hang_bonusFormatRpc, '') | |
| 490 | - return true | |
| 491 | -end | |
| 492 | 465 | |
| 493 | 466 | function _M.buyBonusCountRpc(agent, data) |
| 494 | 467 | local role = agent.role | ... | ... |
src/actions/PvpAction.lua
| ... | ... | @@ -50,6 +50,9 @@ function _M.formatCommonRpc(agent , data) |
| 50 | 50 | end |
| 51 | 51 | pvpTC.leader = msg.leader |
| 52 | 52 | pvpTC.supports = supports |
| 53 | + if msg.tactics and globalCsv.tactics_skill_passive_cell[msg.tactics] then | |
| 54 | + pvpTC.tactics = msg.tactics | |
| 55 | + end | |
| 53 | 56 | |
| 54 | 57 | role:savePvpCTeam(pvpTC) |
| 55 | 58 | SendPacket(actionCodes.Pvp_formatCommonRpc, '') |
| ... | ... | @@ -92,6 +95,9 @@ function _M.formatHighRpc(agent , data) |
| 92 | 95 | curTeam.heros = team.heros |
| 93 | 96 | curTeam.leader = team.leader |
| 94 | 97 | curTeam.supports = supports |
| 98 | + if team.tactics and globalCsv.tactics_skill_passive_cell[team.tactics] then | |
| 99 | + curTeam.tactics = team.tactics | |
| 100 | + end | |
| 95 | 101 | |
| 96 | 102 | table.insert(pvpTH, curTeam) |
| 97 | 103 | end |
| ... | ... | @@ -462,6 +468,10 @@ function _M.startBattleHRpc(agent, data) |
| 462 | 468 | curTeam.heros = team.heros |
| 463 | 469 | curTeam.leader = team.leader |
| 464 | 470 | curTeam.supports = supports |
| 471 | + if team.tactics and globalCsv.tactics_skill_passive_cell[team.tactics] then | |
| 472 | + curTeam.tactics = team.tactics | |
| 473 | + end | |
| 474 | + | |
| 465 | 475 | |
| 466 | 476 | table.insert(pvpTH, curTeam) |
| 467 | 477 | end | ... | ... |
src/actions/RoleAction.lua
src/actions/TowerAction.lua
| ... | ... | @@ -8,36 +8,6 @@ local MsgPack = MsgPack |
| 8 | 8 | local _M = {} |
| 9 | 9 | |
| 10 | 10 | |
| 11 | -function _M.roleFormatRpc(agent , data) | |
| 12 | - local role = agent.role | |
| 13 | - local msg = MsgPack.unpack(data) | |
| 14 | - local towerTeam = role:getProperty("towerF") | |
| 15 | - for slot, heroId in pairs(msg.heros) do | |
| 16 | - if not role.heros[heroId] then | |
| 17 | - return | |
| 18 | - end | |
| 19 | - end | |
| 20 | - local supports = {} | |
| 21 | - for slot, support in pairs(msg.supports) do | |
| 22 | - if slot ~= 1 and slot ~= 2 then return end | |
| 23 | - local level = role.dinerData:getProperty("dishTree"):getv(support, 0) | |
| 24 | - if level <= 0 then return end | |
| 25 | - supports[slot] = support | |
| 26 | - end | |
| 27 | - table.clear(towerTeam) | |
| 28 | - towerTeam.heros = {} | |
| 29 | - for slot, heroId in pairs(msg.heros) do | |
| 30 | - towerTeam.heros[slot] = heroId | |
| 31 | - end | |
| 32 | - towerTeam.leader = msg.leader | |
| 33 | - towerTeam.supports = supports | |
| 34 | - | |
| 35 | - | |
| 36 | - role:updateProperty({field = "towerF", value = towerTeam}) | |
| 37 | - SendPacket(actionCodes.Tower_roleFormatRpc, '') | |
| 38 | - return true | |
| 39 | -end | |
| 40 | - | |
| 41 | 11 | |
| 42 | 12 | local function getUpdateTime(lastCount, lastTime) |
| 43 | 13 | local nextCount, nextTime = lastCount, skynet.timex() | ... | ... |
src/models/Role.lua
| ... | ... | @@ -103,7 +103,6 @@ Role.schema = { |
| 103 | 103 | --挂机相关 |
| 104 | 104 | hangPass = {"table", {}}, -- 挂机通过的最大关卡 |
| 105 | 105 | hangGift = {"table", {}}, -- 挂机奖励 {id = 1} |
| 106 | - hangTeam = {"table", {}}, -- 挂机队伍 | |
| 107 | 106 | hangTS = {"table", {}}, -- 挂机队伍他人可读的队伍信息 |
| 108 | 107 | hangTB = {"table", {}}, -- 挂机队伍他人可用的战斗信息mao |
| 109 | 108 | hangTBV = {"number", 0}, -- 挂机队伍他人可用的战斗力 |
| ... | ... | @@ -111,7 +110,6 @@ Role.schema = { |
| 111 | 110 | hangInfo = {"table", {}}, -- 当前挂机信息 |
| 112 | 111 | hangBag = {"table", {}}, -- 背包 |
| 113 | 112 | hangBagLimit = {"number", globalCsv.idle_field_origin}, --背包上限 |
| 114 | - bTeam = {"table", {}}, -- 奖励副本队伍 | |
| 115 | 113 | hangTeams = {"table", {}}, -- pve自选编队 |
| 116 | 114 | teamIndex = {"table", {}}, -- 各个系统使用的编队索引 type->index 见TeamSystemType |
| 117 | 115 | advTeams = {"table", {}}, -- 拾荒自选编队 |
| ... | ... | @@ -145,7 +143,6 @@ Role.schema = { |
| 145 | 143 | boxL = {"table", {}}, -- boxList 正开启的箱子 -- {[1] = {id = 1010, gem = 101, time = 1313}} |
| 146 | 144 | |
| 147 | 145 | towerInfo = {"table", {c = globalCsv.tower_count_limit, l = 1}}, -- 当天爬塔消耗的次数 -- {t = time, c = count, l = layer, k = battleKey} |
| 148 | - towerF = {"table", {}}, -- 爬塔阵容 | |
| 149 | 146 | |
| 150 | 147 | spTask = {"table", {}}, -- 特殊任务 -- {id = status} |
| 151 | 148 | |
| ... | ... | @@ -357,11 +354,9 @@ function Role:data() |
| 357 | 354 | |
| 358 | 355 | hangPass = self:getProperty("hangPass"), |
| 359 | 356 | hangGift = self:getProperty("hangGift"), |
| 360 | - hangTeam = self:getProperty("hangTeam"), | |
| 361 | 357 | hangInfo = self:getProperty("hangInfo"), |
| 362 | 358 | hangBag = self:getProperty("hangBag"), |
| 363 | 359 | hangBagLimit = self:getProperty("hangBagLimit"), |
| 364 | - bTeam = self:getProperty("bTeam"), | |
| 365 | 360 | hangTeams = self:getProperty("hangTeams"), |
| 366 | 361 | teamIndex = self:getProperty("teamIndex"), |
| 367 | 362 | advTeams = self:getProperty("advTeams"), |
| ... | ... | @@ -380,7 +375,6 @@ function Role:data() |
| 380 | 375 | equips = self:getProperty("equips"), |
| 381 | 376 | boxL = self:getProperty("boxL"), |
| 382 | 377 | towerInfo = self:getProperty("towerInfo"), |
| 383 | - towerF = self:getProperty("towerF"), | |
| 384 | 378 | spTask = self:getProperty("spTask"), |
| 385 | 379 | dTask = self:getProperty("dTask"), |
| 386 | 380 | wTask = self:getProperty("wTask"), | ... | ... |
src/models/RoleBattle.lua
| ... | ... | @@ -57,7 +57,6 @@ function Role:checkBattle(battleType, params) |
| 57 | 57 | end |
| 58 | 58 | end, |
| 59 | 59 | tower = function() |
| 60 | - --local towerF = self:getProperty("towerF") | |
| 61 | 60 | local towerF = self:getTeamFormatByType(TeamSystemType.Tower) |
| 62 | 61 | for slot, hero in pairs(self:getTeamHerosInfo(towerF.heros)) do |
| 63 | 62 | selflist[slot] = hero.type |
| ... | ... | @@ -73,7 +72,6 @@ function Role:checkBattle(battleType, params) |
| 73 | 72 | end |
| 74 | 73 | end, |
| 75 | 74 | bonus = function() |
| 76 | - --local bTeam = self:getProperty("bTeam") | |
| 77 | 75 | local bTeam = self:getTeamFormatByType(TeamSystemType.BonusBattle) |
| 78 | 76 | for slot, hero in pairs(self:getTeamHerosInfo(bTeam.heros)) do |
| 79 | 77 | selflist[slot] = hero.type | ... | ... |
src/models/RolePlugin.lua
| ... | ... | @@ -1135,7 +1135,6 @@ function RolePlugin.bind(Role) |
| 1135 | 1135 | local now = skynet.timex() |
| 1136 | 1136 | local ct = math.ceil((now - StdTowerRankTime) / 86400) --按天计算 365 * 27 < 10000 可以维持 27 年 |
| 1137 | 1137 | local ct = 10000 - ct -- 越早的排名越靠前 |
| 1138 | - --local towerTeam = self:getProperty("towerF") | |
| 1139 | 1138 | local towerTeam = self:getTeamFormatByType(TeamSystemType.Tower) |
| 1140 | 1139 | local battleV = self:getTeamBattleValue(towerTeam.heros) |
| 1141 | 1140 | local score = (level * 10000 + ct) * 10000000 + battleV |
| ... | ... | @@ -1289,6 +1288,7 @@ function RolePlugin.bind(Role) |
| 1289 | 1288 | for slot, id in pairs(team.supports or {}) do |
| 1290 | 1289 | teamInfo.supports[slot] = {id, self.dinerData:getProperty("dishTree"):getv(id, 0)} |
| 1291 | 1290 | end |
| 1291 | + teamInfo.tactics = globalCsv.tactics_skill_passive_cell[team.tactics] and team.tactics or nil | |
| 1292 | 1292 | return teamInfo |
| 1293 | 1293 | end |
| 1294 | 1294 | |
| ... | ... | @@ -1315,20 +1315,6 @@ function RolePlugin.bind(Role) |
| 1315 | 1315 | return self:getRealBattleValue(heros) |
| 1316 | 1316 | end |
| 1317 | 1317 | |
| 1318 | - -- 不传参数 只修改保存的阵容信息 | |
| 1319 | - function Role:saveHangTeam(team) | |
| 1320 | - if not team then | |
| 1321 | - team = self:getProperty("hangTeam") | |
| 1322 | - else | |
| 1323 | - self:updateProperty({field = "hangTeam", value = team}) | |
| 1324 | - end | |
| 1325 | - self:setProperties({ | |
| 1326 | - hangTS = self:getTeamHerosInfo(team.heros), | |
| 1327 | - hangTB = self:getTeamBattleInfo(team), | |
| 1328 | - hangTBV = self:getTeamBattleValue(team.heros), | |
| 1329 | - }) | |
| 1330 | - end | |
| 1331 | - | |
| 1332 | 1318 | function Role:updateHangTeamInfo() |
| 1333 | 1319 | local team = self:getTeamFormatByType(TeamSystemType.Hang) |
| 1334 | 1320 | if not team then return end | ... | ... |